Github user traflm commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1532#discussion_r193921620
--- Diff:
core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java
---
@@ -3226,5 +3260,65 @@ public RecoveryRequestResponse call(TrxRegionService
instance) throws IOExceptio
return resultArray[0].getResultList();
}
+
+ public void setStoragePolicy(String tblName, String policy)
+ throws IOException {
+
+ int retryCount = 0;
+ int retrySleep = TM_SLEEP;
+ boolean retry = false;
+ try {
+ Table tbl = connection.getTable(TableName.valueOf(tblName));
+ String rowkey = "0";
+ CoprocessorRpcChannel channel =
tbl.coprocessorService(rowkey.getBytes());
+
org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TrxRegionService.BlockingInterface
service =
+
org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TrxRegionService.newBlockingStub(channel);
+
org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TrafSetStoragePolicyRequest.Builder
request =
+
org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TrafSetStoragePolicyRequest.newBuilder();
+ String hbaseRoot = config.get("hbase.rootdir");
+ FileSystem fs = FileSystem.get(config);
+ //Construct the HDFS dir
+ //find out if namespace is there
+ String[] parts = tblName.split(":");
+ String namespacestr="";
--- End diff --
The API is only available at HBase 2.0. But I don't know when Trafodion
will support HBase 2.0. And this feature is required by a customer, so we
cannnot wait for months. This is a temp solution, once we move to HBase 2.0,
most of these code can be eliminated and using HBase public API.
---