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>>
TableDescriptor can be used for specifying Samza and implementation-specific properties of a Table.
Table properties provided in configuration override corresponding properties specified using a descriptor.
This is the base descriptor for a table. Use a implementation-specific descriptor (e.g. RocksDBTableDescriptor) to use it in the application. For example:
RocksDbTableDescriptor tableDescriptor = new RocksDbTableDescriptor("table",
KVSerde.of(new IntegerSerde(), new StringSerde("UTF-8")))
.withBlockSize(1024)
.withConfig("some-key", "some-value");
For High Level API StreamApplications, use StreamApplicationDescriptor.getTable(TableDescriptor) to
obtain the corresponding Table instance that can be used with the MessageStream operators like
MessageStream.sendTo(Table). Alternatively, use TaskContext.getTable(String) or
TaskContext.getUpdatableTable(String) in InitableFunction.init(org.apache.samza.context.Context) to get the table instance for use
within operator functions. For Low Level API TaskApplications, use TaskContext.getTable(String) in
InitableTask.init(org.apache.samza.context.Context) to get the table instance for use within the Task.| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getTableId()
Get the id of the table
|
java.util.Map<java.lang.String,java.lang.String> |
toConfig(Config jobConfig)
Generate configuration for this table descriptor, the generated configuration
should be the complete configuration for this table that can be directly
included in the job configuration.
|
java.lang.String getTableId()
java.util.Map<java.lang.String,java.lang.String> toConfig(Config jobConfig)
jobConfig.jobConfig - job configuration