accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1391754 [4/11] - in /accumulo/branches/ACCUMULO-259: ./ assemble/ conf/ conf/examples/1GB/native-standalone/ conf/examples/1GB/standalone/ conf/examples/2GB/native-standalone/ conf/examples/2GB/standalone/ conf/examples/3GB/native-standalo...
Date Sat, 29 Sep 2012 05:43:13 GMT
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCache.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCache.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCache.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCache.java Sat Sep 29 05:42:59 2012
@@ -60,7 +60,9 @@ public interface BlockCache {
   public void shutdown();
   
   /**
-   * @return
+   * Get the maximum size of this cache.
+   *
+   * @return max size in bytes
    */
   public long getMaxSize();
 }

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=1391754&r1=1391753&r2=1391754&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 Sat Sep 29 05:42:59 2012
@@ -68,7 +68,7 @@ public class BlockIndex {
     }
 
     /**
-     * @param startKey
+     * @param key
      */
     public BlockIndexEntry(Key key) {
       this.key = key;

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java Sat Sep 29 05:42:59 2012
@@ -487,6 +487,7 @@ public class RFile {
     private boolean isDefaultLocalityGroup;
     private boolean closed = false;
     private int version;
+    private boolean checkRange = true;
     
     private LocalityGroupReader(BlockFileReader reader, LocalityGroupMetadata lgm, int version) throws IOException {
       this.firstKey = lgm.firstKey;
@@ -572,6 +573,11 @@ public class RFile {
           IndexEntry indexEntry = iiter.next();
           entriesLeft = indexEntry.getNumEntries();
           currBlock = getDataBlock(indexEntry);
+          
+          checkRange = range.afterEndKey(indexEntry.getKey());
+          if (!checkRange)
+            hasTop = true;
+
         } else {
           rk = null;
           val = null;
@@ -584,7 +590,8 @@ public class RFile {
       rk.readFields(currBlock);
       val.readFields(currBlock);
       entriesLeft--;
-      hasTop = !range.afterEndKey(rk.getKey());
+      if (checkRange)
+        hasTop = !range.afterEndKey(rk.getKey());
     }
     
     private ABlockReader getDataBlock(IndexEntry indexEntry) throws IOException {
@@ -724,6 +731,10 @@ public class RFile {
           entriesLeft = indexEntry.getNumEntries();
           currBlock = getDataBlock(indexEntry);
 
+          checkRange = range.afterEndKey(indexEntry.getKey());
+          if (!checkRange)
+            hasTop = true;
+
           RelativeKey tmpRk = new RelativeKey();
           MByteSequence valbs = new MByteSequence(new byte[64], 0, 0);
 
@@ -749,7 +760,6 @@ public class RFile {
                 currKey = bie.getKey();
               }
             }
-            
           }
 
           fastSkipped = tmpRk.fastSkip(currBlock, startKey, valbs, prevKey, currKey);

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/RFileOperations.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/RFileOperations.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/RFileOperations.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/RFileOperations.java Sat Sep 29 05:42:59 2012
@@ -104,22 +104,23 @@ public class RFileOperations extends Fil
   @Override
   public FileSKVWriter openWriter(String file, FileSystem fs, Configuration conf, AccumuloConfiguration acuconf) throws IOException {
     int hrep = conf.getInt("dfs.replication", -1);
-    int trep = acuconf.getCount(Property.TABLE_FILE_REPLICATION);
+    int trep = conf.getInt(Property.TABLE_FILE_REPLICATION.getKey(), acuconf.getCount(Property.TABLE_FILE_REPLICATION));
     int rep = hrep;
     if (trep > 0 && trep != hrep) {
       rep = trep;
     }
     long hblock = conf.getLong("dfs.block.size", 1 << 26);
-    long tblock = acuconf.getMemoryInBytes(Property.TABLE_FILE_BLOCK_SIZE);
+    long tblock = conf.getLong(Property.TABLE_FILE_BLOCK_SIZE.getKey(), acuconf.getMemoryInBytes(Property.TABLE_FILE_BLOCK_SIZE));
     long block = hblock;
     if (tblock > 0)
       block = tblock;
     int bufferSize = conf.getInt("io.file.buffer.size", 4096);
     
-    long blockSize = acuconf.getMemoryInBytes(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE);
-    long indexBlockSize = acuconf.getMemoryInBytes(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE_INDEX);
+    long blockSize = conf.getLong(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE.getKey(), acuconf.getMemoryInBytes(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE));
+    long indexBlockSize = conf.getLong(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE_INDEX.getKey(),
+        acuconf.getMemoryInBytes(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE_INDEX));
     
-    String compression = acuconf.get(Property.TABLE_FILE_COMPRESSION_TYPE);
+    String compression = conf.get(Property.TABLE_FILE_COMPRESSION_TYPE.getKey(), acuconf.get(Property.TABLE_FILE_COMPRESSION_TYPE));
     
     CachableBlockFile.Writer _cbw = new CachableBlockFile.Writer(fs.create(new Path(file), false, bufferSize, (short) rep, block), compression, conf);
     Writer writer = new RFile.Writer(_cbw, (int) blockSize, (int) indexBlockSize);

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/RelativeKey.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/RelativeKey.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/RelativeKey.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/RelativeKey.java Sat Sep 29 05:42:59 2012
@@ -74,7 +74,7 @@ public class RelativeKey implements Writ
     dos.close();
     
     System.out.println("Compressed column map size : " + baos.toByteArray().length);
-    System.out.printf("Bytes written : %,d\n", bytesWritten);
+    System.out.printf("Bytes written : %,d%n", bytesWritten);
     
   }
   
@@ -361,15 +361,37 @@ public class RelativeKey implements Writ
     read(in, mbseq, len);
   }
   
+  /**
+   * Determines what next array size should be by rounding up to next power of two.
+   * 
+   */
+  static int nextArraySize(int i) {
+    if (i < 0)
+      throw new IllegalArgumentException();
+    
+    if (i > (1 << 30))
+      return Integer.MAX_VALUE; // this is the next power of 2 minus one... a special case
+
+    if (i == 0) {
+      return 1;
+    }
+    
+    // round up to next power of two
+    int ret = i;
+    ret--;
+    ret |= ret >> 1;
+    ret |= ret >> 2;
+    ret |= ret >> 4;
+    ret |= ret >> 8;
+    ret |= ret >> 16;
+    ret++;
+    
+    return ret;
+  }
+
   private void read(DataInput in, MByteSequence mbseq, int len) throws IOException {
     if (mbseq.getBackingArray().length < len) {
-      int newLen = mbseq.getBackingArray().length;
-      
-      while (newLen < len) {
-        newLen = newLen * 2;
-      }
-      
-      mbseq.setArray(new byte[newLen]);
+      mbseq.setArray(new byte[nextArraySize(len)]);
     }
     
     in.readFully(mbseq.getBackingArray(), 0, len);
@@ -397,7 +419,7 @@ public class RelativeKey implements Writ
     
     out.writeByte(fieldsSame);
     
-    // System.out.printf("wrote fs %x\n", fieldsSame);
+    // System.out.printf("wrote fs %x%n", fieldsSame);
     
     bytesWritten += 1;
     

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/PrintInfo.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/PrintInfo.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/PrintInfo.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/PrintInfo.java Sat Sep 29 05:42:59 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.core.file.rfile.bcfile;
 
+import java.io.IOException;
 import java.io.PrintStream;
 import java.util.Map.Entry;
 import java.util.Set;
@@ -29,9 +30,11 @@ import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 
 public class PrintInfo {
-  public static void printMetaBlockInfo(Configuration conf, FileSystem fs, Path path) throws Exception {
+  public static void printMetaBlockInfo(Configuration conf, FileSystem fs, Path path) throws IOException {
     FSDataInputStream fsin = fs.open(path);
-    BCFile.Reader bcfr = new BCFile.Reader(fsin, fs.getFileStatus(path).getLen(), conf);
+    BCFile.Reader bcfr = null;
+    try {
+    bcfr = new BCFile.Reader(fsin, fs.getFileStatus(path).getLen(), conf);
     
     Set<Entry<String,MetaIndexEntry>> es = bcfr.metaIndex.index.entrySet();
     
@@ -43,6 +46,11 @@ public class PrintInfo {
       out.println("      Compression type     : " + entry.getValue().getCompressionAlgorithm().getName());
       out.println();
     }
+    } finally {
+    	if (bcfr != null) {
+    		bcfr.close();
+    	}
+    }
   }
   
   public static void main(String[] args) throws Exception {

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/TFile.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/TFile.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/TFile.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/TFile.java Sat Sep 29 05:42:59 2012
@@ -2012,7 +2012,7 @@ public class TFile {
    *          A list of TFile paths.
    */
   public static void main(String[] args) {
-    System.out.printf("TFile Dumper (TFile %s, BCFile %s)\n", TFile.API_VERSION.toString(), BCFile.API_VERSION.toString());
+    System.out.printf("TFile Dumper (TFile %s, BCFile %s)%n", TFile.API_VERSION.toString(), BCFile.API_VERSION.toString());
     if (args.length == 0) {
       System.out.println("Usage: java ... org.apache.hadoop.io.file.tfile.TFile tfile-path [tfile-path ...]");
       System.exit(0);

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/TFileDumper.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/TFileDumper.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/TFileDumper.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/TFileDumper.java Sat Sep 29 05:42:59 2012
@@ -163,7 +163,7 @@ class TFileDumper {
       }
       for (Iterator<Map.Entry<String,String>> it = entrySet.iterator(); it.hasNext();) {
         Map.Entry<String,String> e = it.next();
-        out.printf("%s : %s\n", Align.format(e.getKey(), maxKeyLength, Align.LEFT), e.getValue());
+        out.printf("%s : %s%n", Align.format(e.getKey(), maxKeyLength, Align.LEFT), e.getValue());
       }
       out.println();
       reader.checkTFileDataIndex();
@@ -182,7 +182,7 @@ class TFileDumper {
         String endKey = "End-Key";
         int endKeyWidth = Math.max(endKey.length(), maxKeySampleLen * 2 + 5);
         
-        out.printf("%s %s %s %s %s %s\n", Align.format(blkID, blkIDWidth, Align.CENTER), Align.format(offset, offsetWidth, Align.CENTER),
+        out.printf("%s %s %s %s %s %s%n", Align.format(blkID, blkIDWidth, Align.CENTER), Align.format(offset, offsetWidth, Align.CENTER),
             Align.format(blkLen, blkLenWidth, Align.CENTER), Align.format(rawSize, rawSizeWidth, Align.CENTER),
             Align.format(records, recordsWidth, Align.CENTER), Align.format(endKey, endKeyWidth, Align.LEFT));
         
@@ -237,7 +237,7 @@ class TFileDumper {
         int rawSizeWidth = Align.calculateWidth(rawSize, metaSizeUncompressed / metaBlkCnt * 10);
         String compression = "Compression";
         int compressionWidth = compression.length();
-        out.printf("%s %s %s %s %s\n", Align.format(name, nameWidth, Align.CENTER), Align.format(offset, offsetWidth, Align.CENTER),
+        out.printf("%s %s %s %s %s%n", Align.format(name, nameWidth, Align.CENTER), Align.format(offset, offsetWidth, Align.CENTER),
             Align.format(blkLen, blkLenWidth, Align.CENTER), Align.format(rawSize, rawSizeWidth, Align.CENTER),
             Align.format(compression, compressionWidth, Align.LEFT));
         
@@ -246,7 +246,7 @@ class TFileDumper {
           String blkName = e.getValue().getMetaName();
           BlockRegion region = e.getValue().getRegion();
           String blkCompression = e.getValue().getCompressionAlgorithm().getName();
-          out.printf("%s %s %s %s %s\n", Align.format(blkName, nameWidth, Align.LEFT), Align.format(region.getOffset(), offsetWidth, Align.LEFT),
+          out.printf("%s %s %s %s %s%n", Align.format(blkName, nameWidth, Align.LEFT), Align.format(region.getOffset(), offsetWidth, Align.LEFT),
               Align.format(region.getCompressedSize(), blkLenWidth, Align.LEFT), Align.format(region.getRawSize(), rawSizeWidth, Align.LEFT),
               Align.format(blkCompression, compressionWidth, Align.LEFT));
         }

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GCMonitorService.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GCMonitorService.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GCMonitorService.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GCMonitorService.java Sat Sep 29 05:42:59 2012
@@ -196,7 +196,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.security.thrift.AuthInfo credentials; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)2, "tinfo"),
       CREDENTIALS((short)1, "credentials");
 
@@ -653,7 +653,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.security.thrift.ThriftSecurityException sec; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success"),
       SEC((short)1, "sec");
 

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GCStatus.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GCStatus.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GCStatus.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GCStatus.java Sat Sep 29 05:42:59 2012
@@ -47,7 +47,7 @@ import org.slf4j.LoggerFactory;
   public GcCycleStats currentLog; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     LAST((short)1, "last"),
     LAST_LOG((short)2, "lastLog"),
     CURRENT((short)3, "current"),

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GcCycleStats.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GcCycleStats.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GcCycleStats.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/gc/thrift/GcCycleStats.java Sat Sep 29 05:42:59 2012
@@ -51,7 +51,7 @@ import org.slf4j.LoggerFactory;
   public long errors; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     STARTED((short)1, "started"),
     FINISHED((short)2, "finished"),
     CANDIDATES((short)3, "candidates"),

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/iterators/SortedKeyValueIterator.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/iterators/SortedKeyValueIterator.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/iterators/SortedKeyValueIterator.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/iterators/SortedKeyValueIterator.java Sat Sep 29 05:42:59 2012
@@ -82,11 +82,11 @@ public interface SortedKeyValueIterator<
    * to a key in the middle of such a group (e.g. the middle of a row). Even if the client always seeks to a range containing an entire group (a,c), the tablet
    * server could send back a batch of entries corresponding to (a,b], then reseek the iterator to range (b,c) when the scan is continued.
    *
-   * {@link columnFamilies} is used, at the lowest level, to determine which data blocks inside of an RFile need to be opened for this iterator. This set of data
+   * {@code columnFamilies} is used, at the lowest level, to determine which data blocks inside of an RFile need to be opened for this iterator. This set of data
    * blocks is also the set of locality groups defined for the given table. If no columnFamilies are provided, the data blocks for all locality groups inside of
-   * the correct RFile will be opened and seeked in an attempt to find the correct start key, irregardless of the startKey in the {@link range}.
+   * the correct RFile will be opened and seeked in an attempt to find the correct start key, irregardless of the startKey in the {@code range}.
    *
-   * In an Accumulo instance in which multiple locality groups exist for a table, it is important to ensure that {@link columnFamilies} is properly set to the
+   * In an Accumulo instance in which multiple locality groups exist for a table, it is important to ensure that {@code columnFamilies} is properly set to the
    * minimum required column families to ensure that data from separate locality groups is not inadvertently read.
    * 
    * @param range

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/iterators/WrappingIterator.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/iterators/WrappingIterator.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/iterators/WrappingIterator.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/iterators/WrappingIterator.java Sat Sep 29 05:42:59 2012
@@ -25,6 +25,15 @@ import org.apache.accumulo.core.data.Key
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 
+/**
+ * A convenience class for implementing iterators that select, but do not modify, entries read from a source iterator. Default implementations exist for all
+ * methods, but {@link #deepCopy} will throw an <code>UnsupportedOperationException</code>.
+ * 
+ * This iterator has some checks in place to enforce the iterator contract. Specifically, it verifies that it has a source iterator and that {@link #seek} has
+ * been called before any data is read. If either of these conditions does not hold true, an <code>IllegalStateException</code> will be thrown. In particular,
+ * this means that <code>getSource().seek</code> and <code>super.seek</code> no longer perform identical actions. Implementors should take note of this and if
+ * <code>seek</code> is overridden, ensure that <code>super.seek</code> is called before data is read.
+ */
 public abstract class WrappingIterator implements SortedKeyValueIterator<Key,Value> {
   
   private SortedKeyValueIterator<Key,Value> source = null;

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/iterators/user/IndexedDocIterator.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/iterators/user/IndexedDocIterator.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/iterators/user/IndexedDocIterator.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/iterators/user/IndexedDocIterator.java Sat Sep 29 05:42:59 2012
@@ -31,7 +31,6 @@ import org.apache.accumulo.core.data.Ran
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.IteratorEnvironment;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
-import org.apache.accumulo.core.iterators.user.IntersectingIterator.TermSource;
 import org.apache.hadoop.io.Text;
 
 /**
@@ -127,7 +126,7 @@ public class IndexedDocIterator extends 
   }
   
   @Override
-  public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
+  synchronized public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
     super.init(source, options, env);
     if (options.containsKey(indexFamilyOptionName))
       indexColf = new Text(options.get(indexFamilyOptionName));
@@ -162,7 +161,7 @@ public class IndexedDocIterator extends 
     Key docKey = buildDocKey();
     docSource.seek(new Range(docKey, true, null, false), docColfSet, true);
     log.debug("got doc key: " + docSource.getTopKey().toString());
-    if (docSource.hasTop() && docKey.compareTo(docSource.getTopKey(), PartialKey.ROW_COLFAM_COLQUAL) == 0) {
+    if (docSource.hasTop() && docKey.equals(docSource.getTopKey(), PartialKey.ROW_COLFAM_COLQUAL)) {
       value = docSource.getTopValue();
     }
     log.debug("got doc value: " + value.toString());

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/Compacting.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/Compacting.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/Compacting.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/Compacting.java Sat Sep 29 05:42:59 2012
@@ -43,7 +43,7 @@ import org.slf4j.LoggerFactory;
   public int queued; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     RUNNING((short)1, "running"),
     QUEUED((short)2, "queued");
 

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/DeadServer.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/DeadServer.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/DeadServer.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/DeadServer.java Sat Sep 29 05:42:59 2012
@@ -45,7 +45,7 @@ import org.slf4j.LoggerFactory;
   public String status; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     SERVER((short)1, "server"),
     LAST_STATUS((short)2, "lastStatus"),
     STATUS((short)3, "status");

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/MasterClientService.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/MasterClientService.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/MasterClientService.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/MasterClientService.java Sat Sep 29 05:42:59 2012
@@ -1585,7 +1585,7 @@ import org.slf4j.LoggerFactory;
     public String tableName; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)3, "tinfo"),
       CREDENTIALS((short)1, "credentials"),
       TABLE_NAME((short)2, "tableName");
@@ -2142,7 +2142,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException tope; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success"),
       SEC((short)1, "sec"),
       TOPE((short)2, "tope");
@@ -2538,8 +2538,6 @@ import org.slf4j.LoggerFactory;
 
     private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
       try {
-        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-        __isset_bit_vector = new BitSet(1);
         read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
       } catch (org.apache.thrift.TException te) {
         throw new java.io.IOException(te);
@@ -2706,7 +2704,7 @@ import org.slf4j.LoggerFactory;
     public long maxLoops; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)5, "tinfo"),
       CREDENTIALS((short)1, "credentials"),
       TABLE_NAME((short)2, "tableName"),
@@ -3668,7 +3666,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException tope; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SEC((short)1, "sec"),
       TOPE((short)2, "tope");
 
@@ -4131,7 +4129,7 @@ import org.slf4j.LoggerFactory;
     public String value; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)5, "tinfo"),
       CREDENTIALS((short)1, "credentials"),
       TABLE_NAME((short)2, "tableName"),
@@ -4882,7 +4880,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException tope; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SEC((short)1, "sec"),
       TOPE((short)2, "tope");
 
@@ -5343,7 +5341,7 @@ import org.slf4j.LoggerFactory;
     public String property; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)4, "tinfo"),
       CREDENTIALS((short)1, "credentials"),
       TABLE_NAME((short)2, "tableName"),
@@ -5996,7 +5994,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException tope; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SEC((short)1, "sec"),
       TOPE((short)2, "tope");
 
@@ -6459,7 +6457,7 @@ import org.slf4j.LoggerFactory;
     public MasterGoalState state; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)3, "tinfo"),
       CREDENTIALS((short)1, "credentials"),
       /**
@@ -7024,7 +7022,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.security.thrift.ThriftSecurityException sec; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SEC((short)1, "sec");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -7383,7 +7381,7 @@ import org.slf4j.LoggerFactory;
     public boolean stopTabletServers; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)3, "tinfo"),
       CREDENTIALS((short)1, "credentials"),
       STOP_TABLET_SERVERS((short)2, "stopTabletServers");
@@ -7935,7 +7933,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.security.thrift.ThriftSecurityException sec; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SEC((short)1, "sec");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -8296,7 +8294,7 @@ import org.slf4j.LoggerFactory;
     public boolean force; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)3, "tinfo"),
       CREDENTIALS((short)1, "credentials"),
       TABLET_SERVER((short)2, "tabletServer"),
@@ -8946,7 +8944,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.security.thrift.ThriftSecurityException sec; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SEC((short)1, "sec");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -9307,7 +9305,7 @@ import org.slf4j.LoggerFactory;
     public String value; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)4, "tinfo"),
       CREDENTIALS((short)1, "credentials"),
       PROPERTY((short)2, "property"),
@@ -9958,7 +9956,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.security.thrift.ThriftSecurityException sec; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SEC((short)1, "sec");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -10317,7 +10315,7 @@ import org.slf4j.LoggerFactory;
     public String property; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)3, "tinfo"),
       CREDENTIALS((short)1, "credentials"),
       PROPERTY((short)2, "property");
@@ -10870,7 +10868,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.security.thrift.ThriftSecurityException sec; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SEC((short)1, "sec");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -11227,7 +11225,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.security.thrift.AuthInfo credentials; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)2, "tinfo"),
       CREDENTIALS((short)1, "credentials");
 
@@ -11684,7 +11682,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.security.thrift.ThriftSecurityException sec; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success"),
       SEC((short)1, "sec");
 
@@ -12145,7 +12143,7 @@ import org.slf4j.LoggerFactory;
     public TabletSplit split; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)4, "tinfo"),
       CREDENTIALS((short)1, "credentials"),
       SERVER_NAME((short)2, "serverName"),
@@ -12810,7 +12808,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.data.thrift.TKeyExtent tablet; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)5, "tinfo"),
       CREDENTIALS((short)1, "credentials"),
       SERVER_NAME((short)2, "serverName"),
@@ -13575,7 +13573,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.security.thrift.AuthInfo credentials; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)2, "tinfo"),
       CREDENTIALS((short)1, "credentials");
 
@@ -14032,7 +14030,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.security.thrift.ThriftSecurityException sec; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success"),
       SEC((short)1, "sec");
 
@@ -14353,8 +14351,6 @@ import org.slf4j.LoggerFactory;
 
     private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
       try {
-        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-        __isset_bit_vector = new BitSet(1);
         read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
       } catch (org.apache.thrift.TException te) {
         throw new java.io.IOException(te);
@@ -14500,7 +14496,7 @@ import org.slf4j.LoggerFactory;
     public boolean autoClean; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)7, "tinfo"),
       CREDENTIALS((short)1, "credentials"),
       OPID((short)2, "opid"),
@@ -15569,7 +15565,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException tope; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SEC((short)1, "sec"),
       TOPE((short)2, "tope");
 
@@ -16028,7 +16024,7 @@ import org.slf4j.LoggerFactory;
     public long opid; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)3, "tinfo"),
       CREDENTIALS((short)1, "credentials"),
       OPID((short)2, "opid");
@@ -16584,7 +16580,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.client.impl.thrift.ThriftTableOperationException tope; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SUCCESS((short)0, "success"),
       SEC((short)1, "sec"),
       TOPE((short)2, "tope");
@@ -17141,7 +17137,7 @@ import org.slf4j.LoggerFactory;
     public long opid; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       TINFO((short)3, "tinfo"),
       CREDENTIALS((short)1, "credentials"),
       OPID((short)2, "opid");
@@ -17693,7 +17689,7 @@ import org.slf4j.LoggerFactory;
     public org.apache.accumulo.core.security.thrift.ThriftSecurityException sec; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       SEC((short)1, "sec");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/MasterGoalState.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/MasterGoalState.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/MasterGoalState.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/MasterGoalState.java Sat Sep 29 05:42:59 2012
@@ -11,7 +11,7 @@ import java.util.Map;
 import java.util.HashMap;
 import org.apache.thrift.TEnum;
 
-public enum MasterGoalState implements org.apache.thrift.TEnum {
+@SuppressWarnings("all") public enum MasterGoalState implements org.apache.thrift.TEnum {
   CLEAN_STOP(0),
   SAFE_MODE(1),
   NORMAL(2);

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/MasterMonitorInfo.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/MasterMonitorInfo.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/MasterMonitorInfo.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/MasterMonitorInfo.java Sat Sep 29 05:42:59 2012
@@ -63,7 +63,7 @@ import org.slf4j.LoggerFactory;
   public List<DeadServer> deadTabletServers; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     TABLE_MAP((short)1, "tableMap"),
     T_SERVER_INFO((short)2, "tServerInfo"),
     BAD_TSERVERS((short)3, "badTServers"),

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/MasterState.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/MasterState.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/MasterState.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/MasterState.java Sat Sep 29 05:42:59 2012
@@ -11,7 +11,7 @@ import java.util.Map;
 import java.util.HashMap;
 import org.apache.thrift.TEnum;
 
-public enum MasterState implements org.apache.thrift.TEnum {
+@SuppressWarnings("all") public enum MasterState implements org.apache.thrift.TEnum {
   INITIAL(0),
   HAVE_LOCK(1),
   SAFE_MODE(2),

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/RecoveryException.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/RecoveryException.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/RecoveryException.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/RecoveryException.java Sat Sep 29 05:42:59 2012
@@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory;
   public String why; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     WHY((short)1, "why");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/RecoveryStatus.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/RecoveryStatus.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/RecoveryStatus.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/RecoveryStatus.java Sat Sep 29 05:42:59 2012
@@ -45,7 +45,7 @@ import org.slf4j.LoggerFactory;
   public double progress; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     NAME((short)2, "name"),
     RUNTIME((short)5, "runtime"),
     PROGRESS((short)6, "progress");

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TableInfo.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TableInfo.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TableInfo.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TableInfo.java Sat Sep 29 05:42:59 2012
@@ -63,7 +63,7 @@ import org.slf4j.LoggerFactory;
   public double scanRate; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     RECS((short)1, "recs"),
     RECS_IN_MEMORY((short)2, "recsInMemory"),
     TABLETS((short)3, "tablets"),

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TableOperation.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TableOperation.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TableOperation.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TableOperation.java Sat Sep 29 05:42:59 2012
@@ -11,7 +11,7 @@ import java.util.Map;
 import java.util.HashMap;
 import org.apache.thrift.TEnum;
 
-public enum TableOperation implements org.apache.thrift.TEnum {
+@SuppressWarnings("all") public enum TableOperation implements org.apache.thrift.TEnum {
   CREATE(0),
   CLONE(1),
   DELETE(2),
@@ -21,7 +21,9 @@ public enum TableOperation implements or
   MERGE(6),
   DELETE_RANGE(7),
   BULK_IMPORT(8),
-  COMPACT(9);
+  COMPACT(9),
+  IMPORT(10),
+  EXPORT(11);
 
   private final int value;
 
@@ -62,6 +64,10 @@ public enum TableOperation implements or
         return BULK_IMPORT;
       case 9:
         return COMPACT;
+      case 10:
+        return IMPORT;
+      case 11:
+        return EXPORT;
       default:
         return null;
     }

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TabletLoadState.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TabletLoadState.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TabletLoadState.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TabletLoadState.java Sat Sep 29 05:42:59 2012
@@ -11,7 +11,7 @@ import java.util.Map;
 import java.util.HashMap;
 import org.apache.thrift.TEnum;
 
-public enum TabletLoadState implements org.apache.thrift.TEnum {
+@SuppressWarnings("all") public enum TabletLoadState implements org.apache.thrift.TEnum {
   LOADED(0),
   LOAD_FAILURE(1),
   UNLOADED(2),

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TabletServerStatus.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TabletServerStatus.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TabletServerStatus.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TabletServerStatus.java Sat Sep 29 05:42:59 2012
@@ -61,7 +61,7 @@ import org.slf4j.LoggerFactory;
   public List<RecoveryStatus> logSorts; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     TABLE_MAP((short)1, "tableMap"),
     LAST_CONTACT((short)2, "lastContact"),
     NAME((short)3, "name"),

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TabletSplit.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TabletSplit.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TabletSplit.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/master/thrift/TabletSplit.java Sat Sep 29 05:42:59 2012
@@ -43,7 +43,7 @@ import org.slf4j.LoggerFactory;
   public List<org.apache.accumulo.core.data.thrift.TKeyExtent> newTablets; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     OLD_TABLET((short)1, "oldTablet"),
     NEW_TABLETS((short)2, "newTablets");
 

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java Sat Sep 29 05:42:59 2012
@@ -17,7 +17,9 @@
 package org.apache.accumulo.core.security;
 
 import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
 import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -29,6 +31,7 @@ import org.apache.accumulo.core.data.Arr
 import org.apache.accumulo.core.data.ByteSequence;
 import org.apache.accumulo.core.util.ArgumentChecker;
 import org.apache.accumulo.core.util.ByteBufferUtil;
+import org.apache.commons.codec.binary.Base64;
 
 public class Authorizations implements Iterable<byte[]>, Serializable {
   
@@ -40,6 +43,8 @@ public class Authorizations implements I
   
   private static final boolean[] validAuthChars = new boolean[256];
   
+  public static final String HEADER = "!AUTH1:";
+
   static {
     for (int i = 0; i < 256; i++) {
       validAuthChars[i] = false;
@@ -60,6 +65,8 @@ public class Authorizations implements I
     validAuthChars['_'] = true;
     validAuthChars['-'] = true;
     validAuthChars[':'] = true;
+    validAuthChars['.'] = true;
+    validAuthChars['/'] = true;
   }
   
   static final boolean isValidAuthChar(byte b) {
@@ -73,13 +80,7 @@ public class Authorizations implements I
         throw new IllegalArgumentException("Empty authorization");
       }
       
-      for (byte b : bs.getBackingArray()) {
-        if (!isValidAuthChar(b)) {
-          throw new IllegalArgumentException("invalid authorization " + bs.toString());
-        }
-      }
-      
-      authsList.add(bs.getBackingArray());
+      authsList.add(bs.toArray());
     }
   }
   
@@ -98,39 +99,73 @@ public class Authorizations implements I
     checkAuths();
   }
   
+  /**
+   * @param authorizations
+   *          a serialized authorizations string produced by {@link #getAuthorizationsArray()} or {@link #serialize()}
+   */
+
   public Authorizations(byte[] authorizations) {
+    
     ArgumentChecker.notNull(authorizations);
-    if (authorizations.length > 0)
-      setAuthorizations(new String(authorizations).split(","));
+
+    String authsString = new String(authorizations);
+    if (authsString.startsWith(HEADER)) {
+      // its the new format
+      authsString = authsString.substring(HEADER.length());
+      if (authsString.length() > 0) {
+        for (String encAuth : authsString.split(",")) {
+          byte[] auth = Base64.decodeBase64(encAuth.getBytes());
+          auths.add(new ArrayByteSequence(auth));
+        }
+        checkAuths();
+      }
+    } else {
+      // its the old format
+      ArgumentChecker.notNull(authorizations);
+      if (authorizations.length > 0)
+        setAuthorizations(authsString.split(","));
+    }
   }
   
   public Authorizations() {}
   
+  /**
+   * 
+   * @param charset
+   *          used to convert each authorization to a byte array
+   * @param authorizations
+   *          array of authorizations
+   */
+  
+  public Authorizations(Charset charset, String... authorizations) {
+    setAuthorizations(charset, authorizations);
+  }
+
   public Authorizations(String... authorizations) {
     setAuthorizations(authorizations);
   }
   
   private void setAuthorizations(String... authorizations) {
+    setAuthorizations(Charset.defaultCharset(), authorizations);
+  }
+  
+  private void setAuthorizations(Charset charset, String... authorizations) {
     ArgumentChecker.notNull(authorizations);
     auths.clear();
     for (String str : authorizations) {
       str = str.trim();
-      auths.add(new ArrayByteSequence(str));
+      try {
+        auths.add(new ArrayByteSequence(str.getBytes(charset.name())));
+      } catch (UnsupportedEncodingException e) {
+        throw new RuntimeException(e);
+      }
     }
     
     checkAuths();
   }
   
   public byte[] getAuthorizationsArray() {
-    StringBuilder sb = new StringBuilder();
-    String sep = "";
-    for (ByteSequence auth : auths) {
-      sb.append(sep);
-      sep = ",";
-      sb.append(auth.toString());
-    }
-    
-    return sb.toString().getBytes();
+    return serialize().getBytes();
   }
   
   public List<byte[]> getAuthorizations() {
@@ -142,7 +177,15 @@ public class Authorizations implements I
   }
   
   public String toString() {
-    return serialize();
+    StringBuilder sb = new StringBuilder();
+    String sep = "";
+    for (ByteSequence auth : auths) {
+      sb.append(sep);
+      sep = ",";
+      sb.append(new String(auth.toArray()));
+    }
+    
+    return sb.toString();
   }
   
   public boolean contains(byte[] auth) {
@@ -188,12 +231,12 @@ public class Authorizations implements I
   }
   
   public String serialize() {
-    StringBuilder sb = new StringBuilder();
+    StringBuilder sb = new StringBuilder(HEADER);
     String sep = "";
     for (ByteSequence auth : auths) {
       sb.append(sep);
       sep = ",";
-      sb.append(auth.toString());
+      sb.append(new String(Base64.encodeBase64(auth.toArray())));
     }
     
     return sb.toString();

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/ColumnVisibility.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/ColumnVisibility.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/ColumnVisibility.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/ColumnVisibility.java Sat Sep 29 05:42:59 2012
@@ -16,12 +16,15 @@
  */
 package org.apache.accumulo.core.security;
 
+import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 
+import org.apache.accumulo.core.data.ArrayByteSequence;
+import org.apache.accumulo.core.data.ByteSequence;
 import org.apache.accumulo.core.util.BadArgumentException;
 import org.apache.accumulo.core.util.TextUtil;
 import org.apache.hadoop.io.Text;
@@ -88,6 +91,20 @@ public class ColumnVisibility {
     public int getTermEnd() {
       return end;
     }
+    
+    public ByteSequence getTerm(byte expression[]) {
+      if (type != NodeType.TERM)
+        throw new RuntimeException();
+
+      if (expression[start] == '"') {
+        // its a quoted term
+        int qStart = start + 1;
+        int qEnd = end - 1;
+        
+        return new ArrayByteSequence(expression, qStart, qEnd - qStart);
+      }
+      return new ArrayByteSequence(expression, start, end - start);
+    }
   }
   
   public static class NodeComparator implements Comparator<Node> {
@@ -181,6 +198,8 @@ public class ColumnVisibility {
       Node result = null;
       Node expr = null;
       int termStart = index;
+      boolean termComplete = false;
+
       while (index < expression.length) {
         switch (expression[index++]) {
           case '&': {
@@ -194,6 +213,7 @@ public class ColumnVisibility {
             result.add(expr);
             expr = null;
             termStart = index;
+            termComplete = false;
             break;
           }
           case '|': {
@@ -207,6 +227,7 @@ public class ColumnVisibility {
             result.add(expr);
             expr = null;
             termStart = index;
+            termComplete = false;
             break;
           }
           case '(': {
@@ -215,6 +236,7 @@ public class ColumnVisibility {
               throw new BadArgumentException("expression needs & or |", new String(expression), index - 1);
             expr = parse_(expression);
             termStart = index;
+            termComplete = false;
             break;
           }
           case ')': {
@@ -232,7 +254,35 @@ public class ColumnVisibility {
             result.end = index - 1;
             return result;
           }
+          case '"': {
+            if (termStart != index - 1)
+              throw new BadArgumentException("expression needs & or |", new String(expression), index - 1);
+
+            while (index < expression.length && expression[index] != '"') {
+              if (expression[index] == '\\') {
+                index++;
+                if (expression[index] != '\\' && expression[index] != '"')
+                  throw new BadArgumentException("invalid escaping within quotes", new String(expression), index - 1);
+              }
+              index++;
+            }
+            
+            if (index == expression.length)
+              throw new BadArgumentException("unclosed quote", new String(expression), termStart);
+            
+            if (termStart + 1 == index)
+              throw new BadArgumentException("empty term", new String(expression), termStart);
+
+            index++;
+            
+            termComplete = true;
+
+            break;
+          }
           default: {
+            if (termComplete)
+              throw new BadArgumentException("expression needs & or |", new String(expression), index - 1);
+
             byte c = expression[index - 1];
             if (!Authorizations.isValidAuthChar(c))
               throw new BadArgumentException("bad character (" + c + ")", new String(expression), index - 1);
@@ -275,6 +325,18 @@ public class ColumnVisibility {
     this(expression.getBytes());
   }
   
+  /**
+   * See {@link #ColumnVisibility(byte[])}
+   * 
+   * @param expression
+   * @param encoding
+   *          uses this encoding to convert the expression to a byte array
+   * @throws UnsupportedEncodingException
+   */
+  public ColumnVisibility(String expression, String encoding) throws UnsupportedEncodingException {
+    this(expression.getBytes(encoding));
+  }
+
   public ColumnVisibility(Text expression) {
     this(TextUtil.getBytes(expression));
   }
@@ -295,6 +357,7 @@ public class ColumnVisibility {
    * 
    * </pre>
    * 
+   *          <P>
    *          The following are not valid expressions for visibility:
    * 
    *          <pre>
@@ -306,6 +369,15 @@ public class ColumnVisibility {
    * )
    * dog|!cat
    * </pre>
+   * 
+   *          <P>
+   *          You can use any character you like in your column visibility expression with quoting. If your quoted term contains '&quot;' or '\' then escape
+   *          them with '\'. The {@link #quote(String)} method will properly quote and escape terms for you.
+   * 
+   *          <pre>
+   * &quot;A#C&quot;&B
+   * </pre>
+   * 
    */
   public ColumnVisibility(byte[] expression) {
     validate(expression);
@@ -341,4 +413,56 @@ public class ColumnVisibility {
   public Node getParseTree() {
     return node;
   }
+  
+  /**
+   * see {@link #quote(byte[])}
+   * 
+   */
+  public static String quote(String term) {
+    return quote(term, "UTF-8");
+  }
+  
+  /**
+   * see {@link #quote(byte[])}
+   * 
+   */
+  public static String quote(String term, String encoding) {
+    try {
+      return new String(quote(term.getBytes(encoding)), encoding);
+    } catch (UnsupportedEncodingException e) {
+      throw new RuntimeException(e);
+    }
+  }
+  
+  /**
+   * Use to properly quote terms in a column visibility expression. If no quoting is needed, then nothing is done.
+   * 
+   * <p>
+   * Examples of using quote :
+   * 
+   * <pre>
+   * import static org.apache.accumulo.core.security.ColumnVisibility.quote;
+   *   .
+   *   .
+   *   .
+   * ColumnVisibility cv = new ColumnVisibility(quote(&quot;A#C&quot;) + &quot;&amp;&quot; + quote(&quot;FOO&quot;));
+   * </pre>
+   * 
+   */
+
+  public static byte[] quote(byte[] term) {
+    boolean needsQuote = false;
+    
+    for (int i = 0; i < term.length; i++) {
+      if (!Authorizations.isValidAuthChar(term[i])) {
+        needsQuote = true;
+        break;
+      }
+    }
+    
+    if (!needsQuote)
+      return term;
+    
+    return VisibilityEvaluator.escape(term, true);
+  }
 }

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java Sat Sep 29 05:42:59 2012
@@ -16,23 +16,58 @@
  */
 package org.apache.accumulo.core.security;
 
+import java.util.ArrayList;
 import java.util.Collection;
 
-import org.apache.accumulo.core.data.ArrayByteSequence;
 import org.apache.accumulo.core.security.ColumnVisibility.Node;
 
 public class VisibilityEvaluator {
   private Authorizations auths;
   
+  static Authorizations escape(Authorizations auths) {
+    ArrayList<byte[]> retAuths = new ArrayList<byte[]>(auths.getAuthorizations().size());
+    
+    for (byte[] auth : auths.getAuthorizations())
+      retAuths.add(escape(auth, false));
+    
+    return new Authorizations(retAuths);
+  }
+  
+  public static byte[] escape(byte[] auth, boolean quote) {
+    int escapeCount = 0;
+    
+    for (int i = 0; i < auth.length; i++)
+      if (auth[i] == '"' || auth[i] == '\\')
+        escapeCount++;
+    
+    if (escapeCount > 0 || quote) {
+      byte[] escapedAuth = new byte[auth.length + escapeCount + (quote ? 2 : 0)];
+      int index = quote ? 1 : 0;
+      for (int i = 0; i < auth.length; i++) {
+        if (auth[i] == '"' || auth[i] == '\\')
+          escapedAuth[index++] = '\\';
+        escapedAuth[index++] = auth[i];
+      }
+      
+      if (quote) {
+        escapedAuth[0] = '"';
+        escapedAuth[escapedAuth.length - 1] = '"';
+      }
+
+      auth = escapedAuth;
+    }
+    return auth;
+  }
+
   VisibilityEvaluator(Collection<byte[]> authorizations) {
-    this.auths = new Authorizations(authorizations);
+    this(new Authorizations(authorizations));
   }
   
   /**
    * The VisibilityEvaluator computes a trie from the given Authorizations, that ColumnVisibility expressions can be evaluated against.
    */
   public VisibilityEvaluator(Authorizations authorizations) {
-    this.auths = authorizations;
+    this.auths = escape(authorizations);
   }
   
   public Authorizations getAuthorizations() {
@@ -46,8 +81,7 @@ public class VisibilityEvaluator {
   private final boolean evaluate(final byte[] expression, final Node root) throws VisibilityParseException {
     switch (root.type) {
       case TERM:
-        int len = root.getTermEnd() - root.getTermStart();
-        return auths.contains(new ArrayByteSequence(expression, root.getTermStart(), len));
+        return auths.contains(root.getTerm(expression));
       case AND:
         if (root.children == null || root.children.size() < 2)
           throw new VisibilityParseException("AND has less than 2 children", expression, root.start);

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/thrift/AuthInfo.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/thrift/AuthInfo.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/thrift/AuthInfo.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/thrift/AuthInfo.java Sat Sep 29 05:42:59 2012
@@ -45,7 +45,7 @@ import org.slf4j.LoggerFactory;
   public String instanceId; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     USER((short)1, "user"),
     PASSWORD((short)2, "password"),
     INSTANCE_ID((short)3, "instanceId");

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/thrift/SecurityErrorCode.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/thrift/SecurityErrorCode.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/thrift/SecurityErrorCode.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/thrift/SecurityErrorCode.java Sat Sep 29 05:42:59 2012
@@ -11,7 +11,7 @@ import java.util.Map;
 import java.util.HashMap;
 import org.apache.thrift.TEnum;
 
-public enum SecurityErrorCode implements org.apache.thrift.TEnum {
+@SuppressWarnings("all") public enum SecurityErrorCode implements org.apache.thrift.TEnum {
   DEFAULT_SECURITY_ERROR(0),
   BAD_CREDENTIALS(1),
   PERMISSION_DENIED(2),

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/thrift/ThriftSecurityException.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/thrift/ThriftSecurityException.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/thrift/ThriftSecurityException.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/security/thrift/ThriftSecurityException.java Sat Sep 29 05:42:59 2012
@@ -47,7 +47,7 @@ import org.slf4j.LoggerFactory;
   public SecurityErrorCode code; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     USER((short)1, "user"),
     /**
      * 

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ActionStats.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ActionStats.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ActionStats.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ActionStats.java Sat Sep 29 05:42:59 2012
@@ -55,7 +55,7 @@ import org.slf4j.LoggerFactory;
   public double queueSumDev; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     STATUS((short)1, "status"),
     ELAPSED((short)2, "elapsed"),
     NUM((short)3, "num"),

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ActiveScan.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ActiveScan.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ActiveScan.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ActiveScan.java Sat Sep 29 05:42:59 2012
@@ -69,7 +69,7 @@ import org.slf4j.LoggerFactory;
   public Map<String,Map<String,String>> ssio; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     CLIENT((short)2, "client"),
     USER((short)3, "user"),
     TABLE_ID((short)4, "tableId"),

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ConstraintViolationException.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ConstraintViolationException.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ConstraintViolationException.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ConstraintViolationException.java Sat Sep 29 05:42:59 2012
@@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory;
   public List<org.apache.accumulo.core.data.thrift.TConstraintViolationSummary> violationSummaries; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     VIOLATION_SUMMARIES((short)1, "violationSummaries");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/IteratorConfig.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/IteratorConfig.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/IteratorConfig.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/IteratorConfig.java Sat Sep 29 05:42:59 2012
@@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory;
   public List<TIteratorSetting> iterators; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     ITERATORS((short)1, "iterators");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/NoSuchScanIDException.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/NoSuchScanIDException.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/NoSuchScanIDException.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/NoSuchScanIDException.java Sat Sep 29 05:42:59 2012
@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
 
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
 ;
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/NotServingTabletException.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/NotServingTabletException.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/NotServingTabletException.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/NotServingTabletException.java Sat Sep 29 05:42:59 2012
@@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory;
   public org.apache.accumulo.core.data.thrift.TKeyExtent extent; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     EXTENT((short)1, "extent");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ScanState.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ScanState.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ScanState.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ScanState.java Sat Sep 29 05:42:59 2012
@@ -11,7 +11,7 @@ import java.util.Map;
 import java.util.HashMap;
 import org.apache.thrift.TEnum;
 
-public enum ScanState implements org.apache.thrift.TEnum {
+@SuppressWarnings("all") public enum ScanState implements org.apache.thrift.TEnum {
   IDLE(0),
   RUNNING(1),
   QUEUED(2);

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ScanType.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ScanType.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ScanType.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ScanType.java Sat Sep 29 05:42:59 2012
@@ -11,7 +11,7 @@ import java.util.Map;
 import java.util.HashMap;
 import org.apache.thrift.TEnum;
 
-public enum ScanType implements org.apache.thrift.TEnum {
+@SuppressWarnings("all") public enum ScanType implements org.apache.thrift.TEnum {
   SINGLE(0),
   BATCH(1);
 

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TIteratorSetting.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TIteratorSetting.java?rev=1391754&r1=1391753&r2=1391754&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TIteratorSetting.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TIteratorSetting.java Sat Sep 29 05:42:59 2012
@@ -47,7 +47,7 @@ import org.slf4j.LoggerFactory;
   public Map<String,String> properties; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     PRIORITY((short)1, "priority"),
     NAME((short)2, "name"),
     ITERATOR_CLASS((short)3, "iteratorClass"),



Mime
View raw message