Java Code Examples for org.apache.hadoop.hbase.client.Put.heapSize()

The following are Jave code examples for showing how to use heapSize() of the org.apache.hadoop.hbase.client.Put class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: aliyun-tablestore-hbase-client   File: TablestoreBufferedMutator.java   Source Code and License Vote up 6 votes
private void commitPuts(final List<OPut> puts) throws IOException {
    boolean flushSuccessfully = false;
    try {
        this.adapter.putMultiple(tableName.getNameAsString(), puts);
        flushSuccessfully = true;
    } finally {
        if (!flushSuccessfully && !clearBufferOnFail) {
            List<Put> hputs = ElementConvertor.toHBasePuts(puts, this.columnMapping);
            synchronized (writeBuffer) {
                for (Put put : hputs) {
                    writeBuffer.add(put);
                    currentWriteBufferSize += put.heapSize();
                }
            }
        }
    }
}