Github user prashanth-vasudev commented on a diff in the pull request: https://github.com/apache/trafodion/pull/1532#discussion_r193885236 --- 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 -- One concern here is we make assumptions of hbase internal directory structure for the table. This assumption may not hold good between releases. Is there any public api that can be used or some uniform way?
---