Package org.yamcs.yarch.rocksdb
Class RdbProtobufDatabase
java.lang.Object
org.yamcs.yarch.rocksdb.RdbProtobufDatabase
- All Implemented Interfaces:
ProtobufDatabase
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Delete a protobuf message for a specific id.<T extends com.google.protobuf.Message>
TRetrieves a protobuf message for a specific id.void
Save a protobuf message.
-
Method Details
-
save
Description copied from interface:ProtobufDatabase
Save a protobuf message. If a message is already saved under the given id, it is overwritten.- Specified by:
save
in interfaceProtobufDatabase
- Parameters:
id
- the identifiermessage
- the protobuf message- Throws:
IOException
-
get
public <T extends com.google.protobuf.Message> T get(String id, Class<T> messageClass) throws IOException Description copied from interface:ProtobufDatabase
Retrieves a protobuf message for a specific id.- Specified by:
get
in interfaceProtobufDatabase
- Parameters:
id
- the identifier to search formessageClass
- the expected message class- Returns:
- the found message, or
null
- Throws:
IOException
-
delete
Description copied from interface:ProtobufDatabase
Delete a protobuf message for a specific id.- Specified by:
delete
in interfaceProtobufDatabase
- Parameters:
id
- the identifier to search for- Returns:
- whether a record was found and deleted.
- Throws:
IOException
-