K
- the type of the key in this tableV
- the type of the value in this tableD
- the type of the concrete table descriptor@InterfaceStability.Unstable public interface TableDescriptor<K,V,D extends TableDescriptor<K,V,D>>
Typical user code should look like the following, notice withConfig()
is defined in this class and the rest in subclasses.
TableDescriptor<Integer, String, ?> tableDesc = new RocksDbTableDescriptor("tbl")
.withSerde(KVSerde.of(new IntegerSerde(), new StringSerde("UTF-8")))
.withBlockSize(1024)
.withConfig("some-key", "some-value");
Once constructed, a table descriptor can be registered with the system. Internally,
the table descriptor is then converted to a TableSpec
,
which is used to track tables internally.Modifier and Type | Method and Description |
---|---|
java.lang.String |
getTableId()
Get the Id of the table
|
D |
withConfig(java.lang.String key,
java.lang.String value)
Add a configuration entry for the table
|
D |
withSerde(KVSerde<K,V> serde)
Set the Serde for this table
|
java.lang.String getTableId()
D withSerde(KVSerde<K,V> serde)
serde
- the serdejava.lang.IllegalArgumentException
- if null is providedD withConfig(java.lang.String key, java.lang.String value)
key
- the keyvalue
- the value