hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aengin...@apache.org
Subject hadoop git commit: HDDS-672. Spark shell throws OzoneFileSystem not found. Contributed by Anu Engineer.
Date Fri, 19 Oct 2018 16:45:04 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk b22651e94 -> cd057918d


HDDS-672. Spark shell throws OzoneFileSystem not found.
Contributed by Anu Engineer.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/cd057918
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/cd057918
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/cd057918

Branch: refs/heads/trunk
Commit: cd057918d6b7f222bf2008966dc2c2de5a01d286
Parents: b22651e
Author: Anu Engineer <aengineer@apache.org>
Authored: Fri Oct 19 09:22:46 2018 -0700
Committer: Anu Engineer <aengineer@apache.org>
Committed: Fri Oct 19 09:22:46 2018 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/fs/ozone/OzoneFileSystem.java    | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/cd057918/hadoop-ozone/ozonefs/src/main/java/org/apache/hadoop/fs/ozone/OzoneFileSystem.java
----------------------------------------------------------------------
diff --git a/hadoop-ozone/ozonefs/src/main/java/org/apache/hadoop/fs/ozone/OzoneFileSystem.java
b/hadoop-ozone/ozonefs/src/main/java/org/apache/hadoop/fs/ozone/OzoneFileSystem.java
index 50a63b5..1336382 100644
--- a/hadoop-ozone/ozonefs/src/main/java/org/apache/hadoop/fs/ozone/OzoneFileSystem.java
+++ b/hadoop-ozone/ozonefs/src/main/java/org/apache/hadoop/fs/ozone/OzoneFileSystem.java
@@ -31,6 +31,7 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import com.google.common.base.Preconditions;
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -97,7 +98,11 @@ public class OzoneFileSystem extends FileSystem {
   @Override
   public void initialize(URI name, Configuration conf) throws IOException {
     super.initialize(name, conf);
-    setConf(conf);
+    if(!(conf instanceof OzoneConfiguration)) {
+      setConf(new OzoneConfiguration(conf));
+    } else {
+      setConf(conf);
+    }
     Objects.requireNonNull(name.getScheme(), "No scheme provided in " + name);
     assert getScheme().equals(name.getScheme());
 
@@ -116,15 +121,15 @@ public class OzoneFileSystem extends FileSystem {
       uri = new URIBuilder().setScheme(OZONE_URI_SCHEME)
           .setHost(authority).build();
       LOG.trace("Ozone URI for ozfs initialization is " + uri);
-      this.ozoneClient = OzoneClientFactory.getRpcClient(conf);
+      this.ozoneClient = OzoneClientFactory.getRpcClient(getConf());
       objectStore = ozoneClient.getObjectStore();
       this.volume = objectStore.getVolume(volumeStr);
       this.bucket = volume.getBucket(bucketStr);
       this.replicationType = ReplicationType.valueOf(
-          conf.get(OzoneConfigKeys.OZONE_REPLICATION_TYPE,
+          getConf().get(OzoneConfigKeys.OZONE_REPLICATION_TYPE,
               OzoneConfigKeys.OZONE_REPLICATION_TYPE_DEFAULT));
       this.replicationFactor = ReplicationFactor.valueOf(
-          conf.getInt(OzoneConfigKeys.OZONE_REPLICATION,
+          getConf().getInt(OzoneConfigKeys.OZONE_REPLICATION,
               OzoneConfigKeys.OZONE_REPLICATION_DEFAULT));
       try {
         this.userName =


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message