private static class DirectAttributeFamilyProxyDescriptor.ProxyRandomAccessReader extends java.lang.Object implements RandomAccessReader
RandomAccessReader.Factory<T extends RandomAccessReader>, RandomAccessReader.Listing| Modifier and Type | Field and Description |
|---|---|
private DirectAttributeFamilyProxyDescriptor.AttrLookup |
lookup |
private RandomAccessReader |
reader |
| Constructor and Description |
|---|
ProxyRandomAccessReader(RandomAccessReader reader,
DirectAttributeFamilyProxyDescriptor.AttrLookup lookup) |
| Modifier and Type | Method and Description |
|---|---|
RandomAccessReader.Factory<?> |
asFactory()
Convert instance of this reader to
RandomAccessReader.Factory suitable for serialization. |
void |
close() |
RandomOffset |
fetchOffset(RandomAccessReader.Listing type,
java.lang.String key)
Construct
Offset from string (representing either key of the entity or attribute). |
<T> java.util.Optional<KeyValue<T>> |
get(java.lang.String key,
java.lang.String attribute,
AttributeDescriptor<T> desc,
long stamp)
Retrieve data stored under given (key, attribute) pair (if any).
|
EntityDescriptor |
getEntityDescriptor()
Retrieve entity associated with this reader.
|
void |
listEntities(RandomOffset offset,
int limit,
Consumer<Pair<RandomOffset,java.lang.String>> consumer)
List all entity keys with offset and limit.
|
<T> void |
scanWildcard(java.lang.String key,
AttributeDescriptor<T> wildcard,
RandomOffset offset,
long stamp,
int limit,
Consumer<KeyValue<T>> consumer)
List data stored for a particular wildcard attribute.
|
void |
scanWildcardAll(java.lang.String key,
RandomOffset offset,
long stamp,
int limit,
Consumer<KeyValue<?>> consumer)
Scan all data stored per given key.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitget, get, get, listEntities, newBuilder, scanWildcard, scanWildcard, scanWildcard, scanWildcardAll, scanWildcardAll, scanWildcardAllprivate final RandomAccessReader reader
private final DirectAttributeFamilyProxyDescriptor.AttrLookup lookup
public ProxyRandomAccessReader(RandomAccessReader reader, DirectAttributeFamilyProxyDescriptor.AttrLookup lookup)
public RandomOffset fetchOffset(RandomAccessReader.Listing type, java.lang.String key)
RandomAccessReaderOffset from string (representing either key of the entity or attribute).fetchOffset in interface RandomAccessReadertype - the type of the keykey - the key of entity or attributepublic <T> java.util.Optional<KeyValue<T>> get(java.lang.String key, java.lang.String attribute, AttributeDescriptor<T> desc, long stamp)
RandomAccessReaderget in interface RandomAccessReaderT - value typekey - key of the entityattribute - name of the attributedesc - the attribute to search forstamp - timestamp to relatively to which retrieve the dataKeyValue if presentpublic <T> void scanWildcard(java.lang.String key,
AttributeDescriptor<T> wildcard,
RandomOffset offset,
long stamp,
int limit,
Consumer<KeyValue<T>> consumer)
RandomAccessReaderscanWildcard in interface RandomAccessReaderT - value typekey - key of the entitywildcard - wildcard attribute to scanoffset - name of attribute (including the prefix) to start fromstamp - timestamp to relatively to which retrieve the datalimit - maximal number of items to consume *consumer - the consumer to stream data topublic void scanWildcardAll(java.lang.String key,
RandomOffset offset,
long stamp,
int limit,
Consumer<KeyValue<?>> consumer)
RandomAccessReaderscanWildcardAll in interface RandomAccessReaderkey - the key whose KeyValues to scanoffset - offset to start from (next key value will be returned)stamp - timestamp to relatively to which retrieve the datalimit - how many elements to process at mostconsumer - consumer to use for scanningpublic void listEntities(RandomOffset offset, int limit, Consumer<Pair<RandomOffset,java.lang.String>> consumer)
RandomAccessReaderlistEntities in interface RandomAccessReaderoffset - offset of the entitieslimit - limit for number of resultsconsumer - consumer of resultspublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic EntityDescriptor getEntityDescriptor()
RandomAccessReadergetEntityDescriptor in interface RandomAccessReaderpublic RandomAccessReader.Factory<?> asFactory()
RandomAccessReaderRandomAccessReader.Factory suitable for serialization.asFactory in interface RandomAccessReaderRandomAccessReader.Factory representing this readerCopyright © 2017–2021. All rights reserved.