accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1433166 [4/20] - in /accumulo/branches/ACCUMULO-259: ./ assemble/ assemble/platform/ assemble/scripts/ assemble/scripts/init.d/ bin/ conf/examples/1GB/native-standalone/ conf/examples/1GB/standalone/ conf/examples/2GB/native-standalone/ co...
Date Mon, 14 Jan 2013 22:03:34 GMT
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/client/mock/MockShell.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/client/mock/MockShell.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/client/mock/MockShell.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/client/mock/MockShell.java Mon Jan 14 22:03:24 2013
@@ -21,7 +21,6 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Writer;
-import java.nio.charset.Charset;
 
 import jline.ConsoleReader;
 
@@ -36,8 +35,6 @@ public class MockShell extends Shell {
   
   protected InputStream in;
   protected Writer writer;
-
-  private static final Charset utf8 = Charset.forName("UTF8");
   
   public MockShell(InputStream in, Writer writer) throws IOException {
     super();
@@ -135,6 +132,6 @@ public class MockShell extends Shell {
       sb.append(command).append(NEWLINE);
     }
     
-    return new ByteArrayInputStream(sb.toString().getBytes(utf8));
+    return new ByteArrayInputStream(sb.toString().getBytes());
   }
 }

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java Mon Jan 14 22:03:24 2013
@@ -20,9 +20,11 @@ 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.SortedMap;
 import java.util.SortedSet;
+import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.concurrent.ConcurrentSkipListMap;
 
@@ -53,9 +55,8 @@ public class MockTable {
     }
     
     @Override
