@Stable public interface CachedView extends RandomAccessReader, OnlineAttributeWriter
Client can provide callbacks to be called on data updates. Client might also update the view, all updates must be persisted in a way that will guarantee that subsequent reloads will contain the new data and that read-write operations have happens-before relation semantics.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
CachedView.Factory
Serializable factory for CachedView. |
RandomAccessReader.ListingAttributeWriterBase.Type| Modifier and Type | Method and Description |
|---|---|
CachedView.Factory |
asFactory()
Convert instance of this view to
CachedView.Factory suitable for serialization. |
default void |
assign(java.util.Collection<Partition> partitions)
Assign and make given partitions accessible by random reads.
|
void |
assign(java.util.Collection<Partition> partitions,
BiConsumer<StreamElement,Pair<java.lang.Long,java.lang.Object>> updateCallback)
Assign and make given partitions accessible by random reads.
|
void |
cache(StreamElement element)
Cache given
StreamElement into local cache without writing it to the underlaying
writer. |
java.util.Collection<Partition> |
getAssigned()
Retrieve currently assigned partitions.
|
java.util.Collection<Partition> |
getPartitions()
Retrieve all partitions of the underlying commit log.
|
fetchOffset, get, get, get, get, getEntityDescriptor, listEntities, listEntities, newBuilder, scanWildcard, scanWildcard, scanWildcard, scanWildcard, scanWildcardAll, scanWildcardAll, scanWildcardAll, scanWildcardAllgetType, rollback, writebulk, close, getUri, onlinedefault void assign(java.util.Collection<Partition> partitions)
partitions - the partitions to cache locallyvoid assign(java.util.Collection<Partition> partitions, BiConsumer<StreamElement,Pair<java.lang.Long,java.lang.Object>> updateCallback)
partitions - the partitions to cache locallyupdateCallback - function that is called when cache gets updated the function takes the
new ingest element and pair of the most recent object that was associated with the key and
it's currently associated stampjava.util.Collection<Partition> getAssigned()
void cache(StreamElement element)
StreamElement into local cache without writing it to the underlaying
writer. This is used in conjunction with attribute family proxy.element - the data to cachejava.util.Collection<Partition> getPartitions()
CachedView.Factory asFactory()
CachedView.Factory suitable for serialization.asFactory in interface AttributeWriterBaseasFactory in interface OnlineAttributeWriterasFactory in interface RandomAccessReaderCachedView.Factory representing this viewCopyright © 2017–2021. All rights reserved.