multiSet

写同一HashKey下的多行数据。

  1. /**
  2. * Set multiple value under the same hash key.
  3. * @param tableName table name
  4. * @param hashKey used to decide which partition to put this k-v,
  5. * should not be null or empty.
  6. * @param values all <sortkey,value> pairs to be set,
  7. * should not be null or empty.
  8. * @param ttl_seconds time to live in seconds,
  9. * 0 means no ttl. default value is 0.
  10. * @throws PException
  11. */
  12. public void multiSet(String tableName, byte[] hashKey, List<Pair<byte[], byte[]>> values, int ttl_seconds) throws PException;
  13. public void multiSet(String tableName, byte[] hashKey, List<Pair<byte[], byte[]>> values) throws PException;

注:

  • 提供了两个版本的接口,其中第一个接口可以指定TTL时间。
  • 参数:需传入TableName、HashKey、Values;选择性传入TTL。
    • Values是Pair列表,Pair的第一个元素是SortKey,第二个元素为value。
  • 返回值:无。
  • 异常:如果出现异常,譬如网络错误、超时错误、服务端错误等,会抛出 PException。