accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bil...@apache.org
Subject svn commit: r1208107 - in /incubator/accumulo/trunk: ./ docs/examples/ src/core/src/main/java/org/apache/accumulo/core/iterators/ src/core/src/main/java/org/apache/accumulo/core/iterators/user/ src/core/src/test/java/org/apache/accumulo/core/iterators/...
Date Tue, 29 Nov 2011 22:08:34 GMT
Author: billie
Date: Tue Nov 29 22:08:32 2011
New Revision: 1208107

URL: http://svn.apache.org/viewvc?rev=1208107&view=rev
Log:
ACCUMULO-167 merged to trunk

Added:
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IndexedDocIterator.java
      - copied unchanged from r1208095, incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IndexedDocIterator.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/IndexedDocIteratorTest.java
      - copied unchanged from r1208095, incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/user/IndexedDocIteratorTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java
      - copied unchanged from r1208095, incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java
Removed:
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/FamilyIntersectingIteratorTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/IntersectingIteratorTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest2.java
    incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/dirlist/FileCountMR.java
    incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/dirlist/StringArraySummation.java
Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/docs/examples/README.dirlist
    incubator/accumulo/trunk/docs/examples/README.shard
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/FamilyIntersectingIterator.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/LongCombiner.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/CombinerTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RowDeletingIteratorTest.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java
    incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/dirlist/Ingest.java
    incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/dirlist/QueryUtil.java
    incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/Query.java
    incubator/accumulo/trunk/src/examples/src/test/java/org/apache/accumulo/examples/dirlist/CountTest.java
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 29 22:08:32 2011
@@ -1,2 +1,2 @@
 /incubator/accumulo/branches/1.3:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031
-/incubator/accumulo/branches/1.4:1201902-1207624,1208013,1208034
+/incubator/accumulo/branches/1.4:1201902-1208095

Modified: incubator/accumulo/trunk/docs/examples/README.dirlist
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/docs/examples/README.dirlist?rev=1208107&r1=1208106&r2=1208107&view=diff
==============================================================================
--- incubator/accumulo/trunk/docs/examples/README.dirlist (original)
+++ incubator/accumulo/trunk/docs/examples/README.dirlist Tue Nov 29 22:08:32 2011
@@ -24,12 +24,10 @@ This example stores filesystem informati
 
 This example shows how to use Accumulo to store a file system history.  It has the following
classes:
 
- * Ingest.java - Recursively lists the files and directories under a given path, ingests
their names and file info (not the file data!) into a Accumulo table, and indexes the file
names in a separate table.
+ * Ingest.java - Recursively lists the files and directories under a given path, ingests
their names and file info (not the file data!) into an Accumulo table, and indexes the file
names in a separate table.
  * QueryUtil.java - Provides utility methods for getting the info for a file, listing the
contents of a directory, and performing single wild card searches on file or directory names.
  * Viewer.java - Provides a GUI for browsing the file system information stored in Accumulo.
- * FileCountMR.java - Runs MR over the file system information and writes out recursive counts
to a Accumulo table.
- * FileCount.java - Accomplishes the same thing as FileCountMR, but in a different way. 
Computes recursive counts and stores them back into table.
- * StringArraySummation.java - Aggregates counts for the FileCountMR reducer.
+ * FileCount.java - Computes recursive counts over file system information and stores them
back into the same Accumulo table.
  
 To begin, ingest some data with Ingest.java.
 
@@ -56,12 +54,10 @@ To perform searches on file or directory
     $ ./bin/accumulo org.apache.accumulo.examples.dirlist.QueryUtil instance zookeepers username
password indexTable exampleVis '*jar' -search
     $ ./bin/accumulo org.apache.accumulo.examples.dirlist.QueryUtil instance zookeepers username
password indexTable exampleVis filename*jar -search
 
