MapR-DB supports this list of methods in the HTable class. For more information about this class, see Class HTable in the HBase Java API documentation.

MapR-DB's implementation of the HTable class is thread-safe.

Do not allow an HTable object to be used by more than one user. Ensure that each user works only with self-created HTable objects. A user’s security credentials are associated with each HTable object that the user creates. Therefore, a user that has access to another user’s HTable object acquires the originating user’s privileges on the underlying table.

The descriptions of the methods in the table below are taken from the HBase documentation for this class.

Methods for Configuration and State Management

Modifier and TypeMethod and Description
void

clearRegionCache()

MapR-DB tolerates this method and performs no operation.

void

close()

Releases any resources held or pending changes in internal buffers.

void

flushCommits()

Executes all buffered put operations.

org.apache.hadoop.conf.Configuration

getConfiguration()

Returns the Configuration object used by this instance.

Hconnection

getConnection()

This method is deprecated.

int

getOperationTimeout()

MapR-DB tolerates this method and returns 0 only.

int

getScannerCaching()

This method is deprecated.

boolean

isAutoFlush()

Tells whether or not 'auto-flush' is turned on.

void

setAutoFlush(boolean autoFlush, boolean clearBufferOnFail)

Turns 'auto-flush' on or off.

void

setAutoFlush(boolean autoFlush)

Turns 'auto-flush' on or off.

void

setAutoFlushTo(boolean autoFlush)

Set the autoFlush behavior, without changing the value of clearBufferOnFail.

voidsetOperationTimeout(int operationTimeout)
void

setScannerCaching(int scannerCaching)

This method is deprecated.

void

setWriteBufferSize(long writeBufferSize)

Sets the size of the buffer in bytes.

Methods for Atomic Operations

Modifier and TypeMethod and Description
Result 

append(Append append)

Appends values to one or more columns within a single row.

boolean 

checkAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value, Delete delete)

Atomically checks if a row/family/qualifier value matches the expected value. 

boolean

checkAndMutate(final byte [] row, final byte [] family, final byte [] qualifier, final CompareOp compareOp, final byte [] value, final RowMutations rm)

Atomically whether the value of a row, column family, or qualifier matches an expected value before changing the value.

The implementation of this method on HBase is the opposite of its implemenatation on MapR-DB. After locating a value by means of the first three parameters in the signature, on HBase the method compares the input value against the located value, ignoring the order in which the parameters are listed in the signature. On MapR-DB, the method compares the located value against the input value, following the order of the parameters in the signature.

For example, suppose that you have a table in which there is a column that has the following data:

Row KeyColumn FamilyColumnTimestampValue
row3fam0col01435096036609val03

Your application calls checkAndMutate() with the following code: 

......
byte[] row = Bytes.toBytes("row3");
byte[] cf = Bytes.toBytes("fam0");
byte[] col = Bytes.toBytes("col0");
byte[] rowval = Bytes.toBytes("val02")
......
boolean returnvalue = mytable.checkAndMutate(row, cf, col, CompareOp.GREATER, rowval, mymutations);

When you run this code against a MapR-DB table, the condition is evaluated as true because the value in the cell (val03) is greater than the input value (val02). The mutation is applied to the table. The return value is true.

When you run this code against an HBase table, the condition is evaluated as false because the input value (val02) is less than the value in the cell (val03). The mutation is not applied to the table. The return value is false.

MapR believes that the HBase implementation is in error and has filed report HBASE-13624.

boolean 

checkAndPut(byte[] row, byte[] family, byte[] qualifier, byte[] value, Put put)

Atomically checks if a row/family/qualifier value matches the expected value.

Result 

increment(Increment increment)

Increments one or more columns within a single row.

long 

incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL)

Atomically increments a column value.

long 

incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount)

Atomically increments a column value.

public long 

incrementColumnValue(final byte [] row, final byte [] family, final byte [] qualifier, final long amount, final Durability durability)

Atomically increments a column value.

void 

mutateRow(RowMutations rm)

Performs multiple mutations atomically on a single row.

 

Methods for DML Operations

Modifier and TypeMethod and Description
void

batch(List<? extends Row> actions, Object[] results)

Method that does a batch call on Deletes, Gets, Puts, Increments and Appends.

Object[] 

batch(List<? extends Row> actions)

Method that does a batch call on Deletes, Gets, Puts, Increments and Appends, then returns an array of results instead of using a results parameter reference.

void

delete(Delete delete)

Deletes the specified cells/row.

void

delete(List<Delete> deletes)

Deletes the specified cells/rows in bulk.

boolean 

exists(Get get)

Tests for the existence of columns in the table, as specified by the Get.

Result 

get(Get get)

Extracts certain cells from a given row.

Result[] 

get(List<Get> gets)

Extracts certain cells from the given rows, in batch.

ResultScanner

getScanner(byte[] family)

Gets a scanner on the current table for the given family.

ResultScanner

getScanner(byte[] family, byte[] qualifier)

Gets a scanner on the current table for the given family and qualifier.

ResultScanner

getScanner(Scan scan)

Returns a scanner on the current table as specified by the Scan object.

void

put(List<Put> puts)

Puts some data in the table, in batch.

Result 

put(Put put)

Puts some data in the table.

Methods for Table Schema Information

Modifier and TypeMethod and Description
byte[][] 

getEndKeys()

Gets the ending row key for every region in the currently open table.

HRegionLocation 

getRegionLocation(byte[] row) 

Finds the region on which the given row is being served.

HRegionLocation 

getRegionLocation(byte[] row, boolean reload)

Finds the region on which the given row is being served.

HRegionLocation 

getRegionLocation(String row)

Finds region location hosting passed row using cached info

List<HRegionLocation>

getRegionsInRange(byte[] startKey, byte[] endKey)

Gets the corresponding regions for an arbitrary range of keys.

List<HRegionLocation>

getRegionsInRange(byte[] startKey, byte[] endKey, boolean reload)

Gets the corresponding regions for an arbitrary range of keys.

Pair<byte[][], byte[][]>

getStartEndKeys()

Gets the starting and ending row keys for every region in the currently open table.

byte[][] 

getStartKeys()

Gets the starting row key for every region in the currently open table.

HTableDescriptor 

getTableDescriptor()

Gets the table descriptor for this table.

byte[] 

getTableName()

Gets the name of this table.