org.mule.modules

mule-module-hbase


Namespacehttp://www.mulesoft.org/schema/mule/hbase
Schema Locationhttp://www.mulesoft.org/schema/mule/hbase/current/mule-hbase.xsd  (View Schema)
Schema Version2.0
Minimum Mule Version3.2

Module Overview

HBase connector

It delegates each Processor on a HBaseService and it accepts custom configuration in a Key-Value fashion

Summary

Configuration
<hbase:config>
Configure an instance of this module
Message Processors
<hbase:add-column-family>
Adds a column family to a table given a table and column name.
<hbase:check-and-delete-value>
Atomically checks if a value at a (table, row,family,qualifier) matches the given one.
<hbase:check-and-put-value>
Atomically checks if a value at a (table, row,family,qualifier) matches the given one.
<hbase:create-table>
Creates a new table given its name.
<hbase:delete-column-family>
Delete a column family
<hbase:delete-table>
Disables and deletes an existent table.
<hbase:delete-values>
Deletes the values at a given row
<hbase:disable-table>
Disables an existent table
<hbase:enable-table>
Enables an existent table.
<hbase:exists-column-family>
Answers if column family exists.
<hbase:exists-table>
Answers if a given table exists, regardless it is enabled or not
<hbase:get-values>
Answers the values at the given row - (table, row) combination
<hbase:increment-value>
Atomically increments the value of at a (table, row, familyName, familyQualifier) combination.
<hbase:is-alive-server>
Answers if the HBase server is reachable
<hbase:is-enabled-table>
Answers if the given existent table is enabled.
<hbase:modify-column-family>
Changes one or more properties of a column family in a table.
<hbase:put-value>
Saves a value at the specified (table, row, familyName, familyQualifier, timestamp) combination
<hbase:scan-table>
Scans across all rows in a table, returning a scanner over it

Configuration

To use the this module within a flow the namespace to the module must be included. The resulting flow will look similar to the following:

<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:hbase="http://www.mulesoft.org/schema/mule/hbase"
      xsi:schemaLocation="
               http://www.mulesoft.org/schema/mule/core
               http://www.mulesoft.org/schema/mule/core/current/mule.xsd
               http://www.mulesoft.org/schema/mule/hbase
               http://www.mulesoft.org/schema/mule/hbase/current/mule-hbase.xsd">

      <!-- here goes your flows and configuration elements -->

</mule>

This module is configured using the config element. This element must be placed outside of your flows and at the root of your Mule application. You can create as many configurations as you deem necessary as long as each carries its own name.

Each message processor, message source or transformer carries a config-ref attribute that allows the invoker to specify which configuration to use.

Attributes
TypeNameDefault ValueDescription
xs:string name Optional. Give a name to this configuration so it can be later referenced.
facade Optional. The HBaseService You may change it for mocking purposes
properties Optional. HBase internal configuration properties, be sure to add the following properties to ensure a connection against your hBase instance: "hbase.zookeeper.quorum", "hbase.zookeeper.property.clientPort" For more information please consult HBase documentation.

Message Processors

<hbase:add-column-family>

Adds a column family to a table given a table and column name. This Processor gracefully handles necessary table disabling and enabled.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName The name of the target table
columnFamilyName The name of the column
maxVersions Optional. The optional maximum number of versions the column family supports
inMemory false Optional. If all the column values will be stored in the region's cache
scope Optional. Replication scope: 0 for locally scoped data (data for this column family will not be replicated) and 1 for globally scoped data (data will be replicated to all peers.))
Child Elements

<hbase:check-and-delete-value>

Atomically checks if a value at a (table, row,family,qualifier) matches the given one. If it does, it performs the delete.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName The name of the table that contains the cell to check.
rowKey The row key that contains the cell to check.
checkColumnFamilyName The column family of the cell to check.
checkColumnQualifier The qualifier of the column to check
checkValue The value to check. It must be either a byte array or a serializable object. As a special case, strings are saved always in standard utf-8 format.
deleteColumnFamilyName The name of the column family to delete
deleteColumnQualifier The qualifier of the column values to delete. If no qualifier is specified, the Processor will affect all the qulifiers for the given column family name to delete. Thus it has only sense if deleteColumnFamilyName is specified
deleteTimestamp Optional. The timestamp of the values to delete. If no timestamp is specified, the most recent timestamp for the deleted value is used. Only has sense if deleteColumnFamilyName is specified
deleteAllVersions false Optional. If all versions should be deleted,or only those more recent than the deleteTimestamp. Only has sense if deleteColumnFamilyName and deleteColumnQualifier are specified
lock Optional. An optional RowLock
Child Elements
Return Payload
  • true if the new delete was executed, false otherwise

<hbase:check-and-put-value>

Atomically checks if a value at a (table, row,family,qualifier) matches the given one. If it does, it performs the put.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName The name of the table that contains the cell to check.
rowKey The row key that contains the cell to check.
checkColumnFamilyName The column family of the cell to check.
checkColumnQualifier The column qualifier of the cell to check.
checkValue The value to check. It must be either a byte array or a serializable object. As a special case, strings are saved always in standard utf-8 format.
putColumnFamilyName The column family of the cell to put.
putColumnQualifier The column qualifier of the cell to put.
putTimestamp Optional. The version dimension to put.
value The value to put. It must be either a byte array or a serializable object. As a special case, strings are saved always in standard utf-8 format.
writeToWAL true Optional. Set it to false means that in a fail scenario, you will lose any increments that have not been flushed.
lock Optional. And optional RowLock
Child Elements
Return Payload
  • true if the new put was executed, false otherwise

