accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1483498 - in /accumulo/trunk: ./ assemble/ core/ examples/ fate/src/main/java/org/apache/accumulo/fate/ fate/src/main/java/org/apache/accumulo/fate/zookeeper/ proxy/ server/ server/src/main/java/org/apache/accumulo/server/ src/
Date Thu, 16 May 2013 18:41:43 GMT
Author: ecn
Date: Thu May 16 18:41:42 2013
New Revision: 1483498

URL: http://svn.apache.org/r1483498
Log:
ACCUMULO-1421 simplify reflection lookup of SafeModeAction

Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/assemble/   (props changed)
    accumulo/trunk/core/   (props changed)
    accumulo/trunk/examples/   (props changed)
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java   (props changed)
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java 
 (props changed)
    accumulo/trunk/pom.xml   (props changed)
    accumulo/trunk/proxy/README   (props changed)
    accumulo/trunk/server/   (props changed)
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/Accumulo.java
    accumulo/trunk/src/   (props changed)

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5:r1483496

Propchange: accumulo/trunk/assemble/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/assemble:r1483496

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/core:r1483496

Propchange: accumulo/trunk/examples/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/examples:r1483496

Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1483496

Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java:r1483496

Propchange: accumulo/trunk/pom.xml
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/pom.xml:r1483496

Propchange: accumulo/trunk/proxy/README
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/proxy/README:r1483496

Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/server:r1483496

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/Accumulo.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/Accumulo.java?rev=1483498&r1=1483497&r2=1483498&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/Accumulo.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/Accumulo.java Thu May 16
18:41:42 2013
@@ -218,29 +218,18 @@ public class Accumulo {
     DistributedFileSystem dfs = (DistributedFileSystem) FileSystem.get(CachedConfiguration.getInstance());
     // So this: if (!dfs.setSafeMode(SafeModeAction.SAFEMODE_GET))
     // Becomes this:
-    Class<?> constantClass;
+    Class<?> safeModeAction;
     try {
       // hadoop 2.0
-      constantClass = Class.forName("org.apache.hadoop.hdfs.protocol.HdfsConstants");
+      safeModeAction = Class.forName("org.apache.hadoop.hdfs.protocol.HdfsConstants$SafeModeAction");
     } catch (ClassNotFoundException ex) {
       // hadoop 1.0
       try {
-        constantClass = Class.forName("org.apache.hadoop.hdfs.protocol.FSConstants");
+        safeModeAction = Class.forName("org.apache.hadoop.hdfs.protocol.FSConstants$SafeModeAction");
       } catch (ClassNotFoundException e) {
         throw new RuntimeException("Cannot figure out the right class for Constants");
       }
     }
-    Class<?> safeModeAction = null;
-    for (Class<?> klass : constantClass.getDeclaredClasses()) {
-      if (klass.getSimpleName().equals("SafeModeAction")) {
-        safeModeAction = klass;
-        break;
-      }
-    }
-    if (safeModeAction == null) {
-      throw new RuntimeException("Cannot find SafeModeAction in constants class");
-    }
-    
     Object get = null;
     for (Object obj : safeModeAction.getEnumConstants()) {
       if (obj.toString().equals("SAFEMODE_GET"))

Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/src:r1483496



Mime
View raw message