Class StoreServiceClient

java.lang.Object
io.dingodb.sdk.service.store.StoreServiceClient

public class StoreServiceClient extends Object
  • Constructor Details

  • Method Details

    • getStoreConnector

      public StoreServiceConnector getStoreConnector(DingoCommonId tableId, DingoCommonId regionId)
      Get store connector for the region of a specified table.
      Parameters:
      tableId - table id
      regionId - region id
      Returns:
      store connector
    • shutdown

      public void shutdown()
    • kvGet

      public 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.
      Parameters:
      tableId - table id of key
      regionId - region id of key
      key - key
      Returns:
      value
    • kvBatchGet

      public List<KeyValue> kvBatchGet(DingoCommonId tableId, DingoCommonId regionId, List<byte[]> keys)
      Returns the KeyValue list for the specified keys that are found.
      Parameters:
      tableId - table id of keys
      regionId - region id of keys
      keys - 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 id
      regionId - region id
      range - key range, start and end must in same region
      withStart - is with start
      withEnd - 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 id
      regionId - region id
      range - key range, start and end must in same region
      withStart - is with start
      withEnd - is with end
      coprocessor - coprocessor
      Returns:
      KeyValue iterator of scan
    • kvPut

      public boolean kvPut(DingoCommonId tableId, DingoCommonId regionId, KeyValue keyValue)
      Put key and value to store.
      Parameters:
      tableId - table id
      regionId - region id
      keyValue - key and value
      Returns:
      is success
    • kvBatchPut

      public boolean kvBatchPut(DingoCommonId tableId, DingoCommonId regionId, List<KeyValue> keyValues)
    • kvPutIfAbsent

      public boolean kvPutIfAbsent(DingoCommonId tableId, DingoCommonId regionId, KeyValue keyValue)
      Put key and value to store if the key is not in store.
      Parameters:
      tableId - table id
      regionId - region id
      keyValue - 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 id
      regionId - region id
      keys - delete key list, must in same region
      Returns:
      delete success or fail with keys
    • kvDeleteRange

      public long kvDeleteRange(DingoCommonId tableId, DingoCommonId regionId, RangeWithOptions range)
      Parameters:
      tableId - table id
      regionId - region id
      range - 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)