From 764ff0d5057b4190d0297ece8ea0e4f6b42ee34c Mon Sep 17 00:00:00 2001 From: Anu Engineer Date: Wed, 22 Jul 2015 10:31:43 -0700 Subject: [PATCH] HDFS-8753. Ozone: Unify StorageContainerConfiguration with ozone-default.xml & ozone-site.xml. Contributed by kanaka kumar avvaru --- hadoop-hdfs-project/hadoop-hdfs/pom.xml | 2 ++ ...iguration.java => OzoneConfiguration.java} | 3 ++- .../localstorage/OzoneMetadataManager.java | 4 +-- .../src/main/resources/ozone-default.xml | 27 +++++++++++++++++++ .../src/test/resources/ozone-site.xml | 24 +++++++++++++++++ 5 files changed, 57 insertions(+), 3 deletions(-) rename hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/{StorageContainerConfiguration.java => OzoneConfiguration.java} (91%) create mode 100644 hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml create mode 100644 hadoop-hdfs-project/hadoop-hdfs/src/test/resources/ozone-site.xml diff --git a/hadoop-hdfs-project/hadoop-hdfs/pom.xml b/hadoop-hdfs-project/hadoop-hdfs/pom.xml index f8b17223e3..9b8f21ff0f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/pom.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/pom.xml @@ -304,6 +304,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> + @@ -415,6 +416,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> configuration.xsl hdfs-default.xml + ozone-default.xml false diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/StorageContainerConfiguration.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/OzoneConfiguration.java similarity index 91% rename from hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/StorageContainerConfiguration.java rename to hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/OzoneConfiguration.java index a83fa339f5..70efa49e52 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/StorageContainerConfiguration.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/OzoneConfiguration.java @@ -25,11 +25,12 @@ * Configuration for ozone. */ @InterfaceAudience.Private -public class StorageContainerConfiguration extends Configuration { +public class OzoneConfiguration extends Configuration { static { // adds the default resources Configuration.addDefaultResource("hdfs-default.xml"); Configuration.addDefaultResource("hdfs-site.xml"); + Configuration.addDefaultResource("ozone-default.xml"); Configuration.addDefaultResource("ozone-site.xml"); } } \ No newline at end of file diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/localstorage/OzoneMetadataManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/localstorage/OzoneMetadataManager.java index 22b1ed297f..b13ffd4387 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/localstorage/OzoneMetadataManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/localstorage/OzoneMetadataManager.java @@ -21,7 +21,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.ozone.OzoneConfigKeys; -import org.apache.hadoop.ozone.StorageContainerConfiguration; +import org.apache.hadoop.ozone.OzoneConfiguration; import org.apache.hadoop.ozone.web.exceptions.ErrorTable; import org.apache.hadoop.ozone.web.exceptions.OzoneException; import org.apache.hadoop.ozone.web.handlers.UserArgs; @@ -125,7 +125,7 @@ public final class OzoneMetadataManager { private OzoneMetadataManager() { lock = new ReentrantReadWriteLock(); - StorageContainerConfiguration conf = new StorageContainerConfiguration(); + OzoneConfiguration conf = new OzoneConfiguration(); String storageRoot = conf.getTrimmed(OzoneConfigKeys.DFS_STORAGE_LOCAL_ROOT, diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml b/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml new file mode 100644 index 0000000000..209a2809ec --- /dev/null +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/resources/ozone-default.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/ozone-site.xml b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/ozone-site.xml new file mode 100644 index 0000000000..77dd7ef994 --- /dev/null +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/ozone-site.xml @@ -0,0 +1,24 @@ + + + + + + + + +