public interface

HBaseService

org.mule.module.hbase.api.HBaseService
Known Indirect Subclasses

Class Overview

The service exposes several actions to manage and use an HBase database

Summary

Public Methods
abstract void addColumn(String tableName, String columnFamilyName, Integer maxVersions, Boolean inMemory, Integer scope)
abstract void addProperties(Map<String, String> properties)
Add the properties to the main configuration.
abstract boolean alive()
abstract boolean checkAndDelete(String tableName, String row, String checkColumnFamilyName, String checkColumnQualifier, Object checkValue, String deleteColumnFamilyName, String deleteColumnQualifier, Long deleteTimestamp, Boolean deleteAllVersions, RowLock deleteLock)
Atomically checks if a row/family/qualifier value matches the expected value.
abstract boolean checkAndPut(String tableName, String row, String checkColumnFamilyName, String checkColumnQualifier, Object checkValue, String putColumnFamilyName, String putColumnQualifier, Long putTimestamp, Object value, boolean putWriteToWAL, RowLock putLock)
Atomically checks if a row/family/qualifier value matches the expected value.
abstract void createTable(String name)
abstract void delete(String tableName, String row, String columnFamilyName, String columnQualifier, Long timestamp, boolean deleteAllVersions, RowLock lock)
This method can delete a row in several levels depending on the parameters combination.
abstract void deleteColumn(String tableName, String columnFamilyName)
abstract void deleteTable(String name)
abstract void disabeTable(String name)
abstract void enableTable(String name)
abstract boolean exists(String tableName, String row, Integer maxVersions, Long timestamp)
abstract boolean existsColumn(String tableName, String columnFamilyName)
abstract boolean existsTable(String name)
abstract Result get(String tableName, String rowKey, String columnFamilyName, String columnQualifier, Integer maxVersions, Long timestamp)
abstract long increment(String tableName, String row, String columnFamilyName, String columnQualifier, long amount, boolean writeToWAL)
Atomically increments a column value.
abstract boolean isDisabledTable(String name)
abstract RowLock lock(String tableName, String row)
Locks a row in a table.
abstract void modifyColumn(String tableName, String columnFamilyName, Integer maxVersions, Integer blocksize, CompressionType compressionType, CompressionType compactionCompressionType, Boolean inMemory, Integer timeToLive, Boolean blockCacheEnabled, BloomFilterType bloomFilterType, Integer replicationScope, Map<String, String> values)
Changes a column family in a table, all null parameters will be ignored.
abstract void put(String tableName, String row, String columnFamilyName, String columnQualifier, Long timestamp, Object value, boolean writeToWAL, RowLock lock)
Saves the value at the specified cell (row + family:qualifier + timestamp)
abstract Iterable<Result> scan(String tableName, String columnFamilyName, String columnQualifier, Long timestamp, Long maxTimestamp, Integer caching, boolean cacheBlocks, int maxVersions, String startRow, String stopRow, int fetchSize)
Scan across all rows in a table.
abstract void unlock(String tableName, RowLock lock)
Unlock the row

Public Methods

public abstract void addColumn (String tableName, String columnFamilyName, Integer maxVersions, Boolean inMemory, Integer scope)

Parameters
tableName
columnFamilyName
maxVersions
inMemory
scope

public abstract void addProperties (Map<String, String> properties)

Add the properties to the main configuration. It overrides old properties if they where already added.

Parameters
properties

public abstract boolean alive ()

Returns
  • true only if the server can be reached and the master node is alive, false otherwise.

public abstract boolean checkAndDelete (String tableName, String row, String checkColumnFamilyName, String checkColumnQualifier, Object checkValue, String deleteColumnFamilyName, String deleteColumnQualifier, Long deleteTimestamp, Boolean deleteAllVersions, RowLock deleteLock)

Atomically checks if a row/family/qualifier value matches the expected value. If it does, it adds the delete.

Parameters
tableName
row
checkColumnFamilyName
checkColumnQualifier
checkValue
deleteColumnFamilyName
deleteColumnQualifier
deleteTimestamp
deleteAllVersions
deleteLock
Returns
  • true if the new delete was executed, false otherwise

public abstract boolean checkAndPut (String tableName, String row, String checkColumnFamilyName, String checkColumnQualifier, Object checkValue, String putColumnFamilyName, String putColumnQualifier, Long putTimestamp, Object value, boolean putWriteToWAL, RowLock putLock)

Atomically checks if a row/family/qualifier value matches the expected value. If it does, it adds the put.

