open-io / oio-sds

High Performance Software-Defined Object Storage for Big Data and AI, that supports Amazon S3 and Openstack Swift
https://www.openio.io
Other
664 stars 93 forks source link

[WIP] Implement container sharding (first step) #2089

Closed AymericDu closed 3 years ago

AymericDu commented 4 years ago
SUMMARY
ISSUE TYPE
COMPONENT NAME
SDS VERSION
openio 8.0.0.dev1
Example
$ openio container create mycontainer
+------+---------+
| Name | Created |
+------+---------+
| toto | True    |
+------+---------+
$ openio container-sharding replace mycontainer '[{"index": 0, "lower": "", "upper": "sharding"}, {"index": 1, "lower": "sharding", "upper": ""}]' --enable
+-------+----------+----------+
| Index | Lower    | Upper    |
+-------+----------+----------+
|     0 |          | sharding |
|     1 | sharding |          |
+-------+----------+----------+
$ openio container-sharding show mycontainer --counts
+-------+----------+----------+------------------------------------------------------------------+-------+-------+
| Index | Lower    | Upper    | CID                                                              | Bytes | Count |
+-------+----------+----------+------------------------------------------------------------------+-------+-------+
|     0 |          | sharding | B1348A230C6B88ED18232EA0A877B2455732ECD158E01EE655289A07E6C55D2F | 0     | 0     |
|     1 | sharding |          | 79110CB5BDF6327D4FD344828DC3E724E615D9855C885B447CB5ED64B15ADF20 | 0     | 0     |
+-------+----------+----------+------------------------------------------------------------------+-------+-------+
$ openio object create mycontainer /etc/magic --name magic
+-------+------+----------------------------------+--------+
| Name  | Size | Hash                             | Status |
+-------+------+----------------------------------+--------+
| magic |  111 | 272913026300E7AE9B5E2D51F138E674 | Ok     |
+-------+------+----------------------------------+--------+
$ openio container-sharding show mycontainer --counts
+-------+----------+----------+------------------------------------------------------------------+-------+-------+
| Index | Lower    | Upper    | CID                                                              | Bytes | Count |
+-------+----------+----------+------------------------------------------------------------------+-------+-------+
|     0 |          | sharding | B1348A230C6B88ED18232EA0A877B2455732ECD158E01EE655289A07E6C55D2F | 111   | 1     |
|     1 | sharding |          | 79110CB5BDF6327D4FD344828DC3E724E615D9855C885B447CB5ED64B15ADF20 | 0     | 0     |
+-------+----------+----------+------------------------------------------------------------------+-------+-------+
$ openio object create mycontainer /etc/magic --name test
+------+------+----------------------------------+--------+
| Name | Size | Hash                             | Status |
+------+------+----------------------------------+--------+
| test |  111 | 272913026300E7AE9B5E2D51F138E674 | Ok     |
+------+------+----------------------------------+--------+
$ openio container-sharding show mycontainer --counts
+-------+----------+----------+------------------------------------------------------------------+-------+-------+
| Index | Lower    | Upper    | CID                                                              | Bytes | Count |
+-------+----------+----------+------------------------------------------------------------------+-------+-------+
|     0 |          | sharding | B1348A230C6B88ED18232EA0A877B2455732ECD158E01EE655289A07E6C55D2F | 111   | 1     |
|     1 | sharding |          | 79110CB5BDF6327D4FD344828DC3E724E615D9855C885B447CB5ED64B15ADF20 | 111   | 1     |
+-------+----------+----------+------------------------------------------------------------------+-------+-------+
AymericDu commented 3 years ago

The pull request has been transferred to Stash.