R
- the type of records in the table@InterfaceStability.Unstable public interface Table<R>
Table
is an abstraction for data sources that support random access by key. It is an evolution of the
existing KeyValueStore
API. It offers support for both local and remote data sources and composition through
hybrid tables. For remote data sources, a RemoteTable
provides optimized access with caching, rate-limiting,
and retry support.
Depending on the implementation, a Table
can be a ReadableTable
or a ReadWriteTable
.
Use a TableDescriptor
to specify the properties of a Table
. For High Level API
StreamApplication
s, use StreamApplicationDescriptor.getTable(org.apache.samza.table.descriptors.TableDescriptor<K, V, ?>)
to obtain the Table
instance for
the descriptor that can be used with the MessageStream
operators like MessageStream.sendTo(Table)
.
Alternatively, use TaskContext.getTable(String)
in InitableFunction.init(org.apache.samza.context.Context)
to get the table instance
for use within operator functions. For Low Level API TaskApplication
s, use TaskContext.getTable(java.lang.String)
in InitableTask.init(org.apache.samza.context.Context)
to get the table instance for use within the Task.