-    public boolean equals(Object obj) {
-      MockMemKey other = (MockMemKey) obj;
-      return super.equals(other) && count == other.count;
+    public boolean equals(Object other) {
+      return (other instanceof MockMemKey) && super.equals((MockMemKey)other) && count == ((MockMemKey)other).count;
     }
     
     @Override
@@ -87,6 +88,7 @@ public class MockTable {
   Map<String,EnumSet<TablePermission>> userPermissions = new HashMap<String,EnumSet<TablePermission>>();
   private TimeType timeType;
   SortedSet<Text> splits = new TreeSet<Text>();
+  Map<String,Set<Text>> localityGroups = new TreeMap<String, Set<Text>>();
   
   MockTable(boolean limitVersion, TimeType timeType) {
     this.timeType = timeType;
@@ -123,4 +125,11 @@ public class MockTable {
   public Collection<Text> getSplits() {
     return splits;
   }
+  
+  public void setLocalityGroups(Map<String,Set<Text>> groups) {
+    localityGroups = groups;
+  }
+  public Map<String,Set<Text>> getLocalityGroups() {
+    return localityGroups;
+  }
 }

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java Mon Jan 14 22:03:24 2013
@@ -133,6 +133,7 @@ public class MockTableOperations extends
     acu.tables.put(newTableName, t);
   }
   
+  @Deprecated
   @Override
   public void flush(String tableName) throws AccumuloException, AccumuloSecurityException {}
   
@@ -155,17 +156,23 @@ public class MockTableOperations extends
   
   @Override
   public void setLocalityGroups(String tableName, Map<String,Set<Text>> groups) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
-    throw new NotImplementedException();
+    if (!exists(tableName))
+      throw new TableNotFoundException(tableName, tableName, "");
+    acu.tables.get(tableName).setLocalityGroups(groups);
   }
   
   @Override
   public Map<String,Set<Text>> getLocalityGroups(String tableName) throws AccumuloException, TableNotFoundException {
-    throw new NotImplementedException();
+    if (!exists(tableName))
+      throw new TableNotFoundException(tableName, tableName, "");
+    return acu.tables.get(tableName).getLocalityGroups();
   }
   
   @Override
   public Set<Range> splitRangeByTablets(String tableName, Range range, int maxSplits) throws AccumuloException, AccumuloSecurityException,
       TableNotFoundException {
+    if (!exists(tableName))
+      throw new TableNotFoundException(tableName, tableName, "");
     return Collections.singleton(range);
   }
   
@@ -175,12 +182,11 @@ public class MockTableOperations extends
     long time = System.currentTimeMillis();
     MockTable table = acu.tables.get(tableName);
     if (table == null) {
-      throw new TableNotFoundException(null, tableName,
-          "The table was not found");
+      throw new TableNotFoundException(null, tableName, "The table was not found");
     }
     Path importPath = new Path(dir);
     Path failurePath = new Path(failureDir);
-
+    
     FileSystem fs = acu.getFileSystem();
     /*
      * check preconditions
@@ -215,9 +221,8 @@ public class MockTableOperations extends
      */
     for (FileStatus importStatus : fs.listStatus(importPath)) {
       try {
-        FileSKVIterator importIterator = FileOperations.getInstance()
-            .openReader(importStatus.getPath().toString(), true, fs,
-                fs.getConf(), AccumuloConfiguration.getDefaultConfiguration());
+        FileSKVIterator importIterator = FileOperations.getInstance().openReader(importStatus.getPath().toString(), true, fs, fs.getConf(),
+            AccumuloConfiguration.getDefaultConfiguration());
         while (importIterator.hasTop()) {
           Key key = importIterator.getTopKey();
           Value value = importIterator.getTopValue();
@@ -226,12 +231,10 @@ public class MockTableOperations extends
           }
           Mutation mutation = new Mutation(key.getRow());
           if (!key.isDeleted()) {
-            mutation.put(key.getColumnFamily(), key.getColumnQualifier(),
-                new ColumnVisibility(key.getColumnVisibilityData().toArray()),
-                key.getTimestamp(), value);
+            mutation.put(key.getColumnFamily(), key.getColumnQualifier(), new ColumnVisibility(key.getColumnVisibilityData().toArray()), key.getTimestamp(),
+                value);
           } else {
-            mutation.putDelete(key.getColumnFamily(), key.getColumnQualifier(),
-                new ColumnVisibility(key.getColumnVisibilityData().toArray()),
+            mutation.putDelete(key.getColumnFamily(), key.getColumnQualifier(), new ColumnVisibility(key.getColumnVisibilityData().toArray()),
                 key.getTimestamp());
           }
           table.addMutation(mutation);
@@ -241,8 +244,7 @@ public class MockTableOperations extends
         FSDataOutputStream failureWriter = null;
         DataInputStream failureReader = null;
         try {
-          failureWriter = fs.create(failurePath.suffix("/"
-              + importStatus.getPath().getName()));
+          failureWriter = fs.create(failurePath.suffix("/" + importStatus.getPath().getName()));
           failureReader = fs.open(importStatus.getPath());
           int read = 0;
           byte[] buffer = new byte[1024];
@@ -261,16 +263,21 @@ public class MockTableOperations extends
   }
   
   @Override
-  public void offline(String tableName) throws AccumuloSecurityException, AccumuloException {
-    throw new NotImplementedException();
+  public void offline(String tableName) throws AccumuloSecurityException, AccumuloException, TableNotFoundException {
+    if (!exists(tableName))
+      throw new TableNotFoundException(tableName, tableName, "");
   }
   
   @Override
-  public void online(String tableName) throws AccumuloSecurityException, AccumuloException {}
+  public void online(String tableName) throws AccumuloSecurityException, AccumuloException, TableNotFoundException {
+    if (!exists(tableName))
+      new TableNotFoundException(tableName, tableName, "");
+  }
   
   @Override
   public void clearLocatorCache(String tableName) throws TableNotFoundException {
-    throw new NotImplementedException();
+    if (!exists(tableName))
+      throw new TableNotFoundException(tableName, tableName, "");
   }
   
   @Override
@@ -284,24 +291,31 @@ public class MockTableOperations extends
   
   @Override
   public void merge(String tableName, Text start, Text end) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
-    throw new NotImplementedException();
+    if (!exists(tableName))
+      throw new TableNotFoundException(tableName, tableName, "");
   }
   
   @Override
   public void deleteRows(String tableName, Text start, Text end) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
-    throw new NotImplementedException();
+    if (!exists(tableName))
+      throw new TableNotFoundException(tableName, tableName, "");
+    MockTable t = acu.tables.get(tableName);
+    Set<Key> keep = new TreeSet<Key>(t.table.tailMap(new Key(start)).headMap(new Key(end)).keySet());
+    t.table.keySet().removeAll(keep);
   }
   
   @Override
   public void compact(String tableName, Text start, Text end, boolean flush, boolean wait) throws AccumuloSecurityException, TableNotFoundException,
       AccumuloException {
-    throw new NotImplementedException();
+    if (!exists(tableName))
+      throw new TableNotFoundException(tableName, tableName, "");
   }
   
   @Override
   public void compact(String tableName, Text start, Text end, List<IteratorSetting> iterators, boolean flush, boolean wait) throws AccumuloSecurityException,
       TableNotFoundException, AccumuloException {
-    throw new NotImplementedException();
+    if (!exists(tableName))
+      throw new TableNotFoundException(tableName, tableName, "");
   }
   
   @Override
@@ -312,7 +326,8 @@ public class MockTableOperations extends
   
   @Override
   public void flush(String tableName, Text start, Text end, boolean wait) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
-    throw new NotImplementedException();
+    if (!exists(tableName))
+      throw new TableNotFoundException(tableName, tableName, "");
   }
   
   @Override

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/conf/Property.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/conf/Property.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/conf/Property.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/conf/Property.java Mon Jan 14 22:03:24 2013
@@ -24,6 +24,7 @@ import org.apache.accumulo.core.file.rfi
 import org.apache.accumulo.core.util.format.DefaultFormatter;
 import org.apache.accumulo.core.util.interpret.DefaultScanInterpreter;
 import org.apache.accumulo.start.classloader.AccumuloClassLoader;
+import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader;
 
 public enum Property {
   // instance properties (must be the same for every node in an instance)
@@ -50,16 +51,18 @@ public enum Property {
   // general properties
   GENERAL_PREFIX("general.", null, PropertyType.PREFIX,
       "Properties in this category affect the behavior of accumulo overall, but do not have to be consistent throughout a cloud."),
-  GENERAL_CLASSPATHS(AccumuloClassLoader.CLASSPATH_PROPERTY_NAME, AccumuloClassLoader.DEFAULT_CLASSPATH_VALUE, PropertyType.STRING,
+  GENERAL_CLASSPATHS(AccumuloClassLoader.CLASSPATH_PROPERTY_NAME, AccumuloClassLoader.ACCUMULO_CLASSPATH_VALUE, PropertyType.STRING,
       "A list of all of the places to look for a class. Order does matter, as it will look for the jar "
           + "starting in the first location to the last. Please note, hadoop conf and hadoop lib directories NEED to be here, "
           + "along with accumulo lib and zookeeper directory. Supports full regex on filename alone."), // needs special treatment in accumulo start jar
-  GENERAL_DYNAMIC_CLASSPATHS(AccumuloClassLoader.DYNAMIC_CLASSPATH_PROPERTY_NAME, AccumuloClassLoader.DEFAULT_DYNAMIC_CLASSPATH_VALUE, PropertyType.STRING,
+  GENERAL_DYNAMIC_CLASSPATHS(AccumuloVFSClassLoader.DYNAMIC_CLASSPATH_PROPERTY_NAME, AccumuloVFSClassLoader.DEFAULT_DYNAMIC_CLASSPATH_VALUE,
+      PropertyType.STRING,
       "A list of all of the places where changes in jars or classes will force a reload of the classloader."),
   GENERAL_RPC_TIMEOUT("general.rpc.timeout", "120s", PropertyType.TIMEDURATION, "Time to wait on I/O for simple, short RPC calls"),
   GENERAL_KERBEROS_KEYTAB("general.kerberos.keytab", "", PropertyType.PATH, "Path to the kerberos keytab to use. Leave blank if not using kerberoized hdfs"),
   GENERAL_KERBEROS_PRINCIPAL("general.kerberos.principal", "", PropertyType.STRING, "Name of the kerberos principal to use. _HOST will automatically be "
       + "replaced by the machines hostname in the hostname portion of the principal. Leave blank if not using kerberoized hdfs"),
+  GENERAL_MAX_MESSAGE_SIZE("tserver.server.message.size.max", "1G", PropertyType.MEMORY, "The maximum size of a message that can be sent to a tablet server."),
   
   // properties that are specific to master server behavior
   MASTER_PREFIX("master.", null, PropertyType.PREFIX, "Properties in this category affect the behavior of the master server"),
@@ -70,10 +73,13 @@ public enum Property {
   MASTER_RECOVERY_MAXTIME("master.recovery.time.max", "30m", PropertyType.TIMEDURATION, "The maximum time to attempt recovery before giving up"),
   MASTER_BULK_RETRIES("master.bulk.retries", "3", PropertyType.COUNT, "The number of attempts to bulk-load a file before giving up."),
   MASTER_BULK_THREADPOOL_SIZE("master.bulk.threadpool.size", "5", PropertyType.COUNT, "The number of threads to use when coordinating a bulk-import."),
-  MASTER_MINTHREADS("master.server.threads.minimum", "2", PropertyType.COUNT, "The minimum number of threads to use to handle incoming requests."),
+  MASTER_BULK_TIMEOUT("master.bulk.timeout", "5m", PropertyType.TIMEDURATION, "The time to wait for a tablet server to process a bulk import request"),
+  MASTER_MINTHREADS("master.server.threads.minimum", "20", PropertyType.COUNT, "The minimum number of threads to use to handle incoming requests."),
   MASTER_THREADCHECK("master.server.threadcheck.time", "1s", PropertyType.TIMEDURATION, "The time between adjustments of the server thread pool."),
   MASTER_RECOVERY_DELAY("master.recovery.delay", "10s", PropertyType.TIMEDURATION,
       "When a tablet server's lock is deleted, it takes time for it to completely quit. This delay gives it time before log recoveries begin."),
+  MASTER_LEASE_RECOVERY_IMPLEMETATION("master.lease.recovery.implementation", "org.apache.accumulo.server.master.recovery.RecoverLease", PropertyType.CLASSNAME, "A class that implements a mechansim to steal write access to a file"),
+  MASTER_FATE_THREADPOOL_SIZE("master.fate.threadpool.size", "4", PropertyType.COUNT, "The number of threads used to run FAult-Tolerant Executions.  These are primarily table operations like merge."),
   
   // properties that are specific to tablet server behavior
   TSERV_PREFIX("tserver.", null, PropertyType.PREFIX, "Properties in this category affect the behavior of the tablet servers"),
@@ -147,7 +153,8 @@ public enum Property {
           + " the file to the appropriate tablets on all servers.  This property controls the number of threads used to communicate to the other servers."),
   TSERV_BULK_RETRY("tserver.bulk.retry.max", "3", PropertyType.COUNT,
       "The number of times the tablet server will attempt to assign a file to a tablet as it migrates and splits."),
-  TSERV_MINTHREADS("tserver.server.threads.minimum", "2", PropertyType.COUNT, "The minimum number of threads to use to handle incoming requests."),
+  TSERV_BULK_TIMEOUT("tserver.bulk.timeout", "5m", PropertyType.TIMEDURATION, "The time to wait for a tablet server to process a bulk import request."),
+  TSERV_MINTHREADS("tserver.server.threads.minimum", "20", PropertyType.COUNT, "The minimum number of threads to use to handle incoming requests."),
   TSERV_THREADCHECK("tserver.server.threadcheck.time", "1s", PropertyType.TIMEDURATION, "The time between adjustments of the server thread pool."),
   TSERV_HOLD_TIME_SUICIDE("tserver.hold.time.max", "5m", PropertyType.TIMEDURATION,
       "The maximum time for a tablet server to be in the \"memory full\" state.  If the tablet server cannot write out memory"
@@ -285,8 +292,22 @@ public enum Property {
   TABLE_FORMATTER_CLASS("table.formatter", DefaultFormatter.class.getName(), PropertyType.STRING,
       "The Formatter class to apply on results in the shell"),
   TABLE_INTERPRETER_CLASS("table.interepreter", DefaultScanInterpreter.class.getName(), PropertyType.STRING,
-      "The ScanInterpreter class to apply on scan arguments in the shell");
+      "The ScanInterpreter class to apply on scan arguments in the shell"),
+  TABLE_CLASSPATH("table.classpath.context", "", PropertyType.STRING, "Per table classpath"),
+      
+      
+  //VFS ClassLoader properties
+  VFS_CLASSLOADER_SYSTEM_CLASSPATH_PROPERTY(AccumuloVFSClassLoader.VFS_CLASSLOADER_SYSTEM_CLASSPATH_PROPERTY, "", PropertyType.STRING,
+      "Configuration for a system level vfs classloader.  Accumulo jar can be configured here and loaded out of HDFS."),
+  VFS_CONTEXT_CLASSPATH_PROPERTY(AccumuloVFSClassLoader.VFS_CONTEXT_CLASSPATH_PROPERTY, null, PropertyType.PREFIX,
+      "Properties in this category are define a classpath. These properties start  with the category prefix, followed by a context name.  "
+          + "The value is a comma seperated list of URIs. Supports full regex on filename alone. For example general.vfs.context.classpath.cx1=hdfs://nn1:9902/mylibdir/*.jar.  "
+          + "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.<name>.delegation=post, where <name> is your context name.  "
+          + "If delegation is not specified, it defaults to loading from parent classloader first.");
+      
   
+
   private String key, defaultValue, description;
   private PropertyType type;
   
@@ -348,7 +369,7 @@ public enum Property {
     // white list prefixes
     return key.startsWith(Property.TABLE_PREFIX.getKey()) || key.startsWith(Property.TSERV_PREFIX.getKey()) || key.startsWith(Property.LOGGER_PREFIX.getKey())
         || key.startsWith(Property.MASTER_PREFIX.getKey()) || key.startsWith(Property.GC_PREFIX.getKey())
-        || key.startsWith(Property.MONITOR_PREFIX.getKey() + "banner.");
+        || key.startsWith(Property.MONITOR_PREFIX.getKey() + "banner.") || key.startsWith(VFS_CONTEXT_CLASSPATH_PROPERTY.getKey());
   }
   
   public static Property getPropertyByKey(String key) {

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java Mon Jan 14 22:03:24 2013
@@ -18,6 +18,8 @@ package org.apache.accumulo.core.conf;
 
 import java.util.regex.Pattern;
 
+import org.apache.hadoop.fs.Path;
+
 public enum PropertyType {
   PREFIX(null, null, null),
   
@@ -49,9 +51,13 @@ public enum PropertyType {
   
   PATH("path", ".*",
       "A string that represents a filesystem path, which can be either relative or absolute to some directory. The filesystem depends on the property."),
-  ABSOLUTEPATH("absolute path", "[/].*",
-      "An absolute filesystem path. The filesystem depends on the property. This is the same as path, but enforces that its root is explicitly specified."),
-  
+  ABSOLUTEPATH("absolute path", null,
+      "An absolute filesystem path. The filesystem depends on the property. This is the same as path, but enforces that its root is explicitly specified.") {
+    public boolean isValidFormat(String value) {
+      return new Path(value).isAbsolute();
+    }
+  },
+
   CLASSNAME("java class", "[\\w$.]*", "A fully qualified java class name representing a class on the classpath.<br />"
       + "An example is 'java.lang.String', rather than 'String'"),
   

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/ArrayByteSequence.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/ArrayByteSequence.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/ArrayByteSequence.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/ArrayByteSequence.java Mon Jan 14 22:03:24 2013
@@ -17,14 +17,11 @@
 package org.apache.accumulo.core.data;
 
 import java.io.Serializable;
-import java.nio.charset.Charset;
 
 public class ArrayByteSequence extends ByteSequence implements Serializable {
   
   private static final long serialVersionUID = 1L;
 
-  private static final Charset utf8 = Charset.forName("UTF8");
-  
   protected byte data[];
   protected int offset;
   protected int length;
@@ -48,7 +45,7 @@ public class ArrayByteSequence extends B
   }
   
   public ArrayByteSequence(String s) {
-    this(s.getBytes(utf8));
+    this(s.getBytes());
   }
   
   @Override

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/KeyExtent.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/KeyExtent.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/KeyExtent.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/KeyExtent.java Mon Jan 14 22:03:24 2013
@@ -49,7 +49,7 @@ import org.apache.hadoop.io.WritableComp
 
 public class KeyExtent implements WritableComparable<KeyExtent> {
   
-  private static WeakHashMap<Text,WeakReference<Text>> tableIds = new WeakHashMap<Text,WeakReference<Text>>();
+  private static final WeakHashMap<Text,WeakReference<Text>> tableIds = new WeakHashMap<Text,WeakReference<Text>>();
   
   private static Text dedupeTableId(Text tableId) {
     synchronized (tableIds) {

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/Mutation.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/Mutation.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/Mutation.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/Mutation.java Mon Jan 14 22:03:24 2013
@@ -27,7 +27,6 @@ import java.util.List;
 import org.apache.accumulo.core.data.thrift.TMutation;
 import org.apache.accumulo.core.security.ColumnVisibility;
 import org.apache.accumulo.core.util.ByteBufferUtil;
-import org.apache.accumulo.core.util.TextUtil;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableUtils;
@@ -87,12 +86,6 @@ public class Mutation implements Writabl
       
     }
     
-    void add(byte[] b) {
-      reserve(b.length);
-      System.arraycopy(b, 0, data, offset, b.length);
-      offset += b.length;
-    }
-    
     public void add(byte[] bytes, int off, int length) {
       reserve(length);
       System.arraycopy(bytes, off, data, offset, length);
@@ -199,12 +192,20 @@ public class Mutation implements Writabl
     }
   }
   
-  public Mutation(Text row) {
-    this.row = new byte[row.getLength()];
-    System.arraycopy(row.getBytes(), 0, this.row, 0, row.getLength());
+  public Mutation(byte[] byteBuffer) {
+    this(byteBuffer, 0, byteBuffer.length);
+  }
+  
+  public Mutation(byte[] byteBuffer, int start, int length) {
+    this.row = new byte[length];
+    System.arraycopy(byteBuffer, start, this.row, 0, length);
     buffer = new ByteBuffer();
   }
   
+  public Mutation(Text row) {
+    this(row.getBytes(), 0, row.getLength());
+  }
+  
   public Mutation(CharSequence row) {
     this(new Text(row.toString()));
   }
@@ -230,14 +231,20 @@ public class Mutation implements Writabl
     return row;
   }
   
+  public static String toHexString(byte[] ba) {
+    StringBuilder str = new StringBuilder();
+    for (int i = 0; i < ba.length; i++)
+      str.append(String.format("%x", ba[i]));
+    return str.toString();
+  }
+
   private void put(byte b[]) {
-    buffer.writeVLong(b.length);
-    buffer.add(b);
+    put(b, b.length);
   }
   
-  private void put(Text t) {
-    buffer.writeVLong(t.getLength());
-    buffer.add(t.getBytes(), 0, t.getLength());
+  private void put(byte b[], int length) {
+    buffer.writeVLong(length);
+    buffer.add(b, 0, length);
   }
   
   private void put(boolean b) {
@@ -252,26 +259,38 @@ public class Mutation implements Writabl
     buffer.writeVLong(l);
   }
   
+  private void put(byte[] cf, byte[] cq, byte[] cv, boolean hasts, long ts, boolean deleted, byte[] val) {
+    put(cf, cf.length, cq, cq.length, cv, hasts, ts, deleted, val, val.length);
+  }
+
+  /*
+   * When dealing with Text object the length must be gotten from the object, not from the byte array.
+   */
   private void put(Text cf, Text cq, byte[] cv, boolean hasts, long ts, boolean deleted, byte[] val) {
-    
-    if (buffer == null)
+    put(cf.getBytes(), cf.getLength(), cq.getBytes(), cq.getLength(), cv, hasts, ts, deleted, val, val.length);
+  }
+  
+  private void put(byte[] cf, int cfLength, byte[] cq, int cqLength, byte[] cv, boolean hasts, long ts, boolean deleted, byte[] val, int valLength) {
+    if (buffer == null) {
       throw new IllegalStateException("Can not add to mutation after serializing it");
-    
-    put(cf);
-    put(cq);
+    }
+    put(cf, cfLength);
+    put(cq, cqLength);
     put(cv);
     put(hasts);
-    if (hasts)
+    if (hasts) {
       put(ts);
+    }
     put(deleted);
     
-    if (val.length < VALUE_SIZE_COPY_CUTOFF) {
-      put(val);
+    if (valLength < VALUE_SIZE_COPY_CUTOFF) {
+      put(val, valLength);
     } else {
-      if (values == null)
+      if (values == null) {
         values = new ArrayList<byte[]>();
-      byte copy[] = new byte[val.length];
-      System.arraycopy(val, 0, copy, 0, val.length);
+      }
+      byte copy[] = new byte[valLength];
+      System.arraycopy(val, 0, copy, 0, valLength);
       values.add(copy);
       put(-1 * values.size());
     }
@@ -283,10 +302,14 @@ public class Mutation implements Writabl
     put(new Text(cf.toString()), new Text(cq.toString()), cv, hasts, ts, deleted, val);
   }
   
+  private void put(Text cf, Text cq, byte[] cv, boolean hasts, long ts, boolean deleted, Text val) {
+    put(cf.getBytes(), cf.getLength(), cq.getBytes(), cq.getLength(), cv, hasts, ts, deleted, val.getBytes(), val.getLength());
+  }
+
   private void put(CharSequence cf, CharSequence cq, byte[] cv, boolean hasts, long ts, boolean deleted, CharSequence val) {
-    put(cf, cq, cv, hasts, ts, deleted, TextUtil.getBytes(new Text(val.toString())));
+    put(new Text(cf.toString()), new Text(cq.toString()), cv, hasts, ts, deleted, new Text(val.toString()));
   }
-  
+
   public void put(Text columnFamily, Text columnQualifier, Value value) {
     put(columnFamily, columnQualifier, EMPTY_BYTES, false, 0l, false, value.get());
   }
@@ -367,6 +390,38 @@ public class Mutation implements Writabl
     put(columnFamily, columnQualifier, columnVisibility.getExpression(), true, timestamp, false, value);
   }
   
+  public void put(byte[] columnFamily, byte[] columnQualifier, byte[] value) {
+    put(columnFamily, columnQualifier, EMPTY_BYTES, false, 0l, false, value);
+  }
+  
+  public void put(byte[] columnFamily, byte[] columnQualifier, ColumnVisibility columnVisibility, byte[] value) {
+    put(columnFamily, columnQualifier, columnVisibility.getExpression(), false, 0l, false, value);
+  }
+  
+  public void put(byte[] columnFamily, byte[] columnQualifier, long timestamp, byte[] value) {
+    put(columnFamily, columnQualifier, EMPTY_BYTES, true, timestamp, false, value);
+  }
+  
+  public void put(byte[] columnFamily, byte[] columnQualifier, ColumnVisibility columnVisibility, long timestamp, byte[] value) {
+    put(columnFamily, columnQualifier, columnVisibility.getExpression(), true, timestamp, false, value);
+  }
+  
+  public void putDelete(byte[] columnFamily, byte[] columnQualifier) {
+    put(columnFamily, columnQualifier, EMPTY_BYTES, false, 0l, true, EMPTY_BYTES);
+  }
+  
+  public void putDelete(byte[] columnFamily, byte[] columnQualifier, ColumnVisibility columnVisibility) {
+    put(columnFamily, columnQualifier, columnVisibility.getExpression(), false, 0l, true, EMPTY_BYTES);
+  }
+  
+  public void putDelete(byte[] columnFamily, byte[] columnQualifier, long timestamp) {
+    put(columnFamily, columnQualifier, EMPTY_BYTES, true, timestamp, true, EMPTY_BYTES);
+  }
+  
+  public void putDelete(byte[] columnFamily, byte[] columnQualifier, ColumnVisibility columnVisibility, long timestamp) {
+    put(columnFamily, columnQualifier, columnVisibility.getExpression(), true, timestamp, true, EMPTY_BYTES);
+  }
+
   private byte[] oldReadBytes(SimpleReader in) {
     int len = in.readInt();
     if (len == 0)

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/InitialMultiScan.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/InitialMultiScan.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/InitialMultiScan.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/InitialMultiScan.java Mon Jan 14 22:03:24 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 /**
  * Autogenerated by Thrift Compiler (0.9.0)
  *

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/InitialScan.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/InitialScan.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/InitialScan.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/InitialScan.java Mon Jan 14 22:03:24 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 /**
  * Autogenerated by Thrift Compiler (0.9.0)
  *

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/IterInfo.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/IterInfo.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/IterInfo.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/IterInfo.java Mon Jan 14 22:03:24 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 /**
  * Autogenerated by Thrift Compiler (0.9.0)
  *

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/MapFileInfo.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/MapFileInfo.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/MapFileInfo.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/MapFileInfo.java Mon Jan 14 22:03:24 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 /**
  * Autogenerated by Thrift Compiler (0.9.0)
  *

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/MultiScanResult.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/MultiScanResult.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/MultiScanResult.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/MultiScanResult.java Mon Jan 14 22:03:24 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 /**
  * Autogenerated by Thrift Compiler (0.9.0)
  *

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/ScanResult.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/ScanResult.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/ScanResult.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/ScanResult.java Mon Jan 14 22:03:24 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 /**
  * Autogenerated by Thrift Compiler (0.9.0)
  *

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TColumn.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TColumn.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TColumn.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TColumn.java Mon Jan 14 22:03:24 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 /**
  * Autogenerated by Thrift Compiler (0.9.0)
  *

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TConstraintViolationSummary.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TConstraintViolationSummary.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TConstraintViolationSummary.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TConstraintViolationSummary.java Mon Jan 14 22:03:24 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 /**
  * Autogenerated by Thrift Compiler (0.9.0)
  *

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKey.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKey.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKey.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKey.java Mon Jan 14 22:03:24 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 /**
  * Autogenerated by Thrift Compiler (0.9.0)
  *

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java Mon Jan 14 22:03:24 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 /**
  * Autogenerated by Thrift Compiler (0.9.0)
  *

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java Mon Jan 14 22:03:24 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 /**
  * Autogenerated by Thrift Compiler (0.9.0)
  *

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java Mon Jan 14 22:03:24 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 /**
  * Autogenerated by Thrift Compiler (0.9.0)
  *

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java Mon Jan 14 22:03:24 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 /**
  * Autogenerated by Thrift Compiler (0.9.0)
  *

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/UpdateErrors.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/UpdateErrors.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/UpdateErrors.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/data/thrift/UpdateErrors.java Mon Jan 14 22:03:24 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 /**
  * Autogenerated by Thrift Compiler (0.9.0)
  *
@@ -35,7 +51,7 @@ import org.slf4j.LoggerFactory;
 
   private static final org.apache.thrift.protocol.TField FAILED_EXTENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("failedExtents", org.apache.thrift.protocol.TType.MAP, (short)1);
   private static final org.apache.thrift.protocol.TField VIOLATION_SUMMARIES_FIELD_DESC = new org.apache.thrift.protocol.TField("violationSummaries", org.apache.thrift.protocol.TType.LIST, (short)2);
-  private static final org.apache.thrift.protocol.TField AUTHORIZATION_FAILURES_FIELD_DESC = new org.apache.thrift.protocol.TField("authorizationFailures", org.apache.thrift.protocol.TType.LIST, (short)3);
+  private static final org.apache.thrift.protocol.TField AUTHORIZATION_FAILURES_FIELD_DESC = new org.apache.thrift.protocol.TField("authorizationFailures", org.apache.thrift.protocol.TType.MAP, (short)3);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -45,7 +61,7 @@ import org.slf4j.LoggerFactory;
 
   public Map<TKeyExtent,Long> failedExtents; // required
   public List<TConstraintViolationSummary> violationSummaries; // required
-  public List<TKeyExtent> authorizationFailures; // required
+  public Map<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode> authorizationFailures; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -123,8 +139,9 @@ import org.slf4j.LoggerFactory;
         new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
             new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TConstraintViolationSummary.class))));
     tmpMap.put(_Fields.AUTHORIZATION_FAILURES, new org.apache.thrift.meta_data.FieldMetaData("authorizationFailures", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
-            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TKeyExtent.class))));
+        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
+            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TKeyExtent.class), 
+            new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.accumulo.core.security.thrift.SecurityErrorCode.class))));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UpdateErrors.class, metaDataMap);
   }
@@ -135,7 +152,7 @@ import org.slf4j.LoggerFactory;
   public UpdateErrors(
     Map<TKeyExtent,Long> failedExtents,
     List<TConstraintViolationSummary> violationSummaries,
-    List<TKeyExtent> authorizationFailures)
+    Map<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode> authorizationFailures)
   {
     this();
     this.failedExtents = failedExtents;
@@ -170,9 +187,17 @@ import org.slf4j.LoggerFactory;
       this.violationSummaries = __this__violationSummaries;
     }
     if (other.isSetAuthorizationFailures()) {
-      List<TKeyExtent> __this__authorizationFailures = new ArrayList<TKeyExtent>();
-      for (TKeyExtent other_element : other.authorizationFailures) {
-        __this__authorizationFailures.add(new TKeyExtent(other_element));
+      Map<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode> __this__authorizationFailures = new HashMap<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode>();
+      for (Map.Entry<TKeyExtent, org.apache.accumulo.core.security.thrift.SecurityErrorCode> other_element : other.authorizationFailures.entrySet()) {
+
+        TKeyExtent other_element_key = other_element.getKey();
+        org.apache.accumulo.core.security.thrift.SecurityErrorCode other_element_value = other_element.getValue();
+
+        TKeyExtent __this__authorizationFailures_copy_key = new TKeyExtent(other_element_key);
+
+        org.apache.accumulo.core.security.thrift.SecurityErrorCode __this__authorizationFailures_copy_value = other_element_value;
+
+        __this__authorizationFailures.put(__this__authorizationFailures_copy_key, __this__authorizationFailures_copy_value);
       }
       this.authorizationFailures = __this__authorizationFailures;
     }
@@ -267,22 +292,18 @@ import org.slf4j.LoggerFactory;
     return (this.authorizationFailures == null) ? 0 : this.authorizationFailures.size();
   }
 
-  public java.util.Iterator<TKeyExtent> getAuthorizationFailuresIterator() {
-    return (this.authorizationFailures == null) ? null : this.authorizationFailures.iterator();
-  }
-
-  public void addToAuthorizationFailures(TKeyExtent elem) {
+  public void putToAuthorizationFailures(TKeyExtent key, org.apache.accumulo.core.security.thrift.SecurityErrorCode val) {
     if (this.authorizationFailures == null) {
-      this.authorizationFailures = new ArrayList<TKeyExtent>();
+      this.authorizationFailures = new HashMap<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode>();
     }
-    this.authorizationFailures.add(elem);
+    this.authorizationFailures.put(key, val);
   }
 
-  public List<TKeyExtent> getAuthorizationFailures() {
+  public Map<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode> getAuthorizationFailures() {
     return this.authorizationFailures;
   }
 
-  public UpdateErrors setAuthorizationFailures(List<TKeyExtent> authorizationFailures) {
+  public UpdateErrors setAuthorizationFailures(Map<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode> authorizationFailures) {
     this.authorizationFailures = authorizationFailures;
     return this;
   }
@@ -324,7 +345,7 @@ import org.slf4j.LoggerFactory;
       if (value == null) {
         unsetAuthorizationFailures();
       } else {
-        setAuthorizationFailures((List<TKeyExtent>)value);
+        setAuthorizationFailures((Map<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode>)value);
       }
       break;
 
@@ -576,18 +597,20 @@ import org.slf4j.LoggerFactory;
             }
             break;
           case 3: // AUTHORIZATION_FAILURES
-            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
               {
-                org.apache.thrift.protocol.TList _list57 = iprot.readListBegin();
-                struct.authorizationFailures = new ArrayList<TKeyExtent>(_list57.size);
-                for (int _i58 = 0; _i58 < _list57.size; ++_i58)
+                org.apache.thrift.protocol.TMap _map57 = iprot.readMapBegin();
+                struct.authorizationFailures = new HashMap<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode>(2*_map57.size);
+                for (int _i58 = 0; _i58 < _map57.size; ++_i58)
                 {
-                  TKeyExtent _elem59; // required
-                  _elem59 = new TKeyExtent();
-                  _elem59.read(iprot);
-                  struct.authorizationFailures.add(_elem59);
+                  TKeyExtent _key59; // required
+                  org.apache.accumulo.core.security.thrift.SecurityErrorCode _val60; // required
+                  _key59 = new TKeyExtent();
+                  _key59.read(iprot);
+                  _val60 = org.apache.accumulo.core.security.thrift.SecurityErrorCode.findByValue(iprot.readI32());
+                  struct.authorizationFailures.put(_key59, _val60);
                 }
-                iprot.readListEnd();
+                iprot.readMapEnd();
               }
               struct.setAuthorizationFailuresIsSet(true);
             } else { 
@@ -613,10 +636,10 @@ import org.slf4j.LoggerFactory;
         oprot.writeFieldBegin(FAILED_EXTENTS_FIELD_DESC);
         {
           oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, struct.failedExtents.size()));
-          for (Map.Entry<TKeyExtent, Long> _iter60 : struct.failedExtents.entrySet())
+          for (Map.Entry<TKeyExtent, Long> _iter61 : struct.failedExtents.entrySet())
           {
-            _iter60.getKey().write(oprot);
-            oprot.writeI64(_iter60.getValue());
+            _iter61.getKey().write(oprot);
+            oprot.writeI64(_iter61.getValue());
           }
           oprot.writeMapEnd();
         }
@@ -626,9 +649,9 @@ import org.slf4j.LoggerFactory;
         oprot.writeFieldBegin(VIOLATION_SUMMARIES_FIELD_DESC);
         {
           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.violationSummaries.size()));
-          for (TConstraintViolationSummary _iter61 : struct.violationSummaries)
+          for (TConstraintViolationSummary _iter62 : struct.violationSummaries)
           {
-            _iter61.write(oprot);
+            _iter62.write(oprot);
           }
           oprot.writeListEnd();
         }
@@ -637,12 +660,13 @@ import org.slf4j.LoggerFactory;
       if (struct.authorizationFailures != null) {
         oprot.writeFieldBegin(AUTHORIZATION_FAILURES_FIELD_DESC);
         {
-          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.authorizationFailures.size()));
-          for (TKeyExtent _iter62 : struct.authorizationFailures)
+          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I32, struct.authorizationFailures.size()));
+          for (Map.Entry<TKeyExtent, org.apache.accumulo.core.security.thrift.SecurityErrorCode> _iter63 : struct.authorizationFailures.entrySet())
           {
-            _iter62.write(oprot);
+            _iter63.getKey().write(oprot);
+            oprot.writeI32(_iter63.getValue().getValue());
           }
-          oprot.writeListEnd();
+          oprot.writeMapEnd();
         }
         oprot.writeFieldEnd();
       }
@@ -677,28 +701,29 @@ import org.slf4j.LoggerFactory;
       if (struct.isSetFailedExtents()) {
         {
           oprot.writeI32(struct.failedExtents.size());
-          for (Map.Entry<TKeyExtent, Long> _iter63 : struct.failedExtents.entrySet())
+          for (Map.Entry<TKeyExtent, Long> _iter64 : struct.failedExtents.entrySet())
           {
-            _iter63.getKey().write(oprot);
-            oprot.writeI64(_iter63.getValue());
+            _iter64.getKey().write(oprot);
+            oprot.writeI64(_iter64.getValue());
           }
         }
       }
       if (struct.isSetViolationSummaries()) {
         {
           oprot.writeI32(struct.violationSummaries.size());
-          for (TConstraintViolationSummary _iter64 : struct.violationSummaries)
+          for (TConstraintViolationSummary _iter65 : struct.violationSummaries)
           {
-            _iter64.write(oprot);
+            _iter65.write(oprot);
           }
         }
       }
       if (struct.isSetAuthorizationFailures()) {
         {
           oprot.writeI32(struct.authorizationFailures.size());
-          for (TKeyExtent _iter65 : struct.authorizationFailures)
+          for (Map.Entry<TKeyExtent, org.apache.accumulo.core.security.thrift.SecurityErrorCode> _iter66 : struct.authorizationFailures.entrySet())
           {
-            _iter65.write(oprot);
+            _iter66.getKey().write(oprot);
+            oprot.writeI32(_iter66.getValue().getValue());
           }
         }
       }
@@ -710,44 +735,46 @@ import org.slf4j.LoggerFactory;
       BitSet incoming = iprot.readBitSet(3);
       if (incoming.get(0)) {
         {
-          org.apache.thrift.protocol.TMap _map66 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, iprot.readI32());
-          struct.failedExtents = new HashMap<TKeyExtent,Long>(2*_map66.size);
-          for (int _i67 = 0; _i67 < _map66.size; ++_i67)
+          org.apache.thrift.protocol.TMap _map67 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I64, iprot.readI32());
+          struct.failedExtents = new HashMap<TKeyExtent,Long>(2*_map67.size);
+          for (int _i68 = 0; _i68 < _map67.size; ++_i68)
           {
-            TKeyExtent _key68; // required
-            long _val69; // required
-            _key68 = new TKeyExtent();
-            _key68.read(iprot);
-            _val69 = iprot.readI64();
-            struct.failedExtents.put(_key68, _val69);
+            TKeyExtent _key69; // required
+            long _val70; // required
+            _key69 = new TKeyExtent();
+            _key69.read(iprot);
+            _val70 = iprot.readI64();
+            struct.failedExtents.put(_key69, _val70);
           }
         }
         struct.setFailedExtentsIsSet(true);
       }
       if (incoming.get(1)) {
         {
-          org.apache.thrift.protocol.TList _list70 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-          struct.violationSummaries = new ArrayList<TConstraintViolationSummary>(_list70.size);
-          for (int _i71 = 0; _i71 < _list70.size; ++_i71)
+          org.apache.thrift.protocol.TList _list71 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+          struct.violationSummaries = new ArrayList<TConstraintViolationSummary>(_list71.size);
+          for (int _i72 = 0; _i72 < _list71.size; ++_i72)
           {
-            TConstraintViolationSummary _elem72; // required
-            _elem72 = new TConstraintViolationSummary();
-            _elem72.read(iprot);
-            struct.violationSummaries.add(_elem72);
+            TConstraintViolationSummary _elem73; // required
+            _elem73 = new TConstraintViolationSummary();
+            _elem73.read(iprot);
+            struct.violationSummaries.add(_elem73);
           }
         }
         struct.setViolationSummariesIsSet(true);
       }
       if (incoming.get(2)) {
         {
-          org.apache.thrift.protocol.TList _list73 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-          struct.authorizationFailures = new ArrayList<TKeyExtent>(_list73.size);
-          for (int _i74 = 0; _i74 < _list73.size; ++_i74)
+          org.apache.thrift.protocol.TMap _map74 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT, org.apache.thrift.protocol.TType.I32, iprot.readI32());
+          struct.authorizationFailures = new HashMap<TKeyExtent,org.apache.accumulo.core.security.thrift.SecurityErrorCode>(2*_map74.size);
+          for (int _i75 = 0; _i75 < _map74.size; ++_i75)
           {
-            TKeyExtent _elem75; // required
-            _elem75 = new TKeyExtent();
-            _elem75.read(iprot);
-            struct.authorizationFailures.add(_elem75);
+            TKeyExtent _key76; // required
+            org.apache.accumulo.core.security.thrift.SecurityErrorCode _val77; // required
+            _key76 = new TKeyExtent();
+            _key76.read(iprot);
+            _val77 = org.apache.accumulo.core.security.thrift.SecurityErrorCode.findByValue(iprot.readI32());
+            struct.authorizationFailures.put(_key76, _val77);
           }
         }
         struct.setAuthorizationFailuresIsSet(true);

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java Mon Jan 14 22:03:24 2013
@@ -22,7 +22,6 @@ import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.io.PrintStream;
-import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -52,7 +51,7 @@ import org.apache.accumulo.core.iterator
 import org.apache.accumulo.core.util.CachedConfiguration;
 import org.apache.accumulo.core.util.LoggingRunnable;
 import org.apache.accumulo.core.util.NamingThreadFactory;
-import org.apache.accumulo.start.classloader.AccumuloClassLoader;
+import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.io.Text;
@@ -114,7 +113,7 @@ public class BloomFilterLayer {
        * load KeyFunctor
        */
       try {
-        Class<? extends KeyFunctor> clazz = AccumuloClassLoader.loadClass(acuconf.get(Property.TABLE_BLOOM_KEY_FUNCTOR), KeyFunctor.class);
+        Class<? extends KeyFunctor> clazz = AccumuloVFSClassLoader.loadClass(acuconf.get(Property.TABLE_BLOOM_KEY_FUNCTOR), KeyFunctor.class);
         transformer = clazz.newInstance();
         
       } catch (Exception e) {
@@ -208,7 +207,7 @@ public class BloomFilterLayer {
              */
             ClassName = in.readUTF();
             
-            Class<? extends KeyFunctor> clazz = AccumuloClassLoader.loadClass(ClassName, KeyFunctor.class);
+            Class<? extends KeyFunctor> clazz = AccumuloVFSClassLoader.loadClass(ClassName, KeyFunctor.class);
             transformer = clazz.newInstance();
             
             /**
@@ -402,8 +401,6 @@ public class BloomFilterLayer {
   }
   
   public static void main(String[] args) throws IOException {
-    final Charset utf8 = Charset.forName("UTF8");
-
     PrintStream out = System.out;
     
     Random r = new Random();
@@ -437,8 +434,8 @@ public class BloomFilterLayer {
     
     for (Integer i : vals) {
       String fi = String.format("%010d", i);
-      bmfw.append(new org.apache.accumulo.core.data.Key(new Text("r" + fi), new Text("cf1")), new Value(("v" + fi).getBytes(utf8)));
-      bmfw.append(new org.apache.accumulo.core.data.Key(new Text("r" + fi), new Text("cf2")), new Value(("v" + fi).getBytes(utf8)));
+      bmfw.append(new org.apache.accumulo.core.data.Key(new Text("r" + fi), new Text("cf1")), new Value(("v" + fi).getBytes()));
+      bmfw.append(new org.apache.accumulo.core.data.Key(new Text("r" + fi), new Text("cf2")), new Value(("v" + fi).getBytes()));
     }
     
     long t2 = System.currentTimeMillis();

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java Mon Jan 14 22:03:24 2013
@@ -435,17 +435,17 @@ public class CachableBlockFile {
 
   public static class CachedBlockRead extends BlockRead {
     private SeekableByteArrayInputStream seekableInput;
-    private CacheEntry cb;
+    private final CacheEntry cb;
     
     public CachedBlockRead(CacheEntry cb, byte buf[]) {
-      this(new SeekableByteArrayInputStream(buf), buf.length);
-      this.cb = cb;
+      this(new SeekableByteArrayInputStream(buf), buf.length, cb);
     }
     
-    private CachedBlockRead(SeekableByteArrayInputStream seekableInput, long size) {
-      super(seekableInput, size);
-      this.seekableInput = seekableInput;
-    }
+    private CachedBlockRead(SeekableByteArrayInputStream seekableInput, long size, CacheEntry cb) {
+        super(seekableInput, size);
+        this.seekableInput = seekableInput;
+        this.cb = cb;
+      }
 
     @Override
     public void seek(int position) {

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/BlockIndex.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/BlockIndex.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/BlockIndex.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/BlockIndex.java Mon Jan 14 22:03:24 2013
@@ -57,26 +57,24 @@ public class BlockIndex {
 
   public static class BlockIndexEntry implements Comparable<BlockIndexEntry> {
     
-    private Key key;
+    private Key prevKey;
     private int entriesLeft;
     private int pos;
     
-    public BlockIndexEntry(int pos, int entriesLeft, Key key) {
+    public BlockIndexEntry(int pos, int entriesLeft, Key prevKey) {
       this.pos = pos;
       this.entriesLeft = entriesLeft;
-      this.key = key;
+      this.prevKey = prevKey;
     }
 
     /**
      * @param key
      */
     public BlockIndexEntry(Key key) {
-      this.key = key;
+      this.prevKey = key;
     }
 
-    public Key getKey() {
-      return key;
-    }
+
     
     public int getEntriesLeft() {
       return entriesLeft;
@@ -84,17 +82,21 @@ public class BlockIndex {
 
     @Override
     public int compareTo(BlockIndexEntry o) {
-      return key.compareTo(o.key);
+      return prevKey.compareTo(o.prevKey);
     }
     
+    @Override
     public String toString() {
-      return key + " " + entriesLeft + " " + pos;
+      return prevKey + " " + entriesLeft + " " + pos;
+    }
+    
+    public Key getPrevKey() {
+      return prevKey;
     }
   }
   
   public BlockIndexEntry seekBlock(Key startKey, ABlockReader cacheBlock) {
 
-    
     // get a local ref to the index, another thread could change it
     BlockIndexEntry[] blockIndex = this.blockIndex;
     
@@ -110,18 +112,24 @@ public class BlockIndex {
     } else {
       // found exact key in index
       index = pos;
+      while (index > 0) {
+        if (blockIndex[index].getPrevKey().equals(startKey))
+          index--;
+        else
+          break;
+      }
     }
     
     // handle case where multiple keys in block are exactly the same, want to find the earliest key in the index
     while (index - 1 > 0) {
-      if (blockIndex[index].getKey().equals(blockIndex[index - 1].getKey()))
+      if (blockIndex[index].getPrevKey().equals(blockIndex[index - 1].getPrevKey()))
         index--;
       else
         break;
 
     }
     
-    if (index == 0 && blockIndex[index].getKey().equals(startKey))
+    if (index == 0 && blockIndex[index].getPrevKey().equals(startKey))
       return null;
 
     BlockIndexEntry bie = blockIndex[index];
@@ -150,12 +158,13 @@ public class BlockIndex {
 
     while (count < (indexEntry.getNumEntries() - interval + 1)) {
 
+      Key myPrevKey = rk.getKey();
       int pos = cacheBlock.getPosition();
       rk.readFields(cacheBlock);
       val.readFields(cacheBlock);
 
       if (count > 0 && count % interval == 0) {
-        index.add(new BlockIndexEntry(pos, indexEntry.getNumEntries() - count, rk.getKey()));
+        index.add(new BlockIndexEntry(pos, indexEntry.getNumEntries() - count, myPrevKey));
       }
       
       count++;
@@ -165,4 +174,8 @@ public class BlockIndex {
 
     cacheBlock.seek(0);
   }
+  
+  BlockIndexEntry[] getIndexEntries() {
+    return blockIndex;
+  }
 }

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/MultiLevelIndex.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/MultiLevelIndex.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/MultiLevelIndex.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/MultiLevelIndex.java Mon Jan 14 22:03:24 2013
@@ -252,7 +252,7 @@ public class MultiLevelIndex {
     
     public void readFields(DataInput in, int version) throws IOException {
       
-      if (version == RFile.RINDEX_VER_6) {
+      if (version == RFile.RINDEX_VER_6 || version == RFile.RINDEX_VER_7) {
         level = in.readInt();
         offset = in.readInt();
         hasNext = in.readBoolean();
@@ -723,7 +723,7 @@ public class MultiLevelIndex {
       
       size = 0;
       
-      if (version == RFile.RINDEX_VER_6) {
+      if (version == RFile.RINDEX_VER_6 || version == RFile.RINDEX_VER_7) {
         size = in.readInt();
       }
       

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java?rev=1433166&r1=1433165&r2=1433166&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java Mon Jan 14 22:03:24 2013
@@ -17,7 +17,9 @@
 package org.apache.accumulo.core.file.rfile;
 
 import java.util.ArrayList;
+import java.util.List;
 
+import org.apache.accumulo.core.cli.Help;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.data.ByteSequence;
 import org.apache.accumulo.core.data.Key;
@@ -26,51 +28,40 @@ import org.apache.accumulo.core.data.Val
 import org.apache.accumulo.core.file.FileUtil;
 import org.apache.accumulo.core.file.blockfile.impl.CachableBlockFile;
 import org.apache.accumulo.core.file.rfile.RFile.Reader;
-import org.apache.commons.cli.BasicParser;
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 
+import com.beust.jcommander.Parameter;
+
 public class PrintInfo {
+  
+  static class Opts extends Help {
+    @Parameter(names={"-d", "--dump"}, description="dump the key/value pairs")
+    boolean dump = false;
+    @Parameter(names={"--historgram"}, description="print a histogram of the key-value sizes")
+    boolean histogram = false;
+    @Parameter(description=" <file> { <file> ... }")
+    List<String> files = new ArrayList<String>();
+  }
+  
   public static void main(String[] args) throws Exception {
     Configuration conf = new Configuration();
     @SuppressWarnings("deprecation")
     //Not for client use
     FileSystem fs = FileUtil.getFileSystem(conf, AccumuloConfiguration.getSiteConfiguration());
-    
-    Options opts = new Options();
-    Option dumpKeys = new Option("d", "dump", false, "dump the key/value pairs");
-    opts.addOption(dumpKeys);
-    Option histogramOption = new Option("h", "histogram", false, "print a histogram of the key-value sizes");
-    opts.addOption(histogramOption);
-    
-    CommandLine commandLine = null;
-    try {
-      commandLine = new BasicParser().parse(opts, args);
-      if (commandLine.getArgs().length == 0) {
-        throw new ParseException("No files were given");
-      }
-      
-    } catch (ParseException e) {
-      System.err.println("Failed to parse command line : " + e.getMessage());
-      System.err.println();
-      HelpFormatter formatter = new HelpFormatter();
-      formatter.printHelp("rfile-info <rfile> {<rfile>}", opts);
+    Opts opts = new Opts();
+    opts.parseArgs(PrintInfo.class.getName(), args);
+    if (opts.files.isEmpty()) {
+      System.err.println("No files were given");
       System.exit(-1);
     }
     
-    boolean dump = commandLine.hasOption(dumpKeys.getOpt());
-    boolean doHistogram = commandLine.hasOption(histogramOption.getOpt());
     long countBuckets[] = new long[11];
     long sizeBuckets[] = new long[countBuckets.length];
     long totalSize = 0;
 
-    for (String arg : commandLine.getArgs()) {
+    for (String arg : opts.files) {
       
       Path path = new Path(arg);
       CachableBlockFile.Reader _rdr = new CachableBlockFile.Reader(fs, path, conf, null, null);
@@ -80,14 +71,14 @@ public class PrintInfo {
       System.out.println();
       org.apache.accumulo.core.file.rfile.bcfile.PrintInfo.main(new String[] {arg});
       
-      if (doHistogram || dump) {
+      if (opts.histogram || opts.dump) {
         iter.seek(new Range((Key) null, (Key) null), new ArrayList<ByteSequence>(), false);
         while (iter.hasTop()) {
           Key key = iter.getTopKey();
           Value value = iter.getTopValue();
-          if (dump)
+          if (opts.dump)
             System.out.println(key + " -> " + value);
-          if (doHistogram) {
+          if (opts.histogram) {
             long size = key.getSize() + value.getSize();
             int bucket = (int) Math.log10(size);
             countBuckets[bucket]++;
@@ -98,7 +89,7 @@ public class PrintInfo {
         }
       }
       iter.close();
-      if (doHistogram) {
+      if (opts.histogram) {
         System.out.println("Up to size      count      %-age");
         for (int i = 1; i < countBuckets.length; i++) {
           System.out.println(String.format("%11.0f : %10d %6.2f%%", Math.pow(10, i), countBuckets[i], sizeBuckets[i] * 100. / totalSize));



Mime
View raw message