Parameters
tableName
row
checkColumnFamilyName
checkColumnQualifier
checkValue
putColumnFamilyName
putColumnQualifier
putTimestamp
value
putWriteToWAL
putLock
Returns
  • true if the new put was executed, false otherwise

public abstract void createTable (String name)

Parameters
name

public abstract void delete (String tableName, String row, String columnFamilyName, String columnQualifier, Long timestamp, boolean deleteAllVersions, RowLock lock)

This method can delete a row in several levels depending on the parameters combination.

Parameters
tableName
row
columnFamilyName Set null to delete all column families in the specified row
columnQualifier Set null to delete all columns in the specified column family
timestamp Set it to delete all versions of the specified column or column family with a timestamp less than or equal to the specified timestamp
deleteAllVersions Set false to delete only the latest version of the specified column
lock

public abstract void deleteColumn (String tableName, String columnFamilyName)

Parameters
tableName
columnFamilyName

public abstract void deleteTable (String name)

Parameters
name

public abstract void disabeTable (String name)

Parameters
name

public abstract void enableTable (String name)

Parameters
name

public abstract boolean exists (String tableName, String row, Integer maxVersions, Long timestamp)

Parameters
tableName
row
maxVersions
timestamp
Returns
  • true only if the row exists and is not null

public abstract boolean existsColumn (String tableName, String columnFamilyName)

Parameters
tableName
columnFamilyName

public abstract boolean existsTable (String name)

Parameters
name
Returns
  • true only if the table exists, regardless it is enabled or not

public abstract Result get (String tableName, String rowKey, String columnFamilyName, String columnQualifier, Integer maxVersions, Long timestamp)

Parameters
tableName
rowKey
columnFamilyName
columnQualifier
maxVersions
timestamp

public abstract long increment (String tableName, String row, String columnFamilyName, String columnQualifier, long amount, boolean writeToWAL)

Atomically increments a column value. If the column value does not yet exist it is initialized to amount and written to the specified column.

Parameters
tableName
row
columnFamilyName
columnQualifier
amount
writeToWAL Set it to false means that in a fail scenario, you will lose any increments that have not been flushed.
Returns
  • the new value, post increment

public abstract boolean isDisabledTable (String name)

Parameters
name
Returns
  • true only if the table was disabled. You should check if the table exists before calling this method.

public abstract RowLock lock (String tableName, String row)

Locks a row in a table. You should eventually call unlock(String, RowLock).

Parameters
tableName
row
Returns
  • the lock

public abstract void modifyColumn (String tableName, String columnFamilyName, Integer maxVersions, Integer blocksize, CompressionType compressionType, CompressionType compactionCompressionType, Boolean inMemory, Integer timeToLive, Boolean blockCacheEnabled, BloomFilterType bloomFilterType, Integer replicationScope, Map<String, String> values)

Changes a column family in a table, all null parameters will be ignored.

Parameters
tableName Required
columnFamilyName Required
maxVersions
blocksize
compressionType
compactionCompressionType
inMemory
timeToLive
blockCacheEnabled
bloomFilterType
replicationScope
values (optional) an extension point for arbitrary data

public abstract void put (String tableName, String row, String columnFamilyName, String columnQualifier, Long timestamp, Object value, boolean writeToWAL, RowLock lock)

Saves the value at the specified cell (row + family:qualifier + timestamp)

Parameters
tableName
row
columnFamilyName
columnQualifier
timestamp (optional) a specific version
value
writeToWAL
lock

public abstract Iterable<Result> scan (String tableName, String columnFamilyName, String columnQualifier, Long timestamp, Long maxTimestamp, Integer caching, boolean cacheBlocks, int maxVersions, String startRow, String stopRow, int fetchSize)

Scan across all rows in a table.

Parameters
tableName Limits the scan to a specific table. This is the only required argument.
columnFamilyName Limits the scan to a specific column family or null
columnQualifier Limits the scan to a specific column or null. Requires a columnFamilyName to be defined.
timestamp Limits the scan to a specific timestamp
maxTimestamp Get versions of columns only within the specified timestamp range: [timestamp, maxTimestamp)
caching The number of rows for caching
cacheBlocks The number of rows for caching that will be passed to scanners
maxVersions Limits the number of versions on each column
startRow Limits the beginning of the scan to the specified row inclusive
stopRow Limits the end of the scan to the specified row exclusive
fetchSize

public abstract void unlock (String tableName, RowLock lock)

Unlock the row

Parameters
tableName
lock