You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/12/05 13:59:24 UTC

[GitHub] [accumulo] keith-turner commented on a change in pull request #1445: WIP add erasure coding and storage policy to table/namespace settings

keith-turner commented on a change in pull request #1445: WIP add erasure coding and storage policy to table/namespace settings
URL: https://github.com/apache/accumulo/pull/1445#discussion_r354325324
 
 

 ##########
 File path: server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
 ##########
 @@ -306,6 +312,111 @@ public boolean mkdirs(Path path, FsPermission permission) throws IOException {
     return getVolumeByPath(path).getFileSystem().mkdirs(path, permission);
   }
 
+  @Override
+  public boolean mkdirs(Path path, String storagePolicy, String encoding) throws IOException {
+    boolean ret = mkdirs(path);
+    try {
+      checkDirPolicies(path, storagePolicy, encoding);
+    } catch (IOException e) {
+      // non-fatal error, just print warning and continue
+      // directory will just have wrong policy.
+      log.warn("error checking policy for " + path, e);
+    }
+    return ret;
+  }
+
+  @Override
+  public void checkDirPolicies(Path path, String storagePolicy, String encoding)
+      throws IOException {
+    FileSystem fs = getVolumeByPath(path).getFileSystem();
+    // check that path exists...it may not yet, which is ok. just return
+    if (!fs.exists(path)) {
+      log.debug("check {}: path does not exist", path);
+      return;
+    }
+    if (fs instanceof DistributedFileSystem) {
+      DistributedFileSystem dfs = (DistributedFileSystem) fs;
+      BlockStoragePolicySpi currPolicy = dfs.getStoragePolicy(path);
 
 Review comment:
   Do you know anything about the expense of these methods?  Will these cause RPCs to namenode?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services