Package org.yamcs.yarch.rocksdb
Class RdbBucketDatabase
java.lang.Object
org.yamcs.yarch.rocksdb.RdbBucketDatabase
- All Implemented Interfaces:
BucketDatabase
Stores users objects in rocksdb
Each 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateBucket
(String bucketName) void
deleteBucket
(String bucketName) Retrieve a bucket handler from the database.
-
Constructor Details
-
RdbBucketDatabase
public RdbBucketDatabase(String yamcsInstance, Tablespace tablespace) throws org.rocksdb.RocksDBException, IOException - Throws:
org.rocksdb.RocksDBException
IOException
-
-
Method Details
-
createBucket
- Specified by:
createBucket
in interfaceBucketDatabase
- Throws:
IOException
-
getBucket
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
- Specified by:
listBuckets
in interfaceBucketDatabase
-
deleteBucket
- Specified by:
deleteBucket
in interfaceBucketDatabase
- Throws:
IOException
-
getTablespace
-