org.apache.hadoop.hbase.client.Table.checkAndDelete()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(87)

本文整理了Java中org.apache.hadoop.hbase.client.Table.checkAndDelete()方法的一些代码示例,展示了Table.checkAndDelete()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.checkAndDelete()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Table
类名称:Table
方法名:checkAndDelete

Table.checkAndDelete介绍

[英]Atomically checks if a row/family/qualifier value matches the expected value. If it does, it adds the delete. If the passed value is null, the check is for the lack of column (ie: non-existence) The expected value argument of this call is on the left and the current value of the cell is on the right side of the comparison operator. Ie. eg. GREATER operator means expected value > existing add the delete.
[中]

代码示例

代码示例来源:origin: apache/hbase

/**
 * Atomically checks if a row/family/qualifier value matches the expected
 * value. If it does, it adds the delete.  If the passed value is null, the
 * check is for the lack of column (ie: non-existance)
 *
 * @param row to check
 * @param family column family to check
 * @param qualifier column qualifier to check
 * @param value the expected value
 * @param delete data to delete if check succeeds
 * @throws IOException e
 * @return true if the new delete was executed, false otherwise
 * @deprecated Since 2.0.0. Will be removed in 3.0.0. Use {@link #checkAndMutate(byte[], byte[])}
 */
@Deprecated
default boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier,
 byte[] value, Delete delete) throws IOException {
 return checkAndDelete(row, family, qualifier, CompareOperator.EQUAL, value, delete);
}

代码示例来源:origin: apache/phoenix

@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, CompareOp compareOp,
    byte[] value, Delete delete) throws IOException {
  return delegate.checkAndDelete(row, family, qualifier, compareOp, value, delete);
}

代码示例来源:origin: apache/phoenix

@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, CompareOperator op,
    byte[] value, Delete delete) throws IOException {
  return delegate.checkAndDelete(row, family, qualifier, op, value, delete);
}

代码示例来源:origin: apache/phoenix

@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value,
    Delete delete) throws IOException {
  return delegate.checkAndDelete(row, family, qualifier, value, delete);
}

代码示例来源:origin: apache/hbase

assertObserverHasExecuted();
assertTrue(table.checkAndDelete(ROW, FAMILY, QUALIFIER, VALUE, delete));
assertObserverHasExecuted();

代码示例来源:origin: org.apache.hbase/hbase-client

/**
 * Atomically checks if a row/family/qualifier value matches the expected
 * value. If it does, it adds the delete.  If the passed value is null, the
 * check is for the lack of column (ie: non-existance)
 *
 * @param row to check
 * @param family column family to check
 * @param qualifier column qualifier to check
 * @param value the expected value
 * @param delete data to delete if check succeeds
 * @throws IOException e
 * @return true if the new delete was executed, false otherwise
 * @deprecated Since 2.0.0. Will be removed in 3.0.0. Use {@link #checkAndMutate(byte[], byte[])}
 */
@Deprecated
default boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier,
 byte[] value, Delete delete) throws IOException {
 return checkAndDelete(row, family, qualifier, CompareOperator.EQUAL, value, delete);
}

代码示例来源:origin: larsgeorge/hbase-book

delete1.addColumns(Bytes.toBytes("colfam1"), Bytes.toBytes("qual3")); // co CheckAndDeleteExample-1-Delete1 Create a new Delete instance.
boolean res1 = table.checkAndDelete(Bytes.toBytes("row1"),
 Bytes.toBytes("colfam2"), Bytes.toBytes("qual3"), null, delete1); // co CheckAndDeleteExample-2-CAS1 Check if column does not exist and perform optional delete operation.
System.out.println("Delete 1 successful: " + res1); // co CheckAndDeleteExample-3-SOUT1 Print out the result, should be "Delete successful: false".
table.delete(delete2);
boolean res2 = table.checkAndDelete(Bytes.toBytes("row1"),
 Bytes.toBytes("colfam2"), Bytes.toBytes("qual3"), null, delete1); // co CheckAndDeleteExample-5-CAS2 Attempt to delete same cell again.