-To count the number of direct children (directories and files) and descendants (children
and children's descendents, directories and files), run the FileCountMR over the dirTable
table.
-The results can be written back to the same table.
+To count the number of direct children (directories and files) and descendants (children
and children's descendents, directories and files), run the FileCount over the dirTable table.
+The results are written back to the same table.
 
-    $ ./bin/tool.sh lib/accumulo-examples-*[^c].jar org.apache.accumulo.examples.dirlist.FileCountMR
instance zookeepers username password dirTable dirTable exampleVis exampleVis
-
-Alternatively, you can run FileCount.java which performs the same counts but is not a MapReduce.
 FileCount will be faster for small data sets.
+    $ ./bin/accumulo org.apache.accumulo.examples.dirlist.FileCount instance zookeepers username
password dirTable exampleVis exampleVis
 
 ## Directory Table
 

Modified: incubator/accumulo/trunk/docs/examples/README.shard
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/docs/examples/README.shard?rev=1208107&r1=1208106&r2=1208107&view=diff
==============================================================================
--- incubator/accumulo/trunk/docs/examples/README.shard (original)
+++ incubator/accumulo/trunk/docs/examples/README.shard Tue Nov 29 22:08:32 2011
@@ -50,7 +50,7 @@ The following command queries the index 
     /local/username/workspace/accumulo/src/server/src/test/java/accumulo/server/util/DefaultMapTest.java
     /local/username/workspace/accumulo/src/server/src/test/java/accumulo/server/tabletserver/InMemoryMapTest.java
 
-Inorder to run ContinuousQuery, we need to run Reverse.java to populate doc2term
+In order to run ContinuousQuery, we need to run Reverse.java to populate doc2term.
 
     $ ./bin/accumulo org.apache.accumulo.examples.shard.Reverse instance zookeepers shard
doc2term username password
 

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/FamilyIntersectingIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/FamilyIntersectingIterator.java?rev=1208107&r1=1208106&r2=1208107&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/FamilyIntersectingIterator.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/FamilyIntersectingIterator.java
Tue Nov 29 22:08:32 2011
@@ -1,4 +1,4 @@
-/*
+/**
  * 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.
@@ -16,145 +16,14 @@
  */
 package org.apache.accumulo.core.iterators;
 
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
+import org.apache.accumulo.core.iterators.user.IndexedDocIterator;
 
-import org.apache.accumulo.core.data.ArrayByteSequence;
-import org.apache.accumulo.core.data.ByteSequence;
-import org.apache.accumulo.core.data.Key;
-import org.apache.accumulo.core.data.PartialKey;
-import org.apache.accumulo.core.data.Range;
-import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.iterators.user.IntersectingIterator;
-import org.apache.hadoop.io.Text;
-
-public class FamilyIntersectingIterator extends IntersectingIterator {
-  public static final Text DEFAULT_INDEX_COLF = new Text("i");
-  public static final Text DEFAULT_DOC_COLF = new Text("e");
-  
-  public static final String indexFamilyOptionName = "indexFamily";
-  public static final String docFamilyOptionName = "docFamily";
-  
-  private static Text indexColf = DEFAULT_INDEX_COLF;
-  private static Text docColf = DEFAULT_DOC_COLF;
-  private static Set<ByteSequence> indexColfSet;
-  private static Set<ByteSequence> docColfSet;
-  
-  private static final byte[] nullByte = {0};
-  
-  public SortedKeyValueIterator<Key,Value> docSource;
-  
-  @Override
-  protected Key buildKey(Text partition, Text term, Text docID) {
-    Text colq = new Text(term);
-    colq.append(nullByte, 0, 1);
-    colq.append(docID.getBytes(), 0, docID.getLength());
-    colq.append(nullByte, 0, 1);
-    return new Key(partition, indexColf, colq);
-  }
-  
-  @Override
-  protected Key buildKey(Text partition, Text term) {
-    Text colq = new Text(term);
-    return new Key(partition, indexColf, colq);
-  }
-  
-  @Override
-  protected Text getDocID(Key key) {
-    Text colq = key.getColumnQualifier();
-    int firstZeroIndex = colq.find("\0");
-    if (firstZeroIndex < 0) {
-      throw new IllegalArgumentException("bad docid: " + key.toString());
-    }
-    int secondZeroIndex = colq.find("\0", firstZeroIndex + 1);
-    if (secondZeroIndex < 0) {
-      throw new IllegalArgumentException("bad docid: " + key.toString());
-    }
-    int thirdZeroIndex = colq.find("\0", secondZeroIndex + 1);
-    if (thirdZeroIndex < 0) {
-      throw new IllegalArgumentException("bad docid: " + key.toString());
-    }
-    Text docID = new Text();
-    try {
-      docID.set(colq.getBytes(), firstZeroIndex + 1, thirdZeroIndex - 1 - firstZeroIndex);
-    } catch (ArrayIndexOutOfBoundsException e) {
-      throw new IllegalArgumentException("bad indices for docid: " + key.toString() + " "
+ firstZeroIndex + " " + secondZeroIndex + " " + thirdZeroIndex);
-    }
-    return docID;
-  }
-  
-  @Override
-  protected Text getTerm(Key key) {
-    if (indexColf.compareTo(key.getColumnFamily().getBytes(), 0, indexColf.getLength()) <
0) {
-      // We're past the index column family, so return a term that will sort lexicographically
last.
-      // The last unicode character should suffice
-      return new Text("\uFFFD");
-    }
-    Text colq = key.getColumnQualifier();
-    int zeroIndex = colq.find("\0");
-    Text term = new Text();
-    term.set(colq.getBytes(), 0, zeroIndex);
-    return term;
-  }
-  
-  @Override
-  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));
-    if (options.containsKey(docFamilyOptionName))
-      docColf = new Text(options.get(docFamilyOptionName));
-    docSource = source.deepCopy(env);
-    indexColfSet = Collections.singleton((ByteSequence) new ArrayByteSequence(indexColf.getBytes(),
0, indexColf.getLength()));
-  }
-  
-  @Override
-  public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env) {
-    throw new UnsupportedOperationException();
-  }
-  
-  @Override
-  public void seek(Range range, Collection<ByteSequence> seekColumnFamilies, boolean
inclusive) throws IOException {
-    super.seek(range, indexColfSet, true);
-    
-  }
-  
-  @Override
-  protected void advanceToIntersection() throws IOException {
-    super.advanceToIntersection();
-    if (topKey == null)
-      return;
-    if (log.isTraceEnabled())
-      log.trace("using top key to seek for doc: " + topKey.toString());
-    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) {
-      value = docSource.getTopValue();
-    }
-    log.debug("got doc value: " + value.toString());
-  }
+/**
+ * This class remains here for backwards compatibility.
+ * 
+ * @deprecated since 1.4
+ * @see org.apache.accumulo.core.iterators.user.IndexedDocIterator
+ */
+public class FamilyIntersectingIterator extends IndexedDocIterator {
   
-  protected Key buildDocKey() {
-    if (log.isTraceEnabled())
-      log.trace("building doc key for " + currentPartition + " " + currentDocID);
-    int zeroIndex = currentDocID.find("\0");
-    if (zeroIndex < 0)
-      throw new IllegalArgumentException("bad current docID");
-    Text colf = new Text(docColf);
-    colf.append(nullByte, 0, 1);
-    colf.append(currentDocID.getBytes(), 0, zeroIndex);
-    docColfSet = Collections.singleton((ByteSequence) new ArrayByteSequence(colf.getBytes(),
0, colf.getLength()));
-    if (log.isTraceEnabled())
-      log.trace(zeroIndex + " " + currentDocID.getLength());
-    Text colq = new Text();
-    colq.set(currentDocID.getBytes(), zeroIndex + 1, currentDocID.getLength() - zeroIndex
- 1);
-    Key k = new Key(currentPartition, colf, colq);
-    if (log.isTraceEnabled())
-      log.trace("built doc key for seek: " + k.toString());
-    return k;
-  }
 }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/LongCombiner.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/LongCombiner.java?rev=1208107&r1=1208106&r2=1208107&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/LongCombiner.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/LongCombiner.java
