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 2015/11/24 19:21:21 UTC
[1/6] camel git commit: setter to be able to assign UGI
Repository: camel
Updated Branches:
refs/heads/master db823eaec -> f5ec28b0a
setter to be able to assign UGI
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7f51008d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7f51008d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7f51008d
Branch: refs/heads/master
Commit: 7f51008d991cd8edaf321af1e5098ca1a3adadc6
Parents: 67144c1
Author: woj-i <wo...@gmail.com>
Authored: Wed Oct 21 18:40:54 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Nov 24 19:07:55 2015 +0100
----------------------------------------------------------------------
.../org/apache/camel/component/hbase/HBaseEndpoint.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/7f51008d/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseEndpoint.java
----------------------------------------------------------------------
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
index f89e742..2abc6f1 100644
--- 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
@@ -230,8 +230,15 @@ public class HBaseEndpoint extends DefaultEndpoint {
this.maxMessagesPerPoll = maxMessagesPerPoll;
}
+ /**
+ * Defines privileges to communicate with HBase table by {@link #getTable()}
+ * @param ugi
+ */
+ public void setUgi(UserGroupInformation ugi) {
+ this.ugi = ugi;
+ }
- /**
+ /**
* 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!
[3/6] camel git commit: annotate ugi as a parameter (to be passed by
beanId)
Posted by da...@apache.org.
annotate ugi as a parameter (to be passed by beanId)
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/67144c1f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/67144c1f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/67144c1f
Branch: refs/heads/master
Commit: 67144c1f7e7261ab834cedfd30f4fc5b34fe1c92
Parents: e0b3255
Author: woj-i <wo...@gmail.com>
Authored: Wed Oct 21 18:10:44 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Nov 24 19:07:55 2015 +0100
----------------------------------------------------------------------
.../java/org/apache/camel/component/hbase/HBaseEndpoint.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/67144c1f/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseEndpoint.java
----------------------------------------------------------------------
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
index 109418c..f89e742 100644
--- 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
@@ -68,14 +68,14 @@ public class HBaseEndpoint extends DefaultEndpoint {
private HBaseRow rowModel;
@UriParam(label = "consumer")
private int maxMessagesPerPoll;
+ @UriParam(description = "UserGroupInformation for HBase communication. If not specified, then Camel talks with HBase without Kerberos")
+ private UserGroupInformation ugi;
/**
* in the purpose of performance optimization
*/
private byte[] tableNameBytes;
- private UserGroupInformation ugi = null;
-
public HBaseEndpoint(String uri, HBaseComponent component, HTablePool tablePool, String tableName) {
super(uri, component);
this.tableName = tableName;
[4/6] camel git commit: code formating
Posted by da...@apache.org.
code formating
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3c013e9a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3c013e9a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3c013e9a
Branch: refs/heads/master
Commit: 3c013e9a647d42a60cab2662fa416b7aa8780bb2
Parents: 7f51008
Author: woj-i <wo...@gmail.com>
Authored: Fri Oct 23 09:53:38 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Nov 24 19:07:56 2015 +0100
----------------------------------------------------------------------
.../camel/component/hbase/HBaseEndpoint.java | 50 ++++++++++----------
.../camel/component/hbase/HBaseProducer.java | 20 +++++---
2 files changed, 38 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/3c013e9a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseEndpoint.java
----------------------------------------------------------------------
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
index 2abc6f1..a8f94d0 100644
--- 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
@@ -71,10 +71,10 @@ public class HBaseEndpoint extends DefaultEndpoint {
@UriParam(description = "UserGroupInformation for HBase communication. If not specified, then Camel talks with HBase without Kerberos")
private UserGroupInformation ugi;
- /**
- * in the purpose of performance optimization
- */
- private byte[] tableNameBytes;
+ /**
+ * in the purpose of performance optimization
+ */
+ private byte[] tableNameBytes;
public HBaseEndpoint(String uri, HBaseComponent component, HTablePool tablePool, String tableName) {
super(uri, component);
@@ -82,9 +82,9 @@ public class HBaseEndpoint extends DefaultEndpoint {
this.tablePool = tablePool;
if (this.tableName == null) {
throw new IllegalArgumentException("Table name can not be null");
- }else{
- tableNameBytes = tableName.getBytes();
- }
+ } else {
+ tableNameBytes = tableName.getBytes();
+ }
}
public Producer createProducer() throws Exception {
@@ -92,7 +92,7 @@ public class HBaseEndpoint extends DefaultEndpoint {
}
public Consumer createConsumer(Processor processor) throws Exception {
- HBaseConsumer consumer = new HBaseConsumer(this, processor);
+ HBaseConsumer consumer = new HBaseConsumer(this, processor);
configureConsumer(consumer);
consumer.setMaxMessagesPerPoll(maxMessagesPerPoll);
return consumer;
@@ -232,27 +232,27 @@ public class HBaseEndpoint extends DefaultEndpoint {
/**
* Defines privileges to communicate with HBase table by {@link #getTable()}
- * @param ugi
+ * @param ugi
*/
public void setUgi(UserGroupInformation ugi) {
this.ugi = ugi;
}
/**
- * 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 HTableInterface getTable(){
- if (ugi!=null){
- return ugi.doAs(new PrivilegedAction<HTableInterface>() {
- @Override
- public HTableInterface run() {
- return tablePool.getTable(tableNameBytes);
- }
- });
- }else{
- return tablePool.getTable(tableNameBytes);
- }
- }
+ * 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 HTableInterface getTable() {
+ if (ugi != null) {
+ return ugi.doAs(new PrivilegedAction<HTableInterface>() {
+ @Override
+ public HTableInterface run() {
+ return tablePool.getTable(tableNameBytes);
+ }
+ });
+ } else {
+ return tablePool.getTable(tableNameBytes);
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/camel/blob/3c013e9a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseProducer.java
----------------------------------------------------------------------
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
index 215e502..dcdc57b 100644
--- 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
@@ -57,7 +57,7 @@ public class HBaseProducer extends DefaultProducer implements ServicePoolAware {
}
public void process(Exchange exchange) throws Exception {
- HTableInterface table = endpoint.getTable();
+ HTableInterface table = endpoint.getTable();
try {
updateHeaders(exchange);
@@ -100,7 +100,7 @@ public class HBaseProducer extends DefaultProducer implements ServicePoolAware {
mappingStrategy.applyScanResults(exchange.getOut(), new HBaseData(scanOperationResult));
}
} finally {
- table.close();
+ table.close();
}
}
@@ -124,7 +124,8 @@ public class HBaseProducer extends DefaultProducer implements ServicePoolAware {
ObjectHelper.notNull(family, "HBase column family", cell);
ObjectHelper.notNull(column, "HBase column", cell);
- put.add(HBaseHelper.getHBaseFieldAsBytes(family), HBaseHelper.getHBaseFieldAsBytes(column), endpoint.getCamelContext().getTypeConverter().convertTo(byte[].class, value));
+ put.add(HBaseHelper.getHBaseFieldAsBytes(family), HBaseHelper.getHBaseFieldAsBytes(column),
+ endpoint.getCamelContext().getTypeConverter().convertTo(byte[].class, value));
}
return put;
}
@@ -168,7 +169,8 @@ public class HBaseProducer extends DefaultProducer implements ServicePoolAware {
List<KeyValue> kvs = result.getColumn(HBaseHelper.getHBaseFieldAsBytes(family), HBaseHelper.getHBaseFieldAsBytes(column));
if (kvs != null && !kvs.isEmpty()) {
//Return the most recent entry.
- resultCell.setValue(endpoint.getCamelContext().getTypeConverter().convertTo(cellModel.getValueType(), kvs.get(0).getValue()));
+ resultCell
+ .setValue(endpoint.getCamelContext().getTypeConverter().convertTo(cellModel.getValueType(), kvs.get(0).getValue()));
resultCell.setTimestamp(kvs.get(0).getTimestamp());
}
resultCells.add(resultCell);
@@ -190,7 +192,8 @@ public class HBaseProducer extends DefaultProducer implements ServicePoolAware {
* 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(HTableInterface table, HBaseRow model, String start, Integer maxRowScan, List<Filter> filters) throws Exception {
+ private List<HBaseRow> scanCells(HTableInterface table, HBaseRow model, String start, Integer maxRowScan, List<Filter> filters)
+ throws Exception {
List<HBaseRow> rowSet = new LinkedList<HBaseRow>();
HBaseRow startRow = new HBaseRow(model.getCells());
@@ -249,7 +252,9 @@ public class HBaseProducer extends DefaultProducer implements ServicePoolAware {
resultCell.setQualifier(modelCell.getQualifier());
if (result.getColumnLatest(HBaseHelper.getHBaseFieldAsBytes(family), HBaseHelper.getHBaseFieldAsBytes(column)) != null) {
- resultCell.setTimestamp(result.getColumnLatest(HBaseHelper.getHBaseFieldAsBytes(family), HBaseHelper.getHBaseFieldAsBytes(column)).getTimestamp());
+ resultCell.setTimestamp(
+ result.getColumnLatest(HBaseHelper.getHBaseFieldAsBytes(family), HBaseHelper.getHBaseFieldAsBytes(column))
+ .getTimestamp());
}
resultRow.getCells().add(resultCell);
}
@@ -272,7 +277,8 @@ public class HBaseProducer extends DefaultProducer implements ServicePoolAware {
exchange.getIn().setHeader(CellMappingStrategyFactory.STRATEGY, endpoint.getMappingStrategyName());
}
- if (endpoint.getMappingStrategyName() != null && exchange.getIn().getHeader(CellMappingStrategyFactory.STRATEGY_CLASS_NAME) == null) {
+ if (endpoint.getMappingStrategyName() != null &&
+ exchange.getIn().getHeader(CellMappingStrategyFactory.STRATEGY_CLASS_NAME) == null) {
exchange.getIn().setHeader(CellMappingStrategyFactory.STRATEGY_CLASS_NAME, endpoint.getMappingStrategyClassName());
}
[2/6] camel git commit: handling UGI within camel-hbase
Posted by da...@apache.org.
handling UGI within camel-hbase
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e0b3255c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e0b3255c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e0b3255c
Branch: refs/heads/master
Commit: e0b3255c233873dec0c14b593d7d82bb1efa4826
Parents: db823ea
Author: woj-i <wo...@gmail.com>
Authored: Thu Oct 15 18:29:29 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Nov 24 19:07:55 2015 +0100
----------------------------------------------------------------------
.../camel/component/hbase/HBaseConsumer.java | 12 +++----
.../camel/component/hbase/HBaseEndpoint.java | 37 ++++++++++++++++++--
.../camel/component/hbase/HBaseProducer.java | 11 ++----
3 files changed, 41 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/e0b3255c/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseConsumer.java
----------------------------------------------------------------------
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
index bf3760d..59aaa43 100644
--- 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
@@ -21,6 +21,7 @@ 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.Processor;
import org.apache.camel.component.hbase.mapping.CellMappingStrategy;
@@ -33,7 +34,6 @@ import org.apache.camel.util.CastUtils;
import org.apache.camel.util.ObjectHelper;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.client.HTableInterface;
-import org.apache.hadoop.hbase.client.HTablePool;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Scan;
@@ -50,22 +50,18 @@ public class HBaseConsumer extends ScheduledBatchPollingConsumer {
private static final Logger LOG = LoggerFactory.getLogger(HBaseConsumer.class);
- private String tableName;
private final HBaseEndpoint endpoint;
- private HTablePool tablePool;
private HBaseRow rowModel;
- public HBaseConsumer(HBaseEndpoint endpoint, Processor processor, HTablePool tablePool, String tableName) {
+ public HBaseConsumer(HBaseEndpoint endpoint, Processor processor) {
super(endpoint, processor);
this.endpoint = endpoint;
- this.tableName = tableName;
- this.tablePool = tablePool;
this.rowModel = endpoint.getRowModel();
}
@Override
protected int poll() throws Exception {
- HTableInterface table = tablePool.getTable(tableName);
+ HTableInterface table = endpoint.getTable();
try {
shutdownRunningTask = null;
pendingExchanges = 0;
@@ -192,7 +188,7 @@ public class HBaseConsumer extends ScheduledBatchPollingConsumer {
* Delegates to the {@link HBaseRemoveHandler}.
*/
private void remove(byte[] row) throws IOException {
- HTableInterface table = tablePool.getTable(tableName);
+ HTableInterface table = endpoint.getTable();
try {
endpoint.getRemoveHandler().remove(table, row);
} finally {
http://git-wip-us.apache.org/repos/asf/camel/blob/e0b3255c/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseEndpoint.java
----------------------------------------------------------------------
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
index cb08a02..109418c 100644
--- 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
@@ -16,6 +16,7 @@
*/
package org.apache.camel.component.hbase;
+import java.security.PrivilegedAction;
import java.util.List;
import org.apache.camel.Consumer;
@@ -30,8 +31,10 @@ import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriPath;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.client.HBaseAdmin;
+import org.apache.hadoop.hbase.client.HTableInterface;
import org.apache.hadoop.hbase.client.HTablePool;
import org.apache.hadoop.hbase.filter.Filter;
+import org.apache.hadoop.security.UserGroupInformation;
/**
* Represents an HBase endpoint.
@@ -66,21 +69,30 @@ public class HBaseEndpoint extends DefaultEndpoint {
@UriParam(label = "consumer")
private int maxMessagesPerPoll;
+ /**
+ * in the purpose of performance optimization
+ */
+ private byte[] tableNameBytes;
+
+ private UserGroupInformation ugi = null;
+
public HBaseEndpoint(String uri, HBaseComponent component, HTablePool tablePool, String tableName) {
super(uri, component);
this.tableName = tableName;
this.tablePool = tablePool;
if (this.tableName == null) {
throw new IllegalArgumentException("Table name can not be null");
- }
+ }else{
+ tableNameBytes = tableName.getBytes();
+ }
}
public Producer createProducer() throws Exception {
- return new HBaseProducer(this, tablePool, tableName);
+ return new HBaseProducer(this);
}
public Consumer createConsumer(Processor processor) throws Exception {
- HBaseConsumer consumer = new HBaseConsumer(this, processor, tablePool, tableName);
+ HBaseConsumer consumer = new HBaseConsumer(this, processor);
configureConsumer(consumer);
consumer.setMaxMessagesPerPoll(maxMessagesPerPoll);
return consumer;
@@ -217,4 +229,23 @@ public class HBaseEndpoint extends DefaultEndpoint {
public void setMaxMessagesPerPoll(int maxMessagesPerPoll) {
this.maxMessagesPerPoll = maxMessagesPerPoll;
}
+
+
+ /**
+ * 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 HTableInterface getTable(){
+ if (ugi!=null){
+ return ugi.doAs(new PrivilegedAction<HTableInterface>() {
+ @Override
+ public HTableInterface run() {
+ return tablePool.getTable(tableNameBytes);
+ }
+ });
+ }else{
+ return tablePool.getTable(tableNameBytes);
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/camel/blob/e0b3255c/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseProducer.java
----------------------------------------------------------------------
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
index 4a921aa..215e502 100644
--- 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
@@ -34,7 +34,6 @@ import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.client.Delete;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.HTableInterface;
-import org.apache.hadoop.hbase.client.HTablePool;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
@@ -49,20 +48,16 @@ import org.apache.hadoop.hbase.util.Bytes;
public class HBaseProducer extends DefaultProducer implements ServicePoolAware {
private HBaseEndpoint endpoint;
- private String tableName;
- private final HTablePool tablePool;
private HBaseRow rowModel;
- public HBaseProducer(HBaseEndpoint endpoint, HTablePool tablePool, String tableName) {
+ public HBaseProducer(HBaseEndpoint endpoint) {
super(endpoint);
this.endpoint = endpoint;
- this.tableName = tableName;
- this.tablePool = tablePool;
this.rowModel = endpoint.getRowModel();
}
public void process(Exchange exchange) throws Exception {
- HTableInterface table = tablePool.getTable(tableName.getBytes());
+ HTableInterface table = endpoint.getTable();
try {
updateHeaders(exchange);
@@ -105,7 +100,7 @@ public class HBaseProducer extends DefaultProducer implements ServicePoolAware {
mappingStrategy.applyScanResults(exchange.getOut(), new HBaseData(scanOperationResult));
}
} finally {
- table.close();
+ table.close();
}
}
[6/6] camel git commit: Fixed CS. This closes #695. This closes #655.
Posted by da...@apache.org.
Fixed CS. This closes #695. This closes #655.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f5ec28b0
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f5ec28b0
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f5ec28b0
Branch: refs/heads/master
Commit: f5ec28b0ae48506910f155a3a29679d9b4a74566
Parents: f614eeb
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Nov 24 19:20:32 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Nov 24 19:20:32 2015 +0100
----------------------------------------------------------------------
.../java/org/apache/camel/component/hbase/HBaseProducer.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/f5ec28b0/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseProducer.java
----------------------------------------------------------------------
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
index dcdc57b..224ac22 100644
--- 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
@@ -277,8 +277,8 @@ public class HBaseProducer extends DefaultProducer implements ServicePoolAware {
exchange.getIn().setHeader(CellMappingStrategyFactory.STRATEGY, endpoint.getMappingStrategyName());
}
- if (endpoint.getMappingStrategyName() != null &&
- exchange.getIn().getHeader(CellMappingStrategyFactory.STRATEGY_CLASS_NAME) == null) {
+ if (endpoint.getMappingStrategyName() != null
+ && exchange.getIn().getHeader(CellMappingStrategyFactory.STRATEGY_CLASS_NAME) == null) {
exchange.getIn().setHeader(CellMappingStrategyFactory.STRATEGY_CLASS_NAME, endpoint.getMappingStrategyClassName());
}
[5/6] camel git commit: [CAMEL-9206] full name of the field
userGroupInformation
Posted by da...@apache.org.
[CAMEL-9206] full name of the field userGroupInformation
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f614eeba
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f614eeba
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f614eeba
Branch: refs/heads/master
Commit: f614eeba18005bdf60045b46e52213a682465059
Parents: 3c013e9
Author: woj-i <wo...@gmail.com>
Authored: Tue Nov 24 14:01:41 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Nov 24 19:07:56 2015 +0100
----------------------------------------------------------------------
.../org/apache/camel/component/hbase/HBaseEndpoint.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/f614eeba/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseEndpoint.java
----------------------------------------------------------------------
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
index a8f94d0..8c20d3b 100644
--- 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
@@ -69,7 +69,7 @@ public class HBaseEndpoint extends DefaultEndpoint {
@UriParam(label = "consumer")
private int maxMessagesPerPoll;
@UriParam(description = "UserGroupInformation for HBase communication. If not specified, then Camel talks with HBase without Kerberos")
- private UserGroupInformation ugi;
+ private UserGroupInformation userGroupInformation;
/**
* in the purpose of performance optimization
@@ -232,10 +232,10 @@ public class HBaseEndpoint extends DefaultEndpoint {
/**
* Defines privileges to communicate with HBase table by {@link #getTable()}
- * @param ugi
+ * @param userGroupInformation
*/
- public void setUgi(UserGroupInformation ugi) {
- this.ugi = ugi;
+ public void setUserGroupInformation(UserGroupInformation userGroupInformation) {
+ this.userGroupInformation = userGroupInformation;
}
/**
@@ -244,8 +244,8 @@ public class HBaseEndpoint extends DefaultEndpoint {
* @return table, remember to close!
*/
public HTableInterface getTable() {
- if (ugi != null) {
- return ugi.doAs(new PrivilegedAction<HTableInterface>() {
+ if (userGroupInformation != null) {
+ return userGroupInformation.doAs(new PrivilegedAction<HTableInterface>() {
@Override
public HTableInterface run() {
return tablePool.getTable(tableNameBytes);