accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhava...@apache.org
Subject [2/3] git commit: ACCUMULO-2992 Remove deprecated AccumuloConfiguration.getSiteConfiguration().
Date Tue, 15 Jul 2014 19:53:07 GMT
ACCUMULO-2992 Remove deprecated AccumuloConfiguration.getSiteConfiguration().


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

Branch: refs/heads/master
Commit: f7cfb25845fad9f1938efdfb60d2994f4c3bd215
Parents: d53d45c
Author: Bill Havanki <bhavanki@cloudera.com>
Authored: Mon Jul 14 16:07:21 2014 -0400
Committer: Bill Havanki <bhavanki@cloudera.com>
Committed: Tue Jul 15 15:21:55 2014 -0400

----------------------------------------------------------------------
 .../apache/accumulo/core/conf/AccumuloConfiguration.java  | 10 ----------
 .../org/apache/accumulo/core/conf/SiteConfiguration.java  |  6 ++++++
 .../org/apache/accumulo/core/file/rfile/PrintInfo.java    |  5 +++--
 .../apache/accumulo/core/file/rfile/bcfile/PrintInfo.java |  5 +++--
 .../accumulo/core/util/shell/commands/FateCommand.java    |  5 +++--
 .../java/org/apache/accumulo/test/util/CertUtils.java     |  7 +++----
 6 files changed, 18 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/f7cfb258/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java b/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
index 6d20cb0..cddd3be 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
@@ -213,16 +213,6 @@ public abstract class AccumuloConfiguration implements Iterable<Entry<String,Str
     return DefaultConfiguration.getInstance();
   }
   
-  /**
-   * Only here for Shell option-free start-up
-   * 
-   * @deprecated not for client use
-   */
-  @Deprecated
-  public static synchronized AccumuloConfiguration getSiteConfiguration() {
-    return SiteConfiguration.getInstance(getDefaultConfiguration());
-  }
-  
   public static AccumuloConfiguration getTableConfiguration(Connector conn, String tableId)
