Package org.yamcs.yarch.rocksdb
Class RdbBucketDatabase
- java.lang.Object
-
- org.yamcs.yarch.rocksdb.RdbBucketDatabase
-
- All Implemented Interfaces:
BucketDatabase
public class RdbBucketDatabase extends Object implements BucketDatabase
Stores users objects in rocksdbEach bucket has associated a TablespaceRecord with the corresponding tbsIndex.
Each object in the bucket has an 4 bytes objectId
The rocksdb key is formed by either one of:
4 bytes 1 byte variable size tbsIndex 0 = bucket info tbsIndex 1 = metadata objectName (up to 1000 bytes) tbsIndex 2 = data objectId (4 bytes)
The rocksdb value is formed by:- in case of metadata: protobuf representation of ObjectProperties (contains the objectId and key,value metadata)
- in case of user object: binary user object
- retrieve the tbsIndex based on the bucket name
- retrieve the ObjectProperties based on the tbsIndex and object name
- retrieve the object data based on the tbsIndex and objectId
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RdbBucket
createBucket(String bucketName)
void
deleteBucket(String bucketName)
RdbBucket
getBucket(String bucketName)
Retrieve a bucket handler from the database.List<Tablespace.BucketProperties>
listBuckets()
-
-
-
Method Detail
-
createBucket
public RdbBucket createBucket(String bucketName) throws IOException
- Specified by:
createBucket
in interfaceBucketDatabase
- Throws:
IOException
-
getBucket
public RdbBucket getBucket(String bucketName)
Description copied from interface:BucketDatabase
Retrieve a bucket handler from the database.- Specified by:
getBucket
in interfaceBucketDatabase
- Returns:
- the bucket with the given name or null if it does not exist
-
listBuckets
public List<Tablespace.BucketProperties> listBuckets()
- Specified by:
listBuckets
in interfaceBucketDatabase
-
deleteBucket
public void deleteBucket(String bucketName) throws IOException
- Specified by:
deleteBucket
in interfaceBucketDatabase
- Throws:
IOException
-
-