System.out.println("Delete 2 successful: " + res2); // co CheckAndDeleteExample-6-SOUT2 Print out the result, should be "Delete successful: true" since the checked column now is gone.
 boolean res4 = table.checkAndDelete(Bytes.toBytes("row1"),
  Bytes.toBytes("colfam1"), Bytes.toBytes("qual1"), // co CheckAndDeleteExample-8-CAS4 Try to delete while checking a different row.
  Bytes.toBytes("val1"), delete3);

代码示例来源:origin: larsgeorge/hbase-book

delete = new Delete(Bytes.toBytes("row10"));
delete.addColumn(Bytes.toBytes("colfam1"), Bytes.toBytes("qual17"));
cap = table.checkAndDelete(Bytes.toBytes("row10"),
 Bytes.toBytes("colfam1"), Bytes.toBytes("qual15"), null, delete);
System.out.println("  -> success: " + cap);
cap = table.checkAndDelete(Bytes.toBytes("row10"),
 Bytes.toBytes("colfam1"), Bytes.toBytes("qual18"), null, delete);
System.out.println("  -> success: " + cap);

代码示例来源:origin: org.apache.phoenix/phoenix-core

@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, CompareOperator op,
    byte[] value, Delete delete) throws IOException {
  return delegate.checkAndDelete(row, family, qualifier, op, value, delete);
}

代码示例来源:origin: org.apache.phoenix/phoenix-core

@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, CompareOp compareOp,
    byte[] value, Delete delete) throws IOException {
  return delegate.checkAndDelete(row, family, qualifier, compareOp, value, delete);
}

代码示例来源:origin: com.aliyun.phoenix/ali-phoenix-core

@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, CompareOperator op,
    byte[] value, Delete delete) throws IOException {
  return delegate.checkAndDelete(row, family, qualifier, op, value, delete);
}

代码示例来源:origin: org.apache.phoenix/phoenix-core

@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value,
    Delete delete) throws IOException {
  return delegate.checkAndDelete(row, family, qualifier, value, delete);
}

代码示例来源:origin: com.aliyun.phoenix/ali-phoenix-core

@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value,
    Delete delete) throws IOException {
  return delegate.checkAndDelete(row, family, qualifier, value, delete);
}

代码示例来源:origin: com.aliyun.phoenix/ali-phoenix-core

@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, CompareOp compareOp,
    byte[] value, Delete delete) throws IOException {
  return delegate.checkAndDelete(row, family, qualifier, compareOp, value, delete);
}

代码示例来源:origin: org.apache.tephra/tephra-hbase-compat-1.1

@Override
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value, Delete delete)
 throws IOException {
 if (allowNonTransactional) {
  return hTable.checkAndDelete(row, family, qualifier, value, delete);
 } else {
  throw new UnsupportedOperationException("Operation is not supported transactionally");
 }
}

代码示例来源:origin: org.apache.tephra/tephra-hbase-compat-1.1

@Override
public boolean checkAndDelete(byte[] bytes, byte[] bytes1, byte[] bytes2, CompareFilter.CompareOp compareOp,
               byte[] bytes3, Delete delete) throws IOException {
 if (allowNonTransactional) {
  return hTable.checkAndDelete(bytes, bytes1, bytes2, compareOp, bytes3, delete);
 } else {
  throw new UnsupportedOperationException("Operation is not supported transactionally");
 }
}

代码示例来源:origin: GoogleCloudPlatform/cloud-bigtable-client

@Override
protected boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value,
  Delete delete) throws IOException {
 return getDefaultTable().checkAndDelete(row, family, qualifier, value, delete);
}

代码示例来源:origin: org.apache.hbase/hbase-server

assertObserverHasExecuted();
assertTrue(table.checkAndDelete(ROW, FAMILY, QUALIFIER, VALUE, delete));
assertObserverHasExecuted();

相关文章