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.DefaultEndpointReading and write from/to an HBase store (Hadoop database).
-
-
Constructor Summary
Constructors Constructor Description HBaseEndpoint(String uri, HBaseComponent component, String tableName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.camel.ConsumercreateConsumer(org.apache.camel.Processor processor)org.apache.camel.ProducercreateProducer()protected voiddoInit()protected voiddoStop()CellMappingStrategyFactorygetCellMappingStrategyFactory()HBaseComponentgetComponent()List<org.apache.hadoop.hbase.filter.Filter>getFilters()StringgetMappingStrategyClassName()StringgetMappingStrategyName()intgetMaxMessagesPerPoll()intgetMaxResults()StringgetOperation()HBaseRemoveHandlergetRemoveHandler()Map<String,Object>getRowMapping()HBaseRowgetRowModel()org.apache.hadoop.hbase.client.TablegetTable()Gets connection to the table (secured or not, depends on the object initialization) please remember to close the table after useorg.apache.hadoop.security.UserGroupInformationgetUserGroupInformation()booleanisRemove()voidsetCellMappingStrategyFactory(CellMappingStrategyFactory cellMappingStrategyFactory)To use a custom CellMappingStrategyFactory that is responsible for mapping cells.voidsetFilters(List<org.apache.hadoop.hbase.filter.Filter> filters)A list of filters to use.voidsetMappingStrategyClassName(String mappingStrategyClassName)The class name of a custom mapping strategy implementation.voidsetMappingStrategyName(String mappingStrategyName)The strategy to use for mapping Camel messages to HBase columns.voidsetMaxMessagesPerPoll(int maxMessagesPerPoll)Gets the maximum number of messages as a limit to poll at each polling.voidsetMaxResults(int maxResults)The maximum number of rows to scan.voidsetOperation(String operation)The HBase operation to performvoidsetRemove(boolean remove)If the option is true, Camel HBase Consumer will remove the rows which it processes.voidsetRemoveHandler(HBaseRemoveHandler removeHandler)To use a custom HBaseRemoveHandler that is executed when a row is to be removed.voidsetRowMapping(Map<String,Object> rowMapping)To map the key/values from the Map to aHBaseRow.voidsetRowModel(HBaseRow rowModel)An instance of org.apache.camel.component.hbase.model.HBaseRow which describes how each row should be modeledvoidsetUserGroupInformation(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
-
-
-
-
Constructor Detail
-
HBaseEndpoint
public HBaseEndpoint(String uri, HBaseComponent component, String tableName)
-
-
Method Detail
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception- Throws:
Exception
-
getComponent
public HBaseComponent getComponent()
- Overrides:
getComponentin classorg.apache.camel.support.DefaultEndpoint
-
getMaxResults
public int getMaxResults()
-
setMaxResults
public void setMaxResults(int maxResults)
The maximum number of rows to scan.
-
getFilters
public List<org.apache.hadoop.hbase.filter.Filter> getFilters()
-
setFilters
public void setFilters(List<org.apache.hadoop.hbase.filter.Filter> filters)
A list of filters to use.
-
getOperation
public String getOperation()
-
setOperation
public void setOperation(String operation)
The HBase operation to perform
-
getCellMappingStrategyFactory
public CellMappingStrategyFactory getCellMappingStrategyFactory()
-
setCellMappingStrategyFactory
public void setCellMappingStrategyFactory(CellMappingStrategyFactory cellMappingStrategyFactory)
To use a custom CellMappingStrategyFactory that is responsible for mapping cells.
-
getMappingStrategyName
public String getMappingStrategyName()
-
setMappingStrategyName
public void setMappingStrategyName(String mappingStrategyName)
The strategy to use for mapping Camel messages to HBase columns. Supported values: header, or body.
-
getMappingStrategyClassName
public String getMappingStrategyClassName()
-
setMappingStrategyClassName
public void setMappingStrategyClassName(String mappingStrategyClassName)
The class name of a custom mapping strategy implementation.
-
getRowModel
public HBaseRow getRowModel()
-
setRowModel
public void setRowModel(HBaseRow rowModel)
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
public HBaseRemoveHandler getRemoveHandler()
-
setRemoveHandler
public void setRemoveHandler(HBaseRemoveHandler removeHandler)
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.
-
setRowMapping
public void setRowMapping(Map<String,Object> rowMapping)
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
protected void doInit() throws Exception- Overrides:
doInitin classorg.apache.camel.support.DefaultEndpoint- Throws:
Exception
-
doStop
protected void doStop() throws Exception- Overrides:
doStopin classorg.apache.camel.support.DefaultEndpoint- Throws:
Exception
-
getTable
public org.apache.hadoop.hbase.client.Table getTable() throws IOExceptionGets 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
-
-