Java Code Examples for org.apache.hadoop.hbase.client.Delete#setDurability()

The following examples show how to use org.apache.hadoop.hbase.client.Delete#setDurability() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IndexMaintainer.java    From phoenix with Apache License 2.0 6 votes vote down vote up
public Delete buildRowDeleteMutation(byte[] indexRowKey, DeleteType deleteType, long ts) {
    byte[] emptyCF = emptyKeyValueCFPtr.copyBytesIfNecessary();
    Delete delete = new Delete(indexRowKey);

    for (ColumnReference ref : getCoveredColumns()) {
        ColumnReference indexColumn = coveredColumnsMap.get(ref);
        // If table delete was single version, then index delete should be as well
        if (deleteType == DeleteType.SINGLE_VERSION) {
            delete.addFamilyVersion(indexColumn.getFamily(), ts);
        } else {
            delete.addFamily(indexColumn.getFamily(), ts);
        }
    }
    if (deleteType == DeleteType.SINGLE_VERSION) {
        delete.addFamilyVersion(emptyCF, ts);
    } else {
        delete.addFamily(emptyCF, ts);
    }
    delete.setDurability(!indexWALDisabled ? Durability.USE_DEFAULT : Durability.SKIP_WAL);
    return delete;
}
 
Example 2
Source File: PTableImpl.java    From phoenix with Apache License 2.0 5 votes vote down vote up
private void newMutations() {
     Mutation put = this.hasOnDupKey ? new Increment(this.key) : new Put(this.key);
     Delete delete = new Delete(this.key);
     if (isWALDisabled()) {
         put.setDurability(Durability.SKIP_WAL);
         delete.setDurability(Durability.SKIP_WAL);
     }
     this.setValues = put;
     this.unsetValues = delete;
}