T
- the type of objects in the store@Beta public interface ObjectStore<T> extends Dataset, BatchReadable<byte[],T>, BatchWritable<byte[],T>
Supported types are:
ObjectMappedTable
if you want object fields to be mapped to their own
columns.Modifier and Type | Method and Description |
---|---|
void |
delete(byte[] key)
Delete the object for the specified key.
|
List<Split> |
getSplits(int numSplits,
byte[] start,
byte[] stop)
Returns splits for a range of keys in the table.
|
T |
read(byte[] key)
Read an object with a given key.
|
T |
read(String key)
Read an object with a given key.
|
CloseableIterator<KeyValue<byte[],T>> |
scan(byte[] startRow,
byte[] stopRow)
Scans table.
|
void |
write(byte[] key,
T object)
Write an object with a given key.
|
void |
write(String key,
T object)
Write an object with a given key.
|
createSplitReader, getSplits
static final String TYPE
void write(String key, T object)
key
- the key of the objectobject
- the object to be storedvoid write(byte[] key, T object)
write
in interface BatchWritable<byte[],T>
key
- the key of the objectobject
- the object to be storedT read(String key)
key
- the key of the objectT read(byte[] key)
key
- the key of the objectCloseableIterator<KeyValue<byte[],T>> scan(byte[] startRow, byte[] stopRow)
startRow
- start row inclusive. null
means start from first row of the tablestopRow
- stop row exclusive. null
means scan all rows to the end of the tableCloseableIterator
over
KeyValue<byte[], T>
void delete(byte[] key)
key
- key of the object to be deletedList<Split> getSplits(int numSplits, byte[] start, byte[] stop)
numSplits
- Desired number of splits. If greater than zero, at most this many splits will be returned.
If less than or equal to zero, any number of splits can be returned.start
- if non-null, the returned splits will only cover keys that are greater or equalstop
- if non-null, the returned splits will only cover keys that are lessSplit
Copyright © 2022 Cask Data, Inc. Licensed under the Apache License, Version 2.0.