Package org.yamcs.yarch.rocksdb
Class RdbProtobufDatabase
- java.lang.Object
-
- org.yamcs.yarch.rocksdb.RdbProtobufDatabase
-
- All Implemented Interfaces:
ProtobufDatabase
public class RdbProtobufDatabase extends Object implements ProtobufDatabase
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
delete(String id)
Delete a protobuf message for a specific id.<T extends com.google.protobuf.Message>
Tget(String id, Class<T> messageClass)
Retrieves a protobuf message for a specific id.void
save(String id, com.google.protobuf.Message message)
Save a protobuf message.
-
-
-
Method Detail
-
save
public void save(String id, com.google.protobuf.Message message) throws IOException
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
public boolean delete(String id) throws IOException
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
-
-