Package org.yamcs.yarch.rocksdb
Class RdbBucket
java.lang.Object
org.yamcs.yarch.rocksdb.RdbBucket
- All Implemented Interfaces:
Bucket
-
Constructor Summary
ConstructorDescriptionRdbBucket
(String yamcsInstance, Tablespace tablespace, int tbsIndex, Tablespace.BucketProperties bucketProps) -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteObject
(String objectName) findObject
(String objectName) retrieve the object properties or null if not such an object existgetName()
This bucket's namebyte[]
Retrieve object from the bucket.int
retrieve objects whose name start with prefix and that match the condition Note that searching by prefix is cheap, the condition will be evaluated for all objects that match the prefixvoid
void
setMaxObjects
(int maxObjects) Update the object count limit for this bucket.void
setMaxSize
(long maxSize) Update the size limit for this bucket.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.yamcs.yarch.Bucket
listObjects, listObjects, listObjects
-
Constructor Details
-
RdbBucket
public RdbBucket(String yamcsInstance, Tablespace tablespace, int tbsIndex, Tablespace.BucketProperties bucketProps) throws IOException - Throws:
IOException
-
-
Method Details
-
getProperties
- Specified by:
getProperties
in interfaceBucket
-
setMaxSize
Description copied from interface:Bucket
Update the size limit for this bucket.If the specified size is smaller than the current size, the bucket will no longer accept new files.
- Specified by:
setMaxSize
in interfaceBucket
- Throws:
IOException
-
setMaxObjects
Description copied from interface:Bucket
Update the object count limit for this bucket.If the specified count is smaller than the current count, the bucket will no longer accept new files.
- Specified by:
setMaxObjects
in interfaceBucket
- Throws:
IOException
-
listObjects
public List<Tablespace.ObjectProperties> listObjects(String prefix, Predicate<Tablespace.ObjectPropertiesOrBuilder> p) throws IOException Description copied from interface:Bucket
retrieve objects whose name start with prefix and that match the condition Note that searching by prefix is cheap, the condition will be evaluated for all objects that match the prefix- Specified by:
listObjects
in interfaceBucket
p
- predicate to be matched by the returned objects- Returns:
- list of objects
- Throws:
IOException
-
putObject
public void putObject(String objectName, String contentType, Map<String, String> metadata, byte[] objectData) throws IOException- Specified by:
putObject
in interfaceBucket
- Throws:
IOException
-
findObject
Description copied from interface:Bucket
retrieve the object properties or null if not such an object exist- Specified by:
findObject
in interfaceBucket
- Returns:
- Throws:
IOException
-
getObject
Description copied from interface:Bucket
Retrieve object from the bucket. Returns null if object does not exist.- Specified by:
getObject
in interfaceBucket
- Returns:
- Throws:
IOException
-
deleteObject
- Specified by:
deleteObject
in interfaceBucket
- Throws:
IOException
-
getName
Description copied from interface:Bucket
This bucket's name -
getTablespace
-
getTbsIndex
public int getTbsIndex()
-