You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2017/08/17 16:45:23 UTC
[5/6] incubator-trafodion git commit: Reworks,
addressing Sean's and Selva's comments
Reworks, addressing Sean's and Selva's comments
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/669efea7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/669efea7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/669efea7
Branch: refs/heads/master
Commit: 669efea73181f9c003e4e36c561824412eb5d75a
Parents: de124fc
Author: Dave Birdsall <db...@apache.org>
Authored: Tue Aug 15 22:21:44 2017 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Tue Aug 15 22:21:44 2017 +0000
----------------------------------------------------------------------
.../coprocessor/transactional/TrxRegionEndpoint.java.tmpl | 6 ++++--
core/sql/src/main/java/org/trafodion/sql/HBaseClient.java | 9 ++-------
2 files changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/669efea7/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl
index 5c5c5ab..430378d 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl
@@ -7536,7 +7536,8 @@ TrxTransactionState isTransactionOnCommittedList(final long transactionId)
}
more = scanner.next();
}
- }
+ }
+ //scanner.close(); This API is not available until HBase 2.0
if (sampleRowCount > ROWS_TO_SAMPLE) {
// we read one KeyValue beyond the ROWS_TO_SAMPLE-eth row, so
@@ -7555,7 +7556,8 @@ TrxTransactionState isTransactionOnCommittedList(final long transactionId)
} catch (IOException exp2) {
if (LOG.isErrorEnabled()) LOG.error("Trafodion estimate row count encountered exception ", exp2);
- t = exp2;
+ if (t == null) // don't bury the root cause if an exception also occurred in the for loop
+ t = exp2;
}
// don't you just love Java + Maven? it takes 112 characters to specify the type of the next variable :-)
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/669efea7/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
----------------------------------------------------------------------
diff --git a/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java b/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
index 72fa0af..a9e3d3a 100644
--- a/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
+++ b/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
@@ -1437,10 +1437,7 @@ public class HBaseClient {
boolean retcode = true;
rc[0] = 0;
- HConnection connection = null;
- HTableInterface table = null;
- connection = HConnectionManager.createConnection(config);
- table = connection.getTable(tblName);
+ Table table = getConnection().getTable(TableName.valueOf(tblName));
int putKVsSampled = 0;
int nonPutKVsSampled = 0;
@@ -1564,9 +1561,7 @@ public class HBaseClient {
// at the first family name, and multiply its length times the number of
// columns. Even if more than one family is used in the future, presumably
// they will all be the same short size.
- Table htbl = getConnection().getTable(TableName.valueOf(tblName));
- //HTable htbl = new HTable(config, tblName);
- HTableDescriptor htblDesc = htbl.getTableDescriptor();
+ HTableDescriptor htblDesc = table.getTableDescriptor();
HColumnDescriptor[] families = htblDesc.getColumnFamilies();
rowSize += (families[0].getName().length * numCols);
}