You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2014/10/11 00:41:43 UTC

[01/21] git commit: ACCUMULO-3225 Replace dead ternary statement

Repository: accumulo
Updated Branches:
  refs/heads/1.5 085c5b793 -> 11762c5fb
  refs/heads/1.6 3a73e25f2 -> 9aca7d74d
  refs/heads/master 72336eb81 -> 1fcb96f2f


ACCUMULO-3225 Replace dead ternary statement


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

Branch: refs/heads/1.5
Commit: 7b1bb102d224514ed3c0fa204460c90c867bf725
Parents: 3cce106
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 17:25:26 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 17:25:26 2014 -0400

----------------------------------------------------------------------
 .../apache/accumulo/core/util/shell/commands/ConfigCommand.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7b1bb102/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
index 27beb30..9e9536c 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
@@ -184,7 +184,7 @@ public class ConfigCommand extends Command {
             printed = true;
           }
           if (!siteConfig.containsKey(key) || !siteVal.equals(sysVal)) {
-            printConfLine(output, "system", printed ? "   @override" : key, sysVal == null ? "" : sysVal);
+            printConfLine(output, "system", printed ? "   @override" : key, sysVal);
             printed = true;
           }
         }


[09/21] git commit: ACCUMULO-3225 Remove dead ternary statement

Posted by el...@apache.org.
ACCUMULO-3225 Remove dead ternary statement


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

Branch: refs/heads/1.6
Commit: 45e2e590ec72db183ee7f87a45d31c5dc815797c
Parents: 2dab129
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 17:33:44 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 17:33:44 2014 -0400

----------------------------------------------------------------------
 .../apache/accumulo/core/util/shell/commands/ConfigCommand.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/45e2e590/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
index 9567a47..bf063e2 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
@@ -227,7 +227,7 @@ public class ConfigCommand extends Command {
         }
         if (nspVal != null) {
           if (!systemConfig.containsKey(key) || !sysVal.equals(nspVal)) {
-            printConfLine(output, "namespace", printed ? "   @override" : key, nspVal == null ? "" : nspVal);
+            printConfLine(output, "namespace", printed ? "   @override" : key, nspVal);
             printed = true;
           }
         }


[12/21] git commit: ACCUMULO-3227 A bunch of string encoding issues.

Posted by el...@apache.org.
ACCUMULO-3227 A bunch of string encoding issues.


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

Branch: refs/heads/master
Commit: 4acf7abd55da9b34007a3a6a393e1b6566caf1a4
Parents: dac8a89
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 17:43:50 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 18:40:10 2014 -0400

----------------------------------------------------------------------
 .../accumulo/core/replication/ReplicationSchema.java |  3 ++-
 .../accumulo/core/replication/ReplicationTarget.java |  3 ++-
 .../accumulo/server/replication/ReplicationUtil.java |  3 ++-
 .../accumulo/server/util/MasterMetadataUtil.java     | 15 ++++++++-------
 .../tserver/replication/ReplicationProcessor.java    |  3 ++-
 5 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/4acf7abd/core/src/main/java/org/apache/accumulo/core/replication/ReplicationSchema.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/replication/ReplicationSchema.java b/core/src/main/java/org/apache/accumulo/core/replication/ReplicationSchema.java
index 3804566..6330dca 100644
--- a/core/src/main/java/org/apache/accumulo/core/replication/ReplicationSchema.java
+++ b/core/src/main/java/org/apache/accumulo/core/replication/ReplicationSchema.java
@@ -17,6 +17,7 @@
 package org.apache.accumulo.core.replication;
 
 import java.nio.charset.CharacterCodingException;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.accumulo.core.client.ScannerBase;
 import org.apache.accumulo.core.client.lexicoder.ULongLexicoder;
@@ -215,7 +216,7 @@ public class ReplicationSchema {
       log.trace("Normalized {} into {}", file, pathString);
 
       // Append the file as a suffix to the row
-      row.append((ROW_SEPARATOR + pathString).getBytes(), 0, pathString.length() + ROW_SEPARATOR.getLength());
+      row.append((ROW_SEPARATOR + pathString).getBytes(StandardCharsets.UTF_8), 0, pathString.length() + ROW_SEPARATOR.getLength());
 
       // Make the mutation and add the column update
       return new Mutation(row);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/4acf7abd/core/src/main/java/org/apache/accumulo/core/replication/ReplicationTarget.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/replication/ReplicationTarget.java b/core/src/main/java/org/apache/accumulo/core/replication/ReplicationTarget.java
index d71d2bf..f882a8d 100644
--- a/core/src/main/java/org/apache/accumulo/core/replication/ReplicationTarget.java
+++ b/core/src/main/java/org/apache/accumulo/core/replication/ReplicationTarget.java
@@ -19,6 +19,7 @@ package org.apache.accumulo.core.replication;
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.hadoop.io.DataInputBuffer;
 import org.apache.hadoop.io.DataOutputBuffer;
@@ -154,7 +155,7 @@ public class ReplicationTarget implements Writable {
   public static ReplicationTarget from(String s) {
     ReplicationTarget target = new ReplicationTarget();
     DataInputBuffer buffer = new DataInputBuffer();
-    buffer.reset(s.getBytes(), s.length());
+    buffer.reset(s.getBytes(StandardCharsets.UTF_8), s.length());
 
     try {
       target.readFields(buffer);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/4acf7abd/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java b/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java
index 9f59b23..590cbe4 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/replication/ReplicationUtil.java
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.server.replication;
 
+import java.nio.charset.StandardCharsets;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -200,7 +201,7 @@ public class ReplicationUtil {
   public String getAbsolutePath(Connector conn, String workQueuePath, String queueKey) {
     byte[] data = zooCache.get(workQueuePath + "/" + queueKey);
     if (null != data) {
-      return new String(data);
+      return new String(data, StandardCharsets.UTF_8);
     }
 
     return null;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/4acf7abd/server/base/src/main/java/org/apache/accumulo/server/util/MasterMetadataUtil.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/MasterMetadataUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/MasterMetadataUtil.java
index 2f9e397..05f28d7 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/MasterMetadataUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/MasterMetadataUtil.java
@@ -17,6 +17,7 @@
 package org.apache.accumulo.server.util;
 
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -69,8 +70,8 @@ public class MasterMetadataUtil {
       Map<FileRef,Long> bulkLoadedFiles, Credentials credentials, String time, long lastFlushID, long lastCompactID, ZooLock zooLock) {
     Mutation m = extent.getPrevRowUpdateMutation();
     
-    TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN.put(m, new Value(path.getBytes()));
-    TabletsSection.ServerColumnFamily.TIME_COLUMN.put(m, new Value(time.getBytes()));
+    TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN.put(m, new Value(path.getBytes(StandardCharsets.UTF_8)));
+    TabletsSection.ServerColumnFamily.TIME_COLUMN.put(m, new Value(time.getBytes(StandardCharsets.UTF_8)));
     if (lastFlushID > 0)
       TabletsSection.ServerColumnFamily.FLUSH_COLUMN.put(m, new Value(("" + lastFlushID).getBytes()));
     if (lastCompactID > 0)
@@ -103,7 +104,7 @@ public class MasterMetadataUtil {
       throw new IllegalArgumentException("Metadata entry does not have split ratio (" + metadataEntry + ")");
     }
     
-    double splitRatio = Double.parseDouble(new String(columns.get(TabletsSection.TabletColumnFamily.SPLIT_RATIO_COLUMN).get()));
+    double splitRatio = Double.parseDouble(new String(columns.get(TabletsSection.TabletColumnFamily.SPLIT_RATIO_COLUMN).get(), StandardCharsets.UTF_8));
     
     Value prevEndRowIBW = columns.get(TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN);
     
@@ -215,7 +216,7 @@ public class MasterMetadataUtil {
       m.putDelete(DataFileColumnFamily.NAME, pathToRemove.meta());
     
     for (FileRef scanFile : scanFiles)
-      m.put(ScanFileColumnFamily.NAME, scanFile.meta(), new Value("".getBytes()));
+      m.put(ScanFileColumnFamily.NAME, scanFile.meta(), new Value(new byte[0]));
     
     if (size.getNumEntries() > 0)
       m.put(DataFileColumnFamily.NAME, path.meta(), new Value(size.encode()));
@@ -299,7 +300,7 @@ public class MasterMetadataUtil {
 
     if (dfv.getNumEntries() > 0) {
       m.put(DataFileColumnFamily.NAME, path.meta(), new Value(dfv.encode()));
-      TabletsSection.ServerColumnFamily.TIME_COLUMN.put(m, new Value(time.getBytes()));
+      TabletsSection.ServerColumnFamily.TIME_COLUMN.put(m, new Value(time.getBytes(StandardCharsets.UTF_8)));
       // stuff in this location
       TServerInstance self = getTServerInstance(address, zooLock);
       self.putLastLocation(m);
@@ -314,12 +315,12 @@ public class MasterMetadataUtil {
     }
 
     for (FileRef scanFile : filesInUseByScans)
-      m.put(ScanFileColumnFamily.NAME, scanFile.meta(), new Value("".getBytes()));
+      m.put(ScanFileColumnFamily.NAME, scanFile.meta(), new Value(new byte[0]));
 
     if (mergeFile != null)
       m.putDelete(DataFileColumnFamily.NAME, mergeFile.meta());
 
-    TabletsSection.ServerColumnFamily.FLUSH_COLUMN.put(m, new Value((flushId + "").getBytes()));
+    TabletsSection.ServerColumnFamily.FLUSH_COLUMN.put(m, new Value(Long.toString(flushId).getBytes(StandardCharsets.UTF_8)));
 
     return m;
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/4acf7abd/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/ReplicationProcessor.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/ReplicationProcessor.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/ReplicationProcessor.java
index 6f4d987..fbae6f2 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/ReplicationProcessor.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/replication/ReplicationProcessor.java
@@ -17,6 +17,7 @@
 package org.apache.accumulo.tserver.replication;
 
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 import java.util.Map;
 import java.util.NoSuchElementException;
 
@@ -77,7 +78,7 @@ public class ReplicationProcessor implements Processor {
   @Override
   public void process(String workID, byte[] data) {
     ReplicationTarget target = DistributedWorkQueueWorkAssignerHelper.fromQueueKey(workID).getValue();
-    String file = new String(data);
+    String file = new String(data, StandardCharsets.UTF_8);
 
     log.debug("Received replication work for {} to {}", file, target);
 


[16/21] git commit: Merge branch '1.6' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.6

Posted by el...@apache.org.
Merge branch '1.6' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.6


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

Branch: refs/heads/master
Commit: ec6f069cda9f665395bd9eb67e1cc795185691ab
Parents: 45e2e59 3a73e25
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 18:41:08 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 18:41:08 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/accumulo/core/util/shell/Shell.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



[02/21] git commit: ACCUMULO-3225 Replace dead ternary statement

Posted by el...@apache.org.
ACCUMULO-3225 Replace dead ternary statement


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

Branch: refs/heads/1.6
Commit: 7b1bb102d224514ed3c0fa204460c90c867bf725
Parents: 3cce106
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 17:25:26 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 17:25:26 2014 -0400

----------------------------------------------------------------------
 .../apache/accumulo/core/util/shell/commands/ConfigCommand.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7b1bb102/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
index 27beb30..9e9536c 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
@@ -184,7 +184,7 @@ public class ConfigCommand extends Command {
             printed = true;
           }
           if (!siteConfig.containsKey(key) || !siteVal.equals(sysVal)) {
-            printConfLine(output, "system", printed ? "   @override" : key, sysVal == null ? "" : sysVal);
+            printConfLine(output, "system", printed ? "   @override" : key, sysVal);
             printed = true;
           }
         }


[07/21] git commit: Merge branch '1.5' into 1.6

Posted by el...@apache.org.
Merge branch '1.5' into 1.6


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

Branch: refs/heads/1.6
Commit: 2dab1295a5bfee6e8262014c6889a2de5541b284
Parents: a269f75 633e4df
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 17:33:16 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 17:33:16 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/accumulo/core/security/Authorizations.java     | 1 -
 .../apache/accumulo/core/util/shell/commands/ConfigCommand.java    | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/2dab1295/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/2dab1295/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
index c76a51f,9e9536c..9567a47
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
@@@ -220,23 -184,14 +220,23 @@@ public class ConfigCommand extends Comm
              printed = true;
            }
            if (!siteConfig.containsKey(key) || !siteVal.equals(sysVal)) {
-             printConfLine(output, "system", printed ? "   @override" : key, sysVal == null ? "" : sysVal);
+             printConfLine(output, "system", printed ? "   @override" : key, sysVal);
              printed = true;
            }
 +
 +        }
 +        if (nspVal != null) {
 +          if (!systemConfig.containsKey(key) || !sysVal.equals(nspVal)) {
 +            printConfLine(output, "namespace", printed ? "   @override" : key, nspVal == null ? "" : nspVal);
 +            printed = true;
 +          }
          }
 -        
 +
          // show per-table value only if it is different (overridden)
 -        if (tableName != null && !curVal.equals(sysVal)) {
 +        if (tableName != null && !curVal.equals(nspVal)) {
            printConfLine(output, "table", printed ? "   @override" : key, curVal);
 +        } else if (namespace != null && !curVal.equals(sysVal)) {
 +          printConfLine(output, "namespace", printed ? "   @override" : key, curVal);
          }
        }
        printConfFooter(output);


[14/21] git commit: Merge branch '1.5' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.5

Posted by el...@apache.org.
Merge branch '1.5' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.5


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

Branch: refs/heads/1.5
Commit: 11762c5fbe558863855a6162faf952f70f916e37
Parents: 633e4df 085c5b7
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 18:40:30 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 18:40:30 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/accumulo/core/util/shell/Shell.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



[15/21] git commit: Merge branch '1.5' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.5

Posted by el...@apache.org.
Merge branch '1.5' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.5


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

Branch: refs/heads/master
Commit: 11762c5fbe558863855a6162faf952f70f916e37
Parents: 633e4df 085c5b7
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 18:40:30 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 18:40:30 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/accumulo/core/util/shell/Shell.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



[18/21] git commit: Merge branch '1.5' into 1.6

Posted by el...@apache.org.
Merge branch '1.5' into 1.6


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

Branch: refs/heads/master
Commit: 9aca7d74dc62e19df3514d2ac969ef99b6bdff3f
Parents: ec6f069 11762c5
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 18:41:16 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 18:41:16 2014 -0400

----------------------------------------------------------------------

----------------------------------------------------------------------



[20/21] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/accumulo

Posted by el...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/accumulo


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

Branch: refs/heads/master
Commit: 9976bd737d1e0f1451ada7a5e0f2f1fb49a23667
Parents: 4acf7ab 72336eb
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 18:41:23 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 18:41:23 2014 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/accumulo/shell/Shell.java  | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



[08/21] git commit: Merge branch '1.5' into 1.6

Posted by el...@apache.org.
Merge branch '1.5' into 1.6


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

Branch: refs/heads/master
Commit: 2dab1295a5bfee6e8262014c6889a2de5541b284
Parents: a269f75 633e4df
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 17:33:16 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 17:33:16 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/accumulo/core/security/Authorizations.java     | 1 -
 .../apache/accumulo/core/util/shell/commands/ConfigCommand.java    | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/2dab1295/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/2dab1295/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
index c76a51f,9e9536c..9567a47
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
@@@ -220,23 -184,14 +220,23 @@@ public class ConfigCommand extends Comm
              printed = true;
            }
            if (!siteConfig.containsKey(key) || !siteVal.equals(sysVal)) {
-             printConfLine(output, "system", printed ? "   @override" : key, sysVal == null ? "" : sysVal);
+             printConfLine(output, "system", printed ? "   @override" : key, sysVal);
              printed = true;
            }
 +
 +        }
 +        if (nspVal != null) {
 +          if (!systemConfig.containsKey(key) || !sysVal.equals(nspVal)) {
 +            printConfLine(output, "namespace", printed ? "   @override" : key, nspVal == null ? "" : nspVal);
 +            printed = true;
 +          }
          }
 -        
 +
          // show per-table value only if it is different (overridden)
 -        if (tableName != null && !curVal.equals(sysVal)) {
 +        if (tableName != null && !curVal.equals(nspVal)) {
            printConfLine(output, "table", printed ? "   @override" : key, curVal);
 +        } else if (namespace != null && !curVal.equals(sysVal)) {
 +          printConfLine(output, "namespace", printed ? "   @override" : key, curVal);
          }
        }
        printConfFooter(output);


[04/21] git commit: ACCUMULO-3226 Remove unnecessary null check

Posted by el...@apache.org.
ACCUMULO-3226 Remove unnecessary null check


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

Branch: refs/heads/1.5
Commit: 633e4df18492bac952651b6cd8bb56823cdf3c12
Parents: 7b1bb10
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 17:28:10 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 17:28:10 2014 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/accumulo/core/security/Authorizations.java | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/633e4df1/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java b/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
index b546a48..b983a59 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
@@ -131,7 +131,6 @@ public class Authorizations implements Iterable<byte[]>, Serializable {
       }
     } else {
       // it's the old format
-      ArgumentChecker.notNull(authorizations);
       if (authorizations.length > 0)
         setAuthorizations(authsString.split(","));
     }


[05/21] git commit: ACCUMULO-3226 Remove unnecessary null check

Posted by el...@apache.org.
ACCUMULO-3226 Remove unnecessary null check


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

Branch: refs/heads/1.6
Commit: 633e4df18492bac952651b6cd8bb56823cdf3c12
Parents: 7b1bb10
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 17:28:10 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 17:28:10 2014 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/accumulo/core/security/Authorizations.java | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/633e4df1/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java b/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
index b546a48..b983a59 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
@@ -131,7 +131,6 @@ public class Authorizations implements Iterable<byte[]>, Serializable {
       }
     } else {
       // it's the old format
-      ArgumentChecker.notNull(authorizations);
       if (authorizations.length > 0)
         setAuthorizations(authsString.split(","));
     }


[17/21] git commit: Merge branch '1.6' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.6

Posted by el...@apache.org.
Merge branch '1.6' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.6


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

Branch: refs/heads/1.6
Commit: ec6f069cda9f665395bd9eb67e1cc795185691ab
Parents: 45e2e59 3a73e25
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 18:41:08 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 18:41:08 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/accumulo/core/util/shell/Shell.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



[21/21] git commit: Merge branch '1.6'

Posted by el...@apache.org.
Merge branch '1.6'


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

Branch: refs/heads/master
Commit: 1fcb96f2f4fb6a76db28d4859d86f081807b60e6
Parents: 9976bd7 9aca7d7
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 18:41:29 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 18:41:29 2014 -0400

----------------------------------------------------------------------

----------------------------------------------------------------------



[10/21] git commit: ACCUMULO-3225 Remove dead ternary statement

Posted by el...@apache.org.
ACCUMULO-3225 Remove dead ternary statement


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

Branch: refs/heads/master
Commit: 45e2e590ec72db183ee7f87a45d31c5dc815797c
Parents: 2dab129
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 17:33:44 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 17:33:44 2014 -0400

----------------------------------------------------------------------
 .../apache/accumulo/core/util/shell/commands/ConfigCommand.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/45e2e590/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
index 9567a47..bf063e2 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
@@ -227,7 +227,7 @@ public class ConfigCommand extends Command {
         }
         if (nspVal != null) {
           if (!systemConfig.containsKey(key) || !sysVal.equals(nspVal)) {
-            printConfLine(output, "namespace", printed ? "   @override" : key, nspVal == null ? "" : nspVal);
+            printConfLine(output, "namespace", printed ? "   @override" : key, nspVal);
             printed = true;
           }
         }


[13/21] git commit: Merge branch '1.5' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.5

Posted by el...@apache.org.
Merge branch '1.5' of https://git-wip-us.apache.org/repos/asf/accumulo into 1.5


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

Branch: refs/heads/1.6
Commit: 11762c5fbe558863855a6162faf952f70f916e37
Parents: 633e4df 085c5b7
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 18:40:30 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 18:40:30 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/accumulo/core/util/shell/Shell.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------



[19/21] git commit: Merge branch '1.5' into 1.6

Posted by el...@apache.org.
Merge branch '1.5' into 1.6


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

Branch: refs/heads/1.6
Commit: 9aca7d74dc62e19df3514d2ac969ef99b6bdff3f
Parents: ec6f069 11762c5
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 18:41:16 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 18:41:16 2014 -0400

----------------------------------------------------------------------

----------------------------------------------------------------------



[03/21] git commit: ACCUMULO-3225 Replace dead ternary statement

Posted by el...@apache.org.
ACCUMULO-3225 Replace dead ternary statement


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

Branch: refs/heads/master
Commit: 7b1bb102d224514ed3c0fa204460c90c867bf725
Parents: 3cce106
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 17:25:26 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 17:25:26 2014 -0400

----------------------------------------------------------------------
 .../apache/accumulo/core/util/shell/commands/ConfigCommand.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/7b1bb102/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
index 27beb30..9e9536c 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ConfigCommand.java
@@ -184,7 +184,7 @@ public class ConfigCommand extends Command {
             printed = true;
           }
           if (!siteConfig.containsKey(key) || !siteVal.equals(sysVal)) {
-            printConfLine(output, "system", printed ? "   @override" : key, sysVal == null ? "" : sysVal);
+            printConfLine(output, "system", printed ? "   @override" : key, sysVal);
             printed = true;
           }
         }


[11/21] git commit: Merge branch '1.6'

Posted by el...@apache.org.
Merge branch '1.6'

Conflicts:
	core/src/main/java/org/apache/accumulo/core/security/Authorizations.java


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

Branch: refs/heads/master
Commit: dac8a8932f566c0515964c12dc72fce927395ebc
Parents: 1c657ed 45e2e59
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 17:34:24 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 17:34:24 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/accumulo/core/security/Authorizations.java   | 1 -
 .../java/org/apache/accumulo/shell/commands/ConfigCommand.java   | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/dac8a893/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/accumulo/blob/dac8a893/shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java
----------------------------------------------------------------------
diff --cc shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java
index 302c638,0000000..e720e16
mode 100644,000000..100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java
@@@ -1,316 -1,0 +1,316 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one or more
 + * contributor license agreements.  See the NOTICE file distributed with
 + * this work for additional information regarding copyright ownership.
 + * The ASF licenses this file to You under the Apache License, Version 2.0
 + * (the "License"); you may not use this file except in compliance with
 + * the License.  You may obtain a copy of the License at
 + *
 + *     http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing, software
 + * distributed under the License is distributed on an "AS IS" BASIS,
 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 + * See the License for the specific language governing permissions and
 + * limitations under the License.
 + */
 +package org.apache.accumulo.shell.commands;
 +
 +import java.io.IOException;
 +import java.util.ArrayList;
 +import java.util.List;
 +import java.util.Map;
 +import java.util.Map.Entry;
 +import java.util.Set;
 +import java.util.TreeMap;
 +
 +import jline.console.ConsoleReader;
 +
 +import org.apache.accumulo.core.client.AccumuloException;
 +import org.apache.accumulo.core.client.AccumuloSecurityException;
 +import org.apache.accumulo.core.client.NamespaceNotFoundException;
 +import org.apache.accumulo.core.client.TableNotFoundException;
 +import org.apache.accumulo.core.client.impl.Namespaces;
 +import org.apache.accumulo.core.client.impl.Tables;
 +import org.apache.accumulo.core.conf.AccumuloConfiguration;
 +import org.apache.accumulo.core.conf.Property;
 +import org.apache.accumulo.core.security.ColumnVisibility;
 +import org.apache.accumulo.core.util.BadArgumentException;
 +import org.apache.accumulo.shell.Shell;
 +import org.apache.accumulo.shell.ShellOptions;
 +import org.apache.accumulo.shell.Token;
 +import org.apache.accumulo.shell.Shell.Command;
 +import org.apache.accumulo.shell.Shell.PrintFile;
 +import org.apache.commons.cli.CommandLine;
 +import org.apache.commons.cli.Option;
 +import org.apache.commons.cli.OptionGroup;
 +import org.apache.commons.cli.Options;
 +
 +public class ConfigCommand extends Command {
 +  private Option tableOpt, deleteOpt, setOpt, filterOpt, disablePaginationOpt, outputFileOpt, namespaceOpt;
 +
 +  private int COL1 = 10, COL2 = 7;
 +  private ConsoleReader reader;
 +
 +  @Override
 +  public void registerCompletion(final Token root, final Map<Command.CompletionSet,Set<String>> completionSet) {
 +    final Token cmd = new Token(getName());
 +    final Token sub = new Token("-" + setOpt.getOpt());
 +    for (Property p : Property.values()) {
 +      if (!(p.getKey().endsWith(".")) && !p.isExperimental()) {
 +        sub.addSubcommand(new Token(p.toString()));
 +      }
 +    }
 +    cmd.addSubcommand(sub);
 +    root.addSubcommand(cmd);
 +  }
 +
 +  @Override
 +  public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws AccumuloException, AccumuloSecurityException,
 +      TableNotFoundException, IOException, ClassNotFoundException, NamespaceNotFoundException {
 +    reader = shellState.getReader();
 +
 +    final String tableName = cl.getOptionValue(tableOpt.getOpt());
 +    if (tableName != null && !shellState.getConnector().tableOperations().exists(tableName)) {
 +      throw new TableNotFoundException(null, tableName, null);
 +    }
 +    final String namespace = cl.getOptionValue(namespaceOpt.getOpt());
 +    if (namespace != null && !shellState.getConnector().namespaceOperations().exists(namespace)) {
 +      throw new NamespaceNotFoundException(null, namespace, null);
 +    }
 +    if (cl.hasOption(deleteOpt.getOpt())) {
 +      // delete property from table
 +      String property = cl.getOptionValue(deleteOpt.getOpt());
 +      if (property.contains("=")) {
 +        throw new BadArgumentException("Invalid '=' operator in delete operation.", fullCommand, fullCommand.indexOf('='));
 +      }
 +      if (tableName != null) {
 +        if (!Property.isValidTablePropertyKey(property)) {
 +          Shell.log.warn("Invalid per-table property : " + property + ", still removing from zookeeper if it's there.");
 +        }
 +        shellState.getConnector().tableOperations().removeProperty(tableName, property);
 +        Shell.log.debug("Successfully deleted table configuration option.");
 +      } else if (namespace != null) {
 +        if (!Property.isValidTablePropertyKey(property)) {
 +          Shell.log.warn("Invalid per-table property : " + property + ", still removing from zookeeper if it's there.");
 +        }
 +        shellState.getConnector().namespaceOperations().removeProperty(namespace, property);
 +        Shell.log.debug("Successfully deleted namespace configuration option.");
 +      } else {
 +        if (!Property.isValidZooPropertyKey(property)) {
 +          Shell.log.warn("Invalid per-table property : " + property + ", still removing from zookeeper if it's there.");
 +        }
 +        shellState.getConnector().instanceOperations().removeProperty(property);
 +        Shell.log.debug("Successfully deleted system configuration option");
 +      }
 +    } else if (cl.hasOption(setOpt.getOpt())) {
 +      // set property on table
 +      String property = cl.getOptionValue(setOpt.getOpt()), value = null;
 +      if (!property.contains("=")) {
 +        throw new BadArgumentException("Missing '=' operator in set operation.", fullCommand, fullCommand.indexOf(property));
 +      }
 +      final String pair[] = property.split("=", 2);
 +      property = pair[0];
 +      value = pair[1];
 +
 +      if (tableName != null) {
 +        if (!Property.isValidTablePropertyKey(property)) {
 +          throw new BadArgumentException("Invalid per-table property.", fullCommand, fullCommand.indexOf(property));
 +        }
 +        if (property.equals(Property.TABLE_DEFAULT_SCANTIME_VISIBILITY.getKey())) {
 +          new ColumnVisibility(value); // validate that it is a valid expression
 +        }
 +        shellState.getConnector().tableOperations().setProperty(tableName, property, value);
 +        Shell.log.debug("Successfully set table configuration option.");
 +      } else if (namespace != null) {
 +        if (!Property.isValidTablePropertyKey(property)) {
 +          throw new BadArgumentException("Invalid per-table property.", fullCommand, fullCommand.indexOf(property));
 +        }
 +        if (property.equals(Property.TABLE_DEFAULT_SCANTIME_VISIBILITY.getKey())) {
 +          new ColumnVisibility(value); // validate that it is a valid expression
 +        }
 +        shellState.getConnector().namespaceOperations().setProperty(namespace, property, value);
 +        Shell.log.debug("Successfully set table configuration option.");
 +      } else {
 +        if (!Property.isValidZooPropertyKey(property)) {
 +          throw new BadArgumentException("Property cannot be modified in zookeeper", fullCommand, fullCommand.indexOf(property));
 +        }
 +        shellState.getConnector().instanceOperations().setProperty(property, value);
 +        Shell.log.debug("Successfully set system configuration option");
 +      }
 +    } else {
 +      // display properties
 +      final TreeMap<String,String> systemConfig = new TreeMap<String,String>();
 +      systemConfig.putAll(shellState.getConnector().instanceOperations().getSystemConfiguration());
 +
 +      final String outputFile = cl.getOptionValue(outputFileOpt.getOpt());
 +      final PrintFile printFile = outputFile == null ? null : new PrintFile(outputFile);
 +
 +      final TreeMap<String,String> siteConfig = new TreeMap<String,String>();
 +      siteConfig.putAll(shellState.getConnector().instanceOperations().getSiteConfiguration());
 +
 +      final TreeMap<String,String> defaults = new TreeMap<String,String>();
 +      for (Entry<String,String> defaultEntry : AccumuloConfiguration.getDefaultConfiguration()) {
 +        defaults.put(defaultEntry.getKey(), defaultEntry.getValue());
 +      }
 +
 +      final TreeMap<String,String> namespaceConfig = new TreeMap<String,String>();
 +      if (tableName != null) {
 +        String n = Namespaces.getNamespaceName(shellState.getInstance(),
 +            Tables.getNamespaceId(shellState.getInstance(), Tables.getTableId(shellState.getInstance(), tableName)));
 +        for (Entry<String,String> e : shellState.getConnector().namespaceOperations().getProperties(n)) {
 +          namespaceConfig.put(e.getKey(), e.getValue());
 +        }
 +      }
 +
 +      Iterable<Entry<String,String>> acuconf = shellState.getConnector().instanceOperations().getSystemConfiguration().entrySet();
 +      if (tableName != null) {
 +        acuconf = shellState.getConnector().tableOperations().getProperties(tableName);
 +      } else if (namespace != null) {
 +        acuconf = shellState.getConnector().namespaceOperations().getProperties(namespace);
 +      }
 +      final TreeMap<String,String> sortedConf = new TreeMap<String,String>();
 +      for (Entry<String,String> propEntry : acuconf) {
 +        sortedConf.put(propEntry.getKey(), propEntry.getValue());
 +      }
 +
 +      for (Entry<String,String> propEntry : acuconf) {
 +        final String key = propEntry.getKey();
 +        // only show properties with similar names to that
 +        // specified, or all of them if none specified
 +        if (cl.hasOption(filterOpt.getOpt()) && !key.contains(cl.getOptionValue(filterOpt.getOpt()))) {
 +          continue;
 +        }
 +        if ((tableName != null || namespace != null) && !Property.isValidTablePropertyKey(key)) {
 +          continue;
 +        }
 +        COL2 = Math.max(COL2, propEntry.getKey().length() + 3);
 +      }
 +
 +      final ArrayList<String> output = new ArrayList<String>();
 +      printConfHeader(output);
 +
 +      for (Entry<String,String> propEntry : sortedConf.entrySet()) {
 +        final String key = propEntry.getKey();
 +
 +        // only show properties with similar names to that
 +        // specified, or all of them if none specified
 +        if (cl.hasOption(filterOpt.getOpt()) && !key.contains(cl.getOptionValue(filterOpt.getOpt()))) {
 +          continue;
 +        }
 +        if ((tableName != null || namespace != null) && !Property.isValidTablePropertyKey(key)) {
 +          continue;
 +        }
 +        String siteVal = siteConfig.get(key);
 +        String sysVal = systemConfig.get(key);
 +        String curVal = propEntry.getValue();
 +        String dfault = defaults.get(key);
 +        String nspVal = namespaceConfig.get(key);
 +        boolean printed = false;
 +
 +        if (dfault != null && key.toLowerCase().contains("password")) {
 +          siteVal = sysVal = dfault = curVal = curVal.replaceAll(".", "*");
 +        }
 +        if (sysVal != null) {
 +          if (defaults.containsKey(key) && !Property.getPropertyByKey(key).isExperimental()) {
 +            printConfLine(output, "default", key, dfault);
 +            printed = true;
 +          }
 +          if (!defaults.containsKey(key) || !defaults.get(key).equals(siteVal)) {
 +            printConfLine(output, "site", printed ? "   @override" : key, siteVal == null ? "" : siteVal);
 +            printed = true;
 +          }
 +          if (!siteConfig.containsKey(key) || !siteVal.equals(sysVal)) {
-             printConfLine(output, "system", printed ? "   @override" : key, sysVal == null ? "" : sysVal);
++            printConfLine(output, "system", printed ? "   @override" : key, sysVal);
 +            printed = true;
 +          }
 +
 +        }
 +        if (nspVal != null) {
 +          if (!systemConfig.containsKey(key) || !sysVal.equals(nspVal)) {
-             printConfLine(output, "namespace", printed ? "   @override" : key, nspVal == null ? "" : nspVal);
++            printConfLine(output, "namespace", printed ? "   @override" : key, nspVal);
 +            printed = true;
 +          }
 +        }
 +
 +        // show per-table value only if it is different (overridden)
 +        if (tableName != null && !curVal.equals(nspVal)) {
 +          printConfLine(output, "table", printed ? "   @override" : key, curVal);
 +        } else if (namespace != null && !curVal.equals(sysVal)) {
 +          printConfLine(output, "namespace", printed ? "   @override" : key, curVal);
 +        }
 +      }
 +      printConfFooter(output);
 +      shellState.printLines(output.iterator(), !cl.hasOption(disablePaginationOpt.getOpt()), printFile);
 +      if (printFile != null) {
 +        printFile.close();
 +      }
 +    }
 +    return 0;
 +  }
 +
 +  private void printConfHeader(List<String> output) {
 +    printConfFooter(output);
 +    output.add(String.format("%-" + COL1 + "s | %-" + COL2 + "s | %s", "SCOPE", "NAME", "VALUE"));
 +    printConfFooter(output);
 +  }
 +
 +  private void printConfLine(List<String> output, String s1, String s2, String s3) {
 +    if (s2.length() < COL2) {
 +      s2 += " " + Shell.repeat(".", COL2 - s2.length() - 1);
 +    }
 +    output.add(String.format("%-" + COL1 + "s | %-" + COL2 + "s | %s", s1, s2,
 +        s3.replace("\n", "\n" + Shell.repeat(" ", COL1 + 1) + "|" + Shell.repeat(" ", COL2 + 2) + "|" + " ")));
 +  }
 +
 +  private void printConfFooter(List<String> output) {
 +    int col3 = Math.max(1, Math.min(Integer.MAX_VALUE, reader.getTerminal().getWidth() - COL1 - COL2 - 6));
 +    output.add(String.format("%" + COL1 + "s-+-%" + COL2 + "s-+-%-" + col3 + "s", Shell.repeat("-", COL1), Shell.repeat("-", COL2), Shell.repeat("-", col3)));
 +  }
 +
 +  @Override
 +  public String description() {
 +    return "prints system properties and table specific properties";
 +  }
 +
 +  @Override
 +  public Options getOptions() {
 +    final Options o = new Options();
 +    final OptionGroup og = new OptionGroup();
 +    final OptionGroup tgroup = new OptionGroup();
 +
 +    tableOpt = new Option(ShellOptions.tableOption, "table", true, "table to display/set/delete properties for");
 +    deleteOpt = new Option("d", "delete", true, "delete a per-table property");
 +    setOpt = new Option("s", "set", true, "set a per-table property");
 +    filterOpt = new Option("f", "filter", true, "show only properties that contain this string");
 +    disablePaginationOpt = new Option("np", "no-pagination", false, "disables pagination of output");
 +    outputFileOpt = new Option("o", "output", true, "local file to write the scan output to");
 +    namespaceOpt = new Option(ShellOptions.namespaceOption, "namespace", true, "namespace to display/set/delete properties for");
 +
 +    tableOpt.setArgName("table");
 +    deleteOpt.setArgName("property");
 +    setOpt.setArgName("property=value");
 +    filterOpt.setArgName("string");
 +    outputFileOpt.setArgName("file");
 +    namespaceOpt.setArgName("namespace");
 +
 +    og.addOption(deleteOpt);
 +    og.addOption(setOpt);
 +    og.addOption(filterOpt);
 +
 +    tgroup.addOption(tableOpt);
 +    tgroup.addOption(namespaceOpt);
 +
 +    o.addOptionGroup(tgroup);
 +    o.addOptionGroup(og);
 +    o.addOption(disablePaginationOpt);
 +    o.addOption(outputFileOpt);
 +
 +    return o;
 +  }
 +
 +  @Override
 +  public int numArgs() {
 +    return 0;
 +  }
 +}


[06/21] git commit: ACCUMULO-3226 Remove unnecessary null check

Posted by el...@apache.org.
ACCUMULO-3226 Remove unnecessary null check


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

Branch: refs/heads/master
Commit: 633e4df18492bac952651b6cd8bb56823cdf3c12
Parents: 7b1bb10
Author: Josh Elser <el...@apache.org>
Authored: Fri Oct 10 17:28:10 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 10 17:28:10 2014 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/accumulo/core/security/Authorizations.java | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/633e4df1/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java b/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
index b546a48..b983a59 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
@@ -131,7 +131,6 @@ public class Authorizations implements Iterable<byte[]>, Serializable {
       }
     } else {
       // it's the old format
-      ArgumentChecker.notNull(authorizations);
       if (authorizations.length > 0)
         setAuthorizations(authsString.split(","));
     }