You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/06/07 20:36:00 UTC
[jira] [Commented] (TRAFODION-3026) add create option storage
policy
[ https://issues.apache.org/jira/browse/TRAFODION-3026?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16505229#comment-16505229 ]
ASF GitHub Bot commented on TRAFODION-3026:
-------------------------------------------
Github user selvaganesang commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1532#discussion_r193880363
--- Diff: core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl ---
@@ -2404,6 +2410,72 @@ CoprocessorService, Coprocessor {
done.run(TlogDel_response);
}
+ public void setStoragePolicy(RpcController controller,
+ TrafSetStoragePolicyRequest request,
+ RpcCallback<TrafSetStoragePolicyResponse> done) {
+ String path = request.getPath();
+ String policy = request.getPolicy();
+ if (LOG.isTraceEnabled()) LOG.trace("setStoragePolicy ENTRY. path " + path + " policy " + policy );
+
+ IOException t=null;
+ try {
+ invokeSetStoragePolicy(fs, path, policy);
+ }
+ catch (IOException e) {
+ t = e;
+ }
+
+ org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TrafSetStoragePolicyResponse.Builder setStoragePolicyResponseBuilder =
+ org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.TrafSetStoragePolicyResponse.newBuilder();
+
+ if(t != null)
+ {
+ LOG.error("setStoragePolicy error : " + t.toString() );
+ setStoragePolicyResponseBuilder.setStatus(false);
+ setStoragePolicyResponseBuilder.setException(t.toString());
+ }
+ else
+ {
+ setStoragePolicyResponseBuilder.setStatus(true);
+ setStoragePolicyResponseBuilder.setException("");
+ }
+
+ TrafSetStoragePolicyResponse resp = setStoragePolicyResponseBuilder.build();
+
+ done.run(resp);
+
+ }
+
+ private static void invokeSetStoragePolicy(final FileSystem fs, final String pathstr,
+ final String storagePolicy)
+ throws IOException {
+ Path path = new Path(pathstr);
+ Method m = null;
+ try {
+ m = fs.getClass().getDeclaredMethod("setStoragePolicy",
+ new Class<?>[] { Path.class, String.class });
+ m.setAccessible(true);
--- End diff --
To avoid increased path length, consider issue reflection API to get the method Id once in static block
> add create option storage policy
> --------------------------------
>
> Key: TRAFODION-3026
> URL: https://issues.apache.org/jira/browse/TRAFODION-3026
> Project: Apache Trafodion
> Issue Type: New Feature
> Reporter: liu ming
> Assignee: liu ming
> Priority: Major
>
> HDFS support HSM, it is possible to specify the storage policy in HBase column family attribute, so it can use the underlying storage policy
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)