throws TableNotFoundException, AccumuloException {
     String tableName = Tables.getTableName(conn.getInstance(), tableId);
     return new ConfigurationCopy(conn.tableOperations().getProperties(tableName));

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f7cfb258/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java b/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
index 4c7d95e..997df64 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
@@ -22,6 +22,12 @@ import java.util.Map.Entry;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.log4j.Logger;
 
+/**
+ * A configuration drawn from an XML configuration file specified by the system property
+ * org.apache.accumulo.config.file, which points to the file as a resource. The default value
is
+ * "accumulo-site.xml". <b>Note</b>: Client code should not use this class, and
it may be deprecated in the
+ * future.
+ */
 public class SiteConfiguration extends AccumuloConfiguration {
   private static final Logger log = Logger.getLogger(SiteConfiguration.class);
   

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f7cfb258/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
index dc54b49..43586dd 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
@@ -21,6 +21,8 @@ import java.util.List;
 
 import org.apache.accumulo.core.cli.Help;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
+import org.apache.accumulo.core.conf.DefaultConfiguration;
+import org.apache.accumulo.core.conf.SiteConfiguration;
 import org.apache.accumulo.core.data.ByteSequence;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Range;
@@ -50,8 +52,7 @@ public class PrintInfo {
   public static void main(String[] args) throws Exception {
     Configuration conf = new Configuration();
 
-    @SuppressWarnings("deprecation")
-    AccumuloConfiguration aconf = AccumuloConfiguration.getSiteConfiguration();
+    AccumuloConfiguration aconf = SiteConfiguration.getInstance(DefaultConfiguration.getInstance());
     // TODO ACCUMULO-2462 This will only work for RFiles (path only, not URI) in HDFS when
the correct filesystem for the given file
     // is on Property.INSTANCE_DFS_DIR or, when INSTANCE_DFS_DIR is not defined, is on the
default filesystem 
     // defined in the Hadoop's core-site.xml

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f7cfb258/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/PrintInfo.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/PrintInfo.java
b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/PrintInfo.java
index f387cc2..a67a242 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/PrintInfo.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/PrintInfo.java
@@ -22,6 +22,8 @@ import java.util.Map.Entry;
 import java.util.Set;
 
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
+import org.apache.accumulo.core.conf.DefaultConfiguration;
+import org.apache.accumulo.core.conf.SiteConfiguration;
 import org.apache.accumulo.core.file.rfile.bcfile.BCFile.MetaIndexEntry;
 import org.apache.accumulo.core.volume.VolumeConfiguration;
 import org.apache.hadoop.conf.Configuration;
@@ -55,8 +57,7 @@ public class PrintInfo {
   
   public static void main(String[] args) throws Exception {
     Configuration conf = new Configuration();
-    @SuppressWarnings("deprecation")
-    AccumuloConfiguration siteConf = AccumuloConfiguration.getSiteConfiguration();
+    AccumuloConfiguration siteConf = SiteConfiguration.getInstance(DefaultConfiguration.getInstance());
     // TODO ACCUMULO-2462 not going to operate as expected with volumes when a path, not
URI, is given
     FileSystem hadoopFs = VolumeConfiguration.getDefaultVolume(conf, siteConf).getFileSystem();
     FileSystem localFs = FileSystem.getLocal(conf);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f7cfb258/core/src/main/java/org/apache/accumulo/core/util/shell/commands/FateCommand.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/FateCommand.java
b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/FateCommand.java
index 0196baf..e3be645 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/FateCommand.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/FateCommand.java
@@ -26,6 +26,8 @@ import java.util.Set;
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
+import org.apache.accumulo.core.conf.DefaultConfiguration;
+import org.apache.accumulo.core.conf.SiteConfiguration;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.util.shell.Shell;
 import org.apache.accumulo.core.util.shell.Shell.Command;
@@ -140,8 +142,7 @@ public class FateCommand extends Command {
   protected synchronized IZooReaderWriter getZooReaderWriter(Instance instance, String secret)
{
     
     if (secret == null) {
-      @SuppressWarnings("deprecation")
-      AccumuloConfiguration conf = AccumuloConfiguration.getSiteConfiguration();
+      AccumuloConfiguration conf = SiteConfiguration.getInstance(DefaultConfiguration.getInstance());
       secret = conf.get(Property.INSTANCE_SECRET);
     }
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/f7cfb258/test/src/test/java/org/apache/accumulo/test/util/CertUtils.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/util/CertUtils.java b/test/src/test/java/org/apache/accumulo/test/util/CertUtils.java
index b561600..b7614b8 100644
--- a/test/src/test/java/org/apache/accumulo/test/util/CertUtils.java
+++ b/test/src/test/java/org/apache/accumulo/test/util/CertUtils.java
@@ -46,6 +46,7 @@ import org.apache.accumulo.core.cli.Help;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.conf.DefaultConfiguration;
+import org.apache.accumulo.core.conf.SiteConfiguration;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.commons.io.FileExistsException;
 import org.apache.hadoop.conf.Configuration;
@@ -114,10 +115,9 @@ public class CertUtils {
     @Parameter(names = "--keysize", description = "Key size used by encryption algorithm")
     public int keysize = 2048;
 
-    @SuppressWarnings("deprecation")
     public AccumuloConfiguration getConfiguration() {
       if (siteFile == null) {
-        return AccumuloConfiguration.getSiteConfiguration();
+        return SiteConfiguration.getInstance(DefaultConfiguration.getInstance());
       } else {
         return new AccumuloConfiguration() {
           Configuration xml = new Configuration();
@@ -179,9 +179,8 @@ public class CertUtils {
     }
   }
 
-  @SuppressWarnings("deprecation")
   private static String getDefaultKeyPassword() {
-    return AccumuloConfiguration.getSiteConfiguration().get(Property.INSTANCE_SECRET);
+    return SiteConfiguration.getInstance(DefaultConfiguration.getInstance()).get(Property.INSTANCE_SECRET);
   }
 
   private String issuerDirString;


Mime
View raw message