You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/01/12 14:37:26 UTC
[camel] branch main updated: CAMEL-18883: Remove camel-hbase in v4
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 3baf45c09e6 CAMEL-18883: Remove camel-hbase in v4
3baf45c09e6 is described below
commit 3baf45c09e6dc7ec74155446b70f65d0bae2f87b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Jan 12 15:21:46 2023 +0100
CAMEL-18883: Remove camel-hbase in v4
---
bom/camel-bom/pom.xml | 5 -
camel-dependencies/pom.xml | 1 -
catalog/camel-allcomponents/pom.xml | 5 -
.../org/apache/camel/catalog/components.properties | 1 -
.../org/apache/camel/catalog/components/hbase.json | 59 -
components/camel-hbase/pom.xml | 103 --
.../component/hbase/HBaseComponentConfigurer.java | 70 --
.../component/hbase/HBaseEndpointConfigurer.java | 140 ---
.../component/hbase/HBaseEndpointUriFactory.java | 86 --
.../hbase/converter/HBaseModelConverterLoader.java | 74 --
.../services/org/apache/camel/TypeConverterLoader | 2 -
.../services/org/apache/camel/component.properties | 7 -
.../services/org/apache/camel/component/hbase | 2 -
.../org/apache/camel/configurer/hbase-component | 2 -
.../org/apache/camel/configurer/hbase-endpoint | 2 -
.../org/apache/camel/urifactory/hbase-endpoint | 2 -
.../org/apache/camel/component/hbase/hbase.json | 59 -
.../camel-hbase/src/main/docs/hbase-component.adoc | 459 --------
.../camel/component/hbase/HBaseAttribute.java | 73 --
.../camel/component/hbase/HBaseComponent.java | 107 --
.../camel/component/hbase/HBaseConstants.java | 46 -
.../camel/component/hbase/HBaseConsumer.java | 210 ----
.../camel/component/hbase/HBaseDeleteHandler.java | 42 -
.../camel/component/hbase/HBaseEndpoint.java | 315 -----
.../apache/camel/component/hbase/HBaseHelper.java | 82 --
.../camel/component/hbase/HBaseProducer.java | 364 ------
.../camel/component/hbase/HBaseRemoveHandler.java | 28 -
.../hbase/converter/HBaseModelConverter.java | 88 --
.../filters/ModelAwareColumnMatchingFilter.java | 66 --
.../component/hbase/filters/ModelAwareFilter.java | 32 -
.../hbase/filters/ModelAwareFilterList.java | 97 --
.../filters/ModelAwareRowPrefixMatchingFilter.java | 49 -
.../hbase/filters/ModelAwareSkipFilter.java | 52 -
.../hbase/filters/ModelAwareWhileMatchFilter.java | 53 -
.../hbase/mapping/BodyMappingStrategy.java | 64 -
.../hbase/mapping/CellMappingStrategy.java | 48 -
.../hbase/mapping/CellMappingStrategyFactory.java | 73 --
.../hbase/mapping/HeaderMappingStrategy.java | 166 ---
.../camel/component/hbase/model/HBaseCell.java | 121 --
.../camel/component/hbase/model/HBaseData.java | 40 -
.../camel/component/hbase/model/HBaseRow.java | 95 --
.../idempotent/HBaseIdempotentRepository.java | 140 ---
.../camel/component/hbase/CamelHBaseFilterIT.java | 78 --
.../component/hbase/CamelHBaseTestSupport.java | 121 --
.../camel/component/hbase/HBaseComponentIT.java | 77 --
.../camel/component/hbase/HBaseConsumerIT.java | 63 -
.../camel/component/hbase/HBaseConvertionsIT.java | 109 --
.../camel/component/hbase/HBaseProducerIT.java | 383 ------
.../idempotent/HBaseIdempotentRepositoryIT.java | 141 ---
.../camel-hbase/src/test/resources/hbase-site.xml | 134 ---
.../src/test/resources/log4j2.properties | 34 -
components/pom.xml | 1 -
.../modules/eips/pages/idempotentConsumer-eip.adoc | 1 -
.../org/apache/camel/main/components.properties | 1 -
.../modules/ROOT/examples/json/hbase.json | 1 -
docs/components/modules/ROOT/nav.adoc | 1 -
.../modules/ROOT/pages/hbase-component.adoc | 1 -
.../ROOT/pages/camel-4-migration-guide.adoc | 1 +
.../component/ComponentsBuilderFactory.java | 14 -
.../dsl/HbaseComponentBuilderFactory.java | 176 ---
.../src/generated/resources/metadata.json | 22 -
.../builder/endpoint/EndpointBuilderFactory.java | 1 -
.../camel/builder/endpoint/EndpointBuilders.java | 1 -
.../builder/endpoint/StaticEndpointBuilders.java | 45 -
.../endpoint/dsl/HBaseEndpointBuilderFactory.java | 1233 --------------------
parent/pom.xml | 6 -
test-infra/camel-test-infra-hbase/pom.xml | 88 --
.../src/main/resources/META-INF/MANIFEST.MF | 0
.../test/infra/hbase/common/HBaseProperties.java | 25 -
.../test/infra/hbase/services/HBaseContainer.java | 66 --
.../hbase/services/HBaseLocalContainerService.java | 69 --
.../test/infra/hbase/services/HBaseService.java | 41 -
.../infra/hbase/services/HBaseServiceFactory.java | 76 --
test-infra/pom.xml | 1 -
74 files changed, 1 insertion(+), 6540 deletions(-)
diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index de4dde567e3..a5e155330cc 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -886,11 +886,6 @@
<artifactId>camel-hazelcast</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-hbase</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-hdfs</artifactId>
diff --git a/camel-dependencies/pom.xml b/camel-dependencies/pom.xml
index 806e2c2af26..73522c90a81 100644
--- a/camel-dependencies/pom.xml
+++ b/camel-dependencies/pom.xml
@@ -229,7 +229,6 @@
<hawtbuf-version>1.11</hawtbuf-version>
<hawtdispatch-version>1.22</hawtdispatch-version>
<hazelcast-version>5.2.1</hazelcast-version>
- <hbase-version>2.5.2</hbase-version>
<hdrhistrogram-version>2.1.11</hdrhistrogram-version>
<hibernate-validator-version>8.0.0.Final</hibernate-validator-version>
<hibernate-version>5.6.14.Final</hibernate-version>
diff --git a/catalog/camel-allcomponents/pom.xml b/catalog/camel-allcomponents/pom.xml
index 5ea2eba2053..489f88c065f 100644
--- a/catalog/camel-allcomponents/pom.xml
+++ b/catalog/camel-allcomponents/pom.xml
@@ -733,11 +733,6 @@
<artifactId>camel-hazelcast</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-hbase</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-hdfs</artifactId>
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
index 78b0aeecd30..bb30b10ae41 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
@@ -132,7 +132,6 @@ hazelcast-ringbuffer
hazelcast-seda
hazelcast-set
hazelcast-topic
-hbase
hdfs
http
https
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/hbase.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/hbase.json
deleted file mode 100644
index 5f21f418e7c..00000000000
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/hbase.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "component": {
- "kind": "component",
- "name": "hbase",
- "title": "HBase",
- "description": "Reading and write from\/to an HBase store (Hadoop database).",
- "deprecated": true,
- "firstVersion": "2.10.0",
- "label": "bigdata,database,hadoop",
- "javaType": "org.apache.camel.component.hbase.HBaseComponent",
- "supportLevel": "Stable",
- "groupId": "org.apache.camel",
- "artifactId": "camel-hbase",
- "version": "4.0.0-SNAPSHOT",
- "scheme": "hbase",
- "extendsScheme": "",
- "syntax": "hbase:tableName",
- "async": false,
- "api": false,
- "consumerOnly": false,
- "producerOnly": false,
- "lenientProperties": false
- },
- "componentProperties": {
- "poolMaxSize": { "kind": "property", "displayName": "Pool Max Size", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 10, "description": "Maximum number of references to keep for each table in the HTable pool. The default value is 10." },
- "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a me [...]
- "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
- "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
- "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.hadoop.conf.Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "To use the shared configuration" }
- },
- "headers": {
- "CamelHBaseOperation": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The HBase operation to perform", "constantName": "org.apache.camel.component.hbase.HBaseConstants#OPERATION" },
- "CamelHBaseMaxScanResults": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The maximum number of rows to scan.", "constantName": "org.apache.camel.component.hbase.HBaseConstants#HBASE_MAX_SCAN_RESULTS" },
- "CamelHBaseStartRow": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The row to start scanner at or after", "constantName": "org.apache.camel.component.hbase.HBaseConstants#FROM_ROW" },
- "CamelHBaseStopRow": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The row to end at (exclusive)", "constantName": "org.apache.camel.component.hbase.HBaseConstants#STOP_ROW" },
- "CamelMappingStrategy": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The strategy to use for mapping Camel messages to HBase columns. Supported values: header body", "constantName": "org.apache.camel.component.hbase.HBaseConstants#STRATEGY" },
- "CamelMappingStrategyClassName": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The class name of a custom mapping strategy implementation.", "constantName": "org.apache.camel.component.hbase.HBaseConstants#STRATEGY_CLASS_NAME" },
- "CamelHBaseMarkedRowId": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "byte[]", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The marked row id", "constantName": "org.apache.camel.component.hbase.HBaseConstants#HBASE_MARKED_ROW_ID" }
- },
- "properties": {
- "tableName": { "kind": "path", "displayName": "Table Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the table" },
- "cellMappingStrategyFactory": { "kind": "parameter", "displayName": "Cell Mapping Strategy Factory", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.hbase.mapping.CellMappingStrategyFactory", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom CellMappingStrategyFactory that is responsible for mapping cells." },
- "filters": { "kind": "parameter", "displayName": "Filters", "group": "common", "label": "", "required": false, "type": "array", "javaType": "java.util.List<org.apache.hadoop.hbase.filter.Filter>", "deprecated": false, "autowired": false, "secret": false, "description": "A list of filters to use." },
- "mappingStrategyClassName": { "kind": "parameter", "displayName": "Mapping Strategy Class Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The class name of a custom mapping strategy implementation." },
- "mappingStrategyName": { "kind": "parameter", "displayName": "Mapping Strategy Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "header", "body" ], "deprecated": false, "autowired": false, "secret": false, "description": "The strategy to use for mapping Camel messages to HBase columns. Supported values: header, or body." },
- "rowMapping": { "kind": "parameter", "displayName": "Row Mapping", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "row.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "To map the key\/values from the Map to a HBaseRow. The following keys is supported: rowId - The id of the row. This has limited use as the row usually changes per Exchange. ro [...]
- "rowModel": { "kind": "parameter", "displayName": "Row Model", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.hbase.model.HBaseRow", "deprecated": false, "autowired": false, "secret": false, "description": "An instance of org.apache.camel.component.hbase.model.HBaseRow which describes how each row should be modeled" },
- "userGroupInformation": { "kind": "parameter", "displayName": "User Group Information", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.hadoop.security.UserGroupInformation", "deprecated": false, "autowired": false, "secret": false, "description": "Defines privileges to communicate with HBase such as using kerberos." },
- "maxMessagesPerPoll": { "kind": "parameter", "displayName": "Max Messages Per Poll", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "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." },
- "operation": { "kind": "parameter", "displayName": "Operation", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "CamelHBasePut", "CamelHBaseGet", "CamelHBaseScan", "CamelHBaseDelete" ], "deprecated": false, "autowired": false, "secret": false, "description": "The HBase operation to perform" },
- "remove": { "kind": "parameter", "displayName": "Remove", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "If the option is true, Camel HBase Consumer will remove the rows which it processes." },
- "removeHandler": { "kind": "parameter", "displayName": "Remove Handler", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.hbase.HBaseRemoveHandler", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom HBaseRemoveHandler that is executed when a row is to be removed." },
- "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now [...]
- "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
- "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
- "maxResults": { "kind": "parameter", "displayName": "Max Results", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 100, "description": "The maximum number of rows to scan." },
- "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may other [...]
- }
-}
diff --git a/components/camel-hbase/pom.xml b/components/camel-hbase/pom.xml
deleted file mode 100644
index 8c8559137f2..00000000000
--- a/components/camel-hbase/pom.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.camel</groupId>
- <artifactId>components</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>camel-hbase</artifactId>
- <packaging>jar</packaging>
- <name>Camel :: Hbase (deprecated)</name>
- <description>Camel HBase component</description>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-support</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.hbase</groupId>
- <artifactId>hbase-client</artifactId>
- <version>${hbase-version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.yetus</groupId>
- <artifactId>audience-annotations</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-reload4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- testing -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test-junit5</artifactId>
- <scope>test</scope>
- </dependency>
-
- <!-- test infra -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test-infra-hbase</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.apache.yetus</groupId>
- <artifactId>audience-annotations</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- logging -->
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- <scope>test</scope>
- </dependency>
-
- <!-- workaround for org.apache.log4j.AppenderSkeleton -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>log4j-over-slf4j</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/components/camel-hbase/src/generated/java/org/apache/camel/component/hbase/HBaseComponentConfigurer.java b/components/camel-hbase/src/generated/java/org/apache/camel/component/hbase/HBaseComponentConfigurer.java
deleted file mode 100644
index d7e1bf25b7f..00000000000
--- a/components/camel-hbase/src/generated/java/org/apache/camel/component/hbase/HBaseComponentConfigurer.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.hbase;
-
-import java.util.Map;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
-import org.apache.camel.spi.PropertyConfigurerGetter;
-import org.apache.camel.spi.ConfigurerStrategy;
-import org.apache.camel.spi.GeneratedPropertyConfigurer;
-import org.apache.camel.util.CaseInsensitiveMap;
-import org.apache.camel.support.component.PropertyConfigurerSupport;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-@SuppressWarnings("unchecked")
-public class HBaseComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
-
- @Override
- public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
- HBaseComponent target = (HBaseComponent) obj;
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "autowiredenabled":
- case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
- case "bridgeerrorhandler":
- case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
- case "configuration": target.setConfiguration(property(camelContext, org.apache.hadoop.conf.Configuration.class, value)); return true;
- case "lazystartproducer":
- case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
- case "poolmaxsize":
- case "poolMaxSize": target.setPoolMaxSize(property(camelContext, int.class, value)); return true;
- default: return false;
- }
- }
-
- @Override
- public Class<?> getOptionType(String name, boolean ignoreCase) {
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "autowiredenabled":
- case "autowiredEnabled": return boolean.class;
- case "bridgeerrorhandler":
- case "bridgeErrorHandler": return boolean.class;
- case "configuration": return org.apache.hadoop.conf.Configuration.class;
- case "lazystartproducer":
- case "lazyStartProducer": return boolean.class;
- case "poolmaxsize":
- case "poolMaxSize": return int.class;
- default: return null;
- }
- }
-
- @Override
- public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
- HBaseComponent target = (HBaseComponent) obj;
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "autowiredenabled":
- case "autowiredEnabled": return target.isAutowiredEnabled();
- case "bridgeerrorhandler":
- case "bridgeErrorHandler": return target.isBridgeErrorHandler();
- case "configuration": return target.getConfiguration();
- case "lazystartproducer":
- case "lazyStartProducer": return target.isLazyStartProducer();
- case "poolmaxsize":
- case "poolMaxSize": return target.getPoolMaxSize();
- default: return null;
- }
- }
-}
-
diff --git a/components/camel-hbase/src/generated/java/org/apache/camel/component/hbase/HBaseEndpointConfigurer.java b/components/camel-hbase/src/generated/java/org/apache/camel/component/hbase/HBaseEndpointConfigurer.java
deleted file mode 100644
index 6ef6f474a88..00000000000
--- a/components/camel-hbase/src/generated/java/org/apache/camel/component/hbase/HBaseEndpointConfigurer.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.hbase;
-
-import java.util.Map;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
-import org.apache.camel.spi.PropertyConfigurerGetter;
-import org.apache.camel.spi.ConfigurerStrategy;
-import org.apache.camel.spi.GeneratedPropertyConfigurer;
-import org.apache.camel.util.CaseInsensitiveMap;
-import org.apache.camel.support.component.PropertyConfigurerSupport;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-@SuppressWarnings("unchecked")
-public class HBaseEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
-
- @Override
- public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
- HBaseEndpoint target = (HBaseEndpoint) obj;
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "bridgeerrorhandler":
- case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
- case "cellmappingstrategyfactory":
- case "cellMappingStrategyFactory": target.setCellMappingStrategyFactory(property(camelContext, org.apache.camel.component.hbase.mapping.CellMappingStrategyFactory.class, value)); return true;
- case "exceptionhandler":
- case "exceptionHandler": target.setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true;
- case "exchangepattern":
- case "exchangePattern": target.setExchangePattern(property(camelContext, org.apache.camel.ExchangePattern.class, value)); return true;
- case "filters": target.setFilters(property(camelContext, java.util.List.class, value)); return true;
- case "lazystartproducer":
- case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
- case "mappingstrategyclassname":
- case "mappingStrategyClassName": target.setMappingStrategyClassName(property(camelContext, java.lang.String.class, value)); return true;
- case "mappingstrategyname":
- case "mappingStrategyName": target.setMappingStrategyName(property(camelContext, java.lang.String.class, value)); return true;
- case "maxmessagesperpoll":
- case "maxMessagesPerPoll": target.setMaxMessagesPerPoll(property(camelContext, int.class, value)); return true;
- case "maxresults":
- case "maxResults": target.setMaxResults(property(camelContext, int.class, value)); return true;
- case "operation": target.setOperation(property(camelContext, java.lang.String.class, value)); return true;
- case "remove": target.setRemove(property(camelContext, boolean.class, value)); return true;
- case "removehandler":
- case "removeHandler": target.setRemoveHandler(property(camelContext, org.apache.camel.component.hbase.HBaseRemoveHandler.class, value)); return true;
- case "rowmapping":
- case "rowMapping": target.setRowMapping(property(camelContext, java.util.Map.class, value)); return true;
- case "rowmodel":
- case "rowModel": target.setRowModel(property(camelContext, org.apache.camel.component.hbase.model.HBaseRow.class, value)); return true;
- case "usergroupinformation":
- case "userGroupInformation": target.setUserGroupInformation(property(camelContext, org.apache.hadoop.security.UserGroupInformation.class, value)); return true;
- default: return false;
- }
- }
-
- @Override
- public Class<?> getOptionType(String name, boolean ignoreCase) {
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "bridgeerrorhandler":
- case "bridgeErrorHandler": return boolean.class;
- case "cellmappingstrategyfactory":
- case "cellMappingStrategyFactory": return org.apache.camel.component.hbase.mapping.CellMappingStrategyFactory.class;
- case "exceptionhandler":
- case "exceptionHandler": return org.apache.camel.spi.ExceptionHandler.class;
- case "exchangepattern":
- case "exchangePattern": return org.apache.camel.ExchangePattern.class;
- case "filters": return java.util.List.class;
- case "lazystartproducer":
- case "lazyStartProducer": return boolean.class;
- case "mappingstrategyclassname":
- case "mappingStrategyClassName": return java.lang.String.class;
- case "mappingstrategyname":
- case "mappingStrategyName": return java.lang.String.class;
- case "maxmessagesperpoll":
- case "maxMessagesPerPoll": return int.class;
- case "maxresults":
- case "maxResults": return int.class;
- case "operation": return java.lang.String.class;
- case "remove": return boolean.class;
- case "removehandler":
- case "removeHandler": return org.apache.camel.component.hbase.HBaseRemoveHandler.class;
- case "rowmapping":
- case "rowMapping": return java.util.Map.class;
- case "rowmodel":
- case "rowModel": return org.apache.camel.component.hbase.model.HBaseRow.class;
- case "usergroupinformation":
- case "userGroupInformation": return org.apache.hadoop.security.UserGroupInformation.class;
- default: return null;
- }
- }
-
- @Override
- public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
- HBaseEndpoint target = (HBaseEndpoint) obj;
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "bridgeerrorhandler":
- case "bridgeErrorHandler": return target.isBridgeErrorHandler();
- case "cellmappingstrategyfactory":
- case "cellMappingStrategyFactory": return target.getCellMappingStrategyFactory();
- case "exceptionhandler":
- case "exceptionHandler": return target.getExceptionHandler();
- case "exchangepattern":
- case "exchangePattern": return target.getExchangePattern();
- case "filters": return target.getFilters();
- case "lazystartproducer":
- case "lazyStartProducer": return target.isLazyStartProducer();
- case "mappingstrategyclassname":
- case "mappingStrategyClassName": return target.getMappingStrategyClassName();
- case "mappingstrategyname":
- case "mappingStrategyName": return target.getMappingStrategyName();
- case "maxmessagesperpoll":
- case "maxMessagesPerPoll": return target.getMaxMessagesPerPoll();
- case "maxresults":
- case "maxResults": return target.getMaxResults();
- case "operation": return target.getOperation();
- case "remove": return target.isRemove();
- case "removehandler":
- case "removeHandler": return target.getRemoveHandler();
- case "rowmapping":
- case "rowMapping": return target.getRowMapping();
- case "rowmodel":
- case "rowModel": return target.getRowModel();
- case "usergroupinformation":
- case "userGroupInformation": return target.getUserGroupInformation();
- default: return null;
- }
- }
-
- @Override
- public Object getCollectionValueType(Object target, String name, boolean ignoreCase) {
- switch (ignoreCase ? name.toLowerCase() : name) {
- case "filters": return org.apache.hadoop.hbase.filter.Filter.class;
- case "rowmapping":
- case "rowMapping": return java.lang.Object.class;
- default: return null;
- }
- }
-}
-
diff --git a/components/camel-hbase/src/generated/java/org/apache/camel/component/hbase/HBaseEndpointUriFactory.java b/components/camel-hbase/src/generated/java/org/apache/camel/component/hbase/HBaseEndpointUriFactory.java
deleted file mode 100644
index 597a5a68cff..00000000000
--- a/components/camel-hbase/src/generated/java/org/apache/camel/component/hbase/HBaseEndpointUriFactory.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.hbase;
-
-import java.net.URISyntaxException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.camel.spi.EndpointUriFactory;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-public class HBaseEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory {
-
- private static final String BASE = ":tableName";
-
- private static final Set<String> PROPERTY_NAMES;
- private static final Set<String> SECRET_PROPERTY_NAMES;
- private static final Set<String> MULTI_VALUE_PREFIXES;
- static {
- Set<String> props = new HashSet<>(17);
- props.add("bridgeErrorHandler");
- props.add("cellMappingStrategyFactory");
- props.add("exceptionHandler");
- props.add("exchangePattern");
- props.add("filters");
- props.add("lazyStartProducer");
- props.add("mappingStrategyClassName");
- props.add("mappingStrategyName");
- props.add("maxMessagesPerPoll");
- props.add("maxResults");
- props.add("operation");
- props.add("remove");
- props.add("removeHandler");
- props.add("rowMapping");
- props.add("rowModel");
- props.add("tableName");
- props.add("userGroupInformation");
- PROPERTY_NAMES = Collections.unmodifiableSet(props);
- SECRET_PROPERTY_NAMES = Collections.emptySet();
- Set<String> prefixes = new HashSet<>(1);
- prefixes.add("row.");
- MULTI_VALUE_PREFIXES = Collections.unmodifiableSet(prefixes);
- }
-
- @Override
- public boolean isEnabled(String scheme) {
- return "hbase".equals(scheme);
- }
-
- @Override
- public String buildUri(String scheme, Map<String, Object> properties, boolean encode) throws URISyntaxException {
- String syntax = scheme + BASE;
- String uri = syntax;
-
- Map<String, Object> copy = new HashMap<>(properties);
-
- uri = buildPathParameter(syntax, uri, "tableName", null, true, copy);
- uri = buildQueryParameters(uri, copy, encode);
- return uri;
- }
-
- @Override
- public Set<String> propertyNames() {
- return PROPERTY_NAMES;
- }
-
- @Override
- public Set<String> secretPropertyNames() {
- return SECRET_PROPERTY_NAMES;
- }
-
- @Override
- public Set<String> multiValuePrefixes() {
- return MULTI_VALUE_PREFIXES;
- }
-
- @Override
- public boolean isLenientProperties() {
- return false;
- }
-}
-
diff --git a/components/camel-hbase/src/generated/java/org/apache/camel/component/hbase/converter/HBaseModelConverterLoader.java b/components/camel-hbase/src/generated/java/org/apache/camel/component/hbase/converter/HBaseModelConverterLoader.java
deleted file mode 100644
index 5f7c3e930a4..00000000000
--- a/components/camel-hbase/src/generated/java/org/apache/camel/component/hbase/converter/HBaseModelConverterLoader.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Generated by camel build tools - do NOT edit this file! */
-package org.apache.camel.component.hbase.converter;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.CamelContextAware;
-import org.apache.camel.DeferredContextBinding;
-import org.apache.camel.Exchange;
-import org.apache.camel.TypeConversionException;
-import org.apache.camel.TypeConverterLoaderException;
-import org.apache.camel.spi.TypeConverterLoader;
-import org.apache.camel.spi.TypeConverterRegistry;
-import org.apache.camel.support.SimpleTypeConverter;
-import org.apache.camel.support.TypeConverterSupport;
-import org.apache.camel.util.DoubleMap;
-
-/**
- * Generated by camel build tools - do NOT edit this file!
- */
-@SuppressWarnings("unchecked")
-@DeferredContextBinding
-public final class HBaseModelConverterLoader implements TypeConverterLoader, CamelContextAware {
-
- private CamelContext camelContext;
-
- public HBaseModelConverterLoader() {
- }
-
- @Override
- public void setCamelContext(CamelContext camelContext) {
- this.camelContext = camelContext;
- }
-
- @Override
- public CamelContext getCamelContext() {
- return camelContext;
- }
-
- @Override
- public void load(TypeConverterRegistry registry) throws TypeConverterLoaderException {
- registerConverters(registry);
- }
-
- private void registerConverters(TypeConverterRegistry registry) {
- addTypeConverter(registry, byte[].class, java.lang.Boolean.class, false,
- (type, exchange, value) -> org.apache.camel.component.hbase.converter.HBaseModelConverter.booleanToBytes((java.lang.Boolean) value));
- addTypeConverter(registry, byte[].class, java.lang.Double.class, false,
- (type, exchange, value) -> org.apache.camel.component.hbase.converter.HBaseModelConverter.doubleToBytes((java.lang.Double) value));
- addTypeConverter(registry, byte[].class, java.lang.Float.class, false,
- (type, exchange, value) -> org.apache.camel.component.hbase.converter.HBaseModelConverter.floatToBytes((java.lang.Float) value));
- addTypeConverter(registry, byte[].class, java.lang.Integer.class, false,
- (type, exchange, value) -> org.apache.camel.component.hbase.converter.HBaseModelConverter.integerToBytes((java.lang.Integer) value));
- addTypeConverter(registry, byte[].class, java.lang.Long.class, false,
- (type, exchange, value) -> org.apache.camel.component.hbase.converter.HBaseModelConverter.longToBytes((java.lang.Long) value));
- addTypeConverter(registry, byte[].class, java.lang.Short.class, false,
- (type, exchange, value) -> org.apache.camel.component.hbase.converter.HBaseModelConverter.shortToBytes((java.lang.Short) value));
- addTypeConverter(registry, java.lang.Boolean.class, byte[].class, false,
- (type, exchange, value) -> org.apache.camel.component.hbase.converter.HBaseModelConverter.bytesToBoolean((byte[]) value));
- addTypeConverter(registry, java.lang.Double.class, byte[].class, false,
- (type, exchange, value) -> org.apache.camel.component.hbase.converter.HBaseModelConverter.bytesToDouble((byte[]) value));
- addTypeConverter(registry, java.lang.Float.class, byte[].class, false,
- (type, exchange, value) -> org.apache.camel.component.hbase.converter.HBaseModelConverter.bytesToFloat((byte[]) value));
- addTypeConverter(registry, java.lang.Integer.class, byte[].class, false,
- (type, exchange, value) -> org.apache.camel.component.hbase.converter.HBaseModelConverter.bytesToInteger((byte[]) value));
- addTypeConverter(registry, java.lang.Long.class, byte[].class, false,
- (type, exchange, value) -> org.apache.camel.component.hbase.converter.HBaseModelConverter.bytesToLong((byte[]) value));
- addTypeConverter(registry, java.lang.Short.class, byte[].class, false,
- (type, exchange, value) -> org.apache.camel.component.hbase.converter.HBaseModelConverter.bytesToShort((byte[]) value));
- }
-
- private static void addTypeConverter(TypeConverterRegistry registry, Class<?> toType, Class<?> fromType, boolean allowNull, SimpleTypeConverter.ConversionMethod method) {
- registry.addTypeConverter(toType, fromType, new SimpleTypeConverter(allowNull, method));
- }
-
-}
diff --git a/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/TypeConverterLoader b/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/TypeConverterLoader
deleted file mode 100644
index cfbd2fb21cf..00000000000
--- a/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/TypeConverterLoader
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-org.apache.camel.component.hbase.converter.HBaseModelConverterLoader
diff --git a/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/component.properties b/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/component.properties
deleted file mode 100644
index 44b60eedcff..00000000000
--- a/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/component.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-components=hbase
-groupId=org.apache.camel
-artifactId=camel-hbase
-version=4.0.0-SNAPSHOT
-projectName=Camel :: Hbase (deprecated)
-projectDescription=Camel HBase component
diff --git a/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/component/hbase b/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/component/hbase
deleted file mode 100644
index 00922652101..00000000000
--- a/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/component/hbase
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.hbase.HBaseComponent
diff --git a/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/configurer/hbase-component b/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/configurer/hbase-component
deleted file mode 100644
index 2b0bbc99692..00000000000
--- a/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/configurer/hbase-component
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.hbase.HBaseComponentConfigurer
diff --git a/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/configurer/hbase-endpoint b/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/configurer/hbase-endpoint
deleted file mode 100644
index 12e321735d1..00000000000
--- a/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/configurer/hbase-endpoint
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.hbase.HBaseEndpointConfigurer
diff --git a/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/urifactory/hbase-endpoint b/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/urifactory/hbase-endpoint
deleted file mode 100644
index 178d7f009ad..00000000000
--- a/components/camel-hbase/src/generated/resources/META-INF/services/org/apache/camel/urifactory/hbase-endpoint
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.component.hbase.HBaseEndpointUriFactory
diff --git a/components/camel-hbase/src/generated/resources/org/apache/camel/component/hbase/hbase.json b/components/camel-hbase/src/generated/resources/org/apache/camel/component/hbase/hbase.json
deleted file mode 100644
index 5f21f418e7c..00000000000
--- a/components/camel-hbase/src/generated/resources/org/apache/camel/component/hbase/hbase.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "component": {
- "kind": "component",
- "name": "hbase",
- "title": "HBase",
- "description": "Reading and write from\/to an HBase store (Hadoop database).",
- "deprecated": true,
- "firstVersion": "2.10.0",
- "label": "bigdata,database,hadoop",
- "javaType": "org.apache.camel.component.hbase.HBaseComponent",
- "supportLevel": "Stable",
- "groupId": "org.apache.camel",
- "artifactId": "camel-hbase",
- "version": "4.0.0-SNAPSHOT",
- "scheme": "hbase",
- "extendsScheme": "",
- "syntax": "hbase:tableName",
- "async": false,
- "api": false,
- "consumerOnly": false,
- "producerOnly": false,
- "lenientProperties": false
- },
- "componentProperties": {
- "poolMaxSize": { "kind": "property", "displayName": "Pool Max Size", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 10, "description": "Maximum number of references to keep for each table in the HTable pool. The default value is 10." },
- "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a me [...]
- "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
- "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
- "configuration": { "kind": "property", "displayName": "Configuration", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.hadoop.conf.Configuration", "deprecated": false, "autowired": false, "secret": false, "description": "To use the shared configuration" }
- },
- "headers": {
- "CamelHBaseOperation": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The HBase operation to perform", "constantName": "org.apache.camel.component.hbase.HBaseConstants#OPERATION" },
- "CamelHBaseMaxScanResults": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The maximum number of rows to scan.", "constantName": "org.apache.camel.component.hbase.HBaseConstants#HBASE_MAX_SCAN_RESULTS" },
- "CamelHBaseStartRow": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The row to start scanner at or after", "constantName": "org.apache.camel.component.hbase.HBaseConstants#FROM_ROW" },
- "CamelHBaseStopRow": { "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The row to end at (exclusive)", "constantName": "org.apache.camel.component.hbase.HBaseConstants#STOP_ROW" },
- "CamelMappingStrategy": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The strategy to use for mapping Camel messages to HBase columns. Supported values: header body", "constantName": "org.apache.camel.component.hbase.HBaseConstants#STRATEGY" },
- "CamelMappingStrategyClassName": { "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The class name of a custom mapping strategy implementation.", "constantName": "org.apache.camel.component.hbase.HBaseConstants#STRATEGY_CLASS_NAME" },
- "CamelHBaseMarkedRowId": { "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "byte[]", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The marked row id", "constantName": "org.apache.camel.component.hbase.HBaseConstants#HBASE_MARKED_ROW_ID" }
- },
- "properties": {
- "tableName": { "kind": "path", "displayName": "Table Name", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the table" },
- "cellMappingStrategyFactory": { "kind": "parameter", "displayName": "Cell Mapping Strategy Factory", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.hbase.mapping.CellMappingStrategyFactory", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom CellMappingStrategyFactory that is responsible for mapping cells." },
- "filters": { "kind": "parameter", "displayName": "Filters", "group": "common", "label": "", "required": false, "type": "array", "javaType": "java.util.List<org.apache.hadoop.hbase.filter.Filter>", "deprecated": false, "autowired": false, "secret": false, "description": "A list of filters to use." },
- "mappingStrategyClassName": { "kind": "parameter", "displayName": "Mapping Strategy Class Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The class name of a custom mapping strategy implementation." },
- "mappingStrategyName": { "kind": "parameter", "displayName": "Mapping Strategy Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "header", "body" ], "deprecated": false, "autowired": false, "secret": false, "description": "The strategy to use for mapping Camel messages to HBase columns. Supported values: header, or body." },
- "rowMapping": { "kind": "parameter", "displayName": "Row Mapping", "group": "common", "label": "", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "row.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "To map the key\/values from the Map to a HBaseRow. The following keys is supported: rowId - The id of the row. This has limited use as the row usually changes per Exchange. ro [...]
- "rowModel": { "kind": "parameter", "displayName": "Row Model", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.hbase.model.HBaseRow", "deprecated": false, "autowired": false, "secret": false, "description": "An instance of org.apache.camel.component.hbase.model.HBaseRow which describes how each row should be modeled" },
- "userGroupInformation": { "kind": "parameter", "displayName": "User Group Information", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.hadoop.security.UserGroupInformation", "deprecated": false, "autowired": false, "secret": false, "description": "Defines privileges to communicate with HBase such as using kerberos." },
- "maxMessagesPerPoll": { "kind": "parameter", "displayName": "Max Messages Per Poll", "group": "consumer", "label": "consumer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "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." },
- "operation": { "kind": "parameter", "displayName": "Operation", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "enum": [ "CamelHBasePut", "CamelHBaseGet", "CamelHBaseScan", "CamelHBaseDelete" ], "deprecated": false, "autowired": false, "secret": false, "description": "The HBase operation to perform" },
- "remove": { "kind": "parameter", "displayName": "Remove", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "If the option is true, Camel HBase Consumer will remove the rows which it processes." },
- "removeHandler": { "kind": "parameter", "displayName": "Remove Handler", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "org.apache.camel.component.hbase.HBaseRemoveHandler", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom HBaseRemoveHandler that is executed when a row is to be removed." },
- "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now [...]
- "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
- "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
- "maxResults": { "kind": "parameter", "displayName": "Max Results", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 100, "description": "The maximum number of rows to scan." },
- "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may other [...]
- }
-}
diff --git a/components/camel-hbase/src/main/docs/hbase-component.adoc b/components/camel-hbase/src/main/docs/hbase-component.adoc
deleted file mode 100644
index d298aff62f7..00000000000
--- a/components/camel-hbase/src/main/docs/hbase-component.adoc
+++ /dev/null
@@ -1,459 +0,0 @@
-= HBase Component (deprecated)
-:doctitle: HBase
-:shortname: hbase
-:artifactid: camel-hbase
-:description: Reading and write from/to an HBase store (Hadoop database).
-:since: 2.10
-:supportlevel: Stable-deprecated
-:deprecated: *deprecated*
-:component-header: Both producer and consumer are supported
-//Manually maintained attributes
-:camel-spring-boot-name: hbase
-
-*Since Camel {since}*
-
-*{component-header}*
-
-This component provides an idempotent repository, producers and
-consumers for http://hbase.apache.org/[Apache HBase].
-
-Maven users will need to add the following dependency to their `pom.xml`
-for this component:
-
-[source,xml]
-------------------------------------------------------------
-<dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-hbase</artifactId>
- <version>x.x.x</version>
- <!-- use the same version as your Camel core version -->
-</dependency>
-------------------------------------------------------------
-
-== Apache HBase Overview
-
-HBase is an open-source, distributed, versioned, column-oriented store
-modeled after Google's Bigtable: A Distributed Storage System for
-Structured Data. You can use HBase when you need random, realtime
-read/write access to your Big Data. More information at
-http://hbase.apache.org[Apache HBase].
-
-== Camel and HBase
-
-When using a datastore inside a camel route, there is always the
-challenge of specifying how the camel message will store to the
-datastore. In document based stores things are more easy as the message
-body can be directly mapped to a document. In relational databases an
-ORM solution can be used to map properties to columns etc. In column
-based stores things are more challenging as there is no standard way to
-perform that kind of mapping.
-
-HBase adds two additional challenges:
-
-* HBase groups columns into families, so just mapping a property to a
-column using a name convention is just not enough.
-* HBase doesn't have the notion of type, which means that it stores
-everything as byte[] and doesn't know if the byte[] represents a String,
-a Number, a serialized Java object or just binary data.
-
-To overcome these challenges, camel-hbase makes use of the message
-headers to specify the mapping of the message to HBase columns. It also
-provides the ability to use some camel-hbase provided classes that model
-HBase data and can be easily convert to and from xml/json etc. +
- Finally it provides the ability to the user to implement and use his
-own mapping strategy.
-
-Regardless of the mapping strategy camel-hbase will convert a message
-into an org.apache.camel.component.hbase.model.HBaseData object and use
-that object for its internal operations.
-
-== Configuring the component
-
-The HBase component can be provided a custom HBaseConfiguration object
-as a property or it can create an HBase configuration object on its own
-based on the HBase related resources that are found on classpath.
-
-[source,xml]
------------------------------------------------------------------------------
- <bean id="hbase" class="org.apache.camel.component.hbase.HBaseComponent">
- <property name="configuration" ref="config"/>
- </bean>
------------------------------------------------------------------------------
-
-If no configuration object is provided to the component, the component
-will create one. The created configuration will search the class path
-for an hbase-site.xml file, from which it will draw the configuration.
-You can find more information about how to configure HBase clients at:
-http://archive.apache.org/dist/hbase/docs/client_dependencies.html[HBase
-client configuration and dependencies]
-
-== HBase Producer
-
-As mentioned above camel provides producers endpoints for HBase. This
-allows you to store, delete, retrieve or query data from HBase using
-your camel routes.
-
------------------------
-hbase://table[?options]
------------------------
-
-where *table* is the table name.
-
-The supported operations are:
-
-* Put
-* Append
-* Increment
-* Get
-* Delete
-* Scan
-
-
-// component-configure options: START
-
-// component-configure options: END
-
-// component options: START
-include::partial$component-configure-options.adoc[]
-include::partial$component-endpoint-options.adoc[]
-// component options: END
-
-// endpoint options: START
-
-// endpoint options: END
-// component headers: START
-include::partial$component-endpoint-headers.adoc[]
-// component headers: END
-
-=== Put Operations.
-
-HBase is a column based store, which allows you to store data into a
-specific column of a specific row. Columns are grouped into families, so
-in order to specify a column you need to specify the column family and
-the qualifier of that column. To store data into a specific column you
-need to specify both the column and the row.
-
-The simplest scenario for storing data into HBase from a camel route,
-would be to store part of the message body to specified HBase column.
-
-[source,xml]
------------------------------------------------------------------------------------------------------------
-<route>
- <from uri="direct:in"/>
- <!-- Set the HBase Row -->
- <setHeader name="CamelHBaseRowId">
- <el>${in.body.id}</el>
- </setHeader>
- <!-- Set the HBase Value -->
- <setHeader name="CamelHBaseValue">
- <el>${in.body.value}</el>
- </setHeader>
- <to uri="hbase:mytable?operation=CamelHBasePut&family=myfamily&qualifier=myqualifier"/>
-</route>
------------------------------------------------------------------------------------------------------------
-
-The route above assumes that the message body contains an object that
-has an id and value property and will store the content of value in the
-HBase column myfamily:myqualifier in the row specified by id. If we
-needed to specify more than one column/value pairs we could just specify
-additional column mappings. Notice that you must use numbers from the
-2nd header onwards, eg RowId2, RowId3, RowId4, etc. Only the 1st header
-does not have the number 1.
-
-[source,xml]
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-<route>
- <from uri="direct:in"/>
- <!-- Set the HBase Row 1st column -->
- <setHeader name="CamelHBaseRowId">
- <el>${in.body.id}</el>
- </setHeader>
- <!-- Set the HBase Row 2nd column -->
- <setHeader name="CamelHBaseRowId2">
- <el>${in.body.id}</el>
- </setHeader>
- <!-- Set the HBase Value for 1st column -->
- <setHeader name="CamelHBaseValue">
- <el>${in.body.value}</el>
- </setHeader>
- <!-- Set the HBase Value for 2nd column -->
- <setHeader name="CamelHBaseValue2">
- <el>${in.body.othervalue}</el>
- </setHeader>
- <to uri="hbase:mytable?operation=CamelHBasePut&family=myfamily&qualifier=myqualifier&family2=myfamily&qualifier2=myqualifier2"/>
-</route>
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-It is important to remember that you can use uri options, message
-headers or a combination of both. It is recommended to specify constants
-as part of the uri and dynamic values as headers. If something is
-defined both as header and as part of the uri, the header will be used.
-
-=== Get Operations.
-
-A Get Operation is an operation that is used to retrieve one or more
-values from a specified HBase row. To specify what are the values that
-you want to retrieve you can just specify them as part of the uri or as
-message headers.
-
-[source,xml]
-----------------------------------------------------------------------------------------------------------------------------------------
-<route>
- <from uri="direct:in"/>
- <!-- Set the HBase Row of the Get -->
- <setHeader name="CamelHBaseRowId">
- <el>${in.body.id}</el>
- </setHeader>
- <to uri="hbase:mytable?operation=CamelHBaseGet&family=myfamily&qualifier=myqualifier&valueType=java.lang.Long"/>
- <to uri="log:out"/>
-</route>
-----------------------------------------------------------------------------------------------------------------------------------------
-
-In the example above the result of the get operation will be stored as a
-header with name CamelHBaseValue.
-
-=== Delete Operations.
-
-You can also you camel-hbase to perform HBase delete operation. The
-delete operation will remove an entire row. All that needs to be
-specified is one or more rows as part of the message headers.
-
-[source,xml]
-----------------------------------------------------------------
-<route>
- <from uri="direct:in"/>
- <!-- Set the HBase Row of the Get -->
- <setHeader name="CamelHBaseRowId">
- <el>${in.body.id}</el>
- </setHeader>
- <to uri="hbase:mytable?operation=CamelHBaseDelete"/>
-</route>
-----------------------------------------------------------------
-
-=== Scan Operations.
-
-A scan operation is the equivalent of a query in HBase. You can use the
-scan operation to retrieve multiple rows. To specify what columns should
-be part of the result and also specify how the values will be converted
-to objects you can use either uri options or headers.
-
-[source,xml]
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
-<route>
- <from uri="direct:in"/>
- <to uri="hbase:mytable?operation=CamelHBaseScan&family=myfamily&qualifier=myqualifier&valueType=java.lang.Long&rowType=java.lang.String"/>
- <to uri="log:out"/>
-</route>
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-In this case its probable that you also also need to specify a list of
-filters for limiting the results. You can specify a list of filters as
-part of the uri and camel will return only the rows that satisfy *ALL*
-the filters. +
- To have a filter that will be aware of the information that is part of
-the message, camel defines the ModelAwareFilter. This will allow your
-filter to take into consideration the model that is defined by the
-message and the mapping strategy. +
- When using a ModelAwareFilter camel-hbase will apply the selected
-mapping strategy to the in message, will create an object that models
-the mapping and will pass that object to the Filter.
-
-For example to perform scan using as criteria the message headers, you
-can make use of the ModelAwareColumnMatchingFilter as shown below.
-
-[source,xml]
------------------------------------------------------------------------------------------------------------
-<route>
- <from uri="direct:scan"/>
- <!-- Set the Criteria -->
- <setHeader name="CamelHBaseFamily">
- <constant>name</constant>
- </setHeader>
- <setHeader name="CamelHBaseQualifier">
- <constant>first</constant>
- </setHeader>
- <setHeader name="CamelHBaseValue">
- <el>in.body.firstName</el>
- </setHeader>
- <setHeader name="CamelHBaseFamily2">
- <constant>name</constant>
- </setHeader>
- <setHeader name="CamelHBaseQualifier2">
- <constant>last</constant>
- </setHeader>
- <setHeader name="CamelHBaseValue2">
- <el>in.body.lastName</el>
- </setHeader>
- <!-- Set additional fields that you want to be return by skipping value -->
- <setHeader name="CamelHBaseFamily3">
- <constant>address</constant>
- </setHeader>
- <setHeader name="CamelHBaseQualifier3">
- <constant>country</constant>
- </setHeader>
- <to uri="hbase:mytable?operation=CamelHBaseScan&filters=#myFilterList"/>
-</route>
-
-<bean id="myFilters" class="java.util.ArrayList">
- <constructor-arg>
- <list>
- <bean class="org.apache.camel.component.hbase.filters.ModelAwareColumnMatchingFilter"/>
- </list>
- </constructor-arg>
-</bean>
------------------------------------------------------------------------------------------------------------
-
-The route above assumes that a pojo is with properties firstName and
-lastName is passed as the message body, it takes those properties and
-adds them as part of the message headers. The default mapping strategy
-will create a model object that will map the headers to HBase columns
-and will pass that model the ModelAwareColumnMatchingFilter. The
-filter will filter out any rows, that do not contain columns that match
-the model. It is like query by example.
-
-== HBase Consumer
-
-The Camel HBase Consumer, will perform repeated scan on the specified
-HBase table and will return the scan results as part of the message. You
-can either specify header mapping (default) or body mapping. The later
-will just add the org.apache.camel.component.hbase.model.HBaseData as
-part of the message body.
-
------------------------
-hbase://table[?options]
------------------------
-
-You can specify the columns that you want to be return and their types
-as part of the uri options:
-
-------------------------------------------------------------------------------------------------------------------------------------------------------
-hbase:mutable?family=name&qualifer=first&valueType=java.lang.String&family=address&qualifer=number&valueType2=java.lang.Integer&rowType=java.lang.Long
-------------------------------------------------------------------------------------------------------------------------------------------------------
-
-The example above will create a model object that is consisted of the
-specified fields and the scan results will populate the model object
-with values. Finally the mapping strategy will be used to map this model
-to the camel message.
-
-== HBase Idempotent repository
-
-The camel-hbase component also provides an idempotent repository which
-can be used when you want to make sure that each message is processed
-only once. The HBase idempotent repository is configured with a table, a
-column family and a column qualifier and will create to that table a row
-per message.
-
-[source,java]
-------------------------------------------------------------------------------------------------------------------
-HBaseConfiguration configuration = HBaseConfiguration.create();
-HBaseIdempotentRepository repository = new HBaseIdempotentRepository(configuration, tableName, family, qualifier);
-
-from("direct:in")
- .idempotentConsumer(header("messageId"), repository)
- .to("log:out);
-------------------------------------------------------------------------------------------------------------------
-
-== HBase Mapping
-
-It was mentioned above that you the default mapping strategies are
-*header* and *body* mapping. +
- Below you can find some detailed examples of how each mapping strategy
-works.
-
-=== HBase Header mapping Examples
-
-The header mapping is the default mapping.
- To put the value "myvalue" into HBase row "myrow" and column
-"myfamily:mycolum" the message should contain the following headers:
-
-[width="100%",cols="10%,90%",options="header",]
-|=======================================================================
-|Header |Value
-
-|CamelHBaseRowId |myrow
-
-|CamelHBaseFamily |myfamily
-
-|CamelHBaseQualifier |myqualifier
-
-|CamelHBaseValue |myvalue
-|=======================================================================
-
-To put more values for different columns and / or different rows you can
-specify additional headers suffixed with the index of the headers, e.g:
-
-[width="100%",cols="10%,90%",options="header",]
-|=======================================================================
-|Header |Value
-
-|CamelHBaseRowId |myrow
-
-|CamelHBaseFamily |myfamily
-
-|CamelHBaseQualifier |myqualifier
-
-|CamelHBaseValue |myvalue
-
-|CamelHBaseRowId2 |myrow2
-
-|CamelHBaseFamily2 |myfamily
-
-|CamelHBaseQualifier2 |myqualifier
-
-|CamelHBaseValue2 |myvalue2
-|=======================================================================
-
-In the case of retrieval operations such as get or scan you can also
-specify for each column the type that you want the data to be converted
-to. For exampe:
-
-[width="100%",cols="10%,90%",options="header",]
-|=======================================================================
-|Header |Value
-
-|CamelHBaseFamily |myfamily
-
-|CamelHBaseQualifier |myqualifier
-
-|CamelHBaseValueType |Long
-|=======================================================================
-
-Please note that in order to avoid boilerplate headers that are
-considered constant for all messages, you can also specify them as part
-of the endpoint uri, as you will see below.
-
-=== Body mapping Examples
-
-In order to use the body mapping strategy you will have to specify the
-option mappingStrategy as part of the uri, for example:
-
-----------------------------------
-hbase:mytable?mappingStrategyName=body
-----------------------------------
-
-To use the body mapping strategy the body needs to contain an instance
-of org.apache.camel.component.hbase.model.HBaseData. You can construct t
-
-[source,java]
----------------------------------
-HBaseData data = new HBaseData();
-HBaseRow row = new HBaseRow();
-row.setId("myRowId");
-HBaseCell cell = new HBaseCell();
-cell.setFamily("myfamily");
-cell.setQualifier("myqualifier");
-cell.setValue("myValue");
-row.getCells().add(cell);
-data.addRows().add(row);
----------------------------------
-
-The object above can be used for example in a put operation and will
-result in creating or updating the row with id myRowId and add the value
-myvalue to the column myfamily:myqualifier. +
- The body mapping strategy might not seem very appealing at first. The
-advantage it has over the header mapping strategy is that the HBaseData
-object can be easily converted to or from xml/json.
-
-
-
-include::spring-boot:partial$starter.adoc[]
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseAttribute.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseAttribute.java
deleted file mode 100644
index ae2e399ab13..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseAttribute.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase;
-
-public enum HBaseAttribute {
-
- HBASE_ROW_ID("CamelHBaseRowId"),
- HBASE_ROW_TYPE("CamelHBaseRowType"),
- HBASE_MARKED_ROW_ID("CamelHBaseMarkedRowId"),
- HBASE_FAMILY("CamelHBaseFamily"),
- HBASE_QUALIFIER("CamelHBaseQualifier"),
- HBASE_VALUE("CamelHBaseValue"),
- HBASE_VALUE_TYPE("CamelHBaseValueType");
-
- private final String value;
- private final String option;
-
- HBaseAttribute(String value) {
- this.value = value;
- this.option = asOption(value);
- }
-
- public String asHeader(int i) {
- if (i > 1) {
- return value + i;
- } else {
- return value;
- }
- }
-
- public String asHeader() {
- return value;
- }
-
- public String asOption() {
- return option;
- }
-
- public String asOption(int i) {
- if (i > 1) {
- return option + i;
- } else {
- return option;
- }
- }
-
- @Override
- public String toString() {
- return value;
- }
-
- private static String asOption(String name) {
- StringBuilder sb = new StringBuilder();
- sb.append(name, "CamelHBase".length(), name.length());
- sb.setCharAt(0, Character.toLowerCase(sb.charAt(0)));
-
- return sb.toString();
- }
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseComponent.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseComponent.java
deleted file mode 100644
index 31b1065a48f..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseComponent.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase;
-
-import java.util.Map;
-import java.util.concurrent.Executors;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.Endpoint;
-import org.apache.camel.spi.Metadata;
-import org.apache.camel.spi.annotations.Component;
-import org.apache.camel.support.DefaultComponent;
-import org.apache.camel.util.PropertiesHelper;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HBaseConfiguration;
-import org.apache.hadoop.hbase.client.Connection;
-import org.apache.hadoop.hbase.client.ConnectionFactory;
-
-@Component("hbase")
-public class HBaseComponent extends DefaultComponent {
-
- private Connection connection;
-
- @Metadata(label = "advanced")
- private Configuration configuration;
- @Metadata(defaultValue = "10")
- private int poolMaxSize = 10;
-
- public HBaseComponent() {
- }
-
- public HBaseComponent(CamelContext context) {
- super(context);
- }
-
- @Override
- protected void doStart() throws Exception {
- if (configuration == null) {
- configuration = HBaseConfiguration.create();
-
- ClassLoader applicationContextClassLoader = getCamelContext().getApplicationContextClassLoader();
- if (applicationContextClassLoader != null) {
- configuration.setClassLoader(applicationContextClassLoader);
- HBaseConfiguration.addHbaseResources(configuration);
- }
- }
-
- connection = ConnectionFactory.createConnection(configuration, Executors.newFixedThreadPool(poolMaxSize));
- }
-
- @Override
- protected void doStop() throws Exception {
- if (connection != null) {
- // this will also shutdown the thread pool
- connection.close();
- }
- }
-
- @Override
- protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
- HBaseEndpoint endpoint = new HBaseEndpoint(uri, this, remaining);
- Map<String, Object> mapping = PropertiesHelper.extractProperties(parameters, "row.");
- endpoint.setRowMapping(mapping);
- setProperties(endpoint, parameters);
- return endpoint;
- }
-
- public Connection getConnection() {
- return connection;
- }
-
- public Configuration getConfiguration() {
- return configuration;
- }
-
- /**
- * To use the shared configuration
- */
- public void setConfiguration(Configuration configuration) {
- this.configuration = configuration;
- }
-
- public int getPoolMaxSize() {
- return poolMaxSize;
- }
-
- /**
- * Maximum number of references to keep for each table in the HTable pool. The default value is 10.
- */
- public void setPoolMaxSize(int poolMaxSize) {
- this.poolMaxSize = poolMaxSize;
- }
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseConstants.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseConstants.java
deleted file mode 100644
index 4b0aafbeca9..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseConstants.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase;
-
-import org.apache.camel.spi.Metadata;
-
-public interface HBaseConstants {
-
- @Metadata(label = "producer", description = "The HBase operation to perform", javaType = "String")
- String OPERATION = "CamelHBaseOperation";
-
- String PUT = "CamelHBasePut";
- String APPEND = "CamelHBaseAppend";
- String INCREMENT = "CamelHBaseIncrement";
- String GET = "CamelHBaseGet";
- String SCAN = "CamelHBaseScan";
- String DELETE = "CamelHBaseDelete";
-
- @Metadata(label = "producer", description = "The maximum number of rows to scan.", javaType = "Integer")
- String HBASE_MAX_SCAN_RESULTS = "CamelHBaseMaxScanResults";
- @Metadata(label = "producer", description = "The row to start scanner at or after", javaType = "String")
- String FROM_ROW = "CamelHBaseStartRow";
- @Metadata(label = "producer", description = "The row to end at (exclusive)", javaType = "String")
- String STOP_ROW = "CamelHBaseStopRow";
- @Metadata(description = "The strategy to use for mapping Camel messages to HBase columns.\n\nSupported values:\n\n* header\n* body",
- javaType = "String")
- String STRATEGY = "CamelMappingStrategy";
- @Metadata(description = "The class name of a custom mapping strategy implementation.", javaType = "String")
- String STRATEGY_CLASS_NAME = "CamelMappingStrategyClassName";
- @Metadata(label = "consumer", description = "The marked row id", javaType = "byte[]")
- String HBASE_MARKED_ROW_ID = HBaseAttribute.HBASE_MARKED_ROW_ID.asHeader();
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseConsumer.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseConsumer.java
deleted file mode 100644
index 8ad4978d62f..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseConsumer.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase;
-
-import java.io.IOException;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Queue;
-import java.util.Set;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.ExchangePropertyKey;
-import org.apache.camel.Processor;
-import org.apache.camel.component.hbase.mapping.CellMappingStrategy;
-import org.apache.camel.component.hbase.mapping.CellMappingStrategyFactory;
-import org.apache.camel.component.hbase.model.HBaseCell;
-import org.apache.camel.component.hbase.model.HBaseData;
-import org.apache.camel.component.hbase.model.HBaseRow;
-import org.apache.camel.support.DefaultExchange;
-import org.apache.camel.support.ScheduledBatchPollingConsumer;
-import org.apache.camel.util.CastUtils;
-import org.apache.camel.util.ObjectHelper;
-import org.apache.hadoop.hbase.Cell;
-import org.apache.hadoop.hbase.CellUtil;
-import org.apache.hadoop.hbase.client.Result;
-import org.apache.hadoop.hbase.client.ResultScanner;
-import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.client.Table;
-import org.apache.hadoop.hbase.filter.Filter;
-import org.apache.hadoop.hbase.filter.FilterList;
-import org.apache.hadoop.hbase.filter.PageFilter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The HBase consumer.
- */
-public class HBaseConsumer extends ScheduledBatchPollingConsumer {
-
- private static final Logger LOG = LoggerFactory.getLogger(HBaseConsumer.class);
-
- private final HBaseEndpoint endpoint;
- private HBaseRow rowModel;
-
- public HBaseConsumer(HBaseEndpoint endpoint, Processor processor) {
- super(endpoint, processor);
- this.endpoint = endpoint;
- this.rowModel = endpoint.getRowModel();
- }
-
- @Override
- protected int poll() throws Exception {
- try (Table table = endpoint.getTable()) {
- shutdownRunningTask = null;
- pendingExchanges = 0;
-
- Queue<Exchange> queue = new LinkedList<>();
-
- Scan scan = new Scan();
- List<Filter> filters = new LinkedList<>();
- if (endpoint.getFilters() != null) {
- filters.addAll(endpoint.getFilters());
- }
-
- if (maxMessagesPerPoll > 0) {
- filters.add(new PageFilter(maxMessagesPerPoll));
- }
-
- if (!filters.isEmpty()) {
- Filter compoundFilter = new FilterList(filters);
- scan.setFilter(compoundFilter);
- }
-
- if (rowModel != null && rowModel.getCells() != null) {
- Set<HBaseCell> cellModels = rowModel.getCells();
- for (HBaseCell cellModel : cellModels) {
- scan.addColumn(HBaseHelper.getHBaseFieldAsBytes(cellModel.getFamily()),
- HBaseHelper.getHBaseFieldAsBytes(cellModel.getQualifier()));
- }
- }
-
- ResultScanner scanner = table.getScanner(scan);
- int exchangeCount = 0;
- // The next three statements are used just to get a reference to the BodyCellMappingStrategy instance.
- Exchange exchange = new DefaultExchange(endpoint);
- exchange.getIn().setHeader(HBaseConstants.STRATEGY, CellMappingStrategyFactory.BODY);
- CellMappingStrategy mappingStrategy = endpoint.getCellMappingStrategyFactory().getStrategy(exchange.getIn());
- for (Result result = scanner.next();
- (exchangeCount < maxMessagesPerPoll || maxMessagesPerPoll <= 0) && result != null;
- result = scanner.next()) {
- HBaseData data = new HBaseData();
- HBaseRow resultRow = new HBaseRow();
- resultRow.apply(rowModel);
- byte[] row = result.getRow();
- resultRow.setId(endpoint.getCamelContext().getTypeConverter().convertTo(rowModel.getRowType(), row));
-
- List<Cell> cells = result.listCells();
- if (cells != null) {
- Set<HBaseCell> cellModels = rowModel.getCells();
- if (!cellModels.isEmpty()) {
- for (HBaseCell modelCell : cellModels) {
- HBaseCell resultCell = new HBaseCell();
- String family = modelCell.getFamily();
- String column = modelCell.getQualifier();
- resultCell.setValue(endpoint.getCamelContext().getTypeConverter().convertTo(
- modelCell.getValueType(),
- result.getValue(HBaseHelper.getHBaseFieldAsBytes(family),
- HBaseHelper.getHBaseFieldAsBytes(column))));
- resultCell.setFamily(modelCell.getFamily());
- resultCell.setQualifier(modelCell.getQualifier());
- resultRow.getCells().add(resultCell);
- }
- } else {
- // just need to put every key value into the result Cells
- for (Cell cell : cells) {
- String qualifier = new String(CellUtil.cloneQualifier(cell));
- String family = new String(CellUtil.cloneFamily(cell));
- HBaseCell resultCell = new HBaseCell();
- resultCell.setFamily(family);
- resultCell.setQualifier(qualifier);
- resultCell.setValue(endpoint.getCamelContext().getTypeConverter().convertTo(String.class,
- CellUtil.cloneValue(cell)));
- resultRow.getCells().add(resultCell);
- }
- }
-
- data.getRows().add(resultRow);
- exchange = createExchange(true);
- // Probably overkill but kept it here for consistency.
- exchange.getIn().setHeader(HBaseConstants.STRATEGY, CellMappingStrategyFactory.BODY);
- mappingStrategy.applyScanResults(exchange.getIn(), data);
- //Make sure that there is a header containing the marked row ids, so that they can be deleted.
- exchange.getIn().setHeader(HBaseConstants.HBASE_MARKED_ROW_ID, result.getRow());
- queue.add(exchange);
- exchangeCount++;
- }
- }
- scanner.close();
- return queue.isEmpty() ? 0 : processBatch(CastUtils.cast(queue));
- }
- }
-
- @Override
- public int processBatch(Queue<Object> exchanges) throws Exception {
- int total = exchanges.size();
-
- // limit if needed
- if (maxMessagesPerPoll > 0 && total > maxMessagesPerPoll) {
- LOG.debug("Limiting to maximum messages to poll {} as there were {} messages in this poll.", maxMessagesPerPoll,
- total);
- total = maxMessagesPerPoll;
- }
-
- for (int index = 0; index < total && isBatchAllowed(); index++) {
- // only loop if we are started (allowed to run)
- Exchange exchange = ObjectHelper.cast(Exchange.class, exchanges.poll());
- // add current index and total as properties
- exchange.setProperty(ExchangePropertyKey.BATCH_INDEX, index);
- exchange.setProperty(ExchangePropertyKey.BATCH_SIZE, total);
- exchange.setProperty(ExchangePropertyKey.BATCH_COMPLETE, index == total - 1);
-
- // update pending number of exchanges
- pendingExchanges = total - index - 1;
-
- LOG.trace("Processing exchange [{}]...", exchange);
- getProcessor().process(exchange);
- if (exchange.getException() != null) {
- // if we failed then throw exception
- throw exchange.getException();
- }
-
- if (endpoint.isRemove()) {
- remove((byte[]) exchange.getIn().getHeader(HBaseConstants.HBASE_MARKED_ROW_ID));
- }
- }
-
- return total;
- }
-
- /**
- * Delegates to the {@link HBaseRemoveHandler}.
- */
- private void remove(byte[] row) throws IOException {
- try (Table table = endpoint.getTable()) {
- endpoint.getRemoveHandler().remove(table, row);
- }
- }
-
- public HBaseRow getRowModel() {
- return rowModel;
- }
-
- public void setRowModel(HBaseRow rowModel) {
- this.rowModel = rowModel;
- }
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseDeleteHandler.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseDeleteHandler.java
deleted file mode 100644
index 0d98b8beb6e..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseDeleteHandler.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase;
-
-import java.io.IOException;
-
-import org.apache.hadoop.hbase.client.Delete;
-import org.apache.hadoop.hbase.client.Table;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class HBaseDeleteHandler implements HBaseRemoveHandler {
-
- private static final Logger LOG = LoggerFactory.getLogger(HBaseDeleteHandler.class);
-
- /**
- * Performs a {@link Delete} of the specified row.
- */
- @Override
- public void remove(Table table, byte[] row) {
- Delete delete = new Delete(row);
- try {
- table.delete(delete);
- } catch (IOException e) {
- LOG.warn("Failed to delete row from table. This exception will be ignored.", e);
- }
- }
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseEndpoint.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseEndpoint.java
deleted file mode 100644
index 319b05fd10f..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseEndpoint.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase;
-
-import java.io.IOException;
-import java.security.PrivilegedAction;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.camel.Category;
-import org.apache.camel.Consumer;
-import org.apache.camel.Processor;
-import org.apache.camel.Producer;
-import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.component.hbase.mapping.CellMappingStrategyFactory;
-import org.apache.camel.component.hbase.model.HBaseCell;
-import org.apache.camel.component.hbase.model.HBaseRow;
-import org.apache.camel.spi.Metadata;
-import org.apache.camel.spi.UriEndpoint;
-import org.apache.camel.spi.UriParam;
-import org.apache.camel.spi.UriPath;
-import org.apache.camel.support.DefaultEndpoint;
-import org.apache.hadoop.hbase.TableName;
-import org.apache.hadoop.hbase.client.Table;
-import org.apache.hadoop.hbase.filter.Filter;
-import org.apache.hadoop.security.UserGroupInformation;
-
-/**
- * Reading and write from/to an HBase store (Hadoop database).
- */
-@UriEndpoint(firstVersion = "2.10.0", scheme = "hbase", title = "HBase", syntax = "hbase:tableName",
- category = { Category.BIGDATA, Category.DATABASE, Category.HADOOP }, headersClass = HBaseConstants.class)
-public class HBaseEndpoint extends DefaultEndpoint {
-
- @UriPath(description = "The name of the table")
- @Metadata(required = true)
- private final String tableName;
- private transient TableName tableNameObj;
- @UriParam(label = "producer", defaultValue = "100")
- private int maxResults = 100;
- @UriParam
- private List<Filter> filters;
- @UriParam(label = "consumer", enums = "CamelHBasePut,CamelHBaseGet,CamelHBaseScan,CamelHBaseDelete")
- private String operation;
- @UriParam(label = "consumer", defaultValue = "true")
- private boolean remove = true;
- @UriParam(enums = "header,body")
- private String mappingStrategyName;
- @UriParam
- private String mappingStrategyClassName;
- @UriParam
- private CellMappingStrategyFactory cellMappingStrategyFactory = new CellMappingStrategyFactory();
- @UriParam(label = "consumer")
- private HBaseRemoveHandler removeHandler = new HBaseDeleteHandler();
- @UriParam
- private HBaseRow rowModel;
- @UriParam(label = "consumer")
- private int maxMessagesPerPoll;
- @UriParam
- private UserGroupInformation userGroupInformation;
- @UriParam(prefix = "row.", multiValue = true)
- private Map<String, Object> rowMapping;
-
- public HBaseEndpoint(String uri, HBaseComponent component, String tableName) {
- super(uri, component);
- this.tableName = tableName;
- if (this.tableName == null) {
- throw new IllegalArgumentException("Table name can not be null");
- }
- tableNameObj = TableName.valueOf(tableName);
- }
-
- @Override
- public Producer createProducer() throws Exception {
- return new HBaseProducer(this);
- }
-
- @Override
- public Consumer createConsumer(Processor processor) throws Exception {
- HBaseConsumer consumer = new HBaseConsumer(this, processor);
- configureConsumer(consumer);
- consumer.setMaxMessagesPerPoll(maxMessagesPerPoll);
- return consumer;
- }
-
- @Override
- public HBaseComponent getComponent() {
- return (HBaseComponent) super.getComponent();
- }
-
- public int getMaxResults() {
- return maxResults;
- }
-
- /**
- * The maximum number of rows to scan.
- */
- public void setMaxResults(int maxResults) {
- this.maxResults = maxResults;
- }
-
- public List<Filter> getFilters() {
- return filters;
- }
-
- /**
- * A list of filters to use.
- */
- public void setFilters(List<Filter> filters) {
- this.filters = filters;
- }
-
- public String getOperation() {
- return operation;
- }
-
- /**
- * The HBase operation to perform
- */
- public void setOperation(String operation) {
- this.operation = operation;
- }
-
- public CellMappingStrategyFactory getCellMappingStrategyFactory() {
- return cellMappingStrategyFactory;
- }
-
- /**
- * To use a custom CellMappingStrategyFactory that is responsible for mapping cells.
- */
- public void setCellMappingStrategyFactory(CellMappingStrategyFactory cellMappingStrategyFactory) {
- this.cellMappingStrategyFactory = cellMappingStrategyFactory;
- }
-
- public String getMappingStrategyName() {
- return mappingStrategyName;
- }
-
- /**
- * The strategy to use for mapping Camel messages to HBase columns. Supported values: header, or body.
- */
- public void setMappingStrategyName(String mappingStrategyName) {
- this.mappingStrategyName = mappingStrategyName;
- }
-
- public String getMappingStrategyClassName() {
- return mappingStrategyClassName;
- }
-
- /**
- * The class name of a custom mapping strategy implementation.
- */
- public void setMappingStrategyClassName(String mappingStrategyClassName) {
- this.mappingStrategyClassName = mappingStrategyClassName;
- }
-
- public HBaseRow getRowModel() {
- return rowModel;
- }
-
- /**
- * An instance of org.apache.camel.component.hbase.model.HBaseRow which describes how each row should be modeled
- */
- public void setRowModel(HBaseRow rowModel) {
- this.rowModel = rowModel;
- }
-
- public boolean isRemove() {
- return remove;
- }
-
- /**
- * If the option is true, Camel HBase Consumer will remove the rows which it processes.
- */
- public void setRemove(boolean remove) {
- this.remove = remove;
- }
-
- public HBaseRemoveHandler getRemoveHandler() {
- return removeHandler;
- }
-
- /**
- * To use a custom HBaseRemoveHandler that is executed when a row is to be removed.
- */
- public void setRemoveHandler(HBaseRemoveHandler removeHandler) {
- this.removeHandler = removeHandler;
- }
-
- public int getMaxMessagesPerPoll() {
- return maxMessagesPerPoll;
- }
-
- /**
- * Gets the maximum number of messages as a limit to poll at each polling.
- * <p/>
- * Is default unlimited, but use 0 or negative number to disable it as unlimited.
- */
- public void setMaxMessagesPerPoll(int maxMessagesPerPoll) {
- this.maxMessagesPerPoll = maxMessagesPerPoll;
- }
-
- public UserGroupInformation getUserGroupInformation() {
- return userGroupInformation;
- }
-
- /**
- * Defines privileges to communicate with HBase such as using kerberos.
- */
- public void setUserGroupInformation(UserGroupInformation userGroupInformation) {
- this.userGroupInformation = userGroupInformation;
- }
-
- public Map<String, Object> getRowMapping() {
- return rowMapping;
- }
-
- /**
- * To map the key/values from the Map to a {@link HBaseRow}.
- * <p/>
- * The following keys is supported:
- * <ul>
- * <li>rowId - The id of the row. This has limited use as the row usually changes per Exchange.</li>
- * <li>rowType - The type to covert row id to. Supported operations: CamelHBaseScan.</li>
- * <li>family - The column family. Supports a number suffix for referring to more than one columns.</li>
- * <li>qualifier - The column qualifier. Supports a number suffix for referring to more than one columns.</li>
- * <li>value - The value. Supports a number suffix for referring to more than one columns</li>
- * <li>valueType - The value type. Supports a number suffix for referring to more than one columns. Supported
- * operations: CamelHBaseGet, and CamelHBaseScan.</li>
- * </ul>
- */
- public void setRowMapping(Map<String, Object> rowMapping) {
- this.rowMapping = rowMapping;
- }
-
- @Override
- protected void doInit() throws Exception {
- super.doInit();
-
- if (rowModel == null && rowMapping != null) {
- rowModel = createRowModel(rowMapping);
- }
- }
-
- @Override
- protected void doStop() throws Exception {
- super.doStop();
- }
-
- /**
- * Gets connection to the table (secured or not, depends on the object initialization) please remember to close the
- * table after use
- *
- * @return table, remember to close!
- */
- public Table getTable() throws IOException {
- if (userGroupInformation != null) {
- PrivilegedAction<Table> action = () -> {
- try {
- return getComponent().getConnection().getTable(tableNameObj);
- } catch (IOException e) {
- throw new RuntimeCamelException(e);
- }
- };
- return userGroupInformation.doAs(action);
- } else {
- return getComponent().getConnection().getTable(tableNameObj);
- }
- }
-
- /**
- * Creates an {@link HBaseRow} model from the specified endpoint parameters.
- */
- private HBaseRow createRowModel(Map<String, Object> parameters) {
- HBaseRow rowModel = new HBaseRow();
- if (parameters.containsKey(HBaseAttribute.HBASE_ROW_TYPE.asOption())) {
- String rowType = String.valueOf(parameters.remove(HBaseAttribute.HBASE_ROW_TYPE.asOption()));
- if (rowType != null && !rowType.isEmpty()) {
- rowModel.setRowType(getCamelContext().getClassResolver().resolveClass(rowType));
- }
- }
- for (int i = 1;
- parameters.get(HBaseAttribute.HBASE_FAMILY.asOption(i)) != null
- && parameters.get(HBaseAttribute.HBASE_QUALIFIER.asOption(i)) != null;
- i++) {
- HBaseCell cellModel = new HBaseCell();
- cellModel.setFamily(String.valueOf(parameters.remove(HBaseAttribute.HBASE_FAMILY.asOption(i))));
- cellModel.setQualifier(String.valueOf(parameters.remove(HBaseAttribute.HBASE_QUALIFIER.asOption(i))));
- cellModel.setValue(String.valueOf(parameters.remove(HBaseAttribute.HBASE_VALUE.asOption(i))));
- if (parameters.containsKey(HBaseAttribute.HBASE_VALUE_TYPE.asOption(i))) {
- String valueType = String.valueOf(parameters.remove(HBaseAttribute.HBASE_VALUE_TYPE.asOption(i)));
- if (valueType != null && !valueType.isEmpty()) {
- cellModel.setValueType(getCamelContext().getClassResolver().resolveClass(valueType));
- }
- }
- rowModel.getCells().add(cellModel);
- }
- return rowModel;
- }
-
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseHelper.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseHelper.java
deleted file mode 100644
index b0a46701ee0..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseHelper.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.component.hbase.processor.idempotent.HBaseIdempotentRepository;
-import org.apache.camel.util.IOHelper;
-import org.apache.hadoop.hbase.util.Bytes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public final class HBaseHelper {
-
- private static final Logger LOG = LoggerFactory.getLogger(HBaseIdempotentRepository.class);
- private static final Map<String, byte[]> NAMES = new HashMap<>();
-
- private HBaseHelper() {
- //Utility Class
- }
-
- public static byte[] getHBaseFieldAsBytes(String n) {
- byte[] name = null;
- name = NAMES.get(n);
- if (name == null && n != null) {
- name = n.getBytes();
- NAMES.put(n, name);
- }
- return name;
- }
-
- public static byte[] toBytes(Object obj) {
- if (obj instanceof String) {
- return Bytes.toBytes((String) obj);
- } else if (obj instanceof byte[]) {
- return (byte[]) obj;
- } else if (obj instanceof Byte) {
- return Bytes.toBytes((Byte) obj);
- } else if (obj instanceof Short) {
- return Bytes.toBytes((Short) obj);
- } else if (obj instanceof Integer) {
- return Bytes.toBytes((Integer) obj);
- } else if (obj instanceof Long) {
- return Bytes.toBytes((Long) obj);
- } else if (obj instanceof Double) {
- return Bytes.toBytes((Double) obj);
- } else {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = null;
- try {
- oos = new ObjectOutputStream(baos);
- oos.writeObject(obj);
- return baos.toByteArray();
- } catch (IOException e) {
- LOG.warn("Error while serializing object. Null will be used.", e);
- return null;
- } finally {
- IOHelper.close(oos);
- IOHelper.close(baos);
- }
- }
- }
-
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseProducer.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseProducer.java
deleted file mode 100644
index 157e3d7cc38..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseProducer.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.component.hbase.filters.ModelAwareFilter;
-import org.apache.camel.component.hbase.mapping.CellMappingStrategy;
-import org.apache.camel.component.hbase.model.HBaseCell;
-import org.apache.camel.component.hbase.model.HBaseData;
-import org.apache.camel.component.hbase.model.HBaseRow;
-import org.apache.camel.support.DefaultProducer;
-import org.apache.camel.util.ObjectHelper;
-import org.apache.hadoop.hbase.Cell;
-import org.apache.hadoop.hbase.CellUtil;
-import org.apache.hadoop.hbase.client.Append;
-import org.apache.hadoop.hbase.client.Delete;
-import org.apache.hadoop.hbase.client.Get;
-import org.apache.hadoop.hbase.client.Increment;
-import org.apache.hadoop.hbase.client.Put;
-import org.apache.hadoop.hbase.client.Result;
-import org.apache.hadoop.hbase.client.ResultScanner;
-import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.client.Table;
-import org.apache.hadoop.hbase.filter.Filter;
-import org.apache.hadoop.hbase.filter.FilterList;
-import org.apache.hadoop.hbase.util.Bytes;
-
-/**
- * The HBase producer.
- */
-public class HBaseProducer extends DefaultProducer {
-
- private HBaseEndpoint endpoint;
- private HBaseRow rowModel;
-
- public HBaseProducer(HBaseEndpoint endpoint) {
- super(endpoint);
- this.endpoint = endpoint;
- this.rowModel = endpoint.getRowModel();
- }
-
- @Override
- public void process(Exchange exchange) throws Exception {
- try (Table table = endpoint.getTable()) {
- updateHeaders(exchange);
- String operation = (String) exchange.getIn().getHeader(HBaseConstants.OPERATION);
-
- Integer maxScanResult = exchange.getIn().getHeader(HBaseConstants.HBASE_MAX_SCAN_RESULTS, Integer.class);
- String fromRowId = (String) exchange.getIn().getHeader(HBaseConstants.FROM_ROW);
- String stopRowId = (String) exchange.getIn().getHeader(HBaseConstants.STOP_ROW);
- CellMappingStrategy mappingStrategy = endpoint.getCellMappingStrategyFactory().getStrategy(exchange.getIn());
-
- HBaseData data = mappingStrategy.resolveModel(exchange.getIn());
-
- List<Put> putOperations = new LinkedList<>();
- List<Append> appendOperations = new LinkedList<>();
- List<Increment> incrementOperations = new LinkedList<>();
- List<Delete> deleteOperations = new LinkedList<>();
- List<HBaseRow> getOperationResult = new LinkedList<>();
- List<HBaseRow> scanOperationResult = new LinkedList<>();
-
- for (HBaseRow hRow : data.getRows()) {
- hRow.apply(rowModel);
- if (HBaseConstants.PUT.equals(operation)) {
- putOperations.add(createPut(hRow));
- } else if (HBaseConstants.APPEND.equals(operation)) {
- appendOperations.add(createAppend(hRow));
- } else if (HBaseConstants.INCREMENT.equals(operation)) {
- incrementOperations.add(createIncrement(hRow));
- } else if (HBaseConstants.GET.equals(operation)) {
- HBaseRow getResultRow = getCells(table, hRow);
- getOperationResult.add(getResultRow);
- } else if (HBaseConstants.DELETE.equals(operation)) {
- deleteOperations.add(createDeleteRow(hRow));
- } else if (HBaseConstants.SCAN.equals(operation)) {
- scanOperationResult = scanCells(table, hRow, fromRowId, stopRowId, maxScanResult, endpoint.getFilters());
- }
- }
-
- //Check if we have something to add.
- if (!putOperations.isEmpty()) {
- table.put(putOperations);
- } else if (!appendOperations.isEmpty()) {
- for (Append appendOperation : appendOperations) {
- table.append(appendOperation);
- }
- } else if (!incrementOperations.isEmpty()) {
- for (Increment incrementOperation : incrementOperations) {
- table.increment(incrementOperation);
- }
- } else if (!deleteOperations.isEmpty()) {
- table.delete(deleteOperations);
- } else if (!getOperationResult.isEmpty()) {
- mappingStrategy.applyGetResults(exchange.getMessage(), new HBaseData(getOperationResult));
- } else if (!scanOperationResult.isEmpty()) {
- mappingStrategy.applyScanResults(exchange.getMessage(), new HBaseData(scanOperationResult));
- }
- }
- }
-
- /**
- * Creates an HBase {@link Put} on a specific row, using a collection of values (family/column/value pairs).
- */
- private Put createPut(HBaseRow hRow) {
- ObjectHelper.notNull(hRow, "HBase row");
- ObjectHelper.notNull(hRow.getId(), "HBase row id");
- ObjectHelper.notNull(hRow.getCells(), "HBase cells");
-
- Put put = new Put(endpoint.getCamelContext().getTypeConverter().convertTo(byte[].class, hRow.getId()));
- Set<HBaseCell> cells = hRow.getCells();
- for (HBaseCell cell : cells) {
- String family = cell.getFamily();
- String column = cell.getQualifier();
- Object value = cell.getValue();
-
- ObjectHelper.notNull(family, "HBase column family", cell);
- ObjectHelper.notNull(column, "HBase column", cell);
- put.addColumn(
- HBaseHelper.getHBaseFieldAsBytes(family),
- HBaseHelper.getHBaseFieldAsBytes(column),
- endpoint.getCamelContext().getTypeConverter().convertTo(byte[].class, value));
- }
- return put;
- }
-
- /**
- * Creates an HBase {@link Append} on a specific row, using a collection of values (family/column/value pairs).
- */
- private Append createAppend(HBaseRow hRow) {
- ObjectHelper.notNull(hRow, "HBase row");
- ObjectHelper.notNull(hRow.getId(), "HBase row id");
- ObjectHelper.notNull(hRow.getCells(), "HBase cells");
-
- Append append = new Append(endpoint.getCamelContext().getTypeConverter().convertTo(byte[].class, hRow.getId()));
- Set<HBaseCell> cells = hRow.getCells();
- for (HBaseCell cell : cells) {
- String family = cell.getFamily();
- String column = cell.getQualifier();
- Object value = cell.getValue();
-
- ObjectHelper.notNull(family, "HBase column family", cell);
- ObjectHelper.notNull(column, "HBase column", cell);
- append.addColumn(
- HBaseHelper.getHBaseFieldAsBytes(family),
- HBaseHelper.getHBaseFieldAsBytes(column),
- endpoint.getCamelContext().getTypeConverter().convertTo(byte[].class, value));
- }
- return append;
- }
-
- /**
- * Creates an HBase {@link Increment} on a specific row, using a collection of values (family/column/value pairs).
- */
- private Increment createIncrement(HBaseRow hRow) {
- ObjectHelper.notNull(hRow, "HBase row");
- ObjectHelper.notNull(hRow.getId(), "HBase row id");
- ObjectHelper.notNull(hRow.getCells(), "HBase cells");
-
- Increment increment
- = new Increment(endpoint.getCamelContext().getTypeConverter().convertTo(byte[].class, hRow.getId()));
- Set<HBaseCell> cells = hRow.getCells();
- for (HBaseCell cell : cells) {
- String family = cell.getFamily();
- String column = cell.getQualifier();
- Object value = cell.getValue();
-
- ObjectHelper.notNull(family, "HBase column family", cell);
- ObjectHelper.notNull(column, "HBase column", cell);
- increment.addColumn(
- HBaseHelper.getHBaseFieldAsBytes(family),
- HBaseHelper.getHBaseFieldAsBytes(column),
- endpoint.getCamelContext().getTypeConverter().convertTo(Long.class, value));
- }
- return increment;
- }
-
- /**
- * Performs an HBase {@link Get} on a specific row, using a collection of values (family/column/value pairs). The
- * result is
- * <p>
- * the most recent entry
- * </p>
- * for each column.
- */
- private HBaseRow getCells(Table table, HBaseRow hRow) throws Exception {
- HBaseRow resultRow = new HBaseRow();
- ObjectHelper.notNull(hRow, "HBase row");
- ObjectHelper.notNull(hRow.getId(), "HBase row id");
- ObjectHelper.notNull(hRow.getCells(), "HBase cells");
-
- resultRow.setId(hRow.getId());
- Get get = new Get(endpoint.getCamelContext().getTypeConverter().convertTo(byte[].class, hRow.getId()));
- Set<HBaseCell> cellModels = hRow.getCells();
- for (HBaseCell cellModel : cellModels) {
- String family = cellModel.getFamily();
- String column = cellModel.getQualifier();
-
- ObjectHelper.notNull(family, "HBase column family", cellModel);
- ObjectHelper.notNull(column, "HBase column", cellModel);
- get.addColumn(HBaseHelper.getHBaseFieldAsBytes(family), HBaseHelper.getHBaseFieldAsBytes(column));
- }
-
- Result result = table.get(get);
-
- if (!result.isEmpty()) {
- resultRow.setTimestamp(result.rawCells()[0].getTimestamp());
- }
-
- for (HBaseCell cellModel : cellModels) {
- HBaseCell resultCell = new HBaseCell();
- String family = cellModel.getFamily();
- String column = cellModel.getQualifier();
- resultCell.setFamily(family);
- resultCell.setQualifier(column);
-
- List<Cell> kvs
- = result.getColumnCells(HBaseHelper.getHBaseFieldAsBytes(family), HBaseHelper.getHBaseFieldAsBytes(column));
- if (kvs != null && !kvs.isEmpty()) {
- //Return the most recent entry.
- resultCell.setValue(endpoint.getCamelContext().getTypeConverter().convertTo(cellModel.getValueType(),
- CellUtil.cloneValue(kvs.get(0))));
- resultCell.setTimestamp(kvs.get(0).getTimestamp());
- }
- resultRow.getCells().add(resultCell);
- }
- return resultRow;
- }
-
- /**
- * Creates an HBase {@link Delete} on a specific row, using a collection of values (family/column/value pairs).
- */
- private Delete createDeleteRow(HBaseRow hRow) {
- ObjectHelper.notNull(hRow, "HBase row");
- ObjectHelper.notNull(hRow.getId(), "HBase row id");
- return new Delete(endpoint.getCamelContext().getTypeConverter().convertTo(byte[].class, hRow.getId()));
- }
-
- /**
- * Performs an HBase {@link Get} on a specific row, using a collection of values (family/column/value pairs). The
- * result is
- * <p>
- * the most recent entry
- * </p>
- * for each column.
- */
- private List<HBaseRow> scanCells(
- Table table, HBaseRow model, String start, String stop, Integer maxRowScan, List<Filter> filters)
- throws Exception {
- List<HBaseRow> rowSet = new LinkedList<>();
-
- // unused
- //HBaseRow startRow = new HBaseRow(model.getCells());
- //startRow.setId(start);
-
- Scan scan = new Scan();
- if (start != null) {
- scan.withStartRow(Bytes.toBytes(start));
- }
- if (ObjectHelper.isNotEmpty(stop)) {
- scan.withStopRow(Bytes.toBytes(stop));
- }
-
- if (filters != null && !filters.isEmpty()) {
- for (int i = 0; i < filters.size(); i++) {
- ((ModelAwareFilter<?>) filters.get(i)).apply(endpoint.getCamelContext(), model);
- scan.setFilter(new FilterList(
- FilterList.Operator.MUST_PASS_ALL, ((ModelAwareFilter<?>) filters.get(i)).getFilteredList()));
- }
- }
-
- Set<HBaseCell> cellModels = model.getCells();
- for (HBaseCell cellModel : cellModels) {
- String family = cellModel.getFamily();
- String column = cellModel.getQualifier();
-
- if (ObjectHelper.isNotEmpty(family) && ObjectHelper.isNotEmpty(column)) {
- scan.addColumn(HBaseHelper.getHBaseFieldAsBytes(family), HBaseHelper.getHBaseFieldAsBytes(column));
- }
- }
-
- ResultScanner resultScanner = table.getScanner(scan);
- int count = 0;
- Result result = resultScanner.next();
-
- while (result != null && count < maxRowScan) {
- HBaseRow resultRow = new HBaseRow();
- resultRow.setId(endpoint.getCamelContext().getTypeConverter().convertTo(model.getRowType(), result.getRow()));
-
- resultRow.setTimestamp(result.rawCells()[0].getTimestamp());
- cellModels = model.getCells();
- for (HBaseCell modelCell : cellModels) {
- HBaseCell resultCell = new HBaseCell();
- String family = modelCell.getFamily();
- String column = modelCell.getQualifier();
-
- resultRow.setId(endpoint.getCamelContext().getTypeConverter().convertTo(
- model.getRowType(),
- result.getRow()));
- resultCell.setValue(endpoint.getCamelContext().getTypeConverter().convertTo(
- modelCell.getValueType(),
- result.getValue(HBaseHelper.getHBaseFieldAsBytes(family), HBaseHelper.getHBaseFieldAsBytes(column))));
-
- resultCell.setFamily(modelCell.getFamily());
- resultCell.setQualifier(modelCell.getQualifier());
-
- Cell cell = result.getColumnLatestCell(HBaseHelper.getHBaseFieldAsBytes(family),
- HBaseHelper.getHBaseFieldAsBytes(column));
- if (cell != null) {
- resultCell.setTimestamp(cell.getTimestamp());
- }
- resultRow.getCells().add(resultCell);
- }
- rowSet.add(resultRow);
- count++;
- result = resultScanner.next();
- }
- return rowSet;
- }
-
- /**
- * This methods fill possible gaps in the {@link Exchange} headers, with values passed from the Endpoint.
- */
- private void updateHeaders(Exchange exchange) {
- if (exchange != null && exchange.getIn() != null) {
- if (endpoint.getMaxResults() != 0 && exchange.getIn().getHeader(HBaseConstants.HBASE_MAX_SCAN_RESULTS) == null) {
- exchange.getIn().setHeader(HBaseConstants.HBASE_MAX_SCAN_RESULTS, endpoint.getMaxResults());
- }
- if (endpoint.getMappingStrategyName() != null
- && exchange.getIn().getHeader(HBaseConstants.STRATEGY) == null) {
- exchange.getIn().setHeader(HBaseConstants.STRATEGY, endpoint.getMappingStrategyName());
- }
-
- if (endpoint.getMappingStrategyName() != null
- && exchange.getIn().getHeader(HBaseConstants.STRATEGY_CLASS_NAME) == null) {
- exchange.getIn().setHeader(HBaseConstants.STRATEGY_CLASS_NAME,
- endpoint.getMappingStrategyClassName());
- }
-
- if (endpoint.getOperation() != null && exchange.getIn().getHeader(HBaseConstants.OPERATION) == null) {
- exchange.getIn().setHeader(HBaseConstants.OPERATION, endpoint.getOperation());
- } else if (endpoint.getOperation() == null && exchange.getIn().getHeader(HBaseConstants.OPERATION) == null) {
- exchange.getIn().setHeader(HBaseConstants.OPERATION, HBaseConstants.PUT);
- }
- }
- }
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseRemoveHandler.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseRemoveHandler.java
deleted file mode 100644
index 58373177ed8..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseRemoveHandler.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase;
-
-import org.apache.hadoop.hbase.client.Table;
-
-public interface HBaseRemoveHandler {
-
- /**
- * 'Removes' a row from the table. The removal is not necessarily physical remove. The implementation decides how a
- * row can be considered as removed.
- */
- void remove(Table table, byte[] row);
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/converter/HBaseModelConverter.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/converter/HBaseModelConverter.java
deleted file mode 100644
index 739e03d279c..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/converter/HBaseModelConverter.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase.converter;
-
-import org.apache.camel.Converter;
-import org.apache.hadoop.hbase.util.Bytes;
-
-@Converter(generateLoader = true)
-public final class HBaseModelConverter {
-
- private HBaseModelConverter() {
- //Utility Class
- }
-
- @Converter
- public static byte[] booleanToBytes(Boolean bool) {
- return Bytes.toBytes(bool);
- }
-
- @Converter
- public static Boolean bytesToBoolean(byte[] bytes) {
- return Bytes.toBoolean(bytes);
- }
-
- @Converter
- public static byte[] shortToBytes(Short num) {
- return Bytes.toBytes(num);
- }
-
- @Converter
- public static Short bytesToShort(byte[] bytes) {
- return Bytes.toShort(bytes);
- }
-
- @Converter
- public static byte[] integerToBytes(Integer num) {
- return Bytes.toBytes(num);
- }
-
- @Converter
- public static Integer bytesToInteger(byte[] bytes) {
- return Bytes.toInt(bytes);
- }
-
- @Converter
- public static byte[] longToBytes(Long num) {
- return Bytes.toBytes(num);
- }
-
- @Converter
- public static Long bytesToLong(byte[] bytes) {
- return Bytes.toLong(bytes);
- }
-
- @Converter
- public static byte[] doubleToBytes(Double num) {
- return Bytes.toBytes(num);
- }
-
- @Converter
- public static Double bytesToDouble(byte[] bytes) {
- return Bytes.toDouble(bytes);
- }
-
- @Converter
- public static byte[] floatToBytes(Float num) {
- return Bytes.toBytes(num);
- }
-
- @Converter
- public static Float bytesToFloat(byte[] bytes) {
- return Bytes.toFloat(bytes);
- }
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareColumnMatchingFilter.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareColumnMatchingFilter.java
deleted file mode 100644
index bbacae6fe16..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareColumnMatchingFilter.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase.filters;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.component.hbase.HBaseHelper;
-import org.apache.camel.component.hbase.model.HBaseCell;
-import org.apache.camel.component.hbase.model.HBaseRow;
-import org.apache.hadoop.hbase.CompareOperator;
-import org.apache.hadoop.hbase.filter.FilterList;
-import org.apache.hadoop.hbase.filter.SingleColumnValueExcludeFilter;
-import org.apache.hadoop.hbase.filter.SingleColumnValueFilter;
-
-/**
- * A {@link FilterList} that contains multiple {@link SingleColumnValueExcludeFilter}s one per column that is part of
- * the model.
- */
-public class ModelAwareColumnMatchingFilter implements ModelAwareFilter<FilterList> {
- FilterList fl;
-
- /**
- * Writable constructor, do not use.
- */
- public ModelAwareColumnMatchingFilter() {
- fl = new FilterList();
- }
-
- @Override
- public FilterList getFilteredList() {
- return fl;
- }
-
- /**
- * Applies the message to {@link org.apache.hadoop.hbase.filter.Filter} to context.
- */
- @Override
- public void apply(CamelContext context, HBaseRow rowModel) {
- fl.getFilters().clear();
- if (rowModel != null) {
- for (HBaseCell cell : rowModel.getCells()) {
- if (cell.getValue() != null) {
- byte[] family = HBaseHelper.getHBaseFieldAsBytes(cell.getFamily());
- byte[] qualifier = HBaseHelper.getHBaseFieldAsBytes(cell.getQualifier());
- byte[] value = context.getTypeConverter().convertTo(byte[].class, cell.getValue());
- SingleColumnValueFilter columnValueFilter
- = new SingleColumnValueFilter(family, qualifier, CompareOperator.EQUAL, value);
- fl.addFilter(columnValueFilter);
- }
- }
- }
- }
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareFilter.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareFilter.java
deleted file mode 100644
index 53399cfdf6c..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareFilter.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase.filters;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.component.hbase.model.HBaseRow;
-import org.apache.hadoop.hbase.filter.Filter;
-import org.apache.hadoop.hbase.filter.FilterList;
-
-public interface ModelAwareFilter<T extends Filter> {
-
- /**
- * Applies the message to {@link Filter} to context.
- */
- void apply(CamelContext context, HBaseRow rowModel);
-
- FilterList getFilteredList();
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareFilterList.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareFilterList.java
deleted file mode 100644
index ebfb22fc7fb..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareFilterList.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase.filters;
-
-import java.util.List;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.component.hbase.model.HBaseRow;
-import org.apache.hadoop.hbase.filter.Filter;
-import org.apache.hadoop.hbase.filter.FilterList;
-
-public class ModelAwareFilterList implements ModelAwareFilter<FilterList> {
-
- FilterList fl;
-
- /**
- * Default constructor, filters nothing. Required though for RPC deserialization.
- */
- public ModelAwareFilterList() {
- fl = new FilterList(); //it's worth to prevent the class against null pointer on fl
- }
-
- /**
- * Constructor that takes a set of {@link org.apache.hadoop.hbase.filter.Filter}s. The default operator
- * MUST_PASS_ALL is assumed.
- *
- * @param rowFilters list of filters
- */
- public ModelAwareFilterList(List<Filter> rowFilters) {
- fl = new FilterList(rowFilters);
- }
-
- /**
- * Constructor that takes an operator.
- *
- * @param operator Operator to process filter set with.
- */
- public ModelAwareFilterList(FilterList.Operator operator) {
- fl = new FilterList(operator);
- }
-
- /**
- * Constructor that takes a set of {@link org.apache.hadoop.hbase.filter.Filter}s and an operator.
- *
- * @param operator Operator to process filter set with.
- * @param rowFilters Set of row filters.
- */
- public ModelAwareFilterList(FilterList.Operator operator, List<Filter> rowFilters) {
- fl = new FilterList(operator, rowFilters);
- }
-
- /**
- * Applies the message to {@link org.apache.hadoop.hbase.filter.Filter} to context.
- */
- @Override
- public void apply(CamelContext context, HBaseRow rowModel) {
- for (Filter filter : getFilters()) {
- if (ModelAwareFilter.class.isAssignableFrom(filter.getClass())) { //probably and is assignable from filter
- ((ModelAwareFilter<?>) filter).apply(context, rowModel);
- }
- }
- }
-
- /**
- * Wraps an existing {@link FilterList} filter into a {@link ModelAwareFilterList}.
- */
- public static ModelAwareFilterList wrap(FilterList filter) {
- return new ModelAwareFilterList(filter.getOperator(), filter.getFilters());
- }
-
- public List<Filter> getFilters() {
- return fl.getFilters();
- }
-
- public void addFilter(Filter filter) {
- getFilters().add(filter);
- }
-
- @Override
- public FilterList getFilteredList() {
- return fl;
- }
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareRowPrefixMatchingFilter.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareRowPrefixMatchingFilter.java
deleted file mode 100644
index 4daa83083c0..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareRowPrefixMatchingFilter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase.filters;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.component.hbase.model.HBaseRow;
-import org.apache.hadoop.hbase.filter.FilterList;
-import org.apache.hadoop.hbase.filter.PrefixFilter;
-
-/**
- * A {@link FilterList} that contains multiple {@link PrefixFilter}s one per column that is part of the model.
- */
-public class ModelAwareRowPrefixMatchingFilter extends ModelAwareFilterList {
-
- /**
- * Writable constructor, do not use.
- */
- public ModelAwareRowPrefixMatchingFilter() {
- }
-
- /**
- * Applies the message to {@link org.apache.hadoop.hbase.filter.Filter} to context.
- */
- @Override
- public void apply(CamelContext context, HBaseRow rowModel) {
- getFilters().clear();
- if (rowModel != null) {
- if (rowModel.getId() != null) {
- byte[] value = context.getTypeConverter().convertTo(byte[].class, rowModel.getId());
- PrefixFilter rowPrefixFilter = new PrefixFilter(value);
- addFilter(rowPrefixFilter);
- }
- }
- }
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareSkipFilter.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareSkipFilter.java
deleted file mode 100644
index 96fc9c4edb1..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareSkipFilter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase.filters;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.component.hbase.model.HBaseRow;
-import org.apache.hadoop.hbase.filter.Filter;
-import org.apache.hadoop.hbase.filter.FilterList;
-import org.apache.hadoop.hbase.filter.SkipFilter;
-
-public class ModelAwareSkipFilter extends SkipFilter implements ModelAwareFilter<SkipFilter> {
-
- public ModelAwareSkipFilter(Filter filter) {
- super(filter);
- }
-
- /**
- * Applies the message to {@link org.apache.hadoop.hbase.filter.Filter} to context.
- */
- @Override
- public void apply(CamelContext context, HBaseRow rowModel) {
- if (ModelAwareFilter.class.isAssignableFrom(getFilter().getClass())) {
- ((ModelAwareFilter<?>) getFilter()).apply(context, rowModel);
- }
- }
-
- /**
- * Wraps an existing {@link SkipFilter} filter into a {@link ModelAwareSkipFilter}.
- */
- public static ModelAwareSkipFilter wrap(SkipFilter filter) {
- return new ModelAwareSkipFilter(filter.getFilter());
- }
-
- @Override
- public FilterList getFilteredList() {
- return null;
- }
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareWhileMatchFilter.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareWhileMatchFilter.java
deleted file mode 100644
index f1b79335881..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/filters/ModelAwareWhileMatchFilter.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase.filters;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.component.hbase.model.HBaseRow;
-import org.apache.hadoop.hbase.filter.Filter;
-import org.apache.hadoop.hbase.filter.FilterList;
-import org.apache.hadoop.hbase.filter.WhileMatchFilter;
-
-public class ModelAwareWhileMatchFilter extends WhileMatchFilter implements ModelAwareFilter<WhileMatchFilter> {
-
- public ModelAwareWhileMatchFilter(Filter filter) {
- super(filter);
- }
-
- /**
- * Applies the message to {@link org.apache.hadoop.hbase.filter.Filter} to context.
- */
- @Override
- public void apply(CamelContext context, HBaseRow rowModel) {
- if (ModelAwareFilter.class.isAssignableFrom(getFilter().getClass())) {
- ((ModelAwareFilter<?>) getFilter()).apply(context, rowModel);
- }
- }
-
- /**
- * Wraps an existing {@link WhileMatchFilter} filter into a {@link ModelAwareWhileMatchFilter}.
- */
- public static ModelAwareWhileMatchFilter wrap(WhileMatchFilter filter) {
- return new ModelAwareWhileMatchFilter(filter.getFilter());
- }
-
- @Override
- public FilterList getFilteredList() {
- return null;
- }
-
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/mapping/BodyMappingStrategy.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/mapping/BodyMappingStrategy.java
deleted file mode 100644
index e7a77a9db7e..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/mapping/BodyMappingStrategy.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase.mapping;
-
-import org.apache.camel.Message;
-import org.apache.camel.component.hbase.model.HBaseData;
-
-/**
- * A {@link org.apache.camel.component.hbase.mapping.CellMappingStrategy} implementation. It distinguishes between
- * multiple cell, by reading headers with index suffix.
- * <p/>
- * In case of multiple headers:
- * <ul>
- * <li>First header is expected to have no suffix</li>
- * <li>Suffixes start from number 2</li>
- * <li>Suffixes need to be sequential</li>
- * </ul>
- */
-public class BodyMappingStrategy implements CellMappingStrategy {
-
- /**
- * Resolves the cells that the {@link org.apache.camel.Exchange} refers to.
- */
- @Override
- public HBaseData resolveModel(Message message) {
- return message.getBody(HBaseData.class);
- }
-
- /**
- * Applies the cells to the {@link org.apache.camel.Exchange}.
- */
- @Override
- public void applyGetResults(Message message, HBaseData data) {
- if (data == null) {
- return;
- }
- message.setBody(data);
- }
-
- /**
- * Applies the cells to the {@link org.apache.camel.Exchange}.
- */
- @Override
- public void applyScanResults(Message message, HBaseData data) {
- if (data == null) {
- return;
- }
- message.setBody(data);
- }
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/mapping/CellMappingStrategy.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/mapping/CellMappingStrategy.java
deleted file mode 100644
index bbb6f283de4..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/mapping/CellMappingStrategy.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase.mapping;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.Message;
-import org.apache.camel.component.hbase.model.HBaseData;
-
-/**
- * A Cell resolver is responsible on identifying the cells, to which the Echange refers to. Is used for all types of
- * operations (Put, Get etc). It is allowed that an exchange refers to more than once cells. This happens if headers for
- * multiple cells are present in the {@link Exchange}.
- */
-public interface CellMappingStrategy {
-
- /**
- * Resolves the cell that the {@link Exchange} refers to.
- */
- HBaseData resolveModel(Message message);
-
- /**
- * Applies the KeyValues of a get operation to the {@link Exchange}.
- *
- * @param message The message that will be applied the Get result.
- * @param data The rows that will be applied to the message.
- */
- void applyGetResults(Message message, HBaseData data);
-
- /**
- * Applies the KeyValues of a scan operation to the {@link Exchange}.
- */
- void applyScanResults(Message message, HBaseData data);
-
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/mapping/CellMappingStrategyFactory.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/mapping/CellMappingStrategyFactory.java
deleted file mode 100644
index 579d8feddc1..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/mapping/CellMappingStrategyFactory.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase.mapping;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.Message;
-import org.apache.camel.component.hbase.HBaseConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class CellMappingStrategyFactory {
-
- public static final String HEADER = "header";
- public static final String BODY = "body";
-
- private static final Logger LOG = LoggerFactory.getLogger(CellMappingStrategyFactory.class);
- private static final Map<String, CellMappingStrategy> DEFAULT_STRATEGIES = new HashMap<>();
-
- public CellMappingStrategyFactory() {
- DEFAULT_STRATEGIES.put(HEADER, new HeaderMappingStrategy());
- DEFAULT_STRATEGIES.put(BODY, new BodyMappingStrategy());
- }
-
- public CellMappingStrategy getStrategy(Message message) {
- CellMappingStrategy strategy = null;
-
- //Check if strategy has been explicitly set.
- if (message.getHeader(HBaseConstants.STRATEGY) != null) {
- strategy = DEFAULT_STRATEGIES.get(message.getHeader(HBaseConstants.STRATEGY, String.class));
- }
-
- if (strategy == null && message.getHeader(HBaseConstants.STRATEGY_CLASS_NAME) != null) {
- strategy = loadStrategyFromClassName(message.getHeader(HBaseConstants.STRATEGY_CLASS_NAME, String.class));
- }
-
- if (strategy != null) {
- return strategy;
- }
-
- //Fallback to the default strategy.
- return DEFAULT_STRATEGIES.get(HEADER);
- }
-
- private CellMappingStrategy loadStrategyFromClassName(String strategyClassName) {
- // TODO: We ought to use ClassResolver from CamelContext API
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- if (classLoader != null) {
- try {
- Class<?> clazz = classLoader.loadClass(strategyClassName);
- return (CellMappingStrategy) clazz.getDeclaredConstructor().newInstance();
- } catch (Throwable e) {
- LOG.warn("Failed to load HBase cell mapping strategy from class {}.", strategyClassName);
- }
- }
- return null;
- }
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/mapping/HeaderMappingStrategy.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/mapping/HeaderMappingStrategy.java
deleted file mode 100644
index 102f494715b..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/mapping/HeaderMappingStrategy.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase.mapping;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.Message;
-import org.apache.camel.component.hbase.HBaseAttribute;
-import org.apache.camel.component.hbase.model.HBaseCell;
-import org.apache.camel.component.hbase.model.HBaseData;
-import org.apache.camel.component.hbase.model.HBaseRow;
-
-/**
- * A default {@link CellMappingStrategy} implementation. It distinguishes between multiple cell, by reading headers with
- * index suffix.
- * <p/>
- * In case of multiple headers:
- * <ul>
- * <li>First header is expected to have no suffix</li>
- * <li>Suffixes start from number 2</li>
- * <li>Suffixes need to be sequential</li>
- * </ul>
- */
-public class HeaderMappingStrategy implements CellMappingStrategy {
-
- /**
- * Resolves the cell that the {@link Exchange} refers to.
- */
- private HBaseRow resolveRow(Message message, int index) {
- HBaseRow hRow = new HBaseRow();
- HBaseCell hCell = new HBaseCell();
-
- if (message != null) {
- Object id = message.getHeader(HBaseAttribute.HBASE_ROW_ID.asHeader(index));
- String rowClassName = message.getHeader(HBaseAttribute.HBASE_ROW_TYPE.asHeader(index), String.class);
- Class<?> rowClass = rowClassName == null || rowClassName.isEmpty()
- ? String.class : message.getExchange().getContext().getClassResolver().resolveClass(rowClassName);
- String columnFamily = (String) message.getHeader(HBaseAttribute.HBASE_FAMILY.asHeader(index));
- String columnName = (String) message.getHeader(HBaseAttribute.HBASE_QUALIFIER.asHeader(index));
- Object value = message.getHeader(HBaseAttribute.HBASE_VALUE.asHeader(index));
-
- String valueClassName = message.getHeader(HBaseAttribute.HBASE_VALUE_TYPE.asHeader(index), String.class);
- Class<?> valueClass = valueClassName == null || valueClassName.isEmpty()
- ? String.class : message.getExchange().getContext().getClassResolver().resolveClass(valueClassName);
-
- //Id can be accepted as null when using get, scan etc.
- if (id == null && columnFamily == null && columnName == null) {
- return null;
- }
-
- hRow.setId(id);
- hRow.setRowType(rowClass);
- if (columnFamily != null && columnName != null) {
- hCell.setQualifier(columnName);
- hCell.setFamily(columnFamily);
- hCell.setValue(value);
- // String is the default value type
- hCell.setValueType((valueClass != null) ? valueClass : String.class);
- hRow.getCells().add(hCell);
- }
- }
- return hRow;
- }
-
- /**
- * Resolves the cells that the {@link org.apache.camel.Exchange} refers to.
- */
- @Override
- public HBaseData resolveModel(Message message) {
- int index = 1;
- HBaseData data = new HBaseData();
- //We use a LinkedHashMap to preserve the order.
- Map<Object, HBaseRow> rows = new LinkedHashMap<>();
- HBaseRow hRow = new HBaseRow();
- while (hRow != null) {
- hRow = resolveRow(message, index++);
- if (hRow != null) {
- if (rows.containsKey(hRow.getId())) {
- rows.get(hRow.getId()).getCells().addAll(hRow.getCells());
- } else {
- rows.put(hRow.getId(), hRow);
- }
- }
- }
- for (Map.Entry<Object, HBaseRow> rowEntry : rows.entrySet()) {
- data.getRows().add(rowEntry.getValue());
- }
- return data;
- }
-
- /**
- * Applies the cells to the {@link org.apache.camel.Exchange}.
- */
- @Override
- public void applyGetResults(Message message, HBaseData data) {
- message.setHeaders(message.getExchange().getIn().getHeaders());
- int index = 1;
- if (data == null || data.getRows() == null) {
- return;
- }
-
- for (HBaseRow hRow : data.getRows()) {
- if (hRow.getId() != null) {
- Set<HBaseCell> cells = hRow.getCells();
- for (HBaseCell cell : cells) {
- message.setHeader(HBaseAttribute.HBASE_VALUE.asHeader(index++),
- getValueForColumn(cells, cell.getFamily(), cell.getQualifier()));
- }
- }
- }
- }
-
- /**
- * Applies the cells to the {@link org.apache.camel.Exchange}.
- */
- @Override
- public void applyScanResults(Message message, HBaseData data) {
- message.setHeaders(message.getExchange().getIn().getHeaders());
- int index = 1;
- if (data == null || data.getRows() == null) {
- return;
- }
-
- for (HBaseRow hRow : data.getRows()) {
- Set<HBaseCell> cells = hRow.getCells();
- for (HBaseCell cell : cells) {
- message.setHeader(HBaseAttribute.HBASE_ROW_ID.asHeader(index), hRow.getId());
- message.setHeader(HBaseAttribute.HBASE_FAMILY.asHeader(index), cell.getFamily());
- message.setHeader(HBaseAttribute.HBASE_QUALIFIER.asHeader(index), cell.getQualifier());
- message.setHeader(HBaseAttribute.HBASE_VALUE.asHeader(index), cell.getValue());
- }
- index++;
- }
- }
-
- /**
- * Searches a list of cells and returns the value, if family/column matches with the specified.
- */
- private Object getValueForColumn(Set<HBaseCell> cells, String family, String qualifier) {
- if (cells != null) {
- for (HBaseCell cell : cells) {
- if (cell.getQualifier().equals(qualifier) && cell.getFamily().equals(family)) {
- return cell.getValue();
- }
- }
- }
- return null;
- }
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/model/HBaseCell.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/model/HBaseCell.java
deleted file mode 100644
index 0dd3dc37006..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/model/HBaseCell.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase.model;
-
-/**
- * A simplified representation of HBase KeyValue objects, which uses the actual Objects instead of byte arrays. It is
- * used in order to abstract the conversion strategy from CellMappingStrategy. It is also used as a template to specify
- * which will be the columns returned in gets, scans etc.
- */
-public class HBaseCell {
-
- private String family;
- private String qualifier;
- private Object value;
- private Long timestamp;
- //The value type can be optionally specified for Gets and Scan, to specify how the byte[] read will be converted.
- private Class<?> valueType = String.class;
-
- @Override
- public String toString() {
- return "HBaseCell=[family=" + family + ", qualifier=" + qualifier + ", value=" + value + ", valueType="
- + valueType.getName();
- }
-
- public String getFamily() {
- return family;
- }
-
- public void setFamily(String family) {
- this.family = family;
- }
-
- public String getQualifier() {
- return qualifier;
- }
-
- public void setQualifier(String qualifier) {
- this.qualifier = qualifier;
- }
-
- public Object getValue() {
- return value;
- }
-
- public void setValue(Object value) {
- this.value = value;
- }
-
- public Class<?> getValueType() {
- return valueType;
- }
-
- public void setValueType(Class<?> valueType) {
- if (valueType == null) {
- throw new IllegalArgumentException("Value type can not be null");
- }
- this.valueType = valueType;
- }
-
- public Long getTimestamp() {
- return timestamp;
- }
-
- public void setTimestamp(Long timestamp) {
- this.timestamp = timestamp;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- HBaseCell hBaseCell = (HBaseCell) o;
-
- if (family != null ? !family.equals(hBaseCell.family) : hBaseCell.family != null) {
- return false;
- }
- if (qualifier != null ? !qualifier.equals(hBaseCell.qualifier) : hBaseCell.qualifier != null) {
- return false;
- }
- if (timestamp != null ? !timestamp.equals(hBaseCell.timestamp) : hBaseCell.timestamp != null) {
- return false;
- }
- if (value != null ? !value.equals(hBaseCell.value) : hBaseCell.value != null) {
- return false;
- }
- if (valueType != null ? !valueType.equals(hBaseCell.valueType) : hBaseCell.valueType != null) {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = family != null ? family.hashCode() : 0;
- result = 31 * result + (qualifier != null ? qualifier.hashCode() : 0);
- result = 31 * result + (value != null ? value.hashCode() : 0);
- result = 31 * result + (timestamp != null ? timestamp.hashCode() : 0);
- result = 31 * result + (valueType != null ? valueType.hashCode() : 0);
- return result;
- }
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/model/HBaseData.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/model/HBaseData.java
deleted file mode 100644
index 14e0dfbc478..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/model/HBaseData.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase.model;
-
-import java.util.LinkedList;
-import java.util.List;
-
-public class HBaseData {
-
- private List<HBaseRow> rows = new LinkedList<>();
-
- public HBaseData() {
- }
-
- public HBaseData(List<HBaseRow> rows) {
- this.rows = rows;
- }
-
- public List<HBaseRow> getRows() {
- return rows;
- }
-
- public void setRows(List<HBaseRow> rows) {
- this.rows = rows;
- }
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/model/HBaseRow.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/model/HBaseRow.java
deleted file mode 100644
index 61421c7ce32..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/model/HBaseRow.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase.model;
-
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-public class HBaseRow implements Cloneable {
-
- private Object id;
- //The row type can be optionally specified for Gets and Scan, to specify how the byte[] read will be converted.
- private Class<?> rowType = String.class;
- private Set<HBaseCell> cells;
-
- private long timestamp;
-
- public HBaseRow() {
- this(new LinkedHashSet<HBaseCell>());
- }
-
- public HBaseRow(Set<HBaseCell> cells) {
- this.cells = cells;
- }
-
- public Object getId() {
- return id;
- }
-
- public void setId(Object id) {
- this.id = id;
- }
-
- public Class<?> getRowType() {
- return rowType;
- }
-
- public void setRowType(Class<?> rowType) {
- this.rowType = rowType;
- }
-
- public Set<HBaseCell> getCells() {
- return cells;
- }
-
- public void setCells(Set<HBaseCell> cells) {
- this.cells = cells;
- }
-
- public boolean isEmpty() {
- return cells.isEmpty();
- }
-
- public int size() {
- return cells.size();
- }
-
- public long getTimestamp() {
- return timestamp;
- }
-
- public void setTimestamp(long timestamp) {
- this.timestamp = timestamp;
- }
-
- public void apply(HBaseRow modelRow) {
- if (modelRow != null) {
- if (rowType == null && modelRow.getRowType() != null) {
- rowType = modelRow.getRowType();
- }
- for (HBaseCell modelCell : modelRow.getCells()) {
- if (!getCells().contains(modelCell)) {
- HBaseCell cell = new HBaseCell();
- cell.setFamily(modelCell.getFamily());
- cell.setQualifier(modelCell.getQualifier());
- cell.setValueType(modelCell.getValueType());
- getCells().add(cell);
- }
- }
- }
- }
-}
diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/processor/idempotent/HBaseIdempotentRepository.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/processor/idempotent/HBaseIdempotentRepository.java
deleted file mode 100644
index 605bc73fe8e..00000000000
--- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/processor/idempotent/HBaseIdempotentRepository.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase.processor.idempotent;
-
-import org.apache.camel.component.hbase.HBaseHelper;
-import org.apache.camel.spi.IdempotentRepository;
-import org.apache.camel.support.service.ServiceSupport;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.TableName;
-import org.apache.hadoop.hbase.client.Connection;
-import org.apache.hadoop.hbase.client.ConnectionFactory;
-import org.apache.hadoop.hbase.client.Delete;
-import org.apache.hadoop.hbase.client.Get;
-import org.apache.hadoop.hbase.client.Put;
-import org.apache.hadoop.hbase.client.Result;
-import org.apache.hadoop.hbase.client.ResultScanner;
-import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.client.Table;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class HBaseIdempotentRepository extends ServiceSupport implements IdempotentRepository {
-
- private static final Logger LOG = LoggerFactory.getLogger(HBaseIdempotentRepository.class);
-
- private final String tableName;
- private final String family;
- private final String qualifier;
- private final Configuration configuration;
- private Connection connection;
- private Table table;
-
- public HBaseIdempotentRepository(Configuration configuration, String tableName, String family,
- String qualifier) {
- this.tableName = tableName;
- this.family = family;
- this.qualifier = qualifier;
- this.configuration = configuration;
- this.connection = null;
- this.table = null;
- }
-
- @Override
- public boolean add(String o) {
- try {
- if (contains(o)) {
- return false;
- }
- byte[] b = HBaseHelper.toBytes(o);
- Put put = new Put(b);
- put.addColumn(HBaseHelper.getHBaseFieldAsBytes(family), HBaseHelper.getHBaseFieldAsBytes(qualifier), b);
- table.put(put);
- return true;
- } catch (Exception e) {
- LOG.warn("Error adding object {} to HBase repository.", o);
- return false;
- }
- }
-
- @Override
- public boolean contains(String o) {
- try {
- byte[] b = HBaseHelper.toBytes(o);
- Get get = new Get(b);
- get.addColumn(HBaseHelper.getHBaseFieldAsBytes(family), HBaseHelper.getHBaseFieldAsBytes(qualifier));
- return table.exists(get);
- } catch (Exception e) {
- LOG.warn("Error reading object {} from HBase repository.", o);
- return false;
- }
- }
-
- @Override
- public boolean remove(String o) {
- try {
- byte[] b = HBaseHelper.toBytes(o);
- if (table.exists(new Get(b))) {
- Delete delete = new Delete(b);
- table.delete(delete);
- return true;
- } else {
- return false;
- }
- } catch (Exception e) {
- LOG.warn("Error removing object {} from HBase repository.", o);
- return false;
- }
- }
-
- @Override
- public boolean confirm(String o) {
- return true;
- }
-
- @Override
- public void clear() {
- Scan s = new Scan();
- ResultScanner scanner;
- try {
- scanner = table.getScanner(s);
- for (Result rr : scanner) {
- Delete d = new Delete(rr.getRow());
- table.delete(d);
- }
- } catch (Exception e) {
- LOG.warn("Error clear HBase repository {}", table);
- }
- }
-
- @Override
- protected void doStart() throws Exception {
- this.connection = ConnectionFactory.createConnection(configuration);
- this.table = this.connection.getTable(TableName.valueOf(tableName));
- }
-
- @Override
- protected void doStop() throws Exception {
- if (table != null) {
- table.close();
- }
-
- if (connection != null) {
- connection.close();
- }
- }
-}
diff --git a/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/CamelHBaseFilterIT.java b/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/CamelHBaseFilterIT.java
deleted file mode 100644
index 273239ccf4e..00000000000
--- a/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/CamelHBaseFilterIT.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.apache.camel.BindToRegistry;
-import org.apache.camel.Endpoint;
-import org.apache.camel.Exchange;
-import org.apache.camel.ExchangePattern;
-import org.apache.camel.Message;
-import org.apache.camel.ProducerTemplate;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.hbase.filters.ModelAwareColumnMatchingFilter;
-import org.apache.hadoop.hbase.filter.Filter;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class CamelHBaseFilterIT extends CamelHBaseTestSupport {
-
- @BindToRegistry("myFilters")
- public List<Filter> addFilters() {
- List<Filter> filters = new LinkedList<>();
- filters.add(new ModelAwareColumnMatchingFilter().getFilteredList()); //not used, filters need to be rethink
- return filters;
- }
-
- @Test
- public void testPutMultiRowsAndScanWithFilters() throws Exception {
- putMultipleRows();
- ProducerTemplate template = context.createProducerTemplate();
- Endpoint endpoint = context.getEndpoint("direct:scan");
-
- Exchange exchange = endpoint.createExchange(ExchangePattern.InOut);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_FAMILY.asHeader(), family[0]);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_QUALIFIER.asHeader(), column[0][0]);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_VALUE.asHeader(), body[0][0][0]);
- Exchange resp = template.send(endpoint, exchange);
- Message out = resp.getMessage();
- assertTrue(out.getHeaders().containsValue(body[0][0][0])
- && out.getHeaders().containsValue(body[1][0][0])
- && !out.getHeaders().containsValue(body[2][0][0]),
- "two first keys returned");
- }
-
- /**
- * Factory method which derived classes can use to create a {@link org.apache.camel.builder.RouteBuilder} to define
- * the routes for testing
- */
- @Override
- protected RouteBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start")
- .to("hbase://" + PERSON_TABLE);
- from("direct:scan")
- .to("hbase://" + PERSON_TABLE + "?operation=" + HBaseConstants.SCAN + "&maxResults=2");
- }
- };
- }
-}
diff --git a/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/CamelHBaseTestSupport.java b/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/CamelHBaseTestSupport.java
deleted file mode 100644
index d713c9365de..00000000000
--- a/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/CamelHBaseTestSupport.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase;
-
-import java.io.IOException;
-
-import org.apache.camel.test.infra.hbase.services.HBaseService;
-import org.apache.camel.test.infra.hbase.services.HBaseServiceFactory;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.apache.camel.util.IOHelper;
-import org.apache.hadoop.hbase.TableExistsException;
-import org.apache.hadoop.hbase.TableName;
-import org.apache.hadoop.hbase.TableNotFoundException;
-import org.apache.hadoop.hbase.client.Admin;
-import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
-import org.apache.hadoop.hbase.client.Connection;
-import org.apache.hadoop.hbase.client.ConnectionFactory;
-import org.apache.hadoop.hbase.client.Put;
-import org.apache.hadoop.hbase.client.Table;
-import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.extension.RegisterExtension;
-
-public abstract class CamelHBaseTestSupport extends CamelTestSupport {
- @RegisterExtension
- public static HBaseService service = HBaseServiceFactory.createSingletonService();
-
- protected static final String PERSON_TABLE = "person";
- protected static final String INFO_FAMILY = "info";
-
- protected String[] key = { "1", "2", "3" };
- protected final String[] family = { "info", "birthdate", "address" };
- protected final String[][] column = {
- { "id", "firstName", "lastName" },
- { "day", "month", "year" },
- { "street", "number", "zip" }
- };
-
- //body[row][family][column]
- protected final String[][][] body = {
- { { "1", "Ioannis", "Canellos" }, { "09", "03", "1980" }, { "Awesome Street", "23", "15344" } },
- { { "2", "John", "Dow" }, { "01", "01", "1979" }, { "Unknown Street", "1", "1010" } },
- { { "3", "Christian", "Mueller" }, { "09", "01", "1979" }, { "Another Unknown Street", "14", "2020" } }
- };
-
- protected final byte[][] families = {
- family[0].getBytes(),
- family[1].getBytes(),
- family[2].getBytes() };
-
- @Override
- @BeforeEach
- public void setUp() throws Exception {
- super.setUp();
- try {
- createTable(PERSON_TABLE, families);
- } catch (TableExistsException ex) {
- //Ignore if table exists
- }
- }
-
- @Override
- @AfterEach
- public void tearDown() throws Exception {
- try {
- deleteTable(PERSON_TABLE);
- } catch (TableNotFoundException e) {
- // skip
- }
- super.tearDown();
- }
-
- protected void putMultipleRows() throws IOException {
- Table table = connectHBase().getTable(TableName.valueOf(PERSON_TABLE.getBytes()));
- for (int r = 0; r < key.length; r++) {
- Put put = new Put(key[r].getBytes());
- put.addColumn(family[0].getBytes(), column[0][0].getBytes(), body[r][0][0].getBytes());
- table.put(put);
- }
- IOHelper.close(table);
- }
-
- protected Connection connectHBase() throws IOException {
- Connection connection = ConnectionFactory.createConnection(service.getConfiguration());
- return connection;
- }
-
- protected void createTable(String name, byte[][] families) throws IOException {
- TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(TableName.valueOf(name));
- for (byte[] fam : families) {
- builder.setColumnFamily(ColumnFamilyDescriptorBuilder.of(fam));
- }
- connectHBase().getAdmin().createTable(builder.build());
- }
-
- protected void createTable(String name, String family) throws IOException {
- createTable(name, new byte[][] { family.getBytes() });
- }
-
- protected void deleteTable(String name) throws IOException {
- Admin admin = connectHBase().getAdmin();
- TableName tname = TableName.valueOf(name);
- admin.disableTable(tname);
- admin.deleteTable(tname);
- }
-}
diff --git a/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/HBaseComponentIT.java b/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/HBaseComponentIT.java
deleted file mode 100644
index 94da025b0d3..00000000000
--- a/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/HBaseComponentIT.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase;
-
-import java.io.IOException;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.impl.DefaultCamelContext;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HBaseConfiguration;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertSame;
-
-public class HBaseComponentIT {
-
- @Test
- public void testHBaseConfigurationClassLoaderSetToAppContextClassLoader() throws Exception {
- ClassLoader expectedClassLoader = HBaseComponentIT.class.getClassLoader();
-
- CamelContext camelContext = new DefaultCamelContext();
- camelContext.setApplicationContextClassLoader(expectedClassLoader);
-
- HBaseComponent component = new HBaseComponent(new DefaultCamelContext());
- component.doStart();
- component.doStop();
-
- ClassLoader actualClassLoader = component.getConfiguration().getClassLoader();
- assertSame(expectedClassLoader, actualClassLoader);
- }
-
- @Test
- public void testHBaseConfigurationClassLoaderNotOverridden() throws Exception {
- ClassLoader expectedClassLoader = HBaseComponentIT.class.getClassLoader().getParent();
-
- Configuration configuration = HBaseConfiguration.create();
- configuration.setClassLoader(expectedClassLoader);
-
- HBaseComponent component = new HBaseComponent(new DefaultCamelContext());
- component.setConfiguration(configuration);
- try {
- component.doStart();
- } catch (IOException e) {
- // Expected because the ClassLoader we set is not the correct one, but it's safe to ignore here
- }
- component.doStop();
-
- ClassLoader actualClassLoader = component.getConfiguration().getClassLoader();
- assertSame(expectedClassLoader, actualClassLoader);
- }
-
- @Test
- public void testHBaseConfigurationClassLoaderSetToDefault() throws Exception {
- ClassLoader expectedClassLoader = HBaseConfiguration.class.getClassLoader();
-
- HBaseComponent component = new HBaseComponent(new DefaultCamelContext());
- component.doStart();
- component.doStop();
-
- ClassLoader actualClassLoader = component.getConfiguration().getClassLoader();
- assertSame(expectedClassLoader, actualClassLoader);
- }
-}
diff --git a/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/HBaseConsumerIT.java b/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/HBaseConsumerIT.java
deleted file mode 100644
index d6308ea58a2..00000000000
--- a/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/HBaseConsumerIT.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.jupiter.api.Test;
-
-public class HBaseConsumerIT extends CamelHBaseTestSupport {
-
- @Test
- public void testPutMultiRowsAndConsume() throws Exception {
- MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
- mockEndpoint.expectedMessageCount(3);
-
- Map<String, Object> headers = new HashMap<>();
- for (int row = 0; row < key.length; row++) {
- headers.put(HBaseAttribute.HBASE_ROW_ID.asHeader(row + 1), key[row]);
- headers.put(HBaseAttribute.HBASE_FAMILY.asHeader(row + 1), family[0]);
- headers.put(HBaseAttribute.HBASE_QUALIFIER.asHeader(row + 1), column[0][0]);
- headers.put(HBaseAttribute.HBASE_VALUE.asHeader(row + 1), body[row][0][0]);
- }
- headers.put(HBaseConstants.OPERATION, HBaseConstants.PUT);
-
- template.sendBodyAndHeaders("direct:start", null, headers);
-
- mockEndpoint.assertIsSatisfied();
- }
-
- /**
- * Factory method which derived classes can use to create a {@link org.apache.camel.builder.RouteBuilder} to define
- * the routes for testing
- */
- @Override
- protected RouteBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start")
- .to("hbase://" + PERSON_TABLE);
- from("hbase://" + PERSON_TABLE)
- .to("mock:result");
- }
- };
- }
-}
diff --git a/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/HBaseConvertionsIT.java b/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/HBaseConvertionsIT.java
deleted file mode 100644
index 5fc6bdfbb03..00000000000
--- a/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/HBaseConvertionsIT.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.ProducerTemplate;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.util.IOHelper;
-import org.apache.hadoop.hbase.TableName;
-import org.apache.hadoop.hbase.client.Connection;
-import org.apache.hadoop.hbase.client.Get;
-import org.apache.hadoop.hbase.client.Result;
-import org.apache.hadoop.hbase.client.Table;
-import org.apache.hadoop.hbase.util.Bytes;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertArrayEquals;
-
-public class HBaseConvertionsIT extends CamelHBaseTestSupport {
-
- protected Object[] key = { 1, "2", "3" };
- protected final Object[] body = { 1L, false, "3" };
- protected final String[] column = { "DEFAULTCOLUMN" };
- protected final byte[][] families = { INFO_FAMILY.getBytes() };
-
- @Test
- public void testPutMultiRows() throws Exception {
- ProducerTemplate template = context.createProducerTemplate();
- Map<String, Object> headers = new HashMap<>();
- headers.put(HBaseAttribute.HBASE_ROW_ID.asHeader(), key[0]);
- headers.put(HBaseAttribute.HBASE_FAMILY.asHeader(), INFO_FAMILY);
- headers.put(HBaseAttribute.HBASE_QUALIFIER.asHeader(), column[0]);
- headers.put(HBaseAttribute.HBASE_VALUE.asHeader(), body[0]);
-
- headers.put(HBaseAttribute.HBASE_ROW_ID.asHeader(2), key[1]);
- headers.put(HBaseAttribute.HBASE_FAMILY.asHeader(2), INFO_FAMILY);
- headers.put(HBaseAttribute.HBASE_QUALIFIER.asHeader(2), column[0]);
- headers.put(HBaseAttribute.HBASE_VALUE.asHeader(2), body[1]);
-
- headers.put(HBaseAttribute.HBASE_ROW_ID.asHeader(3), key[2]);
- headers.put(HBaseAttribute.HBASE_FAMILY.asHeader(3), INFO_FAMILY);
- headers.put(HBaseAttribute.HBASE_QUALIFIER.asHeader(3), column[0]);
- headers.put(HBaseAttribute.HBASE_VALUE.asHeader(3), body[2]);
-
- headers.put(HBaseConstants.OPERATION, HBaseConstants.PUT);
-
- template.sendBodyAndHeaders("direct:start", null, headers);
-
- Connection conn = connectHBase();
- Table bar = conn.getTable(TableName.valueOf(PERSON_TABLE));
- Get get = new Get(Bytes.toBytes((Integer) key[0]));
-
- //Check row 1
- get.addColumn(INFO_FAMILY.getBytes(), column[0].getBytes());
- Result result = bar.get(get);
- byte[] resultValue = result.value();
- assertArrayEquals(Bytes.toBytes((Long) body[0]), resultValue);
-
- //Check row 2
- get = new Get(Bytes.toBytes((String) key[1]));
- get.addColumn(INFO_FAMILY.getBytes(), column[0].getBytes());
- result = bar.get(get);
- resultValue = result.value();
- assertArrayEquals(Bytes.toBytes((Boolean) body[1]), resultValue);
-
- //Check row 3
- get = new Get(Bytes.toBytes((String) key[2]));
- get.addColumn(INFO_FAMILY.getBytes(), column[0].getBytes());
- result = bar.get(get);
- resultValue = result.value();
- assertArrayEquals(Bytes.toBytes((String) body[2]), resultValue);
-
- IOHelper.close(bar);
- }
-
- /**
- * Factory method which derived classes can use to create a {@link org.apache.camel.builder.RouteBuilder} to define
- * the routes for testing
- */
- @Override
- protected RouteBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start")
- .to("hbase://" + PERSON_TABLE);
- from("direct:scan")
- .to("hbase://" + PERSON_TABLE + "?operation=" + HBaseConstants.SCAN
- + "&maxResults=2&row.family=family1&row.qualifier=column1");
- }
- };
- }
-}
diff --git a/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/HBaseProducerIT.java b/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/HBaseProducerIT.java
deleted file mode 100644
index fd961d20cc2..00000000000
--- a/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/HBaseProducerIT.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase;
-
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.util.IOHelper;
-import org.apache.hadoop.hbase.TableName;
-import org.apache.hadoop.hbase.client.Connection;
-import org.apache.hadoop.hbase.client.Get;
-import org.apache.hadoop.hbase.client.Result;
-import org.apache.hadoop.hbase.client.Table;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.Timeout;
-
-import static org.junit.jupiter.api.Assertions.assertArrayEquals;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-@Timeout(30)
-public class HBaseProducerIT extends CamelHBaseTestSupport {
-
- @Test
- public void testPut() throws Exception {
- Map<String, Object> headers = new HashMap<>();
- headers.put(HBaseAttribute.HBASE_ROW_ID.asHeader(), key[0]);
- headers.put(HBaseAttribute.HBASE_FAMILY.asHeader(), family[0]);
- headers.put(HBaseAttribute.HBASE_QUALIFIER.asHeader(), column[0][0]);
- headers.put(HBaseAttribute.HBASE_VALUE.asHeader(), body[0][0][0]);
- headers.put(HBaseConstants.OPERATION, HBaseConstants.PUT);
- template.sendBodyAndHeaders("direct:start", null, headers);
-
- Connection connection = connectHBase();
- Table table = connection.getTable(TableName.valueOf(PERSON_TABLE.getBytes()));
-
- Get get = new Get(key[0].getBytes());
-
- get.addColumn(family[0].getBytes(), column[0][0].getBytes());
- Result result = table.get(get);
- byte[] resultValue = result.value();
- assertArrayEquals(body[0][0][0].getBytes(), resultValue);
-
- IOHelper.close(table);
- }
-
- @Test
- public void testPutAndAppend() throws Exception {
- Map<String, Object> headers = new HashMap<>();
- headers.put(HBaseAttribute.HBASE_ROW_ID.asHeader(), key[0]);
- headers.put(HBaseAttribute.HBASE_FAMILY.asHeader(), family[0]);
- headers.put(HBaseAttribute.HBASE_QUALIFIER.asHeader(), column[0][0]);
- headers.put(HBaseAttribute.HBASE_VALUE.asHeader(), body[0][0][0]);
- headers.put(HBaseConstants.OPERATION, HBaseConstants.PUT);
- template.sendBodyAndHeaders("direct:start", null, headers);
-
- headers.put(HBaseAttribute.HBASE_QUALIFIER.asHeader(), column[0][1]);
- headers.put(HBaseAttribute.HBASE_VALUE.asHeader(), body[0][0][1]);
- headers.put(HBaseConstants.OPERATION, HBaseConstants.APPEND);
- template.sendBodyAndHeaders("direct:start", null, headers);
-
- Connection connection = connectHBase();
- Table table = connection.getTable(TableName.valueOf(PERSON_TABLE.getBytes()));
-
- Get get = new Get(key[0].getBytes());
- get.addColumn(family[0].getBytes(), column[0][0].getBytes());
- get.addColumn(family[0].getBytes(), column[0][1].getBytes());
- Result result = table.get(get);
- assertArrayEquals(body[0][0][0].getBytes(), result.getValue(family[0].getBytes(), column[0][0].getBytes()));
- assertArrayEquals(body[0][0][1].getBytes(), result.getValue(family[0].getBytes(), column[0][1].getBytes()));
-
- IOHelper.close(table);
- }
-
- @Test
- public void testPutAndIncrement() throws Exception {
- Map<String, Object> headers = new HashMap<>();
- headers.put(HBaseAttribute.HBASE_ROW_ID.asHeader(), key[0]);
- headers.put(HBaseAttribute.HBASE_FAMILY.asHeader(), family[1]);
- headers.put(HBaseAttribute.HBASE_QUALIFIER.asHeader(), column[1][2]);
- headers.put(HBaseAttribute.HBASE_VALUE.asHeader(), Long.valueOf(body[0][1][2]));
- headers.put(HBaseConstants.OPERATION, HBaseConstants.PUT);
- template.sendBodyAndHeaders("direct:start", null, headers);
-
- headers.put(HBaseAttribute.HBASE_VALUE.asHeader(), 1L);
- headers.put(HBaseConstants.OPERATION, HBaseConstants.INCREMENT);
- template.sendBodyAndHeaders("direct:start", null, headers);
-
- Connection connection = connectHBase();
- Table table = connection.getTable(TableName.valueOf(PERSON_TABLE.getBytes()));
-
- Get get = new Get(key[0].getBytes());
- get.addColumn(family[1].getBytes(), column[1][2].getBytes());
- Result result = table.get(get);
- assertEquals(Long.valueOf(body[0][1][2]) + 1, ByteBuffer.wrap(result.value()).getLong());
-
- IOHelper.close(table);
- }
-
- @Test
- public void testPutAndGet() throws Exception {
- testPut();
-
- Exchange resp = template.request("direct:start", exchange -> {
- exchange.getIn().setHeader(HBaseAttribute.HBASE_ROW_ID.asHeader(), key[0]);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_FAMILY.asHeader(), family[0]);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_QUALIFIER.asHeader(), column[0][0]);
- exchange.getIn().setHeader(HBaseConstants.OPERATION, HBaseConstants.GET);
- });
-
- assertEquals(body[0][0][0], resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader()));
- }
-
- @Test
- public void testPutAndGetWithModel() {
- Map<String, Object> headers = new HashMap<>();
- headers.put(HBaseConstants.OPERATION, HBaseConstants.PUT);
- int index = 1;
- for (int row = 0; row < key.length; row++) {
- for (int fam = 0; fam < family.length; fam++) {
- for (int col = 0; col < column[fam].length; col++) {
- headers.put(HBaseAttribute.HBASE_ROW_ID.asHeader(index), key[row]);
- headers.put(HBaseAttribute.HBASE_FAMILY.asHeader(index), family[fam]);
- headers.put(HBaseAttribute.HBASE_QUALIFIER.asHeader(index), column[fam][col]);
- headers.put(HBaseAttribute.HBASE_VALUE.asHeader(index++), body[row][fam][col]);
- }
- }
- }
-
- template.sendBodyAndHeaders("direct:start", null, headers);
-
- Exchange resp = template.request("direct:start-with-model", exchange -> {
- exchange.getIn().setHeader(HBaseAttribute.HBASE_ROW_ID.asHeader(), key[0]);
- exchange.getIn().setHeader(HBaseConstants.OPERATION, HBaseConstants.GET);
- });
-
- assertEquals(body[0][0][1], resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader()));
- assertEquals(body[0][1][2], resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader(2)));
- }
-
- @Test
- public void testPutMultiRows() throws Exception {
- Map<String, Object> headers = new HashMap<>();
- headers.put(HBaseConstants.OPERATION, HBaseConstants.PUT);
- for (int row = 0; row < key.length; row++) {
- headers.put(HBaseAttribute.HBASE_ROW_ID.asHeader(row + 1), key[row]);
- headers.put(HBaseAttribute.HBASE_FAMILY.asHeader(row + 1), family[0]);
- headers.put(HBaseAttribute.HBASE_QUALIFIER.asHeader(row + 1), column[0][0]);
- headers.put(HBaseAttribute.HBASE_VALUE.asHeader(row + 1), body[row][0][0]);
- }
-
- template.sendBodyAndHeaders("direct:start", null, headers);
-
- Connection conn = connectHBase();
- Table bar = conn.getTable(TableName.valueOf(PERSON_TABLE));
-
- //Check row 1
- for (int row = 0; row < key.length; row++) {
- Get get = new Get(key[row].getBytes());
- get.addColumn(family[0].getBytes(), column[0][0].getBytes());
- Result result = bar.get(get);
- byte[] resultValue = result.value();
- assertArrayEquals(body[row][0][0].getBytes(), resultValue);
- }
-
- IOHelper.close(bar);
- }
-
- @Test
- public void testPutAndGetMultiRows() throws Exception {
- testPutMultiRows();
-
- Exchange resp = template.request("direct:start", exchange -> {
- exchange.getIn().setHeader(HBaseConstants.OPERATION, HBaseConstants.GET);
- for (int row = 0; row < key.length; row++) {
- exchange.getIn().setHeader(HBaseAttribute.HBASE_ROW_ID.asHeader(row + 1), key[row]);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_FAMILY.asHeader(row + 1), family[0]);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_QUALIFIER.asHeader(row + 1), column[0][0]);
- }
- });
-
- for (int row = 0; row < key.length; row++) {
- assertEquals(body[row][0][0], resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader(row + 1)));
- }
- }
-
- @Test
- public void testPutMultiColumns() throws Exception {
-
- Map<String, Object> headers = new HashMap<>();
- headers.put(HBaseConstants.OPERATION, HBaseConstants.PUT);
- for (int col = 0; col < column[0].length; col++) {
- headers.put(HBaseAttribute.HBASE_ROW_ID.asHeader(col + 1), key[0]);
- headers.put(HBaseAttribute.HBASE_FAMILY.asHeader(col + 1), family[0]);
- headers.put(HBaseAttribute.HBASE_QUALIFIER.asHeader(col + 1), column[0][col]);
- headers.put(HBaseAttribute.HBASE_VALUE.asHeader(col + 1), body[0][col][0]);
- }
-
- template.sendBodyAndHeaders("direct:start", null, headers);
-
- Connection connection = connectHBase();
- Table bar = connection.getTable(TableName.valueOf(PERSON_TABLE.getBytes()));
-
- for (int col = 0; col < column[0].length; col++) {
- Get get = new Get(key[0].getBytes());
- get.addColumn(family[0].getBytes(), column[0][col].getBytes());
- Result result = bar.get(get);
- byte[] resultValue = result.value();
- assertArrayEquals(body[0][col][0].getBytes(), resultValue);
- }
-
- IOHelper.close(bar);
- }
-
- @Test
- public void testPutAndGetMultiColumns() throws Exception {
- testPutMultiColumns();
-
- Exchange resp = template.request("direct:start", exchange -> {
- exchange.getIn().setHeader(HBaseConstants.OPERATION, HBaseConstants.GET);
- for (int col = 0; col < column[0].length; col++) {
- exchange.getIn().setHeader(HBaseAttribute.HBASE_ROW_ID.asHeader(col + 1), key[0]);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_FAMILY.asHeader(col + 1), family[0]);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_QUALIFIER.asHeader(col + 1), column[0][col]);
- }
- });
-
- for (int col = 0; col < column[0].length; col++) {
- assertEquals(body[0][col][0], resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader(col + 1)));
- }
- }
-
- @Test
- public void testPutAndGetAndDeleteMultiRows() throws Exception {
- testPutMultiRows();
-
- Map<String, Object> headers = new HashMap<>();
- headers.put(HBaseConstants.OPERATION, HBaseConstants.DELETE);
- headers.put(HBaseAttribute.HBASE_ROW_ID.asHeader(), key[0]);
- template.sendBodyAndHeaders("direct:start", null, headers);
-
- Exchange resp = template.request("direct:start", exchange -> {
- exchange.getIn().setHeader(HBaseConstants.OPERATION, HBaseConstants.GET);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_ROW_ID.asHeader(), key[0]);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_FAMILY.asHeader(), family[0]);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_QUALIFIER.asHeader(), column[0][0]);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_ROW_ID.asHeader(2), key[1]);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_FAMILY.asHeader(2), family[0]);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_QUALIFIER.asHeader(2), column[0][0]);
- });
-
- assertEquals(null, resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader()));
- assertEquals(body[1][0][0], resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader(2)));
- }
-
- @Test
- public void testPutMultiRowsAndMaxScan() throws Exception {
- testPutMultiRows();
-
- Exchange resp = template.request("direct:maxScan", exchange -> {
- exchange.getIn().setHeader(HBaseAttribute.HBASE_FAMILY.asHeader(), family[0]);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_QUALIFIER.asHeader(), column[0][0]);
- });
-
- Object result1 = resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader(1));
- Object result2 = resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader(2));
- // as we use maxResults=2 we only get 2 results back
- Object result3 = resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader(3));
- assertNull(result3, "Should only get 2 results back");
-
- List<?> bodies = Arrays.asList(body[0][0][0], body[1][0][0]);
- assertTrue(bodies.contains(result1) && bodies.contains(result2));
- }
-
- @Test
- public void testPutMultiRowsAndScan() throws Exception {
- testPutMultiRows();
- Exchange resp = template.request("direct:scan", exchange -> {
- exchange.getIn().setHeader(HBaseAttribute.HBASE_FAMILY.asHeader(), family[0]);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_QUALIFIER.asHeader(), column[0][0]);
- });
-
- Object result1 = resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader(1));
- Object result2 = resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader(2));
- Object result3 = resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader(3));
-
- List<?> bodies = Arrays.asList(body[0][0][0], body[1][0][0], body[2][0][0]);
- assertTrue(bodies.contains(result1) && bodies.contains(result2) && bodies.contains(result3));
- }
-
- @Test
- public void testPutMultiRowsAndScanWithStop() throws Exception {
- testPutMultiRows();
- Exchange resp = template.request("direct:scan", exchange -> {
- exchange.getIn().setHeader(HBaseAttribute.HBASE_FAMILY.asHeader(), family[0]);
- exchange.getIn().setHeader(HBaseAttribute.HBASE_QUALIFIER.asHeader(), column[0][0]);
- exchange.getIn().setHeader(HBaseConstants.FROM_ROW, key[0]);
- exchange.getIn().setHeader(HBaseConstants.STOP_ROW, key[1]);
- });
-
- Object result1 = resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader(1));
- Object result2 = resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader(2));
- Object result3 = resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader(3));
-
- List<?> bodies = Arrays.asList(body[0][0][0], body[1][0][0], body[2][0][0]);
- assertTrue(bodies.contains(result1) && !bodies.contains(result2) && !bodies.contains(result3));
- }
-
- @Test
- public void testPutAndScan() throws Exception {
- Map<String, Object> headers = new HashMap<>();
- headers.put(HBaseConstants.OPERATION, HBaseConstants.PUT);
- headers.put(HBaseAttribute.HBASE_ROW_ID.asHeader(), "1");
- headers.put(HBaseAttribute.HBASE_FAMILY.asHeader(), "info");
- headers.put(HBaseAttribute.HBASE_QUALIFIER.asHeader(), "id");
- headers.put(HBaseAttribute.HBASE_VALUE.asHeader(), "3");
-
- template.sendBodyAndHeaders("direct:start", null, headers);
-
- Connection conn = connectHBase();
- Table bar = conn.getTable(TableName.valueOf(PERSON_TABLE));
-
- Get get = new Get("1".getBytes());
- get.addColumn("info".getBytes(), "id".getBytes());
- Result result = bar.get(get);
-
- assertArrayEquals("3".getBytes(), result.value());
-
- IOHelper.close(bar);
-
- Exchange resp = template.request("direct:scan", exchange -> {
- exchange.getIn().setHeader(HBaseAttribute.HBASE_FAMILY.asHeader(), "info");
- exchange.getIn().setHeader(HBaseAttribute.HBASE_QUALIFIER.asHeader(), "id");
- });
-
- assertEquals("1", resp.getMessage().getHeader(HBaseAttribute.HBASE_ROW_ID.asHeader()));
- assertEquals("info", resp.getMessage().getHeader(HBaseAttribute.HBASE_FAMILY.asHeader()));
- assertEquals("id", resp.getMessage().getHeader(HBaseAttribute.HBASE_QUALIFIER.asHeader()));
- assertEquals("3", resp.getMessage().getHeader(HBaseAttribute.HBASE_VALUE.asHeader()));
- }
-
- /**
- * Factory method which derived classes can use to create a {@link org.apache.camel.builder.RouteBuilder} to define
- * the routes for testing
- */
- @Override
- protected RouteBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start")
- .to("hbase://" + PERSON_TABLE);
- from("direct:start-with-model")
- .to("hbase://" + PERSON_TABLE
- + "?row.family=info&row.qualifier=firstName&row.family2=birthdate&row.qualifier2=year");
- from("direct:scan")
- .to("hbase://" + PERSON_TABLE + "?operation=" + HBaseConstants.SCAN);
- from("direct:maxScan")
- .to("hbase://" + PERSON_TABLE + "?operation=" + HBaseConstants.SCAN + "&maxResults=2");
- }
- };
- }
-}
diff --git a/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/processor/idempotent/HBaseIdempotentRepositoryIT.java b/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/processor/idempotent/HBaseIdempotentRepositoryIT.java
deleted file mode 100644
index b3a5508dc3d..00000000000
--- a/components/camel-hbase/src/test/java/org/apache/camel/component/hbase/processor/idempotent/HBaseIdempotentRepositoryIT.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.hbase.processor.idempotent;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.hbase.CamelHBaseTestSupport;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.spi.IdempotentRepository;
-import org.apache.hadoop.hbase.TableExistsException;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class HBaseIdempotentRepositoryIT extends CamelHBaseTestSupport {
-
- IdempotentRepository repository;
-
- private String key01 = "123";
- private String key02 = "456";
-
- @Override
- @BeforeEach
- public void setUp() throws Exception {
- this.repository = new HBaseIdempotentRepository(service.getConfiguration(), PERSON_TABLE, INFO_FAMILY, "mycolumn");
- super.setUp();
- try {
- createTable(PERSON_TABLE, INFO_FAMILY);
- } catch (TableExistsException ex) {
- //Ignore if table exists
- }
- }
-
- @Override
- @AfterEach
- public void tearDown() throws Exception {
- deleteTable(PERSON_TABLE);
- super.tearDown();
- }
-
- @Test
- public void testAdd() {
- // add first key
- assertTrue(repository.add(key01));
- assertTrue(repository.contains(key01));
-
- // try to add an other one
- assertTrue(repository.add(key02));
- assertTrue(repository.contains(key02));
-
- // try to add the first key again
- assertFalse(repository.add(key01));
- }
-
- @Test
- public void testContains() {
- assertFalse(repository.contains(key01));
-
- // add key and check again
- assertTrue(repository.add(key01));
- assertTrue(repository.contains(key01));
- }
-
- @Test
- public void testRemove() {
- // add key to remove
- assertTrue(repository.add(key01));
- assertTrue(repository.contains(key01));
- // assertEquals(1, dataSet.size());
-
- // remove key
- assertTrue(repository.remove(key01));
- //assertEquals(0, dataSet.size());
-
- // try to remove a key that isn't there
- assertFalse(repository.remove(key02));
- }
-
- @Test
- public void testClear() {
- // add key to remove
- assertTrue(repository.add(key01));
- assertTrue(repository.add(key02));
- assertTrue(repository.contains(key01));
- assertTrue(repository.contains(key02));
-
- // remove key
- repository.clear();
-
- assertFalse(repository.contains(key01));
- assertFalse(repository.contains(key02));
- }
-
- @Test
- public void testConfirm() {
- // it always return true
- assertTrue(repository.confirm(key01));
- }
-
- @Test
- public void testRepositoryInRoute() throws Exception {
- MockEndpoint mock = (MockEndpoint) context.getEndpoint("mock:out");
- mock.expectedBodiesReceived("a", "b");
- // c is a duplicate
-
- // send 3 message with one duplicated key (key01)
- template.sendBodyAndHeader("direct:in", "a", "messageId", key01);
- template.sendBodyAndHeader("direct:in", "b", "messageId", key02);
- template.sendBodyAndHeader("direct:in", "c", "messageId", key01);
-
- MockEndpoint.assertIsSatisfied(context);
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:in")
- .idempotentConsumer(header("messageId"), repository)
- .to("mock:out");
- }
- };
- }
-}
diff --git a/components/camel-hbase/src/test/resources/hbase-site.xml b/components/camel-hbase/src/test/resources/hbase-site.xml
deleted file mode 100644
index 710ce57ae9c..00000000000
--- a/components/camel-hbase/src/test/resources/hbase-site.xml
+++ /dev/null
@@ -1,134 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
-<configuration>
- <property>
- <name>hbase.regionserver.msginterval</name>
- <value>1000</value>
- <description>Interval between messages from the RegionServer to HMaster
- in milliseconds. Default is 15. Set this value low if you want unit
- tests to be responsive.
- </description>
- </property>
- <property>
- <name>hbase.client.pause</name>
- <value>5000</value>
- <description>General client pause value. Used mostly as value to wait
- before running a retry of a failed get, region lookup, etc.</description>
- </property>
- <property>
- <name>hbase.master.meta.thread.rescanfrequency</name>
- <value>10000</value>
- <description>How long the HMaster sleeps (in milliseconds) between scans of
- the root and meta tables.
- </description>
- </property>
- <property>
- <name>hbase.server.thread.wakefrequency</name>
- <value>1000</value>
- <description>Time to sleep in between searches for work (in milliseconds).
- Used as sleep interval by service threads such as META scanner and log roller.
- </description>
- </property>
- <property>
- <name>hbase.regionserver.handler.count</name>
- <value>5</value>
- <description>Count of RPC Server instances spun up on RegionServers
- Same property is used by the HMaster for count of master handlers.
- Default is 10.
- </description>
- </property>
- <property>
- <name>hbase.master.lease.period</name>
- <value>6000</value>
- <description>Length of time the master will wait before timing out a region
- server lease. Since region servers report in every second (see above), this
- value has been reduced so that the master will notice a dead region server
- sooner. The default is 30 seconds.
- </description>
- </property>
- <property>
- <name>hbase.master.info.port</name>
- <value>-1</value>
- <description>The port for the hbase master web UI
- Set to -1 if you do not want the info server to run.
- </description>
- </property>
- <property>
- <name>hbase.regionserver.info.port</name>
- <value>-1</value>
- <description>The port for the hbase regionserver web UI
- Set to -1 if you do not want the info server to run.
- </description>
- </property>
- <property>
- <name>hbase.regionserver.info.port.auto</name>
- <value>true</value>
- <description>Info server auto port bind. Enables automatic port
- search if hbase.regionserver.info.port is already in use.
- Enabled for testing to run multiple tests on one machine.
- </description>
- </property>
- <property>
- <name>hbase.master.lease.thread.wakefrequency</name>
- <value>3000</value>
- <description>The interval between checks for expired region server leases.
- This value has been reduced due to the other reduced values above so that
- the master will notice a dead region server sooner. The default is 15 seconds.
- </description>
- </property>
- <property>
- <name>hbase.regionserver.optionalcacheflushinterval</name>
- <value>10000</value>
- <description>
- Amount of time to wait since the last time a region was flushed before
- invoking an optional cache flush. Default 60,000.
- </description>
- </property>
- <property>
- <name>hbase.regionserver.safemode</name>
- <value>false</value>
- <description>
- Turn on/off safe mode in region server. Always on for production, always off
- for tests.
- </description>
- </property>
- <property>
- <name>hbase.hregion.max.filesize</name>
- <value>67108864</value>
- <description>
- Maximum desired file size for an HRegion. If filesize exceeds
- value + (value / 2), the HRegion is split in two. Default: 256M.
-
- Keep the maximum filesize small so we split more often in tests.
- </description>
- </property>
- <property>
- <name>hadoop.log.dir</name>
- <value>${user.dir}/../logs</value>
- </property>
- <property>
- <name>hbase.zookeeper.property.clientPort</name>
- <value>21818</value>
- <description>Property from ZooKeeper's config zoo.cfg.
- The port at which the clients will connect.
- </description>
- </property>
-</configuration>
diff --git a/components/camel-hbase/src/test/resources/log4j2.properties b/components/camel-hbase/src/test/resources/log4j2.properties
deleted file mode 100644
index 17230080aa1..00000000000
--- a/components/camel-hbase/src/test/resources/log4j2.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements. See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License. You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-
-appender.file.type = File
-appender.file.name = file
-appender.file.fileName = target/camel-hbase-test.log
-appender.file.layout.type = PatternLayout
-appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
-
-appender.out.type = Console
-appender.out.name = out
-appender.out.layout.type = PatternLayout
-appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
-
-logger.hbase.name = org.apache.camel.component.hbase
-logger.hbase.level = WARN
-logger.hbase.additivity = true
-
-rootLogger.level = INFO
-rootLogger.appenderRef.file.ref = file
diff --git a/components/pom.xml b/components/pom.xml
index de54384fcf2..c36338f907f 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -152,7 +152,6 @@
<module>camel-guava-eventbus</module>
<module>camel-hashicorp-vault</module>
<module>camel-hazelcast</module>
- <module>camel-hbase</module>
<module>camel-hdfs</module>
<module>camel-headersmap</module>
<module>camel-hl7</module>
diff --git a/core/camel-core-engine/src/main/docs/modules/eips/pages/idempotentConsumer-eip.adoc b/core/camel-core-engine/src/main/docs/modules/eips/pages/idempotentConsumer-eip.adoc
index da8d599433b..75804c49f1a 100644
--- a/core/camel-core-engine/src/main/docs/modules/eips/pages/idempotentConsumer-eip.adoc
+++ b/core/camel-core-engine/src/main/docs/modules/eips/pages/idempotentConsumer-eip.adoc
@@ -37,7 +37,6 @@ Camel provides the following Idempotent Consumer implementations:
xref:ROOT:cql-component.adoc[NamedCassandraIdempotentRepository]
* xref:ROOT:ehcache-component.adoc[EHCacheIdempotentRepository]
* xref:ROOT:hazelcast-summary.adoc[HazelcastIdempotentRepository]
-* xref:ROOT:hbase-component.adoc[HBaseIdempotentRepository]
* xref:ROOT:infinispan-component.adoc[InfinispanIdempotentRepository]
xref:ROOT:infinispan-component.adoc[InfinispanEmbeddedIdempotentRepository]
xref:ROOT:infinispan-component.adoc[InfinispanRemoteIdempotentRepository]
diff --git a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
index 78b0aeecd30..bb30b10ae41 100644
--- a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
+++ b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
@@ -132,7 +132,6 @@ hazelcast-ringbuffer
hazelcast-seda
hazelcast-set
hazelcast-topic
-hbase
hdfs
http
https
diff --git a/docs/components/modules/ROOT/examples/json/hbase.json b/docs/components/modules/ROOT/examples/json/hbase.json
deleted file mode 120000
index b2bf786070a..00000000000
--- a/docs/components/modules/ROOT/examples/json/hbase.json
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../components/camel-hbase/src/generated/resources/org/apache/camel/component/hbase/hbase.json
\ No newline at end of file
diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc
index daaad36ee5a..4801eb2210f 100644
--- a/docs/components/modules/ROOT/nav.adoc
+++ b/docs/components/modules/ROOT/nav.adoc
@@ -138,7 +138,6 @@
*** xref:hazelcast-seda-component.adoc[Hazelcast SEDA]
*** xref:hazelcast-set-component.adoc[Hazelcast Set]
*** xref:hazelcast-topic-component.adoc[Hazelcast Topic]
-** xref:hbase-component.adoc[HBase]
** xref:hdfs-component.adoc[HDFS]
** xref:http-component.adoc[HTTP]
** xref:hwcloud-summary.adoc[Huawei Cloud]
diff --git a/docs/components/modules/ROOT/pages/hbase-component.adoc b/docs/components/modules/ROOT/pages/hbase-component.adoc
deleted file mode 120000
index 90919754951..00000000000
--- a/docs/components/modules/ROOT/pages/hbase-component.adoc
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../components/camel-hbase/src/main/docs/hbase-component.adoc
\ No newline at end of file
diff --git a/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc b/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc
index da841406fae..23bba28aad2 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc
@@ -17,6 +17,7 @@ The following components has been removed:
- camel-caffeine-lrucache
- camel-cdi
- camel-elasticsearch-rest
+- camel-hbase
- camel-ipfs
- camel-microprofile-metrics
- camel-opentracing
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
index 0868aba6f4f..55ec59dea67 100644
--- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
@@ -1820,20 +1820,6 @@ public interface ComponentsBuilderFactory {
static org.apache.camel.builder.component.dsl.HazelcastTopicComponentBuilderFactory.HazelcastTopicComponentBuilder hazelcastTopic() {
return org.apache.camel.builder.component.dsl.HazelcastTopicComponentBuilderFactory.hazelcastTopic();
}
- /**
- * HBase (camel-hbase)
- * Reading and write from/to an HBase store (Hadoop database).
- *
- * Category: bigdata,database,hadoop
- * Since: 2.10
- * Maven coordinates: org.apache.camel:camel-hbase
- *
- * @return the dsl builder
- */
- @Deprecated
- static org.apache.camel.builder.component.dsl.HbaseComponentBuilderFactory.HbaseComponentBuilder hbase() {
- return org.apache.camel.builder.component.dsl.HbaseComponentBuilderFactory.hbase();
- }
/**
* HDFS (camel-hdfs)
* Read and write from/to an HDFS filesystem using Hadoop 2.x.
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HbaseComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HbaseComponentBuilderFactory.java
deleted file mode 100644
index 88d2e6ce9d3..00000000000
--- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HbaseComponentBuilderFactory.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.builder.component.dsl;
-
-import javax.annotation.processing.Generated;
-import org.apache.camel.Component;
-import org.apache.camel.builder.component.AbstractComponentBuilder;
-import org.apache.camel.builder.component.ComponentBuilder;
-import org.apache.camel.component.hbase.HBaseComponent;
-
-/**
- * Reading and write from/to an HBase store (Hadoop database).
- *
- * Generated by camel-package-maven-plugin - do not edit this file!
- */
-@Generated("org.apache.camel.maven.packaging.ComponentDslMojo")
-public interface HbaseComponentBuilderFactory {
-
- /**
- * HBase (camel-hbase)
- * Reading and write from/to an HBase store (Hadoop database).
- *
- * Category: bigdata,database,hadoop
- * Since: 2.10
- * Maven coordinates: org.apache.camel:camel-hbase
- *
- * @return the dsl builder
- */
- @Deprecated
- static HbaseComponentBuilder hbase() {
- return new HbaseComponentBuilderImpl();
- }
-
- /**
- * Builder for the HBase component.
- */
- interface HbaseComponentBuilder extends ComponentBuilder<HBaseComponent> {
- /**
- * Maximum number of references to keep for each table in the HTable
- * pool. The default value is 10.
- *
- * The option is a: <code>int</code> type.
- *
- * Default: 10
- * Group: common
- *
- * @param poolMaxSize the value to set
- * @return the dsl builder
- */
- default HbaseComponentBuilder poolMaxSize(int poolMaxSize) {
- doSetProperty("poolMaxSize", poolMaxSize);
- return this;
- }
- /**
- * Allows for bridging the consumer to the Camel routing Error Handler,
- * which mean any exceptions occurred while the consumer is trying to
- * pickup incoming messages, or the likes, will now be processed as a
- * message and handled by the routing Error Handler. By default the
- * consumer will use the org.apache.camel.spi.ExceptionHandler to deal
- * with exceptions, that will be logged at WARN or ERROR level and
- * ignored.
- *
- * The option is a: <code>boolean</code> type.
- *
- * Default: false
- * Group: consumer
- *
- * @param bridgeErrorHandler the value to set
- * @return the dsl builder
- */
- default HbaseComponentBuilder bridgeErrorHandler(
- boolean bridgeErrorHandler) {
- doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
- return this;
- }
- /**
- * Whether the producer should be started lazy (on the first message).
- * By starting lazy you can use this to allow CamelContext and routes to
- * startup in situations where a producer may otherwise fail during
- * starting and cause the route to fail being started. By deferring this
- * startup to be lazy then the startup failure can be handled during
- * routing messages via Camel's routing error handlers. Beware that when
- * the first message is processed then creating and starting the
- * producer may take a little time and prolong the total processing time
- * of the processing.
- *
- * The option is a: <code>boolean</code> type.
- *
- * Default: false
- * Group: producer
- *
- * @param lazyStartProducer the value to set
- * @return the dsl builder
- */
- default HbaseComponentBuilder lazyStartProducer(
- boolean lazyStartProducer) {
- doSetProperty("lazyStartProducer", lazyStartProducer);
- return this;
- }
- /**
- * Whether autowiring is enabled. This is used for automatic autowiring
- * options (the option must be marked as autowired) by looking up in the
- * registry to find if there is a single instance of matching type,
- * which then gets configured on the component. This can be used for
- * automatic configuring JDBC data sources, JMS connection factories,
- * AWS Clients, etc.
- *
- * The option is a: <code>boolean</code> type.
- *
- * Default: true
- * Group: advanced
- *
- * @param autowiredEnabled the value to set
- * @return the dsl builder
- */
- default HbaseComponentBuilder autowiredEnabled(boolean autowiredEnabled) {
- doSetProperty("autowiredEnabled", autowiredEnabled);
- return this;
- }
- /**
- * To use the shared configuration.
- *
- * The option is a:
- * <code>org.apache.hadoop.conf.Configuration</code> type.
- *
- * Group: advanced
- *
- * @param configuration the value to set
- * @return the dsl builder
- */
- default HbaseComponentBuilder configuration(
- org.apache.hadoop.conf.Configuration configuration) {
- doSetProperty("configuration", configuration);
- return this;
- }
- }
-
- class HbaseComponentBuilderImpl
- extends
- AbstractComponentBuilder<HBaseComponent>
- implements
- HbaseComponentBuilder {
- @Override
- protected HBaseComponent buildConcreteComponent() {
- return new HBaseComponent();
- }
- @Override
- protected boolean setPropertyOnComponent(
- Component component,
- String name,
- Object value) {
- switch (name) {
- case "poolMaxSize": ((HBaseComponent) component).setPoolMaxSize((int) value); return true;
- case "bridgeErrorHandler": ((HBaseComponent) component).setBridgeErrorHandler((boolean) value); return true;
- case "lazyStartProducer": ((HBaseComponent) component).setLazyStartProducer((boolean) value); return true;
- case "autowiredEnabled": ((HBaseComponent) component).setAutowiredEnabled((boolean) value); return true;
- case "configuration": ((HBaseComponent) component).setConfiguration((org.apache.hadoop.conf.Configuration) value); return true;
- default: return false;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/dsl/camel-componentdsl/src/generated/resources/metadata.json b/dsl/camel-componentdsl/src/generated/resources/metadata.json
index 9961944b78d..916a394b034 100644
--- a/dsl/camel-componentdsl/src/generated/resources/metadata.json
+++ b/dsl/camel-componentdsl/src/generated/resources/metadata.json
@@ -2971,28 +2971,6 @@
"producerOnly": false,
"lenientProperties": false
},
- "HbaseComponentBuilderFactory": {
- "kind": "component",
- "name": "hbase",
- "title": "HBase",
- "description": "Reading and write from\/to an HBase store (Hadoop database).",
- "deprecated": true,
- "firstVersion": "2.10.0",
- "label": "bigdata,database,hadoop",
- "javaType": "org.apache.camel.component.hbase.HBaseComponent",
- "supportLevel": "Stable",
- "groupId": "org.apache.camel",
- "artifactId": "camel-hbase",
- "version": "4.0.0-SNAPSHOT",
- "scheme": "hbase",
- "extendsScheme": "",
- "syntax": "hbase:tableName",
- "async": false,
- "api": false,
- "consumerOnly": false,
- "producerOnly": false,
- "lenientProperties": false
- },
"HdfsComponentBuilderFactory": {
"kind": "component",
"name": "hdfs",
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
index 778d5c11cc7..8ea0d29caf9 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
@@ -138,7 +138,6 @@ public interface EndpointBuilderFactory
org.apache.camel.builder.endpoint.dsl.GridFsEndpointBuilderFactory.GridFsBuilders,
org.apache.camel.builder.endpoint.dsl.GrpcEndpointBuilderFactory.GrpcBuilders,
org.apache.camel.builder.endpoint.dsl.GuavaEventBusEndpointBuilderFactory.GuavaEventBusBuilders,
- org.apache.camel.builder.endpoint.dsl.HBaseEndpointBuilderFactory.HBaseBuilders,
org.apache.camel.builder.endpoint.dsl.HashicorpVaultEndpointBuilderFactory.HashicorpVaultBuilders,
org.apache.camel.builder.endpoint.dsl.HazelcastAtomicnumberEndpointBuilderFactory.HazelcastAtomicnumberBuilders,
org.apache.camel.builder.endpoint.dsl.HazelcastInstanceEndpointBuilderFactory.HazelcastInstanceBuilders,
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
index 4e9f4ab698c..07c0b6a734f 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
@@ -135,7 +135,6 @@ public interface EndpointBuilders
org.apache.camel.builder.endpoint.dsl.GridFsEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.GrpcEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.GuavaEventBusEndpointBuilderFactory,
- org.apache.camel.builder.endpoint.dsl.HBaseEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.HashicorpVaultEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.HazelcastAtomicnumberEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.HazelcastInstanceEndpointBuilderFactory,
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
index e729b4d195c..46162fb3e49 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
@@ -6231,51 +6231,6 @@ public class StaticEndpointBuilders {
String path) {
return org.apache.camel.builder.endpoint.dsl.HazelcastTopicEndpointBuilderFactory.endpointBuilder(componentName, path);
}
- /**
- * HBase (camel-hbase)
- * Reading and write from/to an HBase store (Hadoop database).
- *
- * Category: bigdata,database,hadoop
- * Since: 2.10
- * Maven coordinates: org.apache.camel:camel-hbase
- *
- * Syntax: <code>hbase:tableName</code>
- *
- * Path parameter: tableName (required)
- * The name of the table
- *
- * @param path tableName
- * @return the dsl builder
- */
- @Deprecated
- public static org.apache.camel.builder.endpoint.dsl.HBaseEndpointBuilderFactory.HBaseEndpointBuilder hbase(
- String path) {
- return org.apache.camel.builder.endpoint.dsl.HBaseEndpointBuilderFactory.endpointBuilder("hbase", path);
- }
- /**
- * HBase (camel-hbase)
- * Reading and write from/to an HBase store (Hadoop database).
- *
- * Category: bigdata,database,hadoop
- * Since: 2.10
- * Maven coordinates: org.apache.camel:camel-hbase
- *
- * Syntax: <code>hbase:tableName</code>
- *
- * Path parameter: tableName (required)
- * The name of the table
- *
- * @param componentName to use a custom component name for the endpoint
- * instead of the default name
- * @param path tableName
- * @return the dsl builder
- */
- @Deprecated
- public static org.apache.camel.builder.endpoint.dsl.HBaseEndpointBuilderFactory.HBaseEndpointBuilder hbase(
- String componentName,
- String path) {
- return org.apache.camel.builder.endpoint.dsl.HBaseEndpointBuilderFactory.endpointBuilder(componentName, path);
- }
/**
* HDFS (camel-hdfs)
* Read and write from/to an HDFS filesystem using Hadoop 2.x.
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HBaseEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HBaseEndpointBuilderFactory.java
deleted file mode 100644
index b908569363a..00000000000
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HBaseEndpointBuilderFactory.java
+++ /dev/null
@@ -1,1233 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.builder.endpoint.dsl;
-
-import java.util.*;
-import java.util.Map;
-import java.util.concurrent.*;
-import java.util.function.*;
-import java.util.stream.*;
-import javax.annotation.processing.Generated;
-import org.apache.camel.builder.EndpointConsumerBuilder;
-import org.apache.camel.builder.EndpointProducerBuilder;
-import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
-
-/**
- * Reading and write from/to an HBase store (Hadoop database).
- *
- * Generated by camel build tools - do NOT edit this file!
- */
-@Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
-public interface HBaseEndpointBuilderFactory {
-
-
- /**
- * Builder for endpoint consumers for the HBase component.
- */
- public interface HBaseEndpointConsumerBuilder
- extends
- EndpointConsumerBuilder {
- default AdvancedHBaseEndpointConsumerBuilder advanced() {
- return (AdvancedHBaseEndpointConsumerBuilder) this;
- }
- /**
- * To use a custom CellMappingStrategyFactory that is responsible for
- * mapping cells.
- *
- * The option is a:
- * <code>org.apache.camel.component.hbase.mapping.CellMappingStrategyFactory</code> type.
- *
- * Group: common
- *
- * @param cellMappingStrategyFactory the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder cellMappingStrategyFactory(
- org.apache.camel.component.hbase.mapping.CellMappingStrategyFactory cellMappingStrategyFactory) {
- doSetProperty("cellMappingStrategyFactory", cellMappingStrategyFactory);
- return this;
- }
- /**
- * To use a custom CellMappingStrategyFactory that is responsible for
- * mapping cells.
- *
- * The option will be converted to a
- * <code>org.apache.camel.component.hbase.mapping.CellMappingStrategyFactory</code> type.
- *
- * Group: common
- *
- * @param cellMappingStrategyFactory the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder cellMappingStrategyFactory(
- String cellMappingStrategyFactory) {
- doSetProperty("cellMappingStrategyFactory", cellMappingStrategyFactory);
- return this;
- }
- /**
- * A list of filters to use.
- *
- * The option is a:
- * <code>java.util.List&lt;org.apache.hadoop.hbase.filter.Filter&gt;</code> type.
- *
- * Group: common
- *
- * @param filters the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder filters(
- List<org.apache.hadoop.hbase.filter.Filter> filters) {
- doSetProperty("filters", filters);
- return this;
- }
- /**
- * A list of filters to use.
- *
- * The option will be converted to a
- * <code>java.util.List&lt;org.apache.hadoop.hbase.filter.Filter&gt;</code> type.
- *
- * Group: common
- *
- * @param filters the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder filters(String filters) {
- doSetProperty("filters", filters);
- return this;
- }
- /**
- * The class name of a custom mapping strategy implementation.
- *
- * The option is a: <code>java.lang.String</code> type.
- *
- * Group: common
- *
- * @param mappingStrategyClassName the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder mappingStrategyClassName(
- String mappingStrategyClassName) {
- doSetProperty("mappingStrategyClassName", mappingStrategyClassName);
- return this;
- }
- /**
- * The strategy to use for mapping Camel messages to HBase columns.
- * Supported values: header, or body.
- *
- * The option is a: <code>java.lang.String</code> type.
- *
- * Group: common
- *
- * @param mappingStrategyName the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder mappingStrategyName(
- String mappingStrategyName) {
- doSetProperty("mappingStrategyName", mappingStrategyName);
- return this;
- }
- /**
- * To map the key/values from the Map to a HBaseRow. 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.
- *
- * The option is a: <code>java.util.Map&lt;java.lang.String,
- * java.lang.Object&gt;</code> type.
- * The option is multivalued, and you can use the rowMapping(String,
- * Object) method to add a value (call the method multiple times to set
- * more values).
- *
- * Group: common
- *
- * @param key the option key
- * @param value the option value
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder rowMapping(String key, Object value) {
- doSetMultiValueProperty("rowMapping", "row." + key, value);
- return this;
- }
- /**
- * To map the key/values from the Map to a HBaseRow. 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.
- *
- * The option is a: <code>java.util.Map&lt;java.lang.String,
- * java.lang.Object&gt;</code> type.
- * The option is multivalued, and you can use the rowMapping(String,
- * Object) method to add a value (call the method multiple times to set
- * more values).
- *
- * Group: common
- *
- * @param values the values
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder rowMapping(Map values) {
- doSetMultiValueProperties("rowMapping", "row.", values);
- return this;
- }
- /**
- * An instance of org.apache.camel.component.hbase.model.HBaseRow which
- * describes how each row should be modeled.
- *
- * The option is a:
- * <code>org.apache.camel.component.hbase.model.HBaseRow</code> type.
- *
- * Group: common
- *
- * @param rowModel the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder rowModel(
- org.apache.camel.component.hbase.model.HBaseRow rowModel) {
- doSetProperty("rowModel", rowModel);
- return this;
- }
- /**
- * An instance of org.apache.camel.component.hbase.model.HBaseRow which
- * describes how each row should be modeled.
- *
- * The option will be converted to a
- * <code>org.apache.camel.component.hbase.model.HBaseRow</code> type.
- *
- * Group: common
- *
- * @param rowModel the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder rowModel(String rowModel) {
- doSetProperty("rowModel", rowModel);
- return this;
- }
- /**
- * Defines privileges to communicate with HBase such as using kerberos.
- *
- * The option is a:
- * <code>org.apache.hadoop.security.UserGroupInformation</code> type.
- *
- * Group: common
- *
- * @param userGroupInformation the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder userGroupInformation(
- org.apache.hadoop.security.UserGroupInformation userGroupInformation) {
- doSetProperty("userGroupInformation", userGroupInformation);
- return this;
- }
- /**
- * Defines privileges to communicate with HBase such as using kerberos.
- *
- * The option will be converted to a
- * <code>org.apache.hadoop.security.UserGroupInformation</code> type.
- *
- * Group: common
- *
- * @param userGroupInformation the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder userGroupInformation(
- String userGroupInformation) {
- doSetProperty("userGroupInformation", userGroupInformation);
- return this;
- }
- /**
- * 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.
- *
- * The option is a: <code>int</code> type.
- *
- * Group: consumer
- *
- * @param maxMessagesPerPoll the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder maxMessagesPerPoll(
- int maxMessagesPerPoll) {
- doSetProperty("maxMessagesPerPoll", maxMessagesPerPoll);
- return this;
- }
- /**
- * 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.
- *
- * The option will be converted to a <code>int</code> type.
- *
- * Group: consumer
- *
- * @param maxMessagesPerPoll the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder maxMessagesPerPoll(
- String maxMessagesPerPoll) {
- doSetProperty("maxMessagesPerPoll", maxMessagesPerPoll);
- return this;
- }
- /**
- * The HBase operation to perform.
- *
- * The option is a: <code>java.lang.String</code> type.
- *
- * Group: consumer
- *
- * @param operation the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder operation(String operation) {
- doSetProperty("operation", operation);
- return this;
- }
- /**
- * If the option is true, Camel HBase Consumer will remove the rows
- * which it processes.
- *
- * The option is a: <code>boolean</code> type.
- *
- * Default: true
- * Group: consumer
- *
- * @param remove the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder remove(boolean remove) {
- doSetProperty("remove", remove);
- return this;
- }
- /**
- * If the option is true, Camel HBase Consumer will remove the rows
- * which it processes.
- *
- * The option will be converted to a <code>boolean</code>
- * type.
- *
- * Default: true
- * Group: consumer
- *
- * @param remove the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder remove(String remove) {
- doSetProperty("remove", remove);
- return this;
- }
- /**
- * To use a custom HBaseRemoveHandler that is executed when a row is to
- * be removed.
- *
- * The option is a:
- * <code>org.apache.camel.component.hbase.HBaseRemoveHandler</code> type.
- *
- * Group: consumer
- *
- * @param removeHandler the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder removeHandler(
- org.apache.camel.component.hbase.HBaseRemoveHandler removeHandler) {
- doSetProperty("removeHandler", removeHandler);
- return this;
- }
- /**
- * To use a custom HBaseRemoveHandler that is executed when a row is to
- * be removed.
- *
- * The option will be converted to a
- * <code>org.apache.camel.component.hbase.HBaseRemoveHandler</code> type.
- *
- * Group: consumer
- *
- * @param removeHandler the value to set
- * @return the dsl builder
- */
- default HBaseEndpointConsumerBuilder removeHandler(String removeHandler) {
- doSetProperty("removeHandler", removeHandler);
- return this;
- }
- }
-
- /**
- * Advanced builder for endpoint consumers for the HBase component.
- */
- public interface AdvancedHBaseEndpointConsumerBuilder
- extends
- EndpointConsumerBuilder {
- default HBaseEndpointConsumerBuilder basic() {
- return (HBaseEndpointConsumerBuilder) this;
- }
- /**
- * Allows for bridging the consumer to the Camel routing Error Handler,
- * which mean any exceptions occurred while the consumer is trying to
- * pickup incoming messages, or the likes, will now be processed as a
- * message and handled by the routing Error Handler. By default the
- * consumer will use the org.apache.camel.spi.ExceptionHandler to deal
- * with exceptions, that will be logged at WARN or ERROR level and
- * ignored.
- *
- * The option is a: <code>boolean</code> type.
- *
- * Default: false
- * Group: consumer (advanced)
- *
- * @param bridgeErrorHandler the value to set
- * @return the dsl builder
- */
- default AdvancedHBaseEndpointConsumerBuilder bridgeErrorHandler(
- boolean bridgeErrorHandler) {
- doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
- return this;
- }
- /**
- * Allows for bridging the consumer to the Camel routing Error Handler,
- * which mean any exceptions occurred while the consumer is trying to
- * pickup incoming messages, or the likes, will now be processed as a
- * message and handled by the routing Error Handler. By default the
- * consumer will use the org.apache.camel.spi.ExceptionHandler to deal
- * with exceptions, that will be logged at WARN or ERROR level and
- * ignored.
- *
- * The option will be converted to a <code>boolean</code>
- * type.
- *
- * Default: false
- * Group: consumer (advanced)
- *
- * @param bridgeErrorHandler the value to set
- * @return the dsl builder
- */
- default AdvancedHBaseEndpointConsumerBuilder bridgeErrorHandler(
- String bridgeErrorHandler) {
- doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
- return this;
- }
- /**
- * To let the consumer use a custom ExceptionHandler. Notice if the
- * option bridgeErrorHandler is enabled then this option is not in use.
- * By default the consumer will deal with exceptions, that will be
- * logged at WARN or ERROR level and ignored.
- *
- * The option is a:
- * <code>org.apache.camel.spi.ExceptionHandler</code> type.
- *
- * Group: consumer (advanced)
- *
- * @param exceptionHandler the value to set
- * @return the dsl builder
- */
- default AdvancedHBaseEndpointConsumerBuilder exceptionHandler(
- org.apache.camel.spi.ExceptionHandler exceptionHandler) {
- doSetProperty("exceptionHandler", exceptionHandler);
- return this;
- }
- /**
- * To let the consumer use a custom ExceptionHandler. Notice if the
- * option bridgeErrorHandler is enabled then this option is not in use.
- * By default the consumer will deal with exceptions, that will be
- * logged at WARN or ERROR level and ignored.
- *
- * The option will be converted to a
- * <code>org.apache.camel.spi.ExceptionHandler</code> type.
- *
- * Group: consumer (advanced)
- *
- * @param exceptionHandler the value to set
- * @return the dsl builder
- */
- default AdvancedHBaseEndpointConsumerBuilder exceptionHandler(
- String exceptionHandler) {
- doSetProperty("exceptionHandler", exceptionHandler);
- return this;
- }
- /**
- * Sets the exchange pattern when the consumer creates an exchange.
- *
- * The option is a:
- * <code>org.apache.camel.ExchangePattern</code> type.
- *
- * Group: consumer (advanced)
- *
- * @param exchangePattern the value to set
- * @return the dsl builder
- */
- default AdvancedHBaseEndpointConsumerBuilder exchangePattern(
- org.apache.camel.ExchangePattern exchangePattern) {
- doSetProperty("exchangePattern", exchangePattern);
- return this;
- }
- /**
- * Sets the exchange pattern when the consumer creates an exchange.
- *
- * The option will be converted to a
- * <code>org.apache.camel.ExchangePattern</code> type.
- *
- * Group: consumer (advanced)
- *
- * @param exchangePattern the value to set
- * @return the dsl builder
- */
- default AdvancedHBaseEndpointConsumerBuilder exchangePattern(
- String exchangePattern) {
- doSetProperty("exchangePattern", exchangePattern);
- return this;
- }
- }
-
- /**
- * Builder for endpoint producers for the HBase component.
- */
- public interface HBaseEndpointProducerBuilder
- extends
- EndpointProducerBuilder {
- default AdvancedHBaseEndpointProducerBuilder advanced() {
- return (AdvancedHBaseEndpointProducerBuilder) this;
- }
- /**
- * To use a custom CellMappingStrategyFactory that is responsible for
- * mapping cells.
- *
- * The option is a:
- * <code>org.apache.camel.component.hbase.mapping.CellMappingStrategyFactory</code> type.
- *
- * Group: common
- *
- * @param cellMappingStrategyFactory the value to set
- * @return the dsl builder
- */
- default HBaseEndpointProducerBuilder cellMappingStrategyFactory(
- org.apache.camel.component.hbase.mapping.CellMappingStrategyFactory cellMappingStrategyFactory) {
- doSetProperty("cellMappingStrategyFactory", cellMappingStrategyFactory);
- return this;
- }
- /**
- * To use a custom CellMappingStrategyFactory that is responsible for
- * mapping cells.
- *
- * The option will be converted to a
- * <code>org.apache.camel.component.hbase.mapping.CellMappingStrategyFactory</code> type.
- *
- * Group: common
- *
- * @param cellMappingStrategyFactory the value to set
- * @return the dsl builder
- */
- default HBaseEndpointProducerBuilder cellMappingStrategyFactory(
- String cellMappingStrategyFactory) {
- doSetProperty("cellMappingStrategyFactory", cellMappingStrategyFactory);
- return this;
- }
- /**
- * A list of filters to use.
- *
- * The option is a:
- * <code>java.util.List&lt;org.apache.hadoop.hbase.filter.Filter&gt;</code> type.
- *
- * Group: common
- *
- * @param filters the value to set
- * @return the dsl builder
- */
- default HBaseEndpointProducerBuilder filters(
- List<org.apache.hadoop.hbase.filter.Filter> filters) {
- doSetProperty("filters", filters);
- return this;
- }
- /**
- * A list of filters to use.
- *
- * The option will be converted to a
- * <code>java.util.List&lt;org.apache.hadoop.hbase.filter.Filter&gt;</code> type.
- *
- * Group: common
- *
- * @param filters the value to set
- * @return the dsl builder
- */
- default HBaseEndpointProducerBuilder filters(String filters) {
- doSetProperty("filters", filters);
- return this;
- }
- /**
- * The class name of a custom mapping strategy implementation.
- *
- * The option is a: <code>java.lang.String</code> type.
- *
- * Group: common
- *
- * @param mappingStrategyClassName the value to set
- * @return the dsl builder
- */
- default HBaseEndpointProducerBuilder mappingStrategyClassName(
- String mappingStrategyClassName) {
- doSetProperty("mappingStrategyClassName", mappingStrategyClassName);
- return this;
- }
- /**
- * The strategy to use for mapping Camel messages to HBase columns.
- * Supported values: header, or body.
- *
- * The option is a: <code>java.lang.String</code> type.
- *
- * Group: common
- *
- * @param mappingStrategyName the value to set
- * @return the dsl builder
- */
- default HBaseEndpointProducerBuilder mappingStrategyName(
- String mappingStrategyName) {
- doSetProperty("mappingStrategyName", mappingStrategyName);
- return this;
- }
- /**
- * To map the key/values from the Map to a HBaseRow. 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.
- *
- * The option is a: <code>java.util.Map&lt;java.lang.String,
- * java.lang.Object&gt;</code> type.
- * The option is multivalued, and you can use the rowMapping(String,
- * Object) method to add a value (call the method multiple times to set
- * more values).
- *
- * Group: common
- *
- * @param key the option key
- * @param value the option value
- * @return the dsl builder
- */
- default HBaseEndpointProducerBuilder rowMapping(String key, Object value) {
- doSetMultiValueProperty("rowMapping", "row." + key, value);
- return this;
- }
- /**
- * To map the key/values from the Map to a HBaseRow. 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.
- *
- * The option is a: <code>java.util.Map&lt;java.lang.String,
- * java.lang.Object&gt;</code> type.
- * The option is multivalued, and you can use the rowMapping(String,
- * Object) method to add a value (call the method multiple times to set
- * more values).
- *
- * Group: common
- *
- * @param values the values
- * @return the dsl builder
- */
- default HBaseEndpointProducerBuilder rowMapping(Map values) {
- doSetMultiValueProperties("rowMapping", "row.", values);
- return this;
- }
- /**
- * An instance of org.apache.camel.component.hbase.model.HBaseRow which
- * describes how each row should be modeled.
- *
- * The option is a:
- * <code>org.apache.camel.component.hbase.model.HBaseRow</code> type.
- *
- * Group: common
- *
- * @param rowModel the value to set
- * @return the dsl builder
- */
- default HBaseEndpointProducerBuilder rowModel(
- org.apache.camel.component.hbase.model.HBaseRow rowModel) {
- doSetProperty("rowModel", rowModel);
- return this;
- }
- /**
- * An instance of org.apache.camel.component.hbase.model.HBaseRow which
- * describes how each row should be modeled.
- *
- * The option will be converted to a
- * <code>org.apache.camel.component.hbase.model.HBaseRow</code> type.
- *
- * Group: common
- *
- * @param rowModel the value to set
- * @return the dsl builder
- */
- default HBaseEndpointProducerBuilder rowModel(String rowModel) {
- doSetProperty("rowModel", rowModel);
- return this;
- }
- /**
- * Defines privileges to communicate with HBase such as using kerberos.
- *
- * The option is a:
- * <code>org.apache.hadoop.security.UserGroupInformation</code> type.
- *
- * Group: common
- *
- * @param userGroupInformation the value to set
- * @return the dsl builder
- */
- default HBaseEndpointProducerBuilder userGroupInformation(
- org.apache.hadoop.security.UserGroupInformation userGroupInformation) {
- doSetProperty("userGroupInformation", userGroupInformation);
- return this;
- }
- /**
- * Defines privileges to communicate with HBase such as using kerberos.
- *
- * The option will be converted to a
- * <code>org.apache.hadoop.security.UserGroupInformation</code> type.
- *
- * Group: common
- *
- * @param userGroupInformation the value to set
- * @return the dsl builder
- */
- default HBaseEndpointProducerBuilder userGroupInformation(
- String userGroupInformation) {
- doSetProperty("userGroupInformation", userGroupInformation);
- return this;
- }
- /**
- * The maximum number of rows to scan.
- *
- * The option is a: <code>int</code> type.
- *
- * Default: 100
- * Group: producer
- *
- * @param maxResults the value to set
- * @return the dsl builder
- */
- default HBaseEndpointProducerBuilder maxResults(int maxResults) {
- doSetProperty("maxResults", maxResults);
- return this;
- }
- /**
- * The maximum number of rows to scan.
- *
- * The option will be converted to a <code>int</code> type.
- *
- * Default: 100
- * Group: producer
- *
- * @param maxResults the value to set
- * @return the dsl builder
- */
- default HBaseEndpointProducerBuilder maxResults(String maxResults) {
- doSetProperty("maxResults", maxResults);
- return this;
- }
- }
-
- /**
- * Advanced builder for endpoint producers for the HBase component.
- */
- public interface AdvancedHBaseEndpointProducerBuilder
- extends
- EndpointProducerBuilder {
- default HBaseEndpointProducerBuilder basic() {
- return (HBaseEndpointProducerBuilder) this;
- }
- /**
- * Whether the producer should be started lazy (on the first message).
- * By starting lazy you can use this to allow CamelContext and routes to
- * startup in situations where a producer may otherwise fail during
- * starting and cause the route to fail being started. By deferring this
- * startup to be lazy then the startup failure can be handled during
- * routing messages via Camel's routing error handlers. Beware that when
- * the first message is processed then creating and starting the
- * producer may take a little time and prolong the total processing time
- * of the processing.
- *
- * The option is a: <code>boolean</code> type.
- *
- * Default: false
- * Group: producer (advanced)
- *
- * @param lazyStartProducer the value to set
- * @return the dsl builder
- */
- default AdvancedHBaseEndpointProducerBuilder lazyStartProducer(
- boolean lazyStartProducer) {
- doSetProperty("lazyStartProducer", lazyStartProducer);
- return this;
- }
- /**
- * Whether the producer should be started lazy (on the first message).
- * By starting lazy you can use this to allow CamelContext and routes to
- * startup in situations where a producer may otherwise fail during
- * starting and cause the route to fail being started. By deferring this
- * startup to be lazy then the startup failure can be handled during
- * routing messages via Camel's routing error handlers. Beware that when
- * the first message is processed then creating and starting the
- * producer may take a little time and prolong the total processing time
- * of the processing.
- *
- * The option will be converted to a <code>boolean</code>
- * type.
- *
- * Default: false
- * Group: producer (advanced)
- *
- * @param lazyStartProducer the value to set
- * @return the dsl builder
- */
- default AdvancedHBaseEndpointProducerBuilder lazyStartProducer(
- String lazyStartProducer) {
- doSetProperty("lazyStartProducer", lazyStartProducer);
- return this;
- }
- }
-
- /**
- * Builder for endpoint for the HBase component.
- */
- public interface HBaseEndpointBuilder
- extends
- HBaseEndpointConsumerBuilder,
- HBaseEndpointProducerBuilder {
- default AdvancedHBaseEndpointBuilder advanced() {
- return (AdvancedHBaseEndpointBuilder) this;
- }
- /**
- * To use a custom CellMappingStrategyFactory that is responsible for
- * mapping cells.
- *
- * The option is a:
- * <code>org.apache.camel.component.hbase.mapping.CellMappingStrategyFactory</code> type.
- *
- * Group: common
- *
- * @param cellMappingStrategyFactory the value to set
- * @return the dsl builder
- */
- default HBaseEndpointBuilder cellMappingStrategyFactory(
- org.apache.camel.component.hbase.mapping.CellMappingStrategyFactory cellMappingStrategyFactory) {
- doSetProperty("cellMappingStrategyFactory", cellMappingStrategyFactory);
- return this;
- }
- /**
- * To use a custom CellMappingStrategyFactory that is responsible for
- * mapping cells.
- *
- * The option will be converted to a
- * <code>org.apache.camel.component.hbase.mapping.CellMappingStrategyFactory</code> type.
- *
- * Group: common
- *
- * @param cellMappingStrategyFactory the value to set
- * @return the dsl builder
- */
- default HBaseEndpointBuilder cellMappingStrategyFactory(
- String cellMappingStrategyFactory) {
- doSetProperty("cellMappingStrategyFactory", cellMappingStrategyFactory);
- return this;
- }
- /**
- * A list of filters to use.
- *
- * The option is a:
- * <code>java.util.List&lt;org.apache.hadoop.hbase.filter.Filter&gt;</code> type.
- *
- * Group: common
- *
- * @param filters the value to set
- * @return the dsl builder
- */
- default HBaseEndpointBuilder filters(
- List<org.apache.hadoop.hbase.filter.Filter> filters) {
- doSetProperty("filters", filters);
- return this;
- }
- /**
- * A list of filters to use.
- *
- * The option will be converted to a
- * <code>java.util.List&lt;org.apache.hadoop.hbase.filter.Filter&gt;</code> type.
- *
- * Group: common
- *
- * @param filters the value to set
- * @return the dsl builder
- */
- default HBaseEndpointBuilder filters(String filters) {
- doSetProperty("filters", filters);
- return this;
- }
- /**
- * The class name of a custom mapping strategy implementation.
- *
- * The option is a: <code>java.lang.String</code> type.
- *
- * Group: common
- *
- * @param mappingStrategyClassName the value to set
- * @return the dsl builder
- */
- default HBaseEndpointBuilder mappingStrategyClassName(
- String mappingStrategyClassName) {
- doSetProperty("mappingStrategyClassName", mappingStrategyClassName);
- return this;
- }
- /**
- * The strategy to use for mapping Camel messages to HBase columns.
- * Supported values: header, or body.
- *
- * The option is a: <code>java.lang.String</code> type.
- *
- * Group: common
- *
- * @param mappingStrategyName the value to set
- * @return the dsl builder
- */
- default HBaseEndpointBuilder mappingStrategyName(
- String mappingStrategyName) {
- doSetProperty("mappingStrategyName", mappingStrategyName);
- return this;
- }
- /**
- * To map the key/values from the Map to a HBaseRow. 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.
- *
- * The option is a: <code>java.util.Map&lt;java.lang.String,
- * java.lang.Object&gt;</code> type.
- * The option is multivalued, and you can use the rowMapping(String,
- * Object) method to add a value (call the method multiple times to set
- * more values).
- *
- * Group: common
- *
- * @param key the option key
- * @param value the option value
- * @return the dsl builder
- */
- default HBaseEndpointBuilder rowMapping(String key, Object value) {
- doSetMultiValueProperty("rowMapping", "row." + key, value);
- return this;
- }
- /**
- * To map the key/values from the Map to a HBaseRow. 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.
- *
- * The option is a: <code>java.util.Map&lt;java.lang.String,
- * java.lang.Object&gt;</code> type.
- * The option is multivalued, and you can use the rowMapping(String,
- * Object) method to add a value (call the method multiple times to set
- * more values).
- *
- * Group: common
- *
- * @param values the values
- * @return the dsl builder
- */
- default HBaseEndpointBuilder rowMapping(Map values) {
- doSetMultiValueProperties("rowMapping", "row.", values);
- return this;
- }
- /**
- * An instance of org.apache.camel.component.hbase.model.HBaseRow which
- * describes how each row should be modeled.
- *
- * The option is a:
- * <code>org.apache.camel.component.hbase.model.HBaseRow</code> type.
- *
- * Group: common
- *
- * @param rowModel the value to set
- * @return the dsl builder
- */
- default HBaseEndpointBuilder rowModel(
- org.apache.camel.component.hbase.model.HBaseRow rowModel) {
- doSetProperty("rowModel", rowModel);
- return this;
- }
- /**
- * An instance of org.apache.camel.component.hbase.model.HBaseRow which
- * describes how each row should be modeled.
- *
- * The option will be converted to a
- * <code>org.apache.camel.component.hbase.model.HBaseRow</code> type.
- *
- * Group: common
- *
- * @param rowModel the value to set
- * @return the dsl builder
- */
- default HBaseEndpointBuilder rowModel(String rowModel) {
- doSetProperty("rowModel", rowModel);
- return this;
- }
- /**
- * Defines privileges to communicate with HBase such as using kerberos.
- *
- * The option is a:
- * <code>org.apache.hadoop.security.UserGroupInformation</code> type.
- *
- * Group: common
- *
- * @param userGroupInformation the value to set
- * @return the dsl builder
- */
- default HBaseEndpointBuilder userGroupInformation(
- org.apache.hadoop.security.UserGroupInformation userGroupInformation) {
- doSetProperty("userGroupInformation", userGroupInformation);
- return this;
- }
- /**
- * Defines privileges to communicate with HBase such as using kerberos.
- *
- * The option will be converted to a
- * <code>org.apache.hadoop.security.UserGroupInformation</code> type.
- *
- * Group: common
- *
- * @param userGroupInformation the value to set
- * @return the dsl builder
- */
- default HBaseEndpointBuilder userGroupInformation(
- String userGroupInformation) {
- doSetProperty("userGroupInformation", userGroupInformation);
- return this;
- }
- }
-
- /**
- * Advanced builder for endpoint for the HBase component.
- */
- public interface AdvancedHBaseEndpointBuilder
- extends
- AdvancedHBaseEndpointConsumerBuilder,
- AdvancedHBaseEndpointProducerBuilder {
- default HBaseEndpointBuilder basic() {
- return (HBaseEndpointBuilder) this;
- }
- }
-
- public interface HBaseBuilders {
- /**
- * HBase (camel-hbase)
- * Reading and write from/to an HBase store (Hadoop database).
- *
- * Category: bigdata,database,hadoop
- * Since: 2.10
- * Maven coordinates: org.apache.camel:camel-hbase
- *
- * @return the dsl builder for the headers' name.
- */
- default HBaseHeaderNameBuilder hbase() {
- return HBaseHeaderNameBuilder.INSTANCE;
- }
- /**
- * HBase (camel-hbase)
- * Reading and write from/to an HBase store (Hadoop database).
- *
- * Category: bigdata,database,hadoop
- * Since: 2.10
- * Maven coordinates: org.apache.camel:camel-hbase
- *
- * Syntax: <code>hbase:tableName</code>
- *
- * Path parameter: tableName (required)
- * The name of the table
- *
- * @param path tableName
- * @return the dsl builder
- */
- @Deprecated
- default HBaseEndpointBuilder hbase(String path) {
- return HBaseEndpointBuilderFactory.endpointBuilder("hbase", path);
- }
- /**
- * HBase (camel-hbase)
- * Reading and write from/to an HBase store (Hadoop database).
- *
- * Category: bigdata,database,hadoop
- * Since: 2.10
- * Maven coordinates: org.apache.camel:camel-hbase
- *
- * Syntax: <code>hbase:tableName</code>
- *
- * Path parameter: tableName (required)
- * The name of the table
- *
- * @param componentName to use a custom component name for the endpoint
- * instead of the default name
- * @param path tableName
- * @return the dsl builder
- */
- @Deprecated
- default HBaseEndpointBuilder hbase(String componentName, String path) {
- return HBaseEndpointBuilderFactory.endpointBuilder(componentName, path);
- }
- }
-
- /**
- * The builder of headers' name for the HBase component.
- */
- public static class HBaseHeaderNameBuilder {
- /**
- * The internal instance of the builder used to access to all the
- * methods representing the name of headers.
- */
- private static final HBaseHeaderNameBuilder INSTANCE = new HBaseHeaderNameBuilder();
-
- /**
- * The HBase operation to perform.
- *
- * The option is a: {@code String} type.
- *
- * Group: producer
- *
- * @return the name of the header {@code HBaseOperation}.
- */
- public String hBaseOperation() {
- return "HBaseOperation";
- }
-
- /**
- * The maximum number of rows to scan.
- *
- * The option is a: {@code Integer} type.
- *
- * Group: producer
- *
- * @return the name of the header {@code HBaseMaxScanResults}.
- */
- public String hBaseMaxScanResults() {
- return "HBaseMaxScanResults";
- }
-
- /**
- * The row to start scanner at or after.
- *
- * The option is a: {@code String} type.
- *
- * Group: producer
- *
- * @return the name of the header {@code HBaseStartRow}.
- */
- public String hBaseStartRow() {
- return "HBaseStartRow";
- }
-
- /**
- * The row to end at (exclusive).
- *
- * The option is a: {@code String} type.
- *
- * Group: producer
- *
- * @return the name of the header {@code HBaseStopRow}.
- */
- public String hBaseStopRow() {
- return "HBaseStopRow";
- }
-
- /**
- * The strategy to use for mapping Camel messages to HBase columns.
- * Supported values: header body.
- *
- * The option is a: {@code String} type.
- *
- * Group: common
- *
- * @return the name of the header {@code MappingStrategy}.
- */
- public String mappingStrategy() {
- return "MappingStrategy";
- }
-
- /**
- * The class name of a custom mapping strategy implementation.
- *
- * The option is a: {@code String} type.
- *
- * Group: common
- *
- * @return the name of the header {@code MappingStrategyClassName}.
- */
- public String mappingStrategyClassName() {
- return "MappingStrategyClassName";
- }
-
- /**
- * The marked row id.
- *
- * The option is a: {@code byte[]} type.
- *
- * Group: consumer
- *
- * @return the name of the header {@code HBaseMarkedRowId}.
- */
- public String hBaseMarkedRowId() {
- return "HBaseMarkedRowId";
- }
- }
- @Deprecated
- static HBaseEndpointBuilder endpointBuilder(
- String componentName,
- String path) {
- class HBaseEndpointBuilderImpl extends AbstractEndpointBuilder implements HBaseEndpointBuilder, AdvancedHBaseEndpointBuilder {
- public HBaseEndpointBuilderImpl(String path) {
- super(componentName, path);
- }
- }
- return new HBaseEndpointBuilderImpl(path);
- }
-}
\ No newline at end of file
diff --git a/parent/pom.xml b/parent/pom.xml
index aefc31f050d..4efef497c25 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -224,7 +224,6 @@
<hawtbuf-version>1.11</hawtbuf-version>
<hawtdispatch-version>1.22</hawtdispatch-version>
<hazelcast-version>5.2.1</hazelcast-version>
- <hbase-version>2.5.2</hbase-version>
<hdrhistrogram-version>2.1.11</hdrhistrogram-version>
<hibernate-validator-version>8.0.0.Final</hibernate-validator-version>
<hibernate-version>5.6.14.Final</hibernate-version>
@@ -1390,11 +1389,6 @@
<artifactId>camel-hazelcast</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-hbase</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-hdfs</artifactId>
diff --git a/test-infra/camel-test-infra-hbase/pom.xml b/test-infra/camel-test-infra-hbase/pom.xml
deleted file mode 100644
index 126b643e1cb..00000000000
--- a/test-infra/camel-test-infra-hbase/pom.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>camel-test-infra-parent</artifactId>
- <groupId>org.apache.camel</groupId>
- <relativePath>../camel-test-infra-parent/pom.xml</relativePath>
- <version>4.0.0-SNAPSHOT</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>camel-test-infra-hbase</artifactId>
- <name>Camel :: Test Infra :: HBase</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test-infra-common</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- </dependency>
-
- <dependency>
- <groupId>org.testcontainers</groupId>
- <artifactId>testcontainers</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.hbase</groupId>
- <artifactId>hbase-testing-util</artifactId>
- <version>${hbase-version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-reload4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- <!-- has SNAPSHOT in its pom.xml that causes maven problems -->
- <exclusion>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.el</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
-
-</project>
\ No newline at end of file
diff --git a/test-infra/camel-test-infra-hbase/src/main/resources/META-INF/MANIFEST.MF b/test-infra/camel-test-infra-hbase/src/main/resources/META-INF/MANIFEST.MF
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/common/HBaseProperties.java b/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/common/HBaseProperties.java
deleted file mode 100644
index 93a04401bb3..00000000000
--- a/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/common/HBaseProperties.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.camel.test.infra.hbase.common;
-
-public final class HBaseProperties {
-
- private HBaseProperties() {
-
- }
-}
diff --git a/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/services/HBaseContainer.java b/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/services/HBaseContainer.java
deleted file mode 100644
index 934c22fc9b5..00000000000
--- a/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/services/HBaseContainer.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.test.infra.hbase.services;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HBaseConfiguration;
-import org.apache.hadoop.hbase.HBaseTestingUtility;
-import org.testcontainers.containers.GenericContainer;
-
-/**
- * Currently there is no official HBase docker image. This is dummy implementation of the HBase container.
- */
-public class HBaseContainer extends GenericContainer {
-
- // must be the same as in the config of camel component
- private static final Integer CLIENT_PORT = 21818;
-
- private final HBaseTestingUtility hbaseUtil;
-
- public HBaseContainer() {
- hbaseUtil = new HBaseTestingUtility(defaultConf());
- }
-
- public HBaseContainer(Configuration conf) {
- hbaseUtil = new HBaseTestingUtility(conf);
- }
-
- @Override
- public void start() {
- try {
- hbaseUtil.startMiniCluster(1);
- } catch (Exception e) {
- logger().warn("couldn't start HBase cluster. Test is not started, but passed!", e);
- }
- }
-
- @Override
- public void stop() {
- try {
- hbaseUtil.shutdownMiniCluster();
- } catch (Exception e) {
- logger().warn("Error shutting down the HBase container", e);
- }
- }
-
- public static Configuration defaultConf() {
- Configuration conf = HBaseConfiguration.create();
- conf.set("test.hbase.zookeeper.property.clientPort", CLIENT_PORT.toString());
- return conf;
- }
-
-}
diff --git a/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/services/HBaseLocalContainerService.java b/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/services/HBaseLocalContainerService.java
deleted file mode 100644
index 873926f6b75..00000000000
--- a/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/services/HBaseLocalContainerService.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.test.infra.hbase.services;
-
-import org.apache.camel.test.infra.common.services.ContainerService;
-import org.apache.hadoop.conf.Configuration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class HBaseLocalContainerService implements HBaseService, ContainerService<HBaseContainer> {
- private static final Logger LOG = LoggerFactory.getLogger(HBaseLocalContainerService.class);
-
- private final HBaseContainer container;
-
- public HBaseLocalContainerService() {
- container = initContainer();
- }
-
- public HBaseLocalContainerService(HBaseContainer container) {
- this.container = container;
- }
-
- protected HBaseContainer initContainer() {
- return new HBaseContainer();
- }
-
- @Override
- public void registerProperties() {
- // NO-OP
- }
-
- @Override
- public void initialize() {
- LOG.info("Trying to start the HBase container");
- container.start();
-
- registerProperties();
- }
-
- @Override
- public void shutdown() {
- LOG.info("Stopping the HBase container");
- container.stop();
- }
-
- @Override
- public HBaseContainer getContainer() {
- return container;
- }
-
- @Override
- public Configuration getConfiguration() {
- return HBaseContainer.defaultConf();
- }
-}
diff --git a/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/services/HBaseService.java b/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/services/HBaseService.java
deleted file mode 100644
index 858efb13cdf..00000000000
--- a/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/services/HBaseService.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.test.infra.hbase.services;
-
-import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.hadoop.conf.Configuration;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
-
-/**
- * Test infra service for HBase
- */
-public interface HBaseService extends BeforeAllCallback, AfterAllCallback, TestService {
-
- Configuration getConfiguration();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- initialize();
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- shutdown();
- }
-}
diff --git a/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/services/HBaseServiceFactory.java b/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/services/HBaseServiceFactory.java
deleted file mode 100644
index eac5f30b921..00000000000
--- a/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/services/HBaseServiceFactory.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.test.infra.hbase.services;
-
-import org.apache.camel.test.infra.common.services.SimpleTestServiceBuilder;
-import org.apache.camel.test.infra.common.services.SingletonService;
-import org.apache.hadoop.conf.Configuration;
-import org.junit.jupiter.api.extension.ExtensionContext;
-
-public final class HBaseServiceFactory {
- static class SingletonHBaseService extends SingletonService<HBaseService> implements HBaseService {
- public SingletonHBaseService(HBaseService service, String name) {
- super(service, name);
- }
-
- @Override
- public Configuration getConfiguration() {
- return getService().getConfiguration();
- }
-
- @Override
- public void beforeAll(ExtensionContext extensionContext) {
- addToStore(extensionContext);
- }
-
- @Override
- public void afterAll(ExtensionContext extensionContext) {
- // NO-OP
- }
- }
-
- private static SimpleTestServiceBuilder<HBaseService> instance;
- private static HBaseService service;
-
- private HBaseServiceFactory() {
-
- }
-
- public static SimpleTestServiceBuilder<HBaseService> builder() {
- return new SimpleTestServiceBuilder<>("hbase");
- }
-
- public static HBaseService createService() {
- return builder()
- .addLocalMapping(HBaseLocalContainerService::new)
- .build();
- }
-
- public static HBaseService createSingletonService() {
- if (service == null) {
- if (instance == null) {
- instance = builder();
-
- instance.addLocalMapping(() -> new SingletonHBaseService(new HBaseLocalContainerService(), "hbase"));
- }
-
- service = instance.build();
- }
-
- return service;
- }
-}
diff --git a/test-infra/pom.xml b/test-infra/pom.xml
index 55c4635d49d..8b92ce06215 100644
--- a/test-infra/pom.xml
+++ b/test-infra/pom.xml
@@ -55,7 +55,6 @@
<module>camel-test-infra-arangodb</module>
<module>camel-test-infra-consul</module>
<module>camel-test-infra-google-pubsub</module>
- <module>camel-test-infra-hbase</module>
<module>camel-test-infra-infinispan</module>
<module>camel-test-infra-microprofile-lra</module>
<module>camel-test-infra-minio</module>