Package io.dingodb.sdk.service.store
Class StoreServiceClient
java.lang.Object
io.dingodb.sdk.service.store.StoreServiceClient
-
Constructor Summary
ConstructorsConstructorDescriptionStoreServiceClient(MetaServiceClient rootMetaService) StoreServiceClient(MetaServiceClient rootMetaService, Integer retryTimes) -
Method Summary
Modifier and TypeMethodDescriptiongetStoreConnector(DingoCommonId tableId, DingoCommonId regionId) Get store connector for the region of a specified table.kvBatchCompareAndSet(DingoCommonId tableId, DingoCommonId regionId, List<KeyValueWithExpect> keyValues, boolean isAtomic) kvBatchDelete(DingoCommonId tableId, DingoCommonId regionId, List<byte[]> keys) Delete keys on store.kvBatchGet(DingoCommonId tableId, DingoCommonId regionId, List<byte[]> keys) Returns the KeyValue list for the specified keys that are found.booleankvBatchPut(DingoCommonId tableId, DingoCommonId regionId, List<KeyValue> keyValues) kvBatchPutIfAbsent(DingoCommonId tableId, DingoCommonId regionId, List<KeyValue> keyValues) kvBatchPutIfAbsent(DingoCommonId tableId, DingoCommonId regionId, List<KeyValue> keyValues, boolean isAtomic) booleankvCompareAndSet(DingoCommonId tableId, DingoCommonId regionId, KeyValueWithExpect keyValue) longkvDeleteRange(DingoCommonId tableId, DingoCommonId regionId, RangeWithOptions range) Delete keys in range, range strategy likescan(io.dingodb.sdk.common.DingoCommonId, io.dingodb.sdk.common.DingoCommonId, io.dingodb.sdk.common.Range, boolean, boolean).byte[]kvGet(DingoCommonId tableId, DingoCommonId regionId, byte[] key) Returns the value to which the specified key, or empty byte array if not have the key.booleankvPut(DingoCommonId tableId, DingoCommonId regionId, KeyValue keyValue) Put key and value to store.booleankvPutIfAbsent(DingoCommonId tableId, DingoCommonId regionId, KeyValue keyValue) Put key and value to store if the key is not in store.scan(DingoCommonId tableId, DingoCommonId regionId, Range range, boolean withStart, boolean withEnd) Returns KeyValue iterator of scan, the scan is starting from the given start key, traverse in order until a key is encountered that exceeds the specified end key.scan(DingoCommonId tableId, DingoCommonId regionId, Range range, boolean withStart, boolean withEnd, Coprocessor coprocessor) Returns KeyValue iterator of scan, the scan is starting from the given start key, traverse in order until a key is encountered that exceeds the specified end key.voidshutdown()
-
Constructor Details
-
StoreServiceClient
-
StoreServiceClient
-
-
Method Details
-
getStoreConnector
Get store connector for the region of a specified table.- Parameters:
tableId- table idregionId- region id- Returns:
- store connector
-
shutdown
public void shutdown() -
kvGet
Returns the value to which the specified key, or empty byte array if not have the key.- Parameters:
tableId- table id of keyregionId- region id of keykey- key- Returns:
- value
-
kvBatchGet
Returns the KeyValue list for the specified keys that are found.- Parameters:
tableId- table id of keysregionId- region id of keyskeys- keys, the keys must in same region- Returns:
- values
-
scan
public Iterator<KeyValue> scan(DingoCommonId tableId, DingoCommonId regionId, Range range, boolean withStart, boolean withEnd) Returns KeyValue iterator of scan, the scan is starting from the given start key, traverse in order until a key is encountered that exceeds the specified end key. Since the key is a variable-length byte array, the start and end specified in the range will be treated as prefixes.- Parameters:
tableId- table idregionId- region idrange- key range, start and end must in same regionwithStart- is with startwithEnd- is with end- Returns:
- KeyValue iterator of scan
-
scan
public Iterator<KeyValue> scan(DingoCommonId tableId, DingoCommonId regionId, Range range, boolean withStart, boolean withEnd, Coprocessor coprocessor) Returns KeyValue iterator of scan, the scan is starting from the given start key, traverse in order until a key is encountered that exceeds the specified end key. Since the key is a variable-length byte array, the start and end specified in the range will be treated as prefixes.- Parameters:
tableId- table idregionId- region idrange- key range, start and end must in same regionwithStart- is with startwithEnd- is with endcoprocessor- coprocessor- Returns:
- KeyValue iterator of scan
-
kvPut
Put key and value to store.- Parameters:
tableId- table idregionId- region idkeyValue- key and value- Returns:
- is success
-
kvBatchPut
-
kvPutIfAbsent
Put key and value to store if the key is not in store.- Parameters:
tableId- table idregionId- region idkeyValue- key and value- Returns:
- true if key is not in store or false if the key exist in store
-
kvBatchPutIfAbsent
public List<Boolean> kvBatchPutIfAbsent(DingoCommonId tableId, DingoCommonId regionId, List<KeyValue> keyValues) -
kvBatchPutIfAbsent
public List<Boolean> kvBatchPutIfAbsent(DingoCommonId tableId, DingoCommonId regionId, List<KeyValue> keyValues, boolean isAtomic) -
kvBatchDelete
public List<Boolean> kvBatchDelete(DingoCommonId tableId, DingoCommonId regionId, List<byte[]> keys) Delete keys on store.- Parameters:
tableId- table idregionId- region idkeys- delete key list, must in same region- Returns:
- delete success or fail with keys
-
kvDeleteRange
Delete keys in range, range strategy likescan(io.dingodb.sdk.common.DingoCommonId, io.dingodb.sdk.common.DingoCommonId, io.dingodb.sdk.common.Range, boolean, boolean).- Parameters:
tableId- table idregionId- region idrange- key range, start and end must in same region- Returns:
- delete keys count
-
kvCompareAndSet
public boolean kvCompareAndSet(DingoCommonId tableId, DingoCommonId regionId, KeyValueWithExpect keyValue) -
kvBatchCompareAndSet
public List<Boolean> kvBatchCompareAndSet(DingoCommonId tableId, DingoCommonId regionId, List<KeyValueWithExpect> keyValues, boolean isAtomic)
-