SOS: Scalable Object Store
4.0.0
|
In order to faciliate management of the storage consumed by a Container, a Container is divided up into one or more Partitions. A Parition contains the objects that are created in the Container. A Partition is in one of the following states:
There are several commands available to manipulate partitions.
There must be at least one partition in the container in the 'primary' state in order for objects to be allocated and stored in the container. For example:
sos_part_create -C theContainer -s primary "today"
Use the sos_part_query command to see the new partition
sos_part_query -C theContainer Partition Name RefCount Status Size Modified Accessed Path -------------------- -------- ---------------- -------- ---------------- ---------------- ---------------- today 2 PRIMARY 65K 2017/04/11 11:47 2017/04/11 11:47 /btrfs/test_data/theContainer
Let's create another partition to contain tomorrow's data:
sos_part_create -C theContainer -s primary "tomorrow" sos_part_query -C theContainer -v Partition Name RefCount Status Size Modified Accessed Path -------------------- -------- ---------------- -------- ---------------- ---------------- ---------------- today 2 PRIMARY 65K 2017/04/11 11:51 2017/04/11 11:51 /btrfs/test_data/theContainer tomorrow 3 OFFLINE /btrfs/test_data/theContainer
A typical use case for partitions is to group objects together by date and then migrate objects from an older partitions to another container on secondary storage.
At midnight the administrator starts storing data in tomorrow's partition as follows:
sos_part_modify -C theContainer -s primary "tomorrow" sos_part_query -C theContainer -v Partition Name RefCount Status Size Modified Accessed Path -------------------- -------- ---------------- -------- ---------------- ---------------- ---------------- today 2 PRIMARY 65K 2017/04/11 11:51 2017/04/11 11:51 /btrfs/test_data/theContainer tomorrow 3 OFFLINE /btrfs/test_data/theContainer
New object allocations will immediately start flowing into the new primary partition. Objects in the original partition are still accessible and indexed.
The administrator then wants to migrate the data from the today partition to another container in secondary storage. First create the container to contain 'backups'.
sos_cmd -C /secondary/backupContainer -c sos_part_create -C theContainer -s primary "backup"
Then export the contents of the today partition to the backup:
sos_part_export -C theContainer -E /secondary/backupContainer today
All objects in the today partition are now in the /secondary/backupContainer. They are also still in theContainer in the today partition. To remove the today partition, delete the partition as follows:
sos_part_modify -C theContainer -s offline today sos_part_delete -C theContainer today
There are API for manipulating Partitions from a program. In general, only management applications should call these functions. It is possible to corrupt and otherwise destroy the object store by using these functions incorrectly.
The Partition API include the following: