accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1493916 [2/5] - in /accumulo/branches/ACCUMULO-118: ./ assemble/ assemble/src/main/assemblies/ conf/ conf/examples/1GB/native-standalone/ conf/examples/1GB/standalone/ conf/examples/2GB/native-standalone/ conf/examples/2GB/standalone/ conf...
Date Mon, 17 Jun 2013 20:12:07 GMT
Modified: accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java Mon Jun 17 20:12:04 2013
@@ -20,13 +20,13 @@ import java.util.Collection;
 import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Set;
 import java.util.Map.Entry;
+import java.util.Set;
 import java.util.SortedMap;
 import java.util.SortedSet;
 import java.util.TreeMap;
-import java.util.TreeSet;
 import java.util.concurrent.ConcurrentSkipListMap;
+import java.util.concurrent.ConcurrentSkipListSet;
 
 import org.apache.accumulo.core.client.admin.TimeType;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
@@ -87,7 +87,7 @@ public class MockTable {
   final Map<String,String> settings;
   Map<String,EnumSet<TablePermission>> userPermissions = new HashMap<String,EnumSet<TablePermission>>();
   private TimeType timeType;
-  SortedSet<Text> splits = new TreeSet<Text>();
+  SortedSet<Text> splits = new ConcurrentSkipListSet<Text>();
   Map<String,Set<Text>> localityGroups = new TreeMap<String, Set<Text>>();
   
   MockTable(boolean limitVersion, TimeType timeType) {
@@ -101,6 +101,8 @@ public class MockTable {
   }
   
   synchronized void addMutation(Mutation m) {
+    if (m.size() == 0)
+      throw new IllegalArgumentException("Can not add empty mutations");
     long now = System.currentTimeMillis();
     mutationCount++;
     for (ColumnUpdate u : m.getUpdates()) {

Modified: accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/conf/Property.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/conf/Property.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/conf/Property.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/conf/Property.java Mon Jun 17 20:12:04 2013
@@ -34,27 +34,35 @@ import org.apache.log4j.Logger;
 
 public enum Property {
   // Crypto-related properties
-  CRYPTO_PREFIX("crypto.", null, PropertyType.PREFIX, "Properties in this category related to the configuration of both default and custom crypto modules.",
-      true, false),
+  @Experimental
+  CRYPTO_PREFIX("crypto.", null, PropertyType.PREFIX, "Properties in this category related to the configuration of both default and custom crypto modules."),
+  @Experimental
   CRYPTO_MODULE_CLASS("crypto.module.class", "NullCryptoModule", PropertyType.STRING,
       "Fully qualified class name of the class that implements the CryptoModule interface, to be used in setting up encryption at rest for the WAL and "
-          + "(future) other parts of the code.", true, false),
-  CRYPTO_CIPHER_SUITE("crypto.cipher.suite", "NullCipher", PropertyType.STRING, "Describes the cipher suite to use for the write-ahead log", true, false),
+          + "(future) other parts of the code."),
+  @Experimental
+  CRYPTO_CIPHER_SUITE("crypto.cipher.suite", "NullCipher", PropertyType.STRING, "Describes the cipher suite to use for the write-ahead log"),
+  @Experimental
   CRYPTO_CIPHER_ALGORITHM_NAME("crypto.cipher.algorithm.name", "NullCipher", PropertyType.STRING,
-      "States the name of the algorithm used in the corresponding cipher suite. Do not make these different, unless you enjoy mysterious exceptions and bugs.",
-      true, false),
+      "States the name of the algorithm used in the corresponding cipher suite. Do not make these different, unless you enjoy mysterious exceptions and bugs."),
+  @Experimental
   CRYPTO_CIPHER_KEY_LENGTH("crypto.cipher.key.length", "128", PropertyType.STRING,
-      "Specifies the key length *in bits* to use for the symmetric key, should probably be 128 or 256 unless you really know what you're doing", true, false),
+      "Specifies the key length *in bits* to use for the symmetric key, should probably be 128 or 256 unless you really know what you're doing"),
+  @Experimental
   CRYPTO_SECURE_RNG("crypto.secure.rng", "SHA1PRNG", PropertyType.STRING,
-      "States the secure random number generator to use, and defaults to the built-in Sun SHA1PRNG", true, false),
+      "States the secure random number generator to use, and defaults to the built-in Sun SHA1PRNG"),
+  @Experimental
   CRYPTO_SECURE_RNG_PROVIDER("crypto.secure.rng.provider", "SUN", PropertyType.STRING,
-      "States the secure random number generator provider to use, and defaults to the built-in SUN provider", true, false),
+      "States the secure random number generator provider to use, and defaults to the built-in SUN provider"),
+  @Experimental
   CRYPTO_SECRET_KEY_ENCRYPTION_STRATEGY_CLASS("crypto.secret.key.encryption.strategy.class", "NullSecretKeyEncryptionStrategy", PropertyType.STRING,
-      "The class Accumulo should use for its key encryption strategy.", true, false),
+      "The class Accumulo should use for its key encryption strategy."),
+  @Experimental
   CRYPTO_DEFAULT_KEY_STRATEGY_HDFS_URI("crypto.default.key.strategy.hdfs.uri", "", PropertyType.STRING,
-      "The URL Accumulo should use to connect to DFS. If this is blank, Accumulo will obtain this information from the Hadoop configuration", true, false),
+      "The URL Accumulo should use to connect to DFS. If this is blank, Accumulo will obtain this information from the Hadoop configuration"),
+  @Experimental
   CRYPTO_DEFAULT_KEY_STRATEGY_KEY_LOCATION("crypto.default.key.strategy.key.location", "/accumulo/crypto/secret/keyEncryptionKey", PropertyType.ABSOLUTEPATH,
-      "The absolute path of where to store the key encryption key within HDFS.", true, false),
+      "The absolute path of where to store the key encryption key within HDFS."),
   
   // instance properties (must be the same for every node in an instance)
   INSTANCE_PREFIX("instance.", null, PropertyType.PREFIX,
@@ -66,6 +74,7 @@ public enum Property {
       "The url accumulo should use to connect to DFS.  If this is empty, accumulo will obtain this information from the hadoop configuration."),
   INSTANCE_DFS_DIR("instance.dfs.dir", "/accumulo", PropertyType.ABSOLUTEPATH,
       "HDFS directory in which accumulo instance will run.  Do not change after accumulo is initialized."),
+  @Sensitive
   INSTANCE_SECRET("instance.secret", "DEFAULT", PropertyType.STRING,
       "A secret unique to a given instance that all servers must know in order to communicate with one another."
           + " Change it before initialization. To change it later use ./bin/accumulo accumulo.server.util.ChangeSecret [oldpasswd] [newpasswd], "
@@ -205,7 +214,9 @@ public enum Property {
   // properties that are specific to logger server behavior
   LOGGER_PREFIX("logger.", null, PropertyType.PREFIX, "Properties in this category affect the behavior of the write-ahead logger servers"),
   LOGGER_DIR("logger.dir.walog", "walogs", PropertyType.PATH,
-      "The directory used to store write-ahead logs on the local filesystem. It is possible to specify a comma-separated list of directories."),
+      "The property only needs to be set if upgrading from 1.4 which used to store write-ahead logs on the local filesystem. In 1.5 write-ahead logs are "
+          + "stored in DFS.  When 1.5 is started for the first time it will copy any 1.4 write ahead logs into DFS.  It is possible to specify a "
+          + "comma-separated list of directories."),
   
   // accumulo garbage collector properties
   GC_PREFIX("gc.", null, PropertyType.PREFIX, "Properties in this category affect the behavior of the accumulo garbage collector."),
@@ -224,16 +235,24 @@ public enum Property {
   MONITOR_BANNER_COLOR("monitor.banner.color", "#c4c4c4", PropertyType.STRING, "The color of the banner text displayed on the monitor page."),
   MONITOR_BANNER_BACKGROUND("monitor.banner.background", "#304065", PropertyType.STRING,
       "The background color of the banner text displayed on the monitor page."),
-  MONITOR_SSL_KEYSTORE("monitor.ssl.keyStore", "", PropertyType.PATH, "The keystore for enabling monitor SSL.", true, false),
-  MONITOR_SSL_KEYSTOREPASS("monitor.ssl.keyStorePassword", "", PropertyType.STRING, "The keystore password for enabling monitor SSL.", true, false),
-  MONITOR_SSL_TRUSTSTORE("monitor.ssl.trustStore", "", PropertyType.PATH, "The truststore for enabling monitor SSL.", true, false),
-  MONITOR_SSL_TRUSTSTOREPASS("monitor.ssl.trustStorePassword", "", PropertyType.STRING, "The truststore password for enabling monitor SSL.", true, false),
+  @Experimental
+  MONITOR_SSL_KEYSTORE("monitor.ssl.keyStore", "", PropertyType.PATH, "The keystore for enabling monitor SSL."),
+  @Experimental
+  @Sensitive
+  MONITOR_SSL_KEYSTOREPASS("monitor.ssl.keyStorePassword", "", PropertyType.STRING, "The keystore password for enabling monitor SSL."),
+  @Experimental
+  MONITOR_SSL_TRUSTSTORE("monitor.ssl.trustStore", "", PropertyType.PATH, "The truststore for enabling monitor SSL."),
+  @Experimental
+  @Sensitive
+  MONITOR_SSL_TRUSTSTOREPASS("monitor.ssl.trustStorePassword", "", PropertyType.STRING, "The truststore password for enabling monitor SSL."),
   
   TRACE_PREFIX("trace.", null, PropertyType.PREFIX, "Properties in this category affect the behavior of distributed tracing."),
   TRACE_PORT("trace.port.client", "12234", PropertyType.PORT, "The listening port for the trace server"),
   TRACE_TABLE("trace.table", "trace", PropertyType.STRING, "The name of the table to store distributed traces"),
   TRACE_USER("trace.user", "root", PropertyType.STRING, "The name of the user to store distributed traces"),
+  @Sensitive
   TRACE_PASSWORD("trace.password", "secret", PropertyType.STRING, "The password for the user used to store distributed traces"),
+  @Sensitive
   TRACE_TOKEN_PROPERTY_PREFIX("trace.token.property", null, PropertyType.PREFIX,
       "The prefix used to create a token for storing distributed traces.  For each propetry required by trace.token.type, place this prefix in front of it."),
   TRACE_TOKEN_TYPE("trace.token.type", PasswordToken.class.getName(), PropertyType.CLASSNAME, "An AuthenticationToken type supported by the authorizer"),
@@ -343,27 +362,27 @@ public enum Property {
           + "You can enable post delegation for a context, which will load classes from the context first instead of the parent first.  "
           + "Do this by setting general.vfs.context.classpath.&lt;name&gt;.delegation=post, where &lt;name&gt; is your context name.  "
           + "If delegation is not specified, it defaults to loading from parent classloader first."),
+  @Interpolated
   VFS_CLASSLOADER_CACHE_DIR(AccumuloVFSClassLoader.VFS_CACHE_DIR, "${java.io.tmpdir}" + File.separator + "accumulo-vfs-cache-${user.name}",
       PropertyType.ABSOLUTEPATH, "Directory to use for the vfs cache. The cache will keep a soft reference to all of the classes loaded in the VM."
-          + " This should be on local disk on each node with sufficient space. It defaults to ${java.io.tmpdir}/accumulo-vfs-cache-${user.name}", false, true);
+          + " This should be on local disk on each node with sufficient space. It defaults to ${java.io.tmpdir}/accumulo-vfs-cache-${user.name}"),
+  
+  @Interpolated
+  @Experimental
+  GENERAL_MAVEN_PROJECT_BASEDIR(AccumuloClassLoader.MAVEN_PROJECT_BASEDIR_PROPERTY_NAME, AccumuloClassLoader.DEFAULT_MAVEN_PROJECT_BASEDIR_VALUE,
+      PropertyType.ABSOLUTEPATH, "Set this to automatically add maven target/classes directories to your dynamic classpath"),
+  
+  ;
   
   private String key, defaultValue, description;
   private PropertyType type;
-  private boolean experimental;
-  private boolean interpolated;
   static Logger log = Logger.getLogger(Property.class);
   
-  private Property(String name, String defaultValue, PropertyType type, String description, boolean experimental, boolean interpolated) {
+  private Property(String name, String defaultValue, PropertyType type, String description) {
     this.key = name;
     this.defaultValue = defaultValue;
     this.description = description;
     this.type = type;
-    this.experimental = experimental;
-    this.interpolated = interpolated;
-  }
-  
-  private Property(String name, String defaultValue, PropertyType type, String description) {
-    this(name, defaultValue, type, description, false, false);
   }
   
   @Override
@@ -380,7 +399,7 @@ public enum Property {
   }
   
   public String getDefaultValue() {
-    if (this.interpolated) {
+    if (isInterpolated()) {
       PropertiesConfiguration pconf = new PropertiesConfiguration();
       pconf.append(new SystemConfiguration());
       pconf.addProperty("hack_default_value", this.defaultValue);
@@ -402,8 +421,54 @@ public enum Property {
     return this.description;
   }
   
+  private boolean isInterpolated() {
+    return hasAnnotation(Interpolated.class) || hasPrefixWithAnnotation(getKey(), Interpolated.class);
+  }
+  
   public boolean isExperimental() {
-    return experimental;
+    return hasAnnotation(Experimental.class) || hasPrefixWithAnnotation(getKey(), Experimental.class);
+  }
+  
+  public boolean isDeprecated() {
+    return hasAnnotation(Deprecated.class) || hasPrefixWithAnnotation(getKey(), Deprecated.class);
+  }
+  
+  public boolean isSensitive() {
+    return hasAnnotation(Sensitive.class) || hasPrefixWithAnnotation(getKey(), Sensitive.class);
+  }
+  
+  public static boolean isSensitive(String key) {
+    return hasPrefixWithAnnotation(key, Sensitive.class);
+  }
+  
+  private <T extends Annotation> boolean hasAnnotation(Class<T> annotationType) {
+    Logger log = Logger.getLogger(getClass());
+    try {
+      for (Annotation a : getClass().getField(name()).getAnnotations())
+        if (annotationType.isInstance(a))
+          return true;
+    } catch (SecurityException e) {
+      log.error(e, e);
+    } catch (NoSuchFieldException e) {
+      log.error(e, e);
+    }
+    return false;
+  }
+  
+  private static <T extends Annotation> boolean hasPrefixWithAnnotation(String key, Class<T> annotationType) {
+    // relies on side-effects of isValidPropertyKey to populate validPrefixes
+    if (isValidPropertyKey(key)) {
+      // check if property exists on its own and has the annotation
+      if (Property.getPropertyByKey(key) != null)
+        return getPropertyByKey(key).hasAnnotation(annotationType);
+      // can't find the property, so check the prefixes
+      boolean prefixHasAnnotation = false;
+      for (String prefix : validPrefixes)
+        if (key.startsWith(prefix))
+          prefixHasAnnotation = prefixHasAnnotation || getPropertyByKey(prefix).hasAnnotation(annotationType);
+      return prefixHasAnnotation;
+    }
+    return false;
   }
   
   private static HashSet<String> validTableProperties = null;
@@ -484,20 +549,6 @@ public enum Property {
         || key.equals(Property.TABLE_LOAD_BALANCER.getKey());
   }
   
-  public boolean isDeprecated() {
-    Logger log = Logger.getLogger(getClass());
-    try {
-      for (Annotation a : getClass().getField(name()).getAnnotations())
-        if (a instanceof Deprecated)
-          return true;
-    } catch (SecurityException e) {
-      log.error(e, e);
-    } catch (NoSuchFieldException e) {
-      log.error(e, e);
-    }
-    return false;
-  }
-  
   public static <T> T createInstanceFromPropertyName(AccumuloConfiguration conf, Property property, Class<T> base, T defaultInstance) {
     String clazzName = conf.get(property);
     T instance = null;

Modified: accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java Mon Jun 17 20:12:04 2013
@@ -40,7 +40,8 @@ public class Authorizations implements I
   
   private Set<ByteSequence> auths = new HashSet<ByteSequence>();
   private List<byte[]> authsList = new ArrayList<byte[]>();
-  private List<byte[]> immutableList = Collections.unmodifiableList(authsList);
+  
+  public static final Authorizations EMPTY = new Authorizations();
   
   private static final boolean[] validAuthChars = new boolean[256];
   
@@ -183,7 +184,13 @@ public class Authorizations implements I
    * @see #Authorizations(Collection)
    */
   public List<byte[]> getAuthorizations() {
-    return immutableList;
+    ArrayList<byte[]> copy = new ArrayList<byte[]>(authsList.size());
+    for (byte[] auth : authsList) {
+      byte[] bytes = new byte[auth.length];
+      System.arraycopy(auth, 0, bytes, 0, auth.length);
+      copy.add(bytes);
+    }
+    return Collections.unmodifiableList(copy);
   }
   
   /**
@@ -192,7 +199,7 @@ public class Authorizations implements I
    * @see #Authorizations(List)
    */
   public List<ByteBuffer> getAuthorizationsBB() {
-    return ByteBufferUtil.toByteBuffers(immutableList);
+    return ByteBufferUtil.toImmutableByteBufferList(getAuthorizations());
   }
   
   @Override
@@ -262,7 +269,7 @@ public class Authorizations implements I
   
   @Override
   public Iterator<byte[]> iterator() {
-    return immutableList.iterator();
+    return getAuthorizations().iterator();
   }
   
   /**
@@ -271,7 +278,7 @@ public class Authorizations implements I
   public String serialize() {
     StringBuilder sb = new StringBuilder(HEADER);
     String sep = "";
-    for (byte[] auth : immutableList) {
+    for (byte[] auth : authsList) {
       sb.append(sep);
       sep = ",";
       sb.append(new String(Base64.encodeBase64(auth), Constants.UTF8));

Modified: accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/ByteBufferUtil.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/ByteBufferUtil.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/ByteBufferUtil.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/ByteBufferUtil.java Mon Jun 17 20:12:04 2013
@@ -20,6 +20,7 @@ import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 
 import org.apache.hadoop.io.Text;
@@ -41,6 +42,19 @@ public class ByteBufferUtil {
     return result;
   }
   
+  /**
+   * Provides an immutable view of a list of byte buffers, representing the same bytes. This does not protect against modifying the underlying byte arrays.
+   */
+  public static List<ByteBuffer> toImmutableByteBufferList(Collection<byte[]> bytesList) {
+    if (bytesList == null)
+      return null;
+    ArrayList<ByteBuffer> result = new ArrayList<ByteBuffer>();
+    for (byte[] bytes : bytesList) {
+      result.add(ByteBuffer.wrap(bytes));
+    }
+    return Collections.unmodifiableList(result);
+  }
+  
   public static List<byte[]> toBytesList(Collection<ByteBuffer> bytesList) {
     if (bytesList == null)
       return null;

Modified: accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/Merge.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/Merge.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/Merge.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/Merge.java Mon Jun 17 20:12:04 2013
@@ -32,6 +32,7 @@ import org.apache.accumulo.core.conf.Pro
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.KeyExtent;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.security.Authorizations;
 import org.apache.commons.cli.ParseException;
 import org.apache.hadoop.io.Text;
 import org.apache.log4j.Logger;
@@ -61,6 +62,7 @@ public class Merge {
       return AccumuloConfiguration.getMemoryInBytes(value);
     }
   }
+  
   static class TextConverter implements IStringConverter<Text> {
     @Override
     public Text convert(String value) {
@@ -69,13 +71,13 @@ public class Merge {
   }
   
   static class Opts extends ClientOnRequiredTable {
-    @Parameter(names={"-s", "--size"}, description="merge goal size", converter=MemoryConverter.class)
+    @Parameter(names = {"-s", "--size"}, description = "merge goal size", converter = MemoryConverter.class)
     Long goalSize = null;
-    @Parameter(names={"-f", "--force"}, description="merge small tablets even if merging them to larger tablets might cause a split")
+    @Parameter(names = {"-f", "--force"}, description = "merge small tablets even if merging them to larger tablets might cause a split")
     boolean force = false;
-    @Parameter(names={"-b", "--begin"}, description="start tablet", converter=TextConverter.class)
+    @Parameter(names = {"-b", "--begin"}, description = "start tablet", converter = TextConverter.class)
     Text begin = null;
-    @Parameter(names={"-e", "--end"}, description="end tablet", converter=TextConverter.class)
+    @Parameter(names = {"-e", "--end"}, description = "end tablet", converter = TextConverter.class)
     Text end = null;
   }
   
@@ -210,7 +212,7 @@ public class Merge {
     Scanner scanner;
     try {
       tableId = Tables.getTableId(conn.getInstance(), tablename);
-      scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
+      scanner = conn.createScanner(Constants.METADATA_TABLE_NAME, Authorizations.EMPTY);
     } catch (Exception e) {
       throw new MergeException(e);
     }

Modified: accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java Mon Jun 17 20:12:04 2013
@@ -38,6 +38,7 @@ import org.apache.accumulo.core.data.Key
 import org.apache.accumulo.core.data.PartialKey;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.CredentialHelper;
 import org.apache.accumulo.core.security.thrift.TCredentials;
 import org.apache.hadoop.io.Text;
@@ -94,6 +95,7 @@ public class MetadataTable {
       return ("" + size + "," + numEntries).getBytes();
     }
     
+    @Override
     public boolean equals(Object o) {
       if (o instanceof DataFileValue) {
         DataFileValue odfv = (DataFileValue) o;
@@ -104,10 +106,12 @@ public class MetadataTable {
       return false;
     }
     
+    @Override
     public int hashCode() {
       return Long.valueOf(size + numEntries).hashCode();
     }
     
+    @Override
     public String toString() {
       return size + " " + numEntries;
     }
@@ -164,7 +168,7 @@ public class MetadataTable {
           results.put(ke, location);
         else
           locationless.add(ke);
-
+        
         location = null;
         prevRow = null;
       }
@@ -172,7 +176,7 @@ public class MetadataTable {
     
     return new Pair<SortedMap<KeyExtent,Text>,List<KeyExtent>>(results, locationless);
   }
-
+  
   public static SortedMap<Text,SortedMap<ColumnFQ,Value>> getTabletEntries(SortedMap<Key,Value> tabletKeyValues, List<ColumnFQ> columns) {
     TreeMap<Text,SortedMap<ColumnFQ,Value>> tabletEntries = new TreeMap<Text,SortedMap<ColumnFQ,Value>>();
     
@@ -200,12 +204,13 @@ public class MetadataTable {
     
     return tabletEntries;
   }
-    
+  
   public static void getEntries(Instance instance, TCredentials credentials, String table, boolean isTid, Map<KeyExtent,String> locations,
       SortedSet<KeyExtent> tablets) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
     String tableId = isTid ? table : Tables.getNameToIdMap(instance).get(table);
     
-    Scanner scanner = instance.getConnector(credentials.getPrincipal(), CredentialHelper.extractToken(credentials)).createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
+    Scanner scanner = instance.getConnector(credentials.getPrincipal(), CredentialHelper.extractToken(credentials)).createScanner(
+        Constants.METADATA_TABLE_NAME, Authorizations.EMPTY);
     
     Constants.METADATA_PREV_ROW_COLUMN.fetch(scanner);
     scanner.fetchColumnFamily(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY);

Modified: accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/shell/commands/GetSplitsCommand.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/shell/commands/GetSplitsCommand.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/shell/commands/GetSplitsCommand.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/shell/commands/GetSplitsCommand.java Mon Jun 17 20:12:04 2013
@@ -31,6 +31,7 @@ import org.apache.accumulo.core.data.Key
 import org.apache.accumulo.core.data.KeyExtent;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.util.TextUtil;
 import org.apache.accumulo.core.util.format.BinaryFormatter;
 import org.apache.accumulo.core.util.shell.Shell;
@@ -68,7 +69,7 @@ public class GetSplitsCommand extends Co
           p.print(encode(encode, row));
         }
       } else {
-        final Scanner scanner = shellState.getConnector().createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
+        final Scanner scanner = shellState.getConnector().createScanner(Constants.METADATA_TABLE_NAME, Authorizations.EMPTY);
         Constants.METADATA_PREV_ROW_COLUMN.fetch(scanner);
         final Text start = new Text(shellState.getConnector().tableOperations().tableIdMap().get(tableName));
         final Text end = new Text(start);

Modified: accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ScanCommand.java Mon Jun 17 20:12:04 2013
@@ -22,7 +22,6 @@ import java.util.List;
 import java.util.Map.Entry;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.IteratorSetting;
@@ -57,8 +56,9 @@ public class ScanCommand extends Command
   private Option timeoutOption;
   private Option profileOpt;
   
+  @Override
   public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception {
-
+    
     final String outputFile = cl.getOptionValue(outputFileOpt.getOpt());
     final PrintFile printFile = outputFile == null ? null : new PrintFile(outputFile);
     
@@ -83,7 +83,7 @@ public class ScanCommand extends Command
     
     // set timeout
     scanner.setTimeout(getTimeout(cl), TimeUnit.MILLISECONDS);
-
+    
     // output the records
     if (cl.hasOption(showFewOpt.getOpt())) {
       final String showLength = cl.getOptionValue(showFewOpt.getOpt());
@@ -117,7 +117,7 @@ public class ScanCommand extends Command
     
     return Long.MAX_VALUE;
   }
-
+  
   protected void addScanIterators(final Shell shellState, CommandLine cl, final Scanner scanner, final String tableName) {
     
     List<IteratorSetting> tableScanIterators;
@@ -135,7 +135,7 @@ public class ScanCommand extends Command
         return;
       }
     }
-
+    
     Shell.log.debug("Found " + tableScanIterators.size() + " scan iterators to set");
     
     for (IteratorSetting setting : tableScanIterators) {
@@ -161,7 +161,7 @@ public class ScanCommand extends Command
       shellState.printRecords(scanner, cl.hasOption(timestampOpt.getOpt()), !cl.hasOption(disablePaginationOpt.getOpt()), formatter, outFile);
     }
   }
-
+  
   protected void printBinaryRecords(final CommandLine cl, final Shell shellState, final Iterable<Entry<Key,Value>> scanner) throws IOException {
     printBinaryRecords(cl, shellState, scanner, null);
   }
@@ -187,16 +187,16 @@ public class ScanCommand extends Command
     } catch (ClassNotFoundException e) {
       shellState.getReader().println("Interpreter class could not be loaded.\n" + e.getMessage());
     }
-
+    
     if (clazz == null)
       clazz = InterpreterCommand.getCurrentInterpreter(tableName, shellState);
-
+    
     if (clazz == null)
       clazz = DefaultScanInterpreter.class;
     
     return clazz.newInstance();
   }
-
+  
   protected Class<? extends Formatter> getFormatter(final CommandLine cl, final String tableName, final Shell shellState) throws IOException {
     
     try {
@@ -260,7 +260,7 @@ public class ScanCommand extends Command
   
   static Authorizations parseAuthorizations(final String field) {
     if (field == null || field.isEmpty()) {
-      return Constants.NO_AUTHS;
+      return Authorizations.EMPTY;
     }
     return new Authorizations(field.split(","));
   }
@@ -302,7 +302,7 @@ public class ScanCommand extends Command
     
     profileOpt = new Option("pn", "profile", true, "iterator profile name");
     profileOpt.setArgName("profile");
-
+    
     o.addOption(scanOptAuths);
     o.addOption(scanOptRow);
     o.addOption(OptUtil.startRowOpt());

Modified: accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java Mon Jun 17 20:12:04 2013
@@ -23,7 +23,6 @@ import static org.junit.Assert.assertTru
 
 import java.util.concurrent.TimeUnit;
 
-import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.security.Authorizations;
@@ -51,7 +50,7 @@ public class TestClientOpts {
     assertFalse(args.trace);
     assertEquals(10, bsOpts.scanThreads.intValue());
     assertEquals(null, args.instance);
-    assertEquals(Constants.NO_AUTHS, args.auths);
+    assertEquals(Authorizations.EMPTY, args.auths);
     assertEquals("localhost:2181", args.zookeepers);
     assertFalse(args.help);
     

Modified: accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java Mon Jun 17 20:12:04 2013
@@ -21,7 +21,6 @@ import java.util.Map.Entry;
 
 import junit.framework.TestCase;
 
-import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.Connector;
@@ -31,6 +30,7 @@ import org.apache.accumulo.core.client.s
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.security.Authorizations;
 import org.apache.hadoop.io.Text;
 
 public class FindMaxTest extends TestCase {
@@ -70,7 +70,7 @@ public class FindMaxTest extends TestCas
     
     bw.close();
     
-    Scanner scanner = conn.createScanner("foo", Constants.NO_AUTHS);
+    Scanner scanner = conn.createScanner("foo", Authorizations.EMPTY);
     
     ArrayList<Text> rows = new ArrayList<Text>();
     
@@ -79,33 +79,33 @@ public class FindMaxTest extends TestCas
     }
     
     for (int i = rows.size() - 1; i > 0; i--) {
-      Text max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), null, true, rows.get(i), false);
+      Text max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), null, true, rows.get(i), false);
       assertEquals(rows.get(i - 1), max);
       
-      max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), rows.get(i - 1), true, rows.get(i), false);
+      max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), rows.get(i - 1), true, rows.get(i), false);
       assertEquals(rows.get(i - 1), max);
       
-      max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), rows.get(i - 1), false, rows.get(i), false);
+      max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), rows.get(i - 1), false, rows.get(i), false);
       assertNull(max);
       
-      max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), null, true, rows.get(i), true);
+      max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), null, true, rows.get(i), true);
       assertEquals(rows.get(i), max);
       
-      max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), rows.get(i), true, rows.get(i), true);
+      max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), rows.get(i), true, rows.get(i), true);
       assertEquals(rows.get(i), max);
       
-      max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), rows.get(i - 1), false, rows.get(i), true);
+      max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), rows.get(i - 1), false, rows.get(i), true);
       assertEquals(rows.get(i), max);
       
     }
     
-    Text max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), null, true, null, true);
+    Text max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), null, true, null, true);
     assertEquals(rows.get(rows.size() - 1), max);
     
-    max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), null, true, new Text(new byte[] {0}), false);
+    max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), null, true, new Text(new byte[] {0}), false);
     assertNull(max);
     
-    max = FindMax.findMax(conn.createScanner("foo", Constants.NO_AUTHS), null, true, new Text(new byte[] {0}), true);
+    max = FindMax.findMax(conn.createScanner("foo", Authorizations.EMPTY), null, true, new Text(new byte[] {0}), true);
     assertEquals(rows.get(0), max);
   }
 }

Modified: accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java Mon Jun 17 20:12:04 2013
@@ -20,12 +20,14 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map.Entry;
 import java.util.Random;
+import java.util.concurrent.TimeUnit;
 
-import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.BatchDeleter;
@@ -46,6 +48,7 @@ import org.apache.accumulo.core.iterator
 import org.apache.accumulo.core.iterators.user.SummingCombiner;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.hadoop.io.Text;
+import org.junit.Assert;
 import org.junit.Test;
 
 public class MockConnectorTest {
@@ -67,7 +70,7 @@ public class MockConnectorTest {
       bw.addMutation(m);
     }
     bw.close();
-    BatchScanner s = c.createBatchScanner("test", Constants.NO_AUTHS, 2);
+    BatchScanner s = c.createBatchScanner("test", Authorizations.EMPTY, 2);
     s.setRanges(Collections.singletonList(new Range()));
     Key key = null;
     int count = 0;
@@ -94,6 +97,43 @@ public class MockConnectorTest {
   }
   
   @Test
+  public void testBadMutations() throws Exception {
+    Connector c = new MockConnector("root", new MockInstance());
+    c.tableOperations().create("test");
+    BatchWriter bw = c
+        .createBatchWriter("test", new BatchWriterConfig().setMaxMemory(10000L).setMaxLatency(1000L, TimeUnit.MILLISECONDS).setMaxWriteThreads(4));
+    
+    try {
+      bw.addMutation(null);
+      Assert.fail("addMutation should throw IAE for null mutation");
+    } catch (IllegalArgumentException iae) {}
+    try {
+      bw.addMutations(null);
+      Assert.fail("addMutations should throw IAE for null iterable");
+    } catch (IllegalArgumentException iae) {}
+    
+    bw.addMutations(Collections.<Mutation> emptyList());
+    
+    Mutation bad = new Mutation("bad");
+    try {
+      bw.addMutation(bad);
+      Assert.fail("addMutation should throw IAE for empty mutation");
+    } catch (IllegalArgumentException iae) {}
+    
+    Mutation good = new Mutation("good");
+    good.put(asText(random.nextInt()), asText(random.nextInt()), new Value("good".getBytes()));
+    List<Mutation> mutations = new ArrayList<Mutation>();
+    mutations.add(good);
+    mutations.add(bad);
+    try {
+      bw.addMutations(mutations);
+      Assert.fail("addMutations should throw IAE if it contains empty mutation");
+    } catch (IllegalArgumentException iae) {}
+    
+    bw.close();
+  }
+  
+  @Test
   public void testAggregation() throws Exception {
     MockInstance mockInstance = new MockInstance();
     Connector c = mockInstance.getConnector("root", new PasswordToken(""));
@@ -113,7 +153,7 @@ public class MockConnectorTest {
     }
     bw.close();
     
-    Scanner s = c.createScanner("perDayCounts", Constants.NO_AUTHS);
+    Scanner s = c.createScanner("perDayCounts", Authorizations.EMPTY);
     Iterator<Entry<Key,Value>> iterator = s.iterator();
     assertTrue(iterator.hasNext());
     checkEntry(iterator.next(), "bar", "day", "20080101", "2");
@@ -144,7 +184,7 @@ public class MockConnectorTest {
     bw.addMutation(m2);
     bw.flush();
     
-    Scanner scanner = c.createScanner("test", Constants.NO_AUTHS);
+    Scanner scanner = c.createScanner("test", Authorizations.EMPTY);
     
     int count = 0;
     for (@SuppressWarnings("unused")
@@ -172,7 +212,7 @@ public class MockConnectorTest {
       c.tableOperations().delete("test");
     c.tableOperations().create("test");
     
-    BatchDeleter deleter = c.createBatchDeleter("test", Constants.NO_AUTHS, 2, new BatchWriterConfig());
+    BatchDeleter deleter = c.createBatchDeleter("test", Authorizations.EMPTY, 2, new BatchWriterConfig());
     // first make sure it deletes fine when its empty
     deleter.setRanges(Collections.singletonList(new Range(("r1"))));
     deleter.delete();
@@ -223,7 +263,7 @@ public class MockConnectorTest {
    *          number of rows the table should contain
    */
   private void checkRemaining(Connector c, String tableName, int count) throws Exception {
-    Scanner scanner = c.createScanner(tableName, Constants.NO_AUTHS);
+    Scanner scanner = c.createScanner(tableName, Authorizations.EMPTY);
     
     int total = 0;
     for (@SuppressWarnings("unused")
@@ -250,7 +290,7 @@ public class MockConnectorTest {
     
     int count = 10;
     
-    Scanner scanner = c.createScanner("test", Constants.NO_AUTHS);
+    Scanner scanner = c.createScanner("test", Authorizations.EMPTY);
     for (Entry<Key,Value> entry : scanner) {
       Key key = entry.getKey();
       Mutation m = new Mutation(key.getRow());
@@ -300,7 +340,7 @@ public class MockConnectorTest {
     b.addMutation(m1);
     b.flush();
     
-    Scanner scanner = c.createScanner("a", Constants.NO_AUTHS);
+    Scanner scanner = c.createScanner("a", Authorizations.EMPTY);
     int count = 0;
     for (@SuppressWarnings("unused")
     Entry<Key,Value> entry : scanner) {
@@ -308,7 +348,7 @@ public class MockConnectorTest {
     }
     assertEquals(1, count);
     count = 0;
-    scanner = c.createScanner("b", Constants.NO_AUTHS);
+    scanner = c.createScanner("b", Authorizations.EMPTY);
     for (@SuppressWarnings("unused")
     Entry<Key,Value> entry : scanner) {
       count++;
@@ -331,7 +371,7 @@ public class MockConnectorTest {
     
     bw.close();
     
-    Scanner scanner = c.createScanner("test", Constants.NO_AUTHS);
+    Scanner scanner = c.createScanner("test", Authorizations.EMPTY);
     
     Entry<Key,Value> entry = scanner.iterator().next();
     

Modified: accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java Mon Jun 17 20:12:04 2013
@@ -26,7 +26,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.BatchScanner;
@@ -110,7 +109,7 @@ public class MockTableOperationsTest {
   }
   
   protected void assertVersionable(Connector c, String tableName, int size) throws TableNotFoundException {
-    BatchScanner s = c.createBatchScanner(tableName, Constants.NO_AUTHS, 1);
+    BatchScanner s = c.createBatchScanner(tableName, Authorizations.EMPTY, 1);
     s.setRanges(Collections.singleton(Range.exact("row1", "cf", "cq")));
     int count = 0;
     for (Map.Entry<Key,Value> e : s) {
@@ -266,7 +265,7 @@ public class MockTableOperationsTest {
     }
     bw.flush();
     to.deleteRows("test", new Text("1"), new Text("2"));
-    Scanner s = connector.createScanner("test", Constants.NO_AUTHS);
+    Scanner s = connector.createScanner("test", Authorizations.EMPTY);
     for (Entry<Key,Value> entry : s) {
       Assert.assertTrue(entry.getKey().getRow().toString().charAt(0) != '1');
     }

Modified: accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java Mon Jun 17 20:12:04 2013
@@ -21,7 +21,6 @@ import static org.junit.Assert.assertEqu
 import java.util.Collections;
 import java.util.Map.Entry;
 
-import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.BatchScanner;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -32,6 +31,7 @@ import org.apache.accumulo.core.data.Key
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.security.Authorizations;
 import org.junit.Test;
 
 public class TestBatchScanner821 {
@@ -48,13 +48,13 @@ public class TestBatchScanner821 {
       bw.addMutation(m);
     }
     bw.flush();
-    BatchScanner bs = conn.createBatchScanner("test", Constants.NO_AUTHS, 1);
+    BatchScanner bs = conn.createBatchScanner("test", Authorizations.EMPTY, 1);
     IteratorSetting cfg = new IteratorSetting(100, TransformIterator.class);
     bs.addScanIterator(cfg);
     bs.setRanges(Collections.singletonList(new Range("A", "Z")));
     StringBuilder sb = new StringBuilder();
     String comma = "";
-    for (Entry<Key,Value>  entry : bs) {
+    for (Entry<Key,Value> entry : bs) {
       sb.append(comma);
       sb.append(entry.getKey().getRow());
       comma = ",";

Modified: accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java Mon Jun 17 20:12:04 2013
@@ -22,6 +22,10 @@ import static org.junit.Assert.assertTru
 
 import java.io.File;
 import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map.Entry;
+import java.util.TreeMap;
+import java.util.TreeSet;
 
 import org.junit.Test;
 
@@ -98,7 +102,8 @@ public class PropertyTest {
     typeCheckValidFormat(PropertyType.ABSOLUTEPATH, "/foo", "/foo/c", "/");
     // in hadoop 2.0 Path only normalizes Windows paths properly when run on a Windows system
     // this makes the following checks fail
-    // typeCheckValidFormat(PropertyType.ABSOLUTEPATH, "d:\\foo12", "c:\\foo\\g", "c:\\foo\\c", "c:\\");
+    if (System.getProperty("os.name").toLowerCase().contains("windows"))
+      typeCheckValidFormat(PropertyType.ABSOLUTEPATH, "d:\\foo12", "c:\\foo\\g", "c:\\foo\\c", "c:\\");
     typeCheckInvalidFormat(PropertyType.ABSOLUTEPATH, "foo12", "foo/g", "foo\\c");
   }
   
@@ -109,4 +114,50 @@ public class PropertyTest {
     assertEquals(new File(System.getProperty("java.io.tmpdir"), "accumulo-vfs-cache-" + System.getProperty("user.name")).getAbsolutePath(),
         conf.get(Property.VFS_CLASSLOADER_CACHE_DIR));
   }
+  
+  @Test
+  public void testSensitiveKeys() {
+    final TreeMap<String,String> extras = new TreeMap<String,String>();
+    extras.put("trace.token.property.blah", "something");
+    
+    AccumuloConfiguration conf = new DefaultConfiguration() {
+      @Override
+      public Iterator<Entry<String,String>> iterator() {
+        final Iterator<Entry<String,String>> parent = super.iterator();
+        final Iterator<Entry<String,String>> mine = extras.entrySet().iterator();
+        
+        return new Iterator<Entry<String,String>>() {
+          
+          @Override
+          public boolean hasNext() {
+            return parent.hasNext() || mine.hasNext();
+          }
+          
+          @Override
+          public Entry<String,String> next() {
+            return parent.hasNext() ? parent.next() : mine.next();
+          }
+          
+          @Override
+          public void remove() {
+            throw new UnsupportedOperationException();
+          }
+        };
+      }
+    };
+    TreeSet<String> expected = new TreeSet<String>();
+    for (Entry<String,String> entry : conf) {
+      String key = entry.getKey();
+      if (key.equals(Property.INSTANCE_SECRET.getKey()) || key.toLowerCase().contains("password") || key.toLowerCase().contains("secret")
+          || key.startsWith(Property.TRACE_TOKEN_PROPERTY_PREFIX.getKey()))
+        expected.add(key);
+    }
+    TreeSet<String> actual = new TreeSet<String>();
+    for (Entry<String,String> entry : conf) {
+      String key = entry.getKey();
+      if (Property.isSensitive(key))
+        actual.add(key);
+    }
+    assertEquals(expected, actual);
+  }
 }

Modified: accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java Mon Jun 17 20:12:04 2013
@@ -28,7 +28,6 @@ import java.util.TreeMap;
 
 import junit.framework.TestCase;
 
-import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.BatchScanner;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.BatchWriterConfig;
@@ -46,6 +45,7 @@ import org.apache.accumulo.core.iterator
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.core.iterators.SortedMapIterator;
 import org.apache.accumulo.core.iterators.system.MultiIterator;
+import org.apache.accumulo.core.security.Authorizations;
 import org.apache.hadoop.io.Text;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
@@ -282,7 +282,7 @@ public class IntersectingIteratorTest ex
     bw.addMutation(m);
     bw.close();
     
-    BatchScanner bs = connector.createBatchScanner("index", Constants.NO_AUTHS, 10);
+    BatchScanner bs = connector.createBatchScanner("index", Authorizations.EMPTY, 10);
     IteratorSetting ii = new IteratorSetting(20, IntersectingIterator.class);
     IntersectingIterator.setColumnFamilies(ii, new Text[] {new Text("rvy"), new Text("15qh")});
     bs.addScanIterator(ii);

Modified: accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java Mon Jun 17 20:12:04 2013
@@ -23,7 +23,6 @@ import java.util.Map.Entry;
 
 import junit.framework.TestCase;
 
-import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.Connector;
@@ -37,6 +36,7 @@ import org.apache.accumulo.core.data.Mut
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
+import org.apache.accumulo.core.security.Authorizations;
 import org.apache.hadoop.io.Text;
 
 /**
@@ -57,7 +57,7 @@ public class RowFilterTest extends TestC
       if (rowIterator.hasTop()) {
         firstKey = new Key(rowIterator.getTopKey());
       }
-
+      
       while (rowIterator.hasTop()) {
         sum += Integer.parseInt(rowIterator.getTopValue().toString());
         rowIterator.next();
@@ -80,7 +80,7 @@ public class RowFilterTest extends TestC
     }
     
   }
-
+  
   public void test1() throws Exception {
     MockInstance instance = new MockInstance("rft1");
     Connector conn = instance.getConnector("", new PasswordToken(""));
@@ -130,11 +130,11 @@ public class RowFilterTest extends TestC
     m.put("cf2", "cq1", "1");
     m.put("cf2", "cq2", "1");
     bw.addMutation(m);
-
+    
     IteratorSetting is = new IteratorSetting(40, SummingRowFilter.class);
     conn.tableOperations().attachIterator("table1", is);
-
-    Scanner scanner = conn.createScanner("table1", Constants.NO_AUTHS);
+    
+    Scanner scanner = conn.createScanner("table1", Authorizations.EMPTY);
     assertEquals(new HashSet<String>(Arrays.asList("2", "3")), getRows(scanner));
     
     scanner.fetchColumn(new Text("cf1"), new Text("cq2"));
@@ -161,7 +161,7 @@ public class RowFilterTest extends TestC
     scanner.fetchColumn(new Text("cf1"), new Text("cq2"));
     scanner.fetchColumn(new Text("cf1"), new Text("cq4"));
     assertEquals(new HashSet<String>(Arrays.asList("4")), getRows(scanner));
-
+    
   }
   
   private HashSet<String> getRows(Scanner scanner) {

Modified: accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/security/AuthorizationsTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/security/AuthorizationsTest.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/security/AuthorizationsTest.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/security/AuthorizationsTest.java Mon Jun 17 20:12:04 2013
@@ -16,9 +16,12 @@
  */
 package org.apache.accumulo.core.security;
 
+import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
+import java.nio.ByteBuffer;
+
 import org.apache.accumulo.core.util.ByteArraySet;
 import org.junit.Test;
 
@@ -57,4 +60,42 @@ public class AuthorizationsTest {
     assertEquals(a1, a2);
     assertEquals(a1.serialize(), a2.serialize());
   }
+  
+  @Test
+  public void testDefensiveAccess() {
+    Authorizations expected = new Authorizations("foo", "a");
+    Authorizations actual = new Authorizations("foo", "a");
+    
+    // foo to goo; test defensive iterator
+    for (byte[] bytes : actual) {
+      bytes[0]++;
+    }
+    assertArrayEquals(expected.getAuthorizationsArray(), actual.getAuthorizationsArray());
+    
+    // test defensive getter and serializer
+    actual.getAuthorizations().get(0)[0]++;
+    assertArrayEquals(expected.getAuthorizationsArray(), actual.getAuthorizationsArray());
+    assertEquals(expected.serialize(), actual.serialize());
+  }
+  
+  // This should throw ReadOnlyBufferException, but THRIFT-883 requires that the ByteBuffers themselves not be read-only
+  // @Test(expected = ReadOnlyBufferException.class)
+  @Test
+  public void testReadOnlyByteBuffer() {
+    Authorizations expected = new Authorizations("foo");
+    Authorizations actual = new Authorizations("foo");
+    
+    assertArrayEquals(expected.getAuthorizationsArray(), actual.getAuthorizationsArray());
+    actual.getAuthorizationsBB().get(0).array()[0]++;
+    assertArrayEquals(expected.getAuthorizationsArray(), actual.getAuthorizationsArray());
+  }
+  
+  @Test(expected = UnsupportedOperationException.class)
+  public void testUnmodifiableList() {
+    Authorizations expected = new Authorizations("foo");
+    Authorizations actual = new Authorizations("foo");
+    
+    assertArrayEquals(expected.getAuthorizationsArray(), actual.getAuthorizationsArray());
+    actual.getAuthorizationsBB().add(ByteBuffer.wrap(new byte[] {'a'}));
+  }
 }

Modified: accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/util/shell/command/FormatterCommandTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/util/shell/command/FormatterCommandTest.java?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/util/shell/command/FormatterCommandTest.java (original)
+++ accumulo/branches/ACCUMULO-118/core/src/test/java/org/apache/accumulo/core/util/shell/command/FormatterCommandTest.java Mon Jun 17 20:12:04 2013
@@ -22,8 +22,6 @@ import java.io.InputStream;
 import java.util.Iterator;
 import java.util.Map.Entry;
 
-import org.junit.Assert;
-
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.TableExistsException;
@@ -35,6 +33,7 @@ import org.apache.accumulo.core.util.she
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
+import org.junit.Assert;
 import org.junit.Test;
 
 /**
@@ -50,7 +49,7 @@ public class FormatterCommandTest {
     Logger.getLogger(Shell.class).setLevel(Level.WARN);
     
     final String[] args = new String[] {"--fake", "-u", "root", "-p", ""};
-   
+    
     final String[] commands = createCommands();
     
     in = MockShell.makeCommands(commands);
@@ -61,32 +60,25 @@ public class FormatterCommandTest {
     
     // Can't call createtable in the shell with MockAccumulo
     shell.getConnector().tableOperations().create("test");
-
+    
     try {
       shell.start();
     } catch (Exception e) {
       Assert.fail("Exception while running commands: " + e.getMessage());
-    } 
+    }
     
     shell.getReader().flush();
     
     final String[] output = StringUtils.split(new String(out.toByteArray()), '\n');
-   
+    
     boolean formatterOn = false;
     
-    final String[] expectedDefault = new String[] {
-        "row cf:cq []    1234abcd",
-        "row cf1:cq1 []    9876fedc",
-        "row2 cf:cq []    13579bdf",
-        "row2 cf1:cq []    2468ace"
-    };
-    
-    final String[] expectedFormatted = new String[] {
-        "row cf:cq []    0x31 0x32 0x33 0x34 0x61 0x62 0x63 0x64",
-        "row cf1:cq1 []    0x39 0x38 0x37 0x36 0x66 0x65 0x64 0x63",
-        "row2 cf:cq []    0x31 0x33 0x35 0x37 0x39 0x62 0x64 0x66",
-        "row2 cf1:cq []    0x32 0x34 0x36 0x38 0x61 0x63 0x65"
-    };
+    final String[] expectedDefault = new String[] {"row cf:cq []    1234abcd", "row cf1:cq1 []    9876fedc", "row2 cf:cq []    13579bdf",
+        "row2 cf1:cq []    2468ace"};
+    
+    final String[] expectedFormatted = new String[] {"row cf:cq []    0x31 0x32 0x33 0x34 0x61 0x62 0x63 0x64",
+        "row cf1:cq1 []    0x39 0x38 0x37 0x36 0x66 0x65 0x64 0x63", "row2 cf:cq []    0x31 0x33 0x35 0x37 0x39 0x62 0x64 0x66",
+        "row2 cf1:cq []    0x32 0x34 0x36 0x38 0x61 0x63 0x65"};
     
     int outputIndex = 0;
     while (outputIndex < output.length) {
@@ -96,7 +88,7 @@ public class FormatterCommandTest {
         if (line.contains("formatter")) {
           formatterOn = true;
         }
-       
+        
         outputIndex++;
       } else if (line.startsWith("row")) {
         int expectedIndex = 0;
@@ -121,48 +113,37 @@ public class FormatterCommandTest {
   }
   
   private String[] createCommands() {
-    return new String[] {
-        "table test",
-        "insert row cf cq 1234abcd",
-        "insert row cf1 cq1 9876fedc",
-        "insert row2 cf cq 13579bdf",
-        "insert row2 cf1 cq 2468ace",
-        "scan",
-        "formatter -t test -f org.apache.accumulo.core.util.shell.command.FormatterCommandTest$HexFormatter",
-        "scan"
-    };
+    return new String[] {"table test", "insert row cf cq 1234abcd", "insert row cf1 cq1 9876fedc", "insert row2 cf cq 13579bdf", "insert row2 cf1 cq 2468ace",
+        "scan", "formatter -t test -f org.apache.accumulo.core.util.shell.command.FormatterCommandTest$HexFormatter", "scan"};
   }
   
   /**
-   * <p>Simple <code>Formatter</code> that will convert each character in the Value
-   * from decimal to hexadecimal. Will automatically skip over characters in the value
-   * which do not fall within the [0-9,a-f] range.</p>
+   * <p>
+   * Simple <code>Formatter</code> that will convert each character in the Value from decimal to hexadecimal. Will automatically skip over characters in the
+   * value which do not fall within the [0-9,a-f] range.
+   * </p>
    * 
-   * <p>Example: <code>'0'</code> will be displayed as <code>'0x30'</code></p>
+   * <p>
+   * Example: <code>'0'</code> will be displayed as <code>'0x30'</code>
+   * </p>
    */
   public static class HexFormatter implements Formatter {
-    private Iterator<Entry<Key, Value>> iter = null;
+    private Iterator<Entry<Key,Value>> iter = null;
     private boolean printTs = false;
-
+    
     private final static String tab = "\t";
     private final static String newline = "\n";
     
     public HexFormatter() {}
     
-    /* (non-Javadoc)
-     * @see java.util.Iterator#hasNext()
-     */
     @Override
     public boolean hasNext() {
       return this.iter.hasNext();
     }
-
-    /* (non-Javadoc)
-     * @see java.util.Iterator#next()
-     */
+    
     @Override
     public String next() {
-      final Entry<Key, Value> entry = iter.next();
+      final Entry<Key,Value> entry = iter.next();
       
       String key;
       
@@ -176,7 +157,7 @@ public class FormatterCommandTest {
       final Value v = entry.getValue();
       
       // Approximate how much space we'll need
-      final StringBuilder sb = new StringBuilder(key.length() + v.getSize() * 5); 
+      final StringBuilder sb = new StringBuilder(key.length() + v.getSize() * 5);
       
       sb.append(key).append(tab);
       
@@ -190,17 +171,10 @@ public class FormatterCommandTest {
       
       return sb.toString();
     }
-
-    /* (non-Javadoc)
-     * @see java.util.Iterator#remove()
-     */
+    
     @Override
-    public void remove() {
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.accumulo.core.util.format.Formatter#initialize(java.lang.Iterable, boolean)
-     */
+    public void remove() {}
+    
     @Override
     public void initialize(final Iterable<Entry<Key,Value>> scanner, final boolean printTimestamps) {
       this.iter = scanner.iterator();

Propchange: accumulo/branches/ACCUMULO-118/docs/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Jun 17 20:12:04 2013
@@ -1,4 +1,3 @@
-config.html
-accumulo_developer_manual.pdf
-accumulo_user_manual.pdf
-apidocs
+.*
+target
+accumulo-docs.iml

Modified: accumulo/branches/ACCUMULO-118/docs/examples/README
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/docs/examples/README?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/docs/examples/README (original)
+++ accumulo/branches/ACCUMULO-118/docs/examples/README Mon Jun 17 20:12:04 2013
@@ -45,6 +45,10 @@ features of Apache Accumulo.
 
    README.bulkIngest:  Ingesting bulk data using map/reduce jobs on Hadoop.
 
+   README.classpath:   Using per-table classpaths.
+
+   README.client:      Using table operations, reading and writing data in Java.
+
    README.combiner:    Using example StatsCombiner to find min, max, sum, and 
                        count.
 
@@ -52,6 +56,8 @@ features of Apache Accumulo.
 
    README.dirlist:     Storing filesystem information.
 
+   README.export:      Exporting and importing tables.
+
    README.filedata:    Storing file data.
 
    README.filter:      Using the AgeOffFilter to remove records more than 30 
@@ -68,9 +74,20 @@ features of Apache Accumulo.
 
    README.maxmutation: Limiting mutation size to avoid running out of memory.
 
+   README.regex:       Using MapReduce and Accumulo to find data using regular
+                       expressions.
+
+   README.rowhash:     Using MapReduce to read a table and write to a new 
+                       column in the same table.
+
    README.shard:       Using the intersecting iterator with a term index 
                        partitioned by document.
 
+   README.tabletofile: Using MapReduce to read a table and write one of its
+                       columns to a file in HDFS.
+
+   README.terasort:    Generating random data and sorting it using Accumulo.  
+
    README.visibility:  Using visibilities (or combinations of authorizations). 
                        Also shows user permissions.
 

Modified: accumulo/branches/ACCUMULO-118/docs/examples/README.batch
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/docs/examples/README.batch?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/docs/examples/README.batch (original)
+++ accumulo/branches/ACCUMULO-118/docs/examples/README.batch Mon Jun 17 20:12:04 2013
@@ -16,7 +16,7 @@ Notice:    Licensed to the Apache Softwa
            specific language governing permissions and limitations
            under the License.
 
-This tutorial uses the following Java classes, which can be found in org.apache.accumulo.examples.simple.client in the simple-examples module:
+This tutorial uses the following Java classes, which can be found in org.apache.accumulo.examples.simple.client in the examples-simple module:
 
  * SequentialBatchWriter.java - writes mutations with sequential rows and random values
  * RandomBatchWriter.java - used by SequentialBatchWriter to generate random values

Modified: accumulo/branches/ACCUMULO-118/docs/examples/README.classpath
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/docs/examples/README.classpath?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/docs/examples/README.classpath (original)
+++ accumulo/branches/ACCUMULO-118/docs/examples/README.classpath Mon Jun 17 20:12:04 2013
@@ -1,4 +1,4 @@
-Title: Apache Accumulo Client Examples
+Title: Apache Accumulo Classpath Example
 Notice:    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
@@ -25,44 +25,44 @@ table reference that jar.
 
 Execute the following command in the shell.
 
-   $ hadoop fs -copyFromLocal $ACCUMULO_HOME/test/src/test/resources/FooFilter.jar /user1/lib
+    $ hadoop fs -copyFromLocal $ACCUMULO_HOME/test/src/test/resources/FooFilter.jar /user1/lib
 
 Execute following in Accumulo shell to setup classpath context
 
-   root@test15> config -s general.vfs.context.classpath.cx1=hdfs://<namenode host>:<namenode port>/user1/lib
+    root@test15> config -s general.vfs.context.classpath.cx1=hdfs://<namenode host>:<namenode port>/user1/lib
 
 Create a table
 
-   root@test15> createtable nofoo
+    root@test15> createtable nofoo
 
 The following command makes this table use the configured classpath context
 
-   root@test15 nofoo> config -t nofoo -s table.classpath.context=cx1
+    root@test15 nofoo> config -t nofoo -s table.classpath.context=cx1
 
 The following command configures an iterator thats in FooFilter.jar
 
-   root@test15 nofoo> setiter -n foofilter -p 10 -scan -minc -majc -class org.apache.accumulo.test.FooFilter
-   Filter accepts or rejects each Key/Value pair
-   ----------> set FooFilter parameter negate, default false keeps k/v that pass accept method, true rejects k/v that pass accept method: false
+    root@test15 nofoo> setiter -n foofilter -p 10 -scan -minc -majc -class org.apache.accumulo.test.FooFilter
+    Filter accepts or rejects each Key/Value pair
+    ----------> set FooFilter parameter negate, default false keeps k/v that pass accept method, true rejects k/v that pass accept method: false
 
 The commands below show the filter is working.
 
-   root@test15 nofoo> insert foo1 f1 q1 v1
-   root@test15 nofoo> insert noo1 f1 q1 v2
-   root@test15 nofoo> scan
-   noo1 f1:q1 []    v2
-   root@test15 nofoo> 
+    root@test15 nofoo> insert foo1 f1 q1 v1
+    root@test15 nofoo> insert noo1 f1 q1 v2
+    root@test15 nofoo> scan
+    noo1 f1:q1 []    v2
+    root@test15 nofoo> 
 
 Below, an attempt is made to add the FooFilter to a table thats not configured
 to use the clasppath context cx1.  This fails util the table is configured to
 use cx1.
 
-   root@test15 nofoo> createtable nofootwo
-   root@test15 nofootwo> setiter -n foofilter -p 10 -scan -minc -majc -class org.apache.accumulo.test.FooFilter
-   2013-05-03 12:49:35,943 [shell.Shell] ERROR: java.lang.IllegalArgumentException: org.apache.accumulo.test.FooFilter
-   root@test15 nofootwo> config -t nofootwo -s table.classpath.context=cx1
-   root@test15 nofootwo> setiter -n foofilter -p 10 -scan -minc -majc -class org.apache.accumulo.test.FooFilter
-   Filter accepts or rejects each Key/Value pair
-   ----------> set FooFilter parameter negate, default false keeps k/v that pass accept method, true rejects k/v that pass accept method: false
+    root@test15 nofoo> createtable nofootwo
+    root@test15 nofootwo> setiter -n foofilter -p 10 -scan -minc -majc -class org.apache.accumulo.test.FooFilter
+    2013-05-03 12:49:35,943 [shell.Shell] ERROR: java.lang.IllegalArgumentException: org.apache.accumulo.test.FooFilter
+    root@test15 nofootwo> config -t nofootwo -s table.classpath.context=cx1
+    root@test15 nofootwo> setiter -n foofilter -p 10 -scan -minc -majc -class org.apache.accumulo.test.FooFilter
+    Filter accepts or rejects each Key/Value pair
+    ----------> set FooFilter parameter negate, default false keeps k/v that pass accept method, true rejects k/v that pass accept method: false
 
 

Modified: accumulo/branches/ACCUMULO-118/docs/examples/README.client
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/docs/examples/README.client?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/docs/examples/README.client (original)
+++ accumulo/branches/ACCUMULO-118/docs/examples/README.client Mon Jun 17 20:12:04 2013
@@ -18,6 +18,12 @@ Notice:    Licensed to the Apache Softwa
 
 This documents how you run the simplest java examples.
 
+This tutorial uses the following Java classes, which can be found in org.apache.accumulo.examples.simple.client in the examples-simple module:
+
+ * Flush.java - flushes a table
+ * RowOperations.java - reads and writes rows
+ * ReadWriteExample.java - creates a table, writes to it, and reads from it
+
 Using the accumulo command, you can run the simple client examples by providing their 
 class name, and enough arguments to find your accumulo instance.  For example,
 the Flush class will flush a table:

Modified: accumulo/branches/ACCUMULO-118/docs/examples/README.combiner
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/docs/examples/README.combiner?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/docs/examples/README.combiner (original)
+++ accumulo/branches/ACCUMULO-118/docs/examples/README.combiner Mon Jun 17 20:12:04 2013
@@ -16,7 +16,7 @@ Notice:    Licensed to the Apache Softwa
            specific language governing permissions and limitations
            under the License.
 
-This tutorial uses the following Java class, which can be found in org.apache.accumulo.examples.simple.combiner in the simple-examples module:
+This tutorial uses the following Java class, which can be found in org.apache.accumulo.examples.simple.combiner in the examples-simple module:
 
  * StatsCombiner.java - a combiner that calculates max, min, sum, and count
 

Modified: accumulo/branches/ACCUMULO-118/docs/examples/README.constraints
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/docs/examples/README.constraints?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/docs/examples/README.constraints (original)
+++ accumulo/branches/ACCUMULO-118/docs/examples/README.constraints Mon Jun 17 20:12:04 2013
@@ -16,7 +16,7 @@ Notice:    Licensed to the Apache Softwa
            specific language governing permissions and limitations
            under the License.
 
-This tutorial uses the following Java classes, which can be found in org.apache.accumulo.examples.simple.constraints in the simple-examples module:
+This tutorial uses the following Java classes, which can be found in org.apache.accumulo.examples.simple.constraints in the examples-simple module:
 
  * AlphaNumKeyConstraint.java - a constraint that requires alphanumeric keys
  * NumericValueConstraint.java - a constraint that requires numeric string values

Modified: accumulo/branches/ACCUMULO-118/docs/examples/README.export
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/docs/examples/README.export?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/docs/examples/README.export (original)
+++ accumulo/branches/ACCUMULO-118/docs/examples/README.export Mon Jun 17 20:12:04 2013
@@ -1,3 +1,4 @@
+Title: Apache Accumulo Export/Import Example
 Notice:    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
@@ -23,67 +24,67 @@ the table.  A table must be offline to e
 for the duration of the distcp.  An easy way to take a table offline without
 interuppting access to it is to clone it and take the clone offline.
 
-  root@test15> createtable table1
-  root@test15 table1> insert a cf1 cq1 v1
-  root@test15 table1> insert h cf1 cq1 v2
-  root@test15 table1> insert z cf1 cq1 v3
-  root@test15 table1> insert z cf1 cq2 v4
-  root@test15 table1> addsplits -t table1 b r
-  root@test15 table1> scan
-  a cf1:cq1 []    v1
-  h cf1:cq1 []    v2
-  z cf1:cq1 []    v3
-  z cf1:cq2 []    v4
-  root@test15> config -t table1 -s table.split.threshold=100M
-  root@test15 table1> clonetable table1 table1_exp
-  root@test15 table1> offline table1_exp
-  root@test15 table1> exporttable -t table1_exp /tmp/table1_export
-  root@test15 table1> quit
+    root@test15> createtable table1
+    root@test15 table1> insert a cf1 cq1 v1
+    root@test15 table1> insert h cf1 cq1 v2
+    root@test15 table1> insert z cf1 cq1 v3
+    root@test15 table1> insert z cf1 cq2 v4
+    root@test15 table1> addsplits -t table1 b r
+    root@test15 table1> scan
+    a cf1:cq1 []    v1
+    h cf1:cq1 []    v2
+    z cf1:cq1 []    v3
+    z cf1:cq2 []    v4
+    root@test15> config -t table1 -s table.split.threshold=100M
+    root@test15 table1> clonetable table1 table1_exp
+    root@test15 table1> offline table1_exp
+    root@test15 table1> exporttable -t table1_exp /tmp/table1_export
+    root@test15 table1> quit
 
 After executing the export command, a few files are created in the hdfs dir.
 One of the files is a list of files to distcp as shown below.
 
-  $ hadoop fs -ls /tmp/table1_export
-  Found 2 items
-  -rw-r--r--   3 user supergroup        162 2012-07-25 09:56 /tmp/table1_export/distcp.txt
-  -rw-r--r--   3 user supergroup        821 2012-07-25 09:56 /tmp/table1_export/exportMetadata.zip
-  $ hadoop fs -cat /tmp/table1_export/distcp.txt
-  hdfs://n1.example.com:6093/accumulo/tables/3/default_tablet/F0000000.rf
-  hdfs://n1.example.com:6093/tmp/table1_export/exportMetadata.zip
+    $ hadoop fs -ls /tmp/table1_export
+    Found 2 items
+    -rw-r--r--   3 user supergroup        162 2012-07-25 09:56 /tmp/table1_export/distcp.txt
+    -rw-r--r--   3 user supergroup        821 2012-07-25 09:56 /tmp/table1_export/exportMetadata.zip
+    $ hadoop fs -cat /tmp/table1_export/distcp.txt
+    hdfs://n1.example.com:6093/accumulo/tables/3/default_tablet/F0000000.rf
+    hdfs://n1.example.com:6093/tmp/table1_export/exportMetadata.zip
 
 Before the table can be imported, it must be copied using distcp.  After the
 discp completed, the cloned table may be deleted.
 
-  $ hadoop distcp -f /tmp/table1_export/distcp.txt /tmp/table1_export_dest
+    $ hadoop distcp -f /tmp/table1_export/distcp.txt /tmp/table1_export_dest
 
 The Accumulo shell session below shows importing the table and inspecting it.
 The data, splits, config, and logical time information for the table were
 preserved.
 
-  root@test15> importtable table1_copy /tmp/table1_export_dest
-  root@test15> table table1_copy
-  root@test15 table1_copy> scan
-  a cf1:cq1 []    v1
-  h cf1:cq1 []    v2
-  z cf1:cq1 []    v3
-  z cf1:cq2 []    v4
-  root@test15 table1_copy> getsplits -t table1_copy
-  b
-  r
-  root@test15> config -t table1_copy -f split
-  ---------+--------------------------+-------------------------------------------
-  SCOPE    | NAME                     | VALUE
-  ---------+--------------------------+-------------------------------------------
-  default  | table.split.threshold .. | 1G
-  table    |    @override ........... | 100M
-  ---------+--------------------------+-------------------------------------------
-  root@test15> tables -l
-  !METADATA       =>         !0
-  trace           =>          1
-  table1_copy     =>          5
-  root@test15 table1_copy> scan -t !METADATA -b 5 -c srv:time
-  5;b srv:time []    M1343224500467
-  5;r srv:time []    M1343224500467
-  5< srv:time []    M1343224500467
+    root@test15> importtable table1_copy /tmp/table1_export_dest
+    root@test15> table table1_copy
+    root@test15 table1_copy> scan
+    a cf1:cq1 []    v1
+    h cf1:cq1 []    v2
+    z cf1:cq1 []    v3
+    z cf1:cq2 []    v4
+    root@test15 table1_copy> getsplits -t table1_copy
+    b
+    r
+    root@test15> config -t table1_copy -f split
+    ---------+--------------------------+-------------------------------------------
+    SCOPE    | NAME                     | VALUE
+    ---------+--------------------------+-------------------------------------------
+    default  | table.split.threshold .. | 1G
+    table    |    @override ........... | 100M
+    ---------+--------------------------+-------------------------------------------
+    root@test15> tables -l
+    !METADATA       =>         !0
+    trace           =>          1
+    table1_copy     =>          5
+    root@test15 table1_copy> scan -t !METADATA -b 5 -c srv:time
+    5;b srv:time []    M1343224500467
+    5;r srv:time []    M1343224500467
+    5< srv:time []    M1343224500467
 
 

Modified: accumulo/branches/ACCUMULO-118/docs/examples/README.helloworld
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/docs/examples/README.helloworld?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/docs/examples/README.helloworld (original)
+++ accumulo/branches/ACCUMULO-118/docs/examples/README.helloworld Mon Jun 17 20:12:04 2013
@@ -16,7 +16,7 @@ Notice:    Licensed to the Apache Softwa
            specific language governing permissions and limitations
            under the License.
 
-This tutorial uses the following Java classes, which can be found in org.apache.accumulo.examples.simple.helloworld in the simple-examples module: 
+This tutorial uses the following Java classes, which can be found in org.apache.accumulo.examples.simple.helloworld in the examples-simple module: 
 
  * InsertWithBatchWriter.java - Inserts 10K rows (50K entries) into accumulo with each row having 5 entries
  * ReadData.java - Reads all data between two rows

Modified: accumulo/branches/ACCUMULO-118/docs/examples/README.tabletofile
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/docs/examples/README.tabletofile?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/docs/examples/README.tabletofile (original)
+++ accumulo/branches/ACCUMULO-118/docs/examples/README.tabletofile Mon Jun 17 20:12:04 2013
@@ -1,4 +1,4 @@
-Title: Apache Accumulo Regex Example
+Title: Apache Accumulo Table-to-File Example
 Notice:    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

Modified: accumulo/branches/ACCUMULO-118/docs/examples/README.terasort
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/docs/examples/README.terasort?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/docs/examples/README.terasort (original)
+++ accumulo/branches/ACCUMULO-118/docs/examples/README.terasort Mon Jun 17 20:12:04 2013
@@ -1,4 +1,4 @@
-Title: Apache Accumulo MapReduce Example
+Title: Apache Accumulo Terasort Example
 Notice:    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

Modified: accumulo/branches/ACCUMULO-118/docs/pom.xml
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/docs/pom.xml?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/docs/pom.xml (original)
+++ accumulo/branches/ACCUMULO-118/docs/pom.xml Mon Jun 17 20:12:04 2013
@@ -85,6 +85,27 @@
               </execution>
             </executions>
           </plugin>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>build-helper-maven-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>attach-user-manual-pdf</id>
+                <goals>
+                  <goal>attach-artifact</goal>
+                </goals>
+                <configuration>
+                  <artifacts>
+                    <artifact>
+                      <file>${project.build.directory}/accumulo_user_manual.pdf</file>
+                      <type>pdf</type>
+                      <classifier>user-manual</classifier>
+                    </artifact>
+                  </artifacts>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
         </plugins>
       </build>
     </profile>

Propchange: accumulo/branches/ACCUMULO-118/docs/src/main/latex/accumulo_user_manual/
            ('svn:ignore' removed)

Propchange: accumulo/branches/ACCUMULO-118/docs/src/main/latex/accumulo_user_manual/chapters/
            ('svn:ignore' removed)

Propchange: accumulo/branches/ACCUMULO-118/examples/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Jun 17 20:12:04 2013
@@ -1,5 +1,3 @@
+.*
 target
-.settings
-.classpath
-.project
 accumulo-examples.iml

Propchange: accumulo/branches/ACCUMULO-118/examples/
------------------------------------------------------------------------------
  Reverse-merged /accumulo/trunk/examples:r1478775
  Merged /accumulo/trunk/examples:r1486112-1486135,1486203-1488406,1488408-1489580,1489976-1489981,1490337-1493757
  Merged /accumulo/branches/1.5/examples:r1484971-1484975,1484977-1484982,1484986-1485411,1485413-1485414,1485416-1485661,1485663-1492948

Modified: accumulo/branches/ACCUMULO-118/examples/pom.xml
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-118/examples/pom.xml?rev=1493916&r1=1493915&r2=1493916&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-118/examples/pom.xml (original)
+++ accumulo/branches/ACCUMULO-118/examples/pom.xml Mon Jun 17 20:12:04 2013
@@ -28,29 +28,4 @@
   <modules>
     <module>simple</module>
   </modules>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>copy-dependencies</id>
-            <goals>
-              <goal>copy-dependencies</goal>
-            </goals>
-            <phase>prepare-package</phase>
-            <configuration>
-              <outputDirectory>../../lib</outputDirectory>
-              <!-- just grab the non-provided runtime dependencies -->
-              <stripVersion>true</stripVersion>
-              <includeScope>runtime</includeScope>
-              <excludeTransitive>true</excludeTransitive>
-              <excludeClassifiers>sources,test-sources</excludeClassifiers>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
 </project>

Propchange: accumulo/branches/ACCUMULO-118/examples/simple/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Jun 17 20:12:04 2013
@@ -1,3 +1,3 @@
 .*
 target
-examples-simple.iml
+accumulo-examples-simple.iml



Mime
View raw message