Package org.apache.camel.component.hbase
Class HBaseEndpoint
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultEndpoint
org.apache.camel.component.hbase.HBaseEndpoint
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Endpoint
,org.apache.camel.IsSingleton
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.HasId
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="2.10.0",
scheme="hbase",
title="HBase",
syntax="hbase:tableName",
category={BIGDATA,DATABASE,HADOOP},
headersClass=HBaseConstants.class)
public class HBaseEndpoint
extends org.apache.camel.support.DefaultEndpoint
Reading and write from/to an HBase store (Hadoop database).
-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.Consumer
createConsumer
(org.apache.camel.Processor processor) org.apache.camel.Producer
protected void
doInit()
protected void
doStop()
List<org.apache.hadoop.hbase.filter.Filter>
int
int
org.apache.hadoop.hbase.client.Table
getTable()
Gets connection to the table (secured or not, depends on the object initialization) please remember to close the table after useorg.apache.hadoop.security.UserGroupInformation
boolean
isRemove()
void
setCellMappingStrategyFactory
(CellMappingStrategyFactory cellMappingStrategyFactory) To use a custom CellMappingStrategyFactory that is responsible for mapping cells.void
setFilters
(List<org.apache.hadoop.hbase.filter.Filter> filters) A list of filters to use.void
setMappingStrategyClassName
(String mappingStrategyClassName) The class name of a custom mapping strategy implementation.void
setMappingStrategyName
(String mappingStrategyName) The strategy to use for mapping Camel messages to HBase columns.void
setMaxMessagesPerPoll
(int maxMessagesPerPoll) Gets the maximum number of messages as a limit to poll at each polling.void
setMaxResults
(int maxResults) The maximum number of rows to scan.void
setOperation
(String operation) The HBase operation to performvoid
setRemove
(boolean remove) If the option is true, Camel HBase Consumer will remove the rows which it processes.void
setRemoveHandler
(HBaseRemoveHandler removeHandler) To use a custom HBaseRemoveHandler that is executed when a row is to be removed.void
setRowMapping
(Map<String, Object> rowMapping) To map the key/values from the Map to aHBaseRow
.void
setRowModel
(HBaseRow rowModel) An instance of org.apache.camel.component.hbase.model.HBaseRow which describes how each row should be modeledvoid
setUserGroupInformation
(org.apache.hadoop.security.UserGroupInformation userGroupInformation) Defines privileges to communicate with HBase such as using kerberos.Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doStart, equals, getCamelContext, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.camel.Endpoint
getEndpointBaseUri, isSingletonProducer
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
HBaseEndpoint
-
-
Method Details
-
createProducer
- Throws:
Exception
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception - Throws:
Exception
-
getComponent
- Overrides:
getComponent
in classorg.apache.camel.support.DefaultEndpoint
-
getMaxResults
public int getMaxResults() -
setMaxResults
public void setMaxResults(int maxResults) The maximum number of rows to scan. -
getFilters
-
setFilters
A list of filters to use. -
getOperation
-
setOperation
The HBase operation to perform -
getCellMappingStrategyFactory
-
setCellMappingStrategyFactory
To use a custom CellMappingStrategyFactory that is responsible for mapping cells. -
getMappingStrategyName
-
setMappingStrategyName
The strategy to use for mapping Camel messages to HBase columns. Supported values: header, or body. -
getMappingStrategyClassName
-
setMappingStrategyClassName
The class name of a custom mapping strategy implementation. -
getRowModel
-
setRowModel
An instance of org.apache.camel.component.hbase.model.HBaseRow which describes how each row should be modeled -
isRemove
public boolean isRemove() -
setRemove
public void setRemove(boolean remove) If the option is true, Camel HBase Consumer will remove the rows which it processes. -
getRemoveHandler
-
setRemoveHandler
To use a custom HBaseRemoveHandler that is executed when a row is to be removed. -
getMaxMessagesPerPoll
public int getMaxMessagesPerPoll() -
setMaxMessagesPerPoll
public void setMaxMessagesPerPoll(int maxMessagesPerPoll) Gets the maximum number of messages as a limit to poll at each polling. Is default unlimited, but use 0 or negative number to disable it as unlimited. -
getUserGroupInformation
public org.apache.hadoop.security.UserGroupInformation getUserGroupInformation() -
setUserGroupInformation
public void setUserGroupInformation(org.apache.hadoop.security.UserGroupInformation userGroupInformation) Defines privileges to communicate with HBase such as using kerberos. -
getRowMapping
-
setRowMapping
To map the key/values from the Map to aHBaseRow
. The following keys is supported:- rowId - The id of the row. This has limited use as the row usually changes per Exchange.
- rowType - The type to covert row id to. Supported operations: CamelHBaseScan.
- family - The column family. Supports a number suffix for referring to more than one columns.
- qualifier - The column qualifier. Supports a number suffix for referring to more than one columns.
- value - The value. Supports a number suffix for referring to more than one columns
- valueType - The value type. Supports a number suffix for referring to more than one columns. Supported operations: CamelHBaseGet, and CamelHBaseScan.
-
doInit
- Overrides:
doInit
in classorg.apache.camel.support.DefaultEndpoint
- Throws:
Exception
-
doStop
- Overrides:
doStop
in classorg.apache.camel.support.DefaultEndpoint
- Throws:
Exception
-
getTable
Gets connection to the table (secured or not, depends on the object initialization) please remember to close the table after use- Returns:
- table, remember to close!
- Throws:
IOException
-