<hbase:create-table>

Creates a new table given its name. The descriptor must be unique and not reserved.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName The descriptor for the new table.
Child Elements

<hbase:delete-column-family>

Delete a column family

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName Required the target table
columnFamilyName Required the target column family
Child Elements

<hbase:delete-table>

Disables and deletes an existent table.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName Name of table to delete
Child Elements

<hbase:delete-values>

Deletes the values at a given row

XML Sample
INCLUDE_ERROR
XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName The name of the target table
rowKey The key of the row to delete
columnFamilyName Optional. Set null to delete all column families in the specified row
columnQualifier Optional. The qualifier of the column values to delete. If no qualifier is specified, the Processor will affect all the qulifiers for the given column family name to delete. Thus it has only sense if deleteColumnFamilyName is specified
timestamp Optional. The timestamp of the values to delete. If no timestamp is specified, the most recent timestamp for the deleted value is used. Only has sense if deleteColumnFamilyName is specified
deleteAllVersions false Optional. If all versions should be deleted,or only those more recent than the deleteTimestamp. Only has sense if deleteColumnFamilyName and deleteColumnQualifier are specified
lock Optional. An optional RowLock
Child Elements

<hbase:disable-table>

Disables an existent table

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName The table name to disable
Child Elements

<hbase:enable-table>

Enables an existent table.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName Name of the table to enable
Child Elements

<hbase:exists-column-family>

Answers if column family exists.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName The target table name
columnFamilyName The target column family name
Child Elements
Return Payload
  • true if the column exists, false otherwise

<hbase:exists-table>

Answers if a given table exists, regardless it is enabled or not

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName The table name
Child Elements
Return Payload
  • true only if the table exists, false otherwise

<hbase:get-values>

Answers the values at the given row - (table, row) combination

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName Required the target table
rowKey The key of the row to update
maxVersions Optional. The maximum number of versions to retrieved
timestamp Optional. The timestamp
Child Elements
Return Payload
  • the Result

<hbase:increment-value>

Atomically increments the value of at a (table, row, familyName, familyQualifier) combination. If the cell value does not yet exist it is initialized to amount.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName The name of the table that contains the cell to increment.
rowKey The row key that contains the cell to increment.
columnFamilyName The column family of the cell to increment.
columnQualifier The column qualifier of the cell to increment.
amount The amount to increment the cell with (or decrement, if the amount is negative).
writeToWAL true Optional. Set it to false means that in a fail scenario, you will lose any increments that have not been flushed.
Child Elements
Return Payload
  • the new value, post increment

<hbase:is-alive-server>

Answers if the HBase server is reachable

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
Child Elements
Return Payload
  • true if the server can be reached and the master node is alive, false otherwise.

<hbase:is-enabled-table>

Answers if the given existent table is enabled.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName Name of the table to query for its enabling state
Child Elements
Return Payload
  • true only if the table was disabled. False otherwise

<hbase:modify-column-family>

Changes one or more properties of a column family in a table. This Processor gracefully handles necessary table disabling and enabled.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName Required the target table
columnFamilyName Required the target column family
maxVersions Optional. The new max amount of versions
blocksize Optional. The the new block size
compressionType Optional. The new compression type
compactionCompressionType Optional. The new compaction compression type
inMemory Optional. New value for if values are stored in Region's cache
timeToLive Optional. New ttl
blockCacheEnabled Optional. New value of enabling block cache
bloomFilterType Optional. New value of bloom filter type
replicationScope Optional. New value for replication scope
Child Elements
<hbase:values>
Optional. Other custom parameters values

<hbase:put-value>

Saves a value at the specified (table, row, familyName, familyQualifier, timestamp) combination

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName Required the target table
rowKey The key of the row to update
columnFamilyName The column family dimension
columnQualifier The column qualifier dimension
timestamp Optional. The version dimension
value The value to put. It must be either a byte array or a serializable object. As a special case, strings are saved always in standard utf-8 format.
writeToWAL true Optional. Set it to false means that in a fail scenario, you will lose any increments that have not been flushed.
lock Optional. A optional RowLock
Child Elements

<hbase:scan-table>

Scans across all rows in a table, returning a scanner over it

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
tableName Limits the scan to a specific table. This is the only required argument.
columnFamilyName Optional. Limits the scan to a specific column family or null
columnQualifier Optional. Limits the scan to a specific column or null. Requires a columnFamilyName to be defined.
timestamp Optional. Limits the scan to a specific timestamp
maxTimestamp Optional. Get versions of columns only within the specified timestamp range: [timestamp, maxTimestamp)
caching Optional. The number of rows for caching
cacheBlocks true Optional. The number of rows for caching that will be passed to scanners
maxVersions 1 Optional. Limits the number of versions on each column
startRowKey Optional. Limits the beginning of the scan to the specified row inclusive
stopRowKey Optional. Limits the end of the scan to the specified row exclusive
fetchSize 50 Optional. The number of results internally fetched by request to the HBase server. Increase it for improving network efficiency, or decrease it for reducing memory usage
Child Elements
Return Payload
  • an Iterable of Result's. It may be used with a collection splitter.