exist

检查数据是否存在。

  1. /**
  2. * Check value exist by key from the cluster
  3. * @param tableName TableHandler name
  4. * @param hashKey used to decide which partition the key may exist.
  5. * @param sortKey all keys under the same hashKey will be sorted by sortKey
  6. *
  7. * @return true if exist, false if not exist
  8. * @throws PException
  9. */
  10. public boolean exist(String tableName, byte[] hashKey, byte[] sortKey) throws PException;

注:

  • 参数:需传入TableName、HashKey、SortKey。
  • 返回值:如果存在返回true,否则返回false。
  • 异常:如果出现异常,譬如网络错误、超时错误、服务端错误等,会抛出 PException。