Table table = connection.getTable(TableName.valueOf("testtable"));
Delete delete1 = new Delete(Bytes.toBytes("row1"));
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.
<BUG>System.out.println("Delete successful: " + res1); // co CheckAndDeleteExample-3-SOUT1 Print out the result, should be "Delete successful: false".
</BUG>
Delete delete2 = new Delete(Bytes.toBytes("row1"));
delete2.addColumns(Bytes.toBytes("colfam2"), Bytes.toBytes("qual3")); // co CheckAndDeleteExample-4-Delete2 Delete checked column manually.
table.delete(delete2);

Table table = connection.getTable(TableName.valueOf("testtable"));
Delete delete1 = new Delete(Bytes.toBytes("row1"));
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".
Delete delete2 = new Delete(Bytes.toBytes("row1"));
delete2.addColumns(Bytes.toBytes("colfam2"), Bytes.toBytes("qual3")); // co CheckAndDeleteExample-4-Delete2 Delete checked column manually.
table.delete(delete2);
