accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1458888 - /accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/FateCommand.java
Date Wed, 20 Mar 2013 15:34:10 GMT
Author: kturner
Date: Wed Mar 20 15:34:10 2013
New Revision: 1458888

URL: http://svn.apache.org/r1458888
Log:
ACCUMULO-842 removed dependency on accumulo-site.xml from new fate shell command

Modified:
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/FateCommand.java

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/FateCommand.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/FateCommand.java?rev=1458888&r1=1458887&r2=1458888&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/FateCommand.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/FateCommand.java
Wed Mar 20 15:34:10 2013
@@ -69,7 +69,7 @@ public class FateCommand extends Command
     
     String path = ZooUtil.getRoot(instance) + Constants.ZFATE;
     String masterPath = ZooUtil.getRoot(instance) + Constants.ZMASTER_LOCK;
-    IZooReaderWriter zk = getZooReaderWriter(cl.getOptionValue('s'));
+    IZooReaderWriter zk = getZooReaderWriter(shellState.getInstance(), cl.getOptionValue(secretOption.getOpt()));
     ZooStore<FateCommand> zs = new ZooStore<FateCommand>(path, zk);
     
     if ("fail".equals(cmd)) {
@@ -113,9 +113,9 @@ public class FateCommand extends Command
       
       // Parse TStatus filters for print display
       EnumSet<TStatus> filterStatus = null;
-      if (cl.hasOption('t')) {
+      if (cl.hasOption(statusOption.getOpt())) {
         filterStatus = EnumSet.noneOf(TStatus.class);
-        String[] tstat = cl.getOptionValues('t');
+        String[] tstat = cl.getOptionValues(statusOption.getOpt());
         for (int i = 0; i < tstat.length; i++) {
           try {
             filterStatus.add(TStatus.valueOf(tstat[i]));
@@ -138,12 +138,14 @@ public class FateCommand extends Command
   }
   
   @SuppressWarnings("deprecation")
-  protected synchronized IZooReaderWriter getZooReaderWriter(String secret) {
-    AccumuloConfiguration conf = AccumuloConfiguration.getSiteConfiguration();
+  protected synchronized IZooReaderWriter getZooReaderWriter(Instance instance, String secret)
{
+
     if (secret == null) {
+      AccumuloConfiguration conf = AccumuloConfiguration.getSiteConfiguration();
       secret = conf.get(Property.INSTANCE_SECRET);
     }
-    return new ZooReaderWriter(conf.get(Property.INSTANCE_ZK_HOST), (int) conf.getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT),
SCHEME,
+    
+    return new ZooReaderWriter(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut(),
SCHEME,
         (USER + ":" + secret).getBytes());
   }
   



Mime
View raw message