Tue Nov 29 22:08:32 2011
@@ -40,6 +40,10 @@ import org.apache.hadoop.io.WritableUtil
  * VARNUM, LONG, and STRING which indicate the VarNumEncoder, LongEncoder, and StringEncoder
respectively.
  */
 public abstract class LongCombiner extends TypedValueCombiner<Long> {
+  public static final Encoder<Long> FIXED_LEN_ENCODER = new FixedLenEncoder();
+  public static final Encoder<Long> VAR_LEN_ENCODER = new VarLenEncoder();
+  public static final Encoder<Long> STRING_ENCODER = new StringEncoder();
+  
   protected static final String TYPE = "type";
   protected static final String CLASS_PREFIX = "class:";
   
@@ -73,17 +77,16 @@ public abstract class LongCombiner exten
       } catch (IllegalAccessException e) {
         throw new IllegalArgumentException(e);
       }
-    }
-    else {
+    } else {
       switch (Type.valueOf(type)) {
         case VARNUM:
-          encoder = new VarNumEncoder();
+          encoder = VAR_LEN_ENCODER;
           return;
         case LONG:
-          encoder = new LongEncoder();
+          encoder = FIXED_LEN_ENCODER;
           return;
         case STRING:
-          encoder = new StringEncoder();
+          encoder = STRING_ENCODER;
           return;
         default:
           throw new IllegalArgumentException();
@@ -110,7 +113,7 @@ public abstract class LongCombiner exten
   /**
    * An Encoder that uses a variable-length encoding for Longs. It uses WritableUtils.writeVLong
and WritableUtils.readVLong for encoding and decoding.
    */
-  public static class VarNumEncoder implements Encoder<Long> {
+  public static class VarLenEncoder implements Encoder<Long> {
     @Override
     public byte[] encode(Long v) {
       ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -139,7 +142,7 @@ public abstract class LongCombiner exten
   /**
    * An Encoder that uses an 8-byte encoding for Longs.
    */
-  public static class LongEncoder implements Encoder<Long> {
+  public static class FixedLenEncoder implements Encoder<Long> {
     @Override
     public byte[] encode(Long l) {
       byte[] b = new byte[8];

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java?rev=1208107&r1=1208106&r2=1208107&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/IntersectingIterator.java
Tue Nov 29 22:08:32 2011
@@ -33,6 +33,23 @@ import org.apache.commons.codec.binary.B
 import org.apache.hadoop.io.Text;
 import org.apache.log4j.Logger;
 
+/**
+ * This iterator facilitates document-partitioned indexing. It involves grouping a set of
documents together and indexing those documents into a single row of
+ * an Accumulo table. This allows a tablet server to perform boolean AND operations on terms
in the index.
+ * 
+ * The table structure should have the following form:
+ * 
+ * row: shardID, colfam: term, colqual: docID
+ * 
+ * When you configure this iterator with a set of terms (column families), it will return
only the docIDs that appear with all of the specified terms. The
+ * result will have an empty column family, as follows:
+ * 
+ * row: shardID, colfam: (empty), colqual: docID
+ * 
+ * This iterator is commonly used with BatchScanner or AccumuloInputFormat, to parallelize
the search over all shardIDs.
+ * 
+ * README.shard in docs/examples shows an example of using the IntersectingIterator.
+ */
 public class IntersectingIterator implements SortedKeyValueIterator<Key,Value> {
   
   protected Text nullText = new Text();
@@ -361,11 +378,16 @@ public class IntersectingIterator implem
     return "";
   }
   
-  public static final String columnFamiliesOptionName = "columnFamilies";
-  public static final String notFlagOptionName = "notFlag";
+  private static final String columnFamiliesOptionName = "columnFamilies";
+  private static final String notFlagOptionName = "notFlag";
   
-  // to be made private
-  // @see setColumnFamilies
+  /**
+   * to be made protected
+   * 
+   * @param columns
+   * @return encoded columns
+   * @deprecated since 1.4 {@link #setColumnFamilies(IteratorSetting, Text[] columns)}
+   */
   public static String encodeColumns(Text[] columns) {
     StringBuilder sb = new StringBuilder();
     for (int i = 0; i < columns.length; i++) {
@@ -375,6 +397,13 @@ public class IntersectingIterator implem
     return sb.toString();
   }
   
+  /**
+   * to be made protected
+   * 
+   * @param flags
+   * @return encoded flags
+   * @deprecated since 1.4 {@link #setColumnFamilies(IteratorSetting, Text[] columns, boolean[]
flags)}
+   */
   public static String encodeBooleans(boolean[] flags) {
     byte[] bytes = new byte[flags.length];
     for (int i = 0; i < flags.length; i++) {
@@ -386,7 +415,7 @@ public class IntersectingIterator implem
     return new String(Base64.encodeBase64(bytes));
   }
   
-  private static Text[] decodeColumns(String columns) {
+  protected static Text[] decodeColumns(String columns) {
     String[] columnStrings = columns.split("\n");
     Text[] columnTexts = new Text[columnStrings.length];
     for (int i = 0; i < columnStrings.length; i++) {
@@ -395,6 +424,13 @@ public class IntersectingIterator implem
     return columnTexts;
   }
   
+  /**
+   * to be made protected
+   * 
+   * @param flags
+   * @return decoded flags
+   * @deprecated since 1.4
+   */
   public static boolean[] decodeBooleans(String flags) {
     // return null of there were no flags
     if (flags == null)
@@ -507,4 +543,18 @@ public class IntersectingIterator implem
   public static void setColumnFamilies(IteratorSetting cfg, Text[] columns) {
     cfg.addOption(IntersectingIterator.columnFamiliesOptionName, IntersectingIterator.encodeColumns(columns));
   }
-}
\ No newline at end of file
+  
+  /**
+   * Encode columns and NOT flags indicating which columns should be negated (docIDs will
be excluded if matching negated columns, instead of included).
+   * 
+   * @param cfg
+   * @param columns
+   * @param notFlags
+   */
+  public static void setColumnFamilies(IteratorSetting cfg, Text[] columns, boolean[] notFlags)
{
+    if (columns.length != notFlags.length)
+      throw new IllegalArgumentException("columns and notFlags arrays must be the same length");
+    setColumnFamilies(cfg, columns);
+    cfg.addOption(IntersectingIterator.notFlagOptionName, IntersectingIterator.encodeBooleans(notFlags));
+  }
+}

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java?rev=1208107&r1=1208106&r2=1208107&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java
Tue Nov 29 22:08:32 2011
@@ -41,13 +41,17 @@ import org.apache.hadoop.io.WritableUtil
  * A Combiner that interprets Values as arrays of Longs and returns an array of element-wise
sums.
  */
 public class SummingArrayCombiner extends TypedValueCombiner<List<Long>> {
+  public static final Encoder<List<Long>> FIXED_LONG_ARRAY_ENCODER = new FixedLongArrayEncoder();
+  public static final Encoder<List<Long>> VAR_LONG_ARRAY_ENCODER = new VarLongArrayEncoder();
+  public static final Encoder<List<Long>> STRING_ARRAY_ENCODER = new StringArrayEncoder();
+  
   private static final String TYPE = "type";
   private static final String CLASS_PREFIX = "class:";
-
+  
   public static enum Type {
     VARNUM, LONG, STRING
   }
-
+  
   @Override
   public List<Long> typedReduce(Key key, Iterator<List<Long>> iter) {
     List<Long> sum = new ArrayList<Long>();
@@ -88,7 +92,7 @@ public class SummingArrayCombiner extend
             type.substring(CLASS_PREFIX.length()), Encoder.class);
         encoder = clazz.newInstance();
         List<Long> testList = encoder.decode(encoder.encode(Arrays.asList(0l, 1l)));
-        if (testList.size() != 3 || testList.get(0) != 0l || testList.get(1) != 1l) {
+        if (testList.size() != 2 || testList.get(0) != 0l || testList.get(1) != 1l) {
           throw new IllegalArgumentException("something wrong with " + type + " -- doesn't
encode and decode a List<Long> properly");
         }
       } catch (ClassNotFoundException e) {
@@ -101,10 +105,10 @@ public class SummingArrayCombiner extend
     } else {
       switch (Type.valueOf(options.get(TYPE))) {
         case VARNUM:
-          encoder = new VarNumArrayEncoder();
+          encoder = new VarLongArrayEncoder();
           return;
         case LONG:
-          encoder = new LongArrayEncoder();
+          encoder = new FixedLongArrayEncoder();
           return;
         case STRING:
           encoder = new StringArrayEncoder();
@@ -167,7 +171,7 @@ public class SummingArrayCombiner extend
     }
   }
   
-  public static class VarNumArrayEncoder extends DOSArrayEncoder<Long> {
+  public static class VarLongArrayEncoder extends DOSArrayEncoder<Long> {
     @Override
     public void write(DataOutputStream dos, Long v) throws IOException {
       WritableUtils.writeVLong(dos, v);
@@ -179,7 +183,7 @@ public class SummingArrayCombiner extend
     }
   }
   
-  public static class LongArrayEncoder extends DOSArrayEncoder<Long> {
+  public static class FixedLongArrayEncoder extends DOSArrayEncoder<Long> {
     @Override
     public void write(DataOutputStream dos, Long v) throws IOException {
       dos.writeLong(v);
@@ -236,7 +240,7 @@ public class SummingArrayCombiner extend
    * @param is
    *          IteratorSetting object to configure.
    * @param encoderClass
-   *          Class<? extends Encoder<Long>> specifying the encoding type.
+   *          Class<? extends Encoder<List<Long>>> specifying the encoding
type.
    */
   public static void setEncodingType(IteratorSetting is, Class<? extends Encoder<List<Long>>>
encoderClass) {
     is.addOption(TYPE, CLASS_PREFIX + encoderClass.getName());

Modified: incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/CombinerTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/CombinerTest.java?rev=1208107&r1=1208106&r2=1208107&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/CombinerTest.java
(original)
+++ incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/CombinerTest.java
Tue Nov 29 22:08:32 2011
@@ -36,9 +36,9 @@ import org.apache.accumulo.core.iterator
 import org.apache.accumulo.core.iterators.Combiner.ValueIterator;
 import org.apache.accumulo.core.iterators.DefaultIteratorEnvironment;
 import org.apache.accumulo.core.iterators.LongCombiner;
-import org.apache.accumulo.core.iterators.LongCombiner.LongEncoder;
+import org.apache.accumulo.core.iterators.LongCombiner.FixedLenEncoder;
 import org.apache.accumulo.core.iterators.LongCombiner.StringEncoder;
-import org.apache.accumulo.core.iterators.LongCombiner.VarNumEncoder;
+import org.apache.accumulo.core.iterators.LongCombiner.VarLenEncoder;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.core.iterators.SortedMapIterator;
 import org.apache.accumulo.core.iterators.TypedValueCombiner.Encoder;
@@ -78,13 +78,9 @@ public class CombinerTest {
     return new Text(String.format("r%03d", row));
   }
   
-  Encoder<Long> varNumEncoder = new LongCombiner.VarNumEncoder();
-  Encoder<Long> longEncoder = new LongCombiner.LongEncoder();
-  Encoder<Long> stringEncoder = new LongCombiner.StringEncoder();
-  
   @Test
   public void test1() throws IOException {
-    Encoder<Long> encoder = varNumEncoder;
+    Encoder<Long> encoder = LongCombiner.VAR_LEN_ENCODER;
     
     TreeMap<Key,Value> tm1 = new TreeMap<Key,Value>();
     
@@ -149,7 +145,7 @@ public class CombinerTest {
   
   @Test
   public void test2() throws IOException {
-    Encoder<Long> encoder = varNumEncoder;
+    Encoder<Long> encoder = LongCombiner.VAR_LEN_ENCODER;
     
     TreeMap<Key,Value> tm1 = new TreeMap<Key,Value>();
     
@@ -161,7 +157,7 @@ public class CombinerTest {
     Combiner ai = new SummingCombiner();
     
     IteratorSetting is = new IteratorSetting(1, SummingCombiner.class);
-    LongCombiner.setEncodingType(is, VarNumEncoder.class);
+    LongCombiner.setEncodingType(is, VarLenEncoder.class);
     Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("cf001")));
     
     ai.init(new SortedMapIterator(tm1), is.getProperties(), null);
@@ -211,7 +207,7 @@ public class CombinerTest {
   
   @Test
   public void test3() throws IOException {
-    Encoder<Long> encoder = longEncoder;
+    Encoder<Long> encoder = LongCombiner.FIXED_LEN_ENCODER;
     
     TreeMap<Key,Value> tm1 = new TreeMap<Key,Value>();
     
@@ -227,7 +223,7 @@ public class CombinerTest {
     Combiner ai = new SummingCombiner();
     
     IteratorSetting is = new IteratorSetting(1, SummingCombiner.class);
-    LongCombiner.setEncodingType(is, LongEncoder.class.getName());
+    LongCombiner.setEncodingType(is, FixedLenEncoder.class.getName());
     Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("cf001")));
     
     ai.init(new SortedMapIterator(tm1), is.getProperties(), null);
@@ -277,7 +273,7 @@ public class CombinerTest {
   
   @Test
   public void test4() throws IOException {
-    Encoder<Long> encoder = stringEncoder;
+    Encoder<Long> encoder = LongCombiner.STRING_ENCODER;
     
     TreeMap<Key,Value> tm1 = new TreeMap<Key,Value>();
     
@@ -352,7 +348,7 @@ public class CombinerTest {
   
   @Test
   public void test5() throws IOException {
-    Encoder<Long> encoder = stringEncoder;
+    Encoder<Long> encoder = LongCombiner.STRING_ENCODER;
     // try aggregating across multiple data sets that contain
     // the exact same keys w/ different values
     
@@ -370,7 +366,7 @@ public class CombinerTest {
     IteratorSetting is = new IteratorSetting(1, SummingCombiner.class);
     LongCombiner.setEncodingType(is, StringEncoder.class);
     Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("cf001")));
-
+    
     List<SortedKeyValueIterator<Key,Value>> sources = new ArrayList<SortedKeyValueIterator<Key,Value>>(3);
     sources.add(new SortedMapIterator(tm1));
     sources.add(new SortedMapIterator(tm2));
@@ -387,7 +383,7 @@ public class CombinerTest {
   
   @Test
   public void test6() throws IOException {
-    Encoder<Long> encoder = varNumEncoder;
+    Encoder<Long> encoder = LongCombiner.VAR_LEN_ENCODER;
     TreeMap<Key,Value> tm1 = new TreeMap<Key,Value>();
     
     // keys that aggregate
@@ -398,7 +394,7 @@ public class CombinerTest {
     Combiner ai = new SummingCombiner();
     
     IteratorSetting is = new IteratorSetting(1, SummingCombiner.class);
-    LongCombiner.setEncodingType(is, VarNumEncoder.class.getName());
+    LongCombiner.setEncodingType(is, VarLenEncoder.class.getName());
     Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("cf001")));
     
     ai.init(new SortedMapIterator(tm1), is.getProperties(), new DefaultIteratorEnvironment());
@@ -413,7 +409,7 @@ public class CombinerTest {
   
   @Test
   public void test7() throws IOException {
-    Encoder<Long> encoder = longEncoder;
+    Encoder<Long> encoder = LongCombiner.FIXED_LEN_ENCODER;
     
     // test that delete is not aggregated
     
@@ -475,7 +471,7 @@ public class CombinerTest {
   
   @Test
   public void maxMinTest() throws IOException {
-    Encoder<Long> encoder = varNumEncoder;
+    Encoder<Long> encoder = LongCombiner.VAR_LEN_ENCODER;
     
     TreeMap<Key,Value> tm1 = new TreeMap<Key,Value>();
     
@@ -529,7 +525,10 @@ public class CombinerTest {
       assertEquals(a[i], b[i]);
   }
   
-  public static void sumArray(Encoder<List<Long>> encoder, String type) throws
IOException {
+  public static void sumArray(Class<? extends Encoder<List<Long>>> encoderClass,
String type) throws IOException, InstantiationException,
+      IllegalAccessException {
+    Encoder<List<Long>> encoder = encoderClass.newInstance();
+    
     TreeMap<Key,Value> tm1 = new TreeMap<Key,Value>();
     
     // keys that aggregate
@@ -539,8 +538,38 @@ public class CombinerTest {
     
     Combiner ai = new SummingArrayCombiner();
     
-    IteratorSetting is = new IteratorSetting(1, SummingCombiner.class);
-    LongCombiner.setEncodingType(is, SummingCombiner.Type.valueOf(type));
+    IteratorSetting is = new IteratorSetting(1, SummingArrayCombiner.class);
+    SummingArrayCombiner.setEncodingType(is, SummingArrayCombiner.Type.valueOf(type));
+    Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("cf001")));
+    
+    ai.init(new SortedMapIterator(tm1), is.getProperties(), null);
+    ai.seek(new Range(), EMPTY_COL_FAMS, false);
+    
+    assertTrue(ai.hasTop());
+    assertEquals(nk(1, 1, 1, 3), ai.getTopKey());
+    assertBytesEqual(encoder.encode(nal(4l, 6l, 5l)), ai.getTopValue().get());
+    
+    ai.next();
+    
+    assertFalse(ai.hasTop());
+    
+    is.clearOptions();
+    SummingArrayCombiner.setEncodingType(is, encoderClass);
+    Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("cf001")));
+    
+    ai.init(new SortedMapIterator(tm1), is.getProperties(), null);
+    ai.seek(new Range(), EMPTY_COL_FAMS, false);
+    
+    assertTrue(ai.hasTop());
+    assertEquals(nk(1, 1, 1, 3), ai.getTopKey());
+    assertBytesEqual(encoder.encode(nal(4l, 6l, 5l)), ai.getTopValue().get());
+    
+    ai.next();
+    
+    assertFalse(ai.hasTop());
+    
+    is.clearOptions();
+    SummingArrayCombiner.setEncodingType(is, encoderClass.getName());
     Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("cf001")));
     
     ai.init(new SortedMapIterator(tm1), is.getProperties(), null);
@@ -556,12 +585,9 @@ public class CombinerTest {
   }
   
   @Test
-  public void sumArrayTest() throws IOException {
-    Encoder<List<Long>> encoder = new SummingArrayCombiner.VarNumArrayEncoder();
-    sumArray(encoder, "VARNUM");
-    encoder = new SummingArrayCombiner.LongArrayEncoder();
-    sumArray(encoder, "LONG");
-    encoder = new SummingArrayCombiner.StringArrayEncoder();
-    sumArray(encoder, "STRING");
+  public void sumArrayTest() throws IOException, InstantiationException, IllegalAccessException
{
+    sumArray(SummingArrayCombiner.VarLongArrayEncoder.class, "VARNUM");
+    sumArray(SummingArrayCombiner.FixedLongArrayEncoder.class, "LONG");
+    sumArray(SummingArrayCombiner.StringArrayEncoder.class, "STRING");
   }
 }

Modified: incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RowDeletingIteratorTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RowDeletingIteratorTest.java?rev=1208107&r1=1208106&r2=1208107&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RowDeletingIteratorTest.java
(original)
+++ incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RowDeletingIteratorTest.java
Tue Nov 29 22:08:32 2011
@@ -30,12 +30,10 @@ import org.apache.accumulo.core.data.Key
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.IteratorEnvironment;
-import org.apache.accumulo.core.iterators.IteratorUtil;
+import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.core.iterators.SortedMapIterator;
-import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
 import org.apache.accumulo.core.iterators.system.ColumnFamilySkippingIterator;
-import org.apache.accumulo.core.iterators.user.RowDeletingIterator;
 import org.apache.hadoop.io.Text;
 
 public class RowDeletingIteratorTest extends TestCase {

Modified: incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java?rev=1208107&r1=1208106&r2=1208107&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java
(original)
+++ incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/VersioningIteratorTest.java
Tue Nov 29 22:08:32 2011
@@ -37,7 +37,7 @@ import org.apache.hadoop.io.Text;
 public class VersioningIteratorTest extends TestCase {
   // add test for seek function
   private static final Collection<ByteSequence> EMPTY_COL_FAMS = new ArrayList<ByteSequence>();
-  private static final Encoder<Long> encoder = new LongCombiner.LongEncoder();
+  private static final Encoder<Long> encoder = LongCombiner.FIXED_LEN_ENCODER;
   
   void createTestData(TreeMap<Key,Value> tm, Text colf, Text colq) {
     for (int i = 0; i < 2; i++) {

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/dirlist/Ingest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/dirlist/Ingest.java?rev=1208107&r1=1208106&r2=1208107&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/dirlist/Ingest.java
(original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/dirlist/Ingest.java
Tue Nov 29 22:08:32 2011
@@ -26,7 +26,8 @@ import org.apache.accumulo.core.client.C
 import org.apache.accumulo.core.client.ZooKeeperInstance;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.iterators.aggregation.LongSummation;
+import org.apache.accumulo.core.iterators.LongCombiner;
+import org.apache.accumulo.core.iterators.TypedValueCombiner.Encoder;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.ColumnVisibility;
 import org.apache.accumulo.examples.filedata.FileDataIngest;
@@ -39,6 +40,7 @@ public class Ingest {
   public static final String EXEC_CQ = "exec";
   public static final String LASTMOD_CQ = "lastmod";
   public static final String HASH_CQ = "md5";
+  public static final Encoder<Long> encoder = LongCombiner.FIXED_LEN_ENCODER;
   
   public static Mutation buildMutation(ColumnVisibility cv, String path, boolean isDir, boolean
isHidden, boolean canExec, long length, long lastmod,
       String hash) {
@@ -49,7 +51,7 @@ public class Ingest {
     if (isDir)
       colf = QueryUtil.DIR_COLF;
     else
-      colf = new Text(LongSummation.longToBytes(Long.MAX_VALUE - lastmod));
+      colf = new Text(encoder.encode(Long.MAX_VALUE - lastmod));
     m.put(colf, new Text(LENGTH_CQ), cv, new Value(Long.toString(length).getBytes()));
     m.put(colf, new Text(HIDDEN_CQ), cv, new Value(Boolean.toString(isHidden).getBytes()));
     m.put(colf, new Text(EXEC_CQ), cv, new Value(Boolean.toString(canExec).getBytes()));

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/dirlist/QueryUtil.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/dirlist/QueryUtil.java?rev=1208107&r1=1208106&r2=1208107&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/dirlist/QueryUtil.java
(original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/dirlist/QueryUtil.java
Tue Nov 29 22:08:32 2011
@@ -16,7 +16,6 @@
  */
 package org.apache.accumulo.examples.dirlist;
 
-import java.io.IOException;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.TreeMap;
@@ -31,7 +30,6 @@ import org.apache.accumulo.core.client.Z
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.iterators.aggregation.LongSummation;
 import org.apache.accumulo.core.iterators.user.RegExFilter;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.hadoop.io.Text;
@@ -93,11 +91,7 @@ public class QueryUtil {
   public static String getType(Text colf) {
     if (colf.equals(DIR_COLF))
       return colf.toString() + ":";
-    try {
-      return Long.toString(LongSummation.bytesToLong(colf.getBytes())) + ":";
-    } catch (IOException e) {
-      return colf.toString() + ":";
-    }
+    return Long.toString(Ingest.encoder.decode(colf.getBytes())) + ":";
   }
   
   public Map<String,String> getData(String path) throws TableNotFoundException {

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/Query.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/Query.java?rev=1208107&r1=1208106&r2=1208107&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/Query.java
(original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/Query.java
Tue Nov 29 22:08:32 2011
@@ -63,7 +63,7 @@ public class Query {
       columns[i - 5] = new Text(args[i]);
     }
     IteratorSetting ii = new IteratorSetting(20, "ii", IntersectingIterator.class);
-    ii.addOption(IntersectingIterator.columnFamiliesOptionName, IntersectingIterator.encodeColumns(columns));
+    IntersectingIterator.setColumnFamilies(ii, columns);
     bs.addScanIterator(ii);
     bs.setRanges(Collections.singleton(new Range()));
     for (Entry<Key,Value> entry : bs) {

Modified: incubator/accumulo/trunk/src/examples/src/test/java/org/apache/accumulo/examples/dirlist/CountTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/test/java/org/apache/accumulo/examples/dirlist/CountTest.java?rev=1208107&r1=1208106&r2=1208107&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/test/java/org/apache/accumulo/examples/dirlist/CountTest.java
(original)
+++ incubator/accumulo/trunk/src/examples/src/test/java/org/apache/accumulo/examples/dirlist/CountTest.java
Tue Nov 29 22:08:32 2011
@@ -16,40 +16,21 @@
  */
 package org.apache.accumulo.examples.dirlist;
 
-import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Map;
 import java.util.Map.Entry;
-import java.util.TreeMap;
 
 import junit.framework.TestCase;
 
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Scanner;
-import org.apache.accumulo.core.client.mapreduce.AccumuloInputFormat;
-import org.apache.accumulo.core.client.mapreduce.InputFormatBase.RangeInputSplit;
 import org.apache.accumulo.core.client.mock.MockInstance;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.iterators.aggregation.Aggregator;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.ColumnVisibility;
 import org.apache.accumulo.core.util.Pair;
-import org.apache.accumulo.examples.dirlist.FileCount;
-import org.apache.accumulo.examples.dirlist.FileCountMR;
-import org.apache.accumulo.examples.dirlist.Ingest;
-import org.apache.accumulo.examples.dirlist.QueryUtil;
-import org.apache.accumulo.examples.dirlist.StringArraySummation;
-import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.io.Text;
-import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.hadoop.mapreduce.JobID;
-import org.apache.hadoop.mapreduce.Mapper;
-import org.apache.hadoop.mapreduce.RecordReader;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.hadoop.mapreduce.TaskAttemptID;
 
 public class CountTest extends TestCase {
   {
@@ -74,65 +55,7 @@ public class CountTest extends TestCase 
     }
   }
   
-  public static class AggregatingMap extends TreeMap<Key,Value> {
-    private static final long serialVersionUID = -6644406149713336633L;
-    private Aggregator agg;
-    
-    public AggregatingMap(Aggregator agg) {
-      this.agg = agg;
-    }
-    
-    @Override
-    public Value put(Key key, Value value) {
-      if (!this.containsKey(key))
-        return super.put(key, value);
-      agg.reset();
-      agg.collect(value);
-      agg.collect(this.get(key));
-      return super.put(key, agg.aggregate());
-    }
-  }
-  
   public void test() throws Exception {
-    JobContext job = new JobContext(new Configuration(), new JobID());
-    AccumuloInputFormat.setInputInfo(job, "root", "".getBytes(), "dirlisttable", new Authorizations());
-    AccumuloInputFormat.setMockInstance(job, "counttest");
-    AccumuloInputFormat cif = new AccumuloInputFormat();
-    RangeInputSplit ris = new RangeInputSplit();
-    TaskAttemptContext tac = new TaskAttemptContext(job.getConfiguration(), new TaskAttemptID());
-    RecordReader<Key,Value> rr = cif.createRecordReader(ris, tac);
-    rr.initialize(ris, tac);
-    FileCountMR.FileCountMapper mapper = new FileCountMR.FileCountMapper();
-    RecordWriter<Key,Value> rw = new RecordWriter<Key,Value>() {
-      Map<Key,Value> aggmap = new AggregatingMap(new StringArraySummation());
-      
-      @Override
-      public void write(Key key, Value value) throws IOException, InterruptedException {
-        aggmap.put(key, value);
-      }
-      
-      @Override
-      public void close(TaskAttemptContext context) throws IOException, InterruptedException
{
-        ArrayList<Pair<String,String>> expected = new ArrayList<Pair<String,String>>();
-        expected.add(new Pair<String,String>("", "1,0,3,3"));
-        expected.add(new Pair<String,String>("/local", "2,1,2,3"));
-        expected.add(new Pair<String,String>("/local/user1", "0,2,0,2"));
-        
-        int i = 0;
-        for (Entry<Key,Value> e : aggmap.entrySet()) {
-          assertEquals(e.getKey().getRow().toString(), expected.get(i).getFirst());
-          assertEquals(e.getValue().toString(), expected.get(i).getSecond());
-          i++;
-        }
-        assertEquals(aggmap.entrySet().size(), expected.size());
-      }
-    };
-    Mapper<Key,Value,Key,Value>.Context context = mapper.new Context(job.getConfiguration(),
new TaskAttemptID(), rr, rw, null, null, ris);
-    mapper.run(context);
-    rw.close(context);
-  }
-  
-  public void test2() throws Exception {
     Scanner scanner = new MockInstance("counttest").getConnector("root", "".getBytes()).createScanner("dirlisttable",
new Authorizations());
     scanner.fetchColumn(new Text("dir"), new Text("counts"));
     assertFalse(scanner.iterator().hasNext());

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java?rev=1208107&r1=1208106&r2=1208107&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/DefaultServlet.java
Tue Nov 29 22:08:32 2011
@@ -274,7 +274,8 @@ public class DefaultServlet extends Basi
         
         boolean highlight = false;
         tableRow(sb, (highlight = !highlight), "Disk&nbsp;Used", diskUsed);
-        tableRow(sb, (highlight = !highlight), "%&nbsp;of&nbsp;Used&nbsp;DFS",
consumed);
+        if (fs.getUsed() != 0)
+          tableRow(sb, (highlight = !highlight), "%&nbsp;of&nbsp;Used&nbsp;DFS",
consumed);
         tableRow(sb, (highlight = !highlight), "<a href='/tables'>Tables</a>",
NumberType.commas(Monitor.getTotalTables()));
         tableRow(sb, (highlight = !highlight), "<a href='/tservers'>Tablet&nbsp;Servers</a>",
NumberType.commas(info.tServerInfo.size()));
         tableRow(sb, (highlight = !highlight), "<a href='/tservers'>Dead&nbsp;Tablet&nbsp;Servers</a>",
NumberType.commas(info.deadTabletServers.size()));



Mime
View raw message