incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1245233 - in /incubator/accumulo/trunk: ./ src/core/ src/core/src/main/java/org/apache/accumulo/core/client/ src/core/src/main/java/org/apache/accumulo/core/iterators/ src/core/src/main/java/org/apache/accumulo/core/iterators/user/ src/cor...
Date Thu, 16 Feb 2012 22:47:02 GMT
Author: vines
Date: Thu Feb 16 22:47:01 2012
New Revision: 1245233

URL: http://svn.apache.org/viewvc?rev=1245233&view=rev
Log:
Merging ACCUMULO-413, plus other things. Come on people, merge!


Added:
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RowFilter.java
      - copied unchanged from r1245229, incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RowFilter.java
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java
      - copied unchanged from r1245229, incubator/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java
Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/src/core/   (props changed)
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/BatchDeleter.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/BatchWriter.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/Connector.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/Instance.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/MultiTableBatchWriter.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/Scanner.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/SortedKeyValueIterator.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/WholeRowIterator.java
    incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteManyCommand.java
    incubator/accumulo/trunk/src/examples/wikisearch/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/ingest/WikipediaPartitionedMapper.java
    incubator/accumulo/trunk/src/examples/wikisearch/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/output/BufferingRFileRecordWriter.java

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Feb 16 22:47:01 2012
@@ -1,3 +1,3 @@
 /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,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611,1228195,1230180,1230736,1231043,1236873
 /incubator/accumulo/branches/1.3.5rc:1209938
-/incubator/accumulo/branches/1.4:1201902-1245050
+/incubator/accumulo/branches/1.4:1201902-1245229

Propchange: incubator/accumulo/trunk/src/core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Feb 16 22:47:01 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3/src/core:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215
 /incubator/accumulo/branches/1.3.5rc/src/core:1209938
-/incubator/accumulo/branches/1.4/src/core:1201902-1245050
+/incubator/accumulo/branches/1.4/src/core:1201902-1245229

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/BatchDeleter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/BatchDeleter.java?rev=1245233&r1=1245232&r2=1245233&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/BatchDeleter.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/BatchDeleter.java
Thu Feb 16 22:47:01 2012
@@ -20,12 +20,17 @@ import java.util.Collection;
 
 import org.apache.accumulo.core.data.Range;
 
+/**
+ * Implementations of BatchDeleter support efficient deletion of ranges in accumulo.
+ * 
+ */
+
 public interface BatchDeleter extends ScannerBase {
   
   public void delete() throws MutationsRejectedException, TableNotFoundException;
   
   /**
-   * Allows scanning over multiple ranges efficiently.
+   * Allows deleting multiple ranges efficiently.
    * 
    * @param ranges
    *          specifies the non-overlapping ranges to query

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/BatchWriter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/BatchWriter.java?rev=1245233&r1=1245232&r2=1245233&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/BatchWriter.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/BatchWriter.java
Thu Feb 16 22:47:01 2012
@@ -24,7 +24,7 @@ import org.apache.accumulo.core.data.Mut
 public interface BatchWriter {
   
   /**
-   * Queues one mutation to write
+   * Queues one mutation to write.
    * 
    * @param m
    *          the mutation to add
@@ -35,7 +35,7 @@ public interface BatchWriter {
   public void addMutation(Mutation m) throws MutationsRejectedException;
   
   /**
-   * Queues several mutations to write
+   * Queues several mutations to write.
    * 
    * @param iterable
    *          allows adding any number of mutations iteratively

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java?rev=1245233&r1=1245232&r2=1245233&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java
Thu Feb 16 22:47:01 2012
@@ -44,9 +44,13 @@ import org.apache.hadoop.io.Text;
 
 /**
  * A scanner that instantiates iterators on the client side instead of on the tablet server.
This can be useful for testing iterators or in cases where you
- * don't want iterators affecting the performance of tablet servers.
- * 
- * Suggested usage: Scanner scanner = new ClientSideIteratorScanner(connector.createScanner(tableName,
authorizations))
+ * don't want iterators affecting the performance of tablet servers.<br>
+ * <br>
+ * Suggested usage:<br>
+ * <code>Scanner scanner = new ClientSideIteratorScanner(connector.createScanner(tableName,
authorizations));</code><br>
+ * <br>
+ * Iterators added to this scanner will be run in the client JVM. Separate scan iterators
can be run on the server side and client side by adding iterators to
+ * the source scanner (which will execute server side) and to the client side scanner (which
will execute client side).
  */
 public class ClientSideIteratorScanner extends ScannerOptions implements Scanner {
   private int size;
@@ -55,11 +59,20 @@ public class ClientSideIteratorScanner e
   private Range range;
   private boolean isolated = false;
   
+  /**
+   * A class that wraps a Scanner in a SortedKeyValueIterator so that other accumulo iterators
can use it as a source.
+   */
   public class ScannerTranslator implements SortedKeyValueIterator<Key,Value> {
     protected Scanner scanner;
     Iterator<Entry<Key,Value>> iter;
     Entry<Key,Value> top = null;
     
+    /**
+     * Constructs an accumulo iterator from a scanner.
+     * 
+     * @param scanner
+     *          the scanner to iterate over
+     */
     public ScannerTranslator(Scanner scanner) {
       this.scanner = scanner;
     }
@@ -111,8 +124,14 @@ public class ClientSideIteratorScanner e
     }
   }
   
-  protected ScannerTranslator smi;
+  private ScannerTranslator smi;
   
+  /**
+   * Constructs a scanner that can execute client-side iterators.
+   * 
+   * @param scanner
+   *          the source scanner
+   */
   public ClientSideIteratorScanner(Scanner scanner) {
     smi = new ScannerTranslator(scanner);
     this.range = new Range((Key) null, (Key) null);
@@ -120,6 +139,11 @@ public class ClientSideIteratorScanner e
     this.timeOut = Integer.MAX_VALUE;
   }
   
+  /**
+   * Sets the source Scanner.
+   * 
+   * @param scanner
+   */
   public void setSource(Scanner scanner) {
     smi = new ScannerTranslator(scanner);
   }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/Connector.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/Connector.java?rev=1245233&r1=1245232&r2=1245233&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/Connector.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/Connector.java
Thu Feb 16 22:47:01 2012
@@ -22,18 +22,16 @@ import org.apache.accumulo.core.client.a
 import org.apache.accumulo.core.security.Authorizations;
 
 /**
- * Connector facilitates connecting to an Accumulo instance. One of the main purposes of
this class is to make it easy to connect to multiple Accumulo instances
- * within the same JVM.
+ * Connector connects to an Accumulo instance and allows the user to request readers and
writers for the instance as well as various objects that permit
+ * administrative operations.
  * 
- * Additionally, the Connector object enforces security on the client side, by forcing all
API calls to be accompanied by user credentials.
- * 
- * This Connector requires a master to be running to be instantiated, and for certain calls,
such as getTables()
+ * The Connector enforces security on the client side by forcing all API calls to be accompanied
by user credentials.
  */
 public class Connector {
   final Connector impl;
   
   /**
-   * Construct an Connector from an {@link Instance}
+   * Construct a Connector from an {@link Instance}
    * 
    * @deprecated Not for client use
    * @param instance
@@ -181,7 +179,7 @@ public class Connector {
   }
   
   /**
-   * Retrieves a TableOperations object to perform table functions, such as create and delete
+   * Retrieves a TableOperations object to perform table functions, such as create and delete.
    * 
    * @return an object to manipulate tables
    */
@@ -190,7 +188,7 @@ public class Connector {
   }
   
   /**
-   * Retrieves a SecurityOperations object to perform user security operations, such as creating
users
+   * Retrieves a SecurityOperations object to perform user security operations, such as creating
users.
    * 
    * @return an object to modify users and permissions
    */
@@ -199,7 +197,7 @@ public class Connector {
   }
   
   /**
-   * Retrieves a InstanceOperations object to modify instance configuration
+   * Retrieves an InstanceOperations object to modify instance configuration.
    * 
    * @return an object to modify instance configuration
    */

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/Instance.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/Instance.java?rev=1245233&r1=1245232&r2=1245233&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/Instance.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/Instance.java
Thu Feb 16 22:47:01 2012
@@ -28,21 +28,21 @@ import org.apache.accumulo.core.security
  */
 public interface Instance {
   /**
-   * Get the location of the tablet server that is serving the root tablet.
+   * Returns the location of the tablet server that is serving the root tablet.
    * 
-   * @return location in "hostname:port" form.
+   * @return location in "hostname:port" form
    */
   public abstract String getRootTabletLocation();
   
   /**
-   * Get the location(s) of the accumulo master and any redundant servers.
+   * Returns the location(s) of the accumulo master and any redundant servers.
    * 
-   * @return a list of locations in "hostname:port" form.
+   * @return a list of locations in "hostname:port" form
    */
   public abstract List<String> getMasterLocations();
   
   /**
-   * Get a unique string that identifies this instance of accumulo.
+   * Returns a unique string that identifies this instance of accumulo.
    * 
    * @return a UUID
    */
@@ -56,70 +56,91 @@ public interface Instance {
   public abstract String getInstanceName();
   
   /**
-   * @return the zoo keepers this instance is using
+   * Returns a comma-separated list of zookeeper servers the instance is using.
+   * 
+   * @return the zookeeper servers this instance is using in "hostname:port" form
    */
   public abstract String getZooKeepers();
   
   /**
+   * Returns the zookeeper connection timeout.
+   * 
    * @return the configured timeout to connect to zookeeper
    */
   public abstract int getZooKeepersSessionTimeOut();
   
   /**
+   * Returns a connection to accumulo.
    * 
    * @param user
+   *          a valid accumulo user
    * @param pass
    *          A UTF-8 encoded password. The password may be cleared after making this call.
-   * @return
+   * @return the accumulo Connector
    * @throws AccumuloException
+   *           when a generic exception occurs
    * @throws AccumuloSecurityException
+   *           when a user's credentials are invalid
    */
   public abstract Connector getConnector(String user, byte[] pass) throws AccumuloException,
AccumuloSecurityException;
   
   /**
+   * Returns a connection to accumulo.
    * 
    * @param user
+   *          a valid accumulo user
    * @param pass
    *          A UTF-8 encoded password. The password may be cleared after making this call.
-   * @return
+   * @return the accumulo Connector
    * @throws AccumuloException
+   *           when a generic exception occurs
    * @throws AccumuloSecurityException
+   *           when a user's credentials are invalid
    */
   public abstract Connector getConnector(AuthInfo auth) throws AccumuloException, AccumuloSecurityException;
   
   /**
+   * Returns a connection to accumulo.
    * 
    * @param user
+   *          a valid accumulo user
    * @param pass
    *          A UTF-8 encoded password. The password may be cleared after making this call.
-   * @return
+   * @return the accumulo Connector
    * @throws AccumuloException
+   *           when a generic exception occurs
    * @throws AccumuloSecurityException
+   *           when a user's credentials are invalid
    */
   public abstract Connector getConnector(String user, ByteBuffer pass) throws AccumuloException,
AccumuloSecurityException;
   
   /**
+   * Returns a connection to this instance of accumulo.
    * 
    * @param user
+   *          a valid accumulo user
    * @param pass
    *          If a mutable CharSequence is passed in, it may be cleared after this call.
-   * @return
+   * @return the accumulo Connector
    * @throws AccumuloException
+   *           when a generic exception occurs
    * @throws AccumuloSecurityException
+   *           when a user's credentials are invalid
    */
   public abstract Connector getConnector(String user, CharSequence pass) throws AccumuloException,
AccumuloSecurityException;
   
   /**
-   * get the AccumuloConfiguration to use when interacting with this instance
+   * Returns the AccumuloConfiguration to use when interacting with this instance.
    * 
    * @return the AccumuloConfiguration that specifies properties related to interacting with
this instance
    */
   public abstract AccumuloConfiguration getConfiguration();
   
   /**
-   * set the AccumuloConfiguration to use when interacting with this instance
+   * Set the AccumuloConfiguration to use when interacting with this instance.
    * 
    * @param conf
+   *          accumulo configuration
    */
   public abstract void setConfiguration(AccumuloConfiguration conf);
 }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/MultiTableBatchWriter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/MultiTableBatchWriter.java?rev=1245233&r1=1245232&r2=1245233&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/MultiTableBatchWriter.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/MultiTableBatchWriter.java
Thu Feb 16 22:47:01 2012
@@ -18,12 +18,14 @@ package org.apache.accumulo.core.client;
 
 /**
  * This class enables efficient batch writing to multiple tables. When creating a batch writer
for each table, each has its own memory and network resources.
- * Using this class these resource may be shared among multiple tables.
+ * Using this class these resources may be shared among multiple tables.
  * 
  */
 public interface MultiTableBatchWriter {
   
   /**
+   * Returns a BatchWriter for a particular table.
+   * 
    * @param table
    *          the name of a table whose batch writer you wish to retrieve
    * @return an instance of a batch writer for the specified table
@@ -54,6 +56,8 @@ public interface MultiTableBatchWriter {
   public void close() throws MutationsRejectedException;
   
   /**
+   * Returns true if this batch writer has been closed.
+   * 
    * @return true if this batch writer has been closed
    */
   public boolean isClosed();

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/Scanner.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/Scanner.java?rev=1245233&r1=1245232&r2=1245233&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/Scanner.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/Scanner.java
Thu Feb 16 22:47:01 2012
@@ -19,9 +19,7 @@ package org.apache.accumulo.core.client;
 import org.apache.accumulo.core.data.Range;
 
 /**
- * Walk a table over a given range.
- * 
- * provides scanner functionality
+ * Scans a table over a given range.
  * 
  * "Clients can iterate over multiple column families, and there are several mechanisms for
limiting the rows, columns, and timestamps traversed by a scan. For
  * example, we could restrict [a] scan ... to only produce anchors whose columns match [a]
regular expression ..., or to only produce anchors whose timestamps
@@ -30,7 +28,7 @@ import org.apache.accumulo.core.data.Ran
 public interface Scanner extends ScannerBase {
   
   /**
-   * When failure occurs, the scanner automatically retries. This setting determines how
long a scanner will retry. By default a scanner will retry forever.
+   * This setting determines how long a scanner will automatically retry when a failure occurs.
By default a scanner will retry forever.
    * 
    * @param timeOut
    *          in seconds
@@ -38,33 +36,49 @@ public interface Scanner extends Scanner
   public void setTimeOut(int timeOut);
   
   /**
+   * Returns the setting for how long a scanner will automatically retry when a failure occurs.
+   * 
    * @return the timeout configured for this scanner
    */
   public int getTimeOut();
   
   /**
+   * Sets the range of keys to scan over.
+   * 
    * @param range
    *          key range to begin and end scan
    */
   public void setRange(Range range);
   
   /**
+   * Returns the range of keys to scan over.
+   * 
    * @return the range configured for this scanner
    */
   public Range getRange();
   
   /**
+   * Sets the number of Key/Value pairs that will be fetched at a time from a tablet server.
+   * 
    * @param size
-   *          the number of Keys/Value pairs to fetch per call to Accumulo
+   *          the number of Key/Value pairs to fetch per call to Accumulo
    */
   public void setBatchSize(int size);
   
   /**
+   * Returns the batch size (number of Key/Value pairs) that will be fetched at a time from
a tablet server.
+   * 
    * @return the batch size configured for this scanner
    */
   public int getBatchSize();
   
+  /**
+   * Enables row isolation. Writes that occur to a row after a scan of that row has begun
will not be seen if this option is enabled.
+   */
   public void enableIsolation();
   
+  /**
+   * Disables row isolation. Writes that occur to a row after a scan of that row has begun
may be seen if this option is enabled.
+   */
   void disableIsolation();
 }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java?rev=1245233&r1=1245232&r2=1245233&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
Thu Feb 16 22:47:01 2012
@@ -24,7 +24,7 @@ import org.apache.accumulo.core.data.Val
 import org.apache.hadoop.io.Text;
 
 /**
- * This class host methods that are shared between all different types of scanners.
+ * This class hosts configuration methods that are shared between different types of scanners.
  * 
  */
 public interface ScannerBase extends Iterable<Entry<Key,Value>> {
@@ -41,7 +41,7 @@ public interface ScannerBase extends Ite
   public void addScanIterator(IteratorSetting cfg);
   
   /**
-   * Remove an iterator from the list of iterators
+   * Remove an iterator from the list of iterators.
    * 
    * @param iteratorName
    *          nickname used for the iterator
@@ -62,13 +62,17 @@ public interface ScannerBase extends Ite
   public void updateScanIteratorOption(String iteratorName, String key, String value);
   
   /**
+   * Adds a column family to the list of columns that will be fetched by this scanner. By
default when no columns have been added the scanner fetches all
+   * columns.
+   * 
    * @param col
-   *          limit the scan to only this column family (multiple calls appends to the list
of column families to limit)
+   *          the column family to be fetched
    */
   public void fetchColumnFamily(Text col);
   
   /**
-   * Limits the scan to only this column, identified by family and qualifier. Multiple calls
appends to the list of columns to be fetched.
+   * Adds a column to the list of columns that will be fetched by this scanner. The column
is identified by family and qualifier. By default when no columns
+   * have been added the scanner fetches all columns.
    * 
    * @param colFam
    *          the column family of the column to be fetched
@@ -78,7 +82,7 @@ public interface ScannerBase extends Ite
   public void fetchColumn(Text colFam, Text colQual);
   
   /**
-   * Clears the columns to be fetched (useful for resetting the scanner for reuse)
+   * Clears the columns to be fetched (useful for resetting the scanner for reuse). Once
cleared, the scanner will fetch all columns.
    */
   public void clearColumns();
   
@@ -88,10 +92,12 @@ public interface ScannerBase extends Ite
   public void clearScanIterators();
   
   /**
-   * Returns an iterator over an accumulo table. This iterator uses the options that are
currently set for its lifetime. So setting options will have no effect
+   * Returns an iterator over an accumulo table. This iterator uses the options that are
currently set for its lifetime, so setting options will have no effect
    * on existing iterators.
    * 
    * Keys returned by the iterator are not guaranteed to be in sorted order.
+   * 
+   * @return an iterator over Key,Value pairs which meet the restrictions set on the scanner
    */
   public Iterator<Entry<Key,Value>> iterator();
 }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/SortedKeyValueIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/SortedKeyValueIterator.java?rev=1245233&r1=1245232&r2=1245233&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/SortedKeyValueIterator.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/SortedKeyValueIterator.java
Thu Feb 16 22:47:01 2012
@@ -19,6 +19,7 @@ package org.apache.accumulo.core.iterato
 import java.io.IOException;
 import java.util.Collection;
 import java.util.Map;
+import java.util.NoSuchElementException;
 
 import org.apache.accumulo.core.data.ByteSequence;
 import org.apache.accumulo.core.data.Range;
@@ -31,14 +32,20 @@ import org.apache.hadoop.io.WritableComp
 
 public interface SortedKeyValueIterator<K extends WritableComparable<?>,V extends
Writable> {
   /**
-   * Initializes the iterator.  Data should not be read from the source in this method.
+   * Initializes the iterator. Data should not be read from the source in this method.
    * 
-   * @param source <tt>SortedKeyValueIterator</tt> source to read data from.
-   * @param options <tt>Map</tt> map of string option names to option values.
-   * @param env <tt>IteratorEnvironment</tt> environment in which iterator is
being run.
-   * @throws IOException unused.
-   * @exception IllegalArgumentException if there are problems with the options.
-   * @exception UnsupportedOperationException if not supported.
+   * @param source
+   *          <tt>SortedKeyValueIterator</tt> source to read data from.
+   * @param options
+   *          <tt>Map</tt> map of string option names to option values.
+   * @param env
+   *          <tt>IteratorEnvironment</tt> environment in which iterator is being
run.
+   * @throws IOException
+   *           unused.
+   * @exception IllegalArgumentException
+   *              if there are problems with the options.
+   * @exception UnsupportedOperationException
+   *              if not supported.
    */
   void init(SortedKeyValueIterator<K,V> source, Map<String,String> options, IteratorEnvironment
env) throws IOException;
   
@@ -46,59 +53,72 @@ public interface SortedKeyValueIterator<
    * Returns true if the iterator has more elements.
    * 
    * @return <tt>true</tt> if the iterator has more elements.
-   * @exception IllegalStateException if called before seek.
+   * @exception IllegalStateException
+   *              if called before seek.
    */
   boolean hasTop();
   
   /**
    * Advances to the next K,V pair.
    * 
-   * @throws IOException if an I/O error occurs.
-   * @exception IllegalStateException if called before seek.
-   * @exception NoSuchElementException if next element doesn't exist.
+   * @throws IOException
+   *           if an I/O error occurs.
+   * @exception IllegalStateException
+   *              if called before seek.
+   * @exception NoSuchElementException
+   *              if next element doesn't exist.
    */
   void next() throws IOException;
   
   /**
-   * An iterator must seek to the first key in the range taking inclusiveness into account.
However, an iterator does not have to stop at the end of the range.
-   * The whole range is provided so that iterators can make optimizations.
+   * Seeks to the first key in the Range, restricting the resulting K,V pairs to those with
the specified columns. An iterator does not have to stop at the end
+   * of the range. The whole range is provided so that iterators can make optimizations.
    * 
-   * @param range <tt>Range</tt> of keys to iterate over.
-   * @param columnFamilies <tt>Collection</tt> of column families to include
or exclude.
-   * @param inclusive <tt>boolean</tt> that indicates whether to include (true)
or exclude (false) column families.
-   * @throws IOException if an I/O error occurs.
-   * @exception IllegalArgumentException if there are problems with the parameters.
+   * @param range
+   *          <tt>Range</tt> of keys to iterate over.
+   * @param columnFamilies
+   *          <tt>Collection</tt> of column families to include or exclude.
+   * @param inclusive
+   *          <tt>boolean</tt> that indicates whether to include (true) or exclude
(false) column families.
+   * @throws IOException
+   *           if an I/O error occurs.
+   * @exception IllegalArgumentException
+   *              if there are problems with the parameters.
    */
   void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
throws IOException;
   
   /**
-   * Returns top key.  Can be called 0 or more times without affecting behavior of next()
or hasTop().
+   * Returns top key. Can be called 0 or more times without affecting behavior of next()
or hasTop().
    * 
    * @return <tt>K</tt>
-   * @exception IllegalStateException if called before seek.
-   * @exception NoSuchElementException if top element doesn't exist.
+   * @exception IllegalStateException
+   *              if called before seek.
+   * @exception NoSuchElementException
+   *              if top element doesn't exist.
    */
   K getTopKey();
   
   /**
-   * Returns top value.  Can be called 0 or more times without affecting behavior of next()
or hasTop().
+   * Returns top value. Can be called 0 or more times without affecting behavior of next()
or hasTop().
    * 
    * @return <tt>V</tt>
-   * @exception IllegalStateException if called before seek.
-   * @exception NoSuchElementException if top element doesn't exist.
+   * @exception IllegalStateException
+   *              if called before seek.
+   * @exception NoSuchElementException
+   *              if top element doesn't exist.
    */
   V getTopValue();
   
   /**
-   * Creates a deep copy of this iterator as though seek had not yet been called.
-   * init should be called on an iterator before deepCopy is called. 
-   * init should not need to be called on the copy that is returned by deepCopy; that is,
-   * when necessary init should be called in the deepCopy method on the iterator it returns.
-   * The behavior is unspecified if init is called after deepCopy either on the original
or the copy.
+   * Creates a deep copy of this iterator as though seek had not yet been called. init should
be called on an iterator before deepCopy is called. init should
+   * not need to be called on the copy that is returned by deepCopy; that is, when necessary
init should be called in the deepCopy method on the iterator it
+   * returns. The behavior is unspecified if init is called after deepCopy either on the
original or the copy.
    * 
-   * @param env <tt>IteratorEnvironment</tt> environment in which iterator is
being run.
+   * @param env
+   *          <tt>IteratorEnvironment</tt> environment in which iterator is being
run.
    * @return <tt>SortedKeyValueIterator</tt> a copy of this iterator (with the
same source and settings).
-   * @exception UnsupportedOperationException if not supported.
+   * @exception UnsupportedOperationException
+   *              if not supported.
    */
   SortedKeyValueIterator<K,V> deepCopy(IteratorEnvironment env);
 }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/WholeRowIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/WholeRowIterator.java?rev=1245233&r1=1245232&r2=1245233&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/WholeRowIterator.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/WholeRowIterator.java
Thu Feb 16 22:47:01 2012
@@ -51,6 +51,7 @@ import org.apache.hadoop.io.Text;
  * <p>
  * To regain the original key/value pairs of the row, call the decodeRow function on the
key/value pair that this iterator returned.
  * 
+ * @see RowFilter
  */
 public class WholeRowIterator implements SortedKeyValueIterator<Key,Value> {
   

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteManyCommand.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteManyCommand.java?rev=1245233&r1=1245232&r2=1245233&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteManyCommand.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/DeleteManyCommand.java
Thu Feb 16 22:47:01 2012
@@ -56,7 +56,7 @@ public class DeleteManyCommand extends S
     Authorizations auths = getAuths(cl, shellState);
     final Scanner scanner = shellState.getConnector().createScanner(tableName, auths);
     
-    scanner.addScanIterator(new IteratorSetting(1, "NOVALUE", SortedKeyIterator.class));
+    scanner.addScanIterator(new IteratorSetting(Integer.MAX_VALUE, "NOVALUE", SortedKeyIterator.class));
     
     // handle remaining optional arguments
     scanner.setRange(getRange(cl));

Modified: incubator/accumulo/trunk/src/examples/wikisearch/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/ingest/WikipediaPartitionedMapper.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/wikisearch/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/ingest/WikipediaPartitionedMapper.java?rev=1245233&r1=1245232&r2=1245233&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/wikisearch/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/ingest/WikipediaPartitionedMapper.java
(original)
+++ incubator/accumulo/trunk/src/examples/wikisearch/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/ingest/WikipediaPartitionedMapper.java
Thu Feb 16 22:47:01 2012
@@ -26,6 +26,10 @@ import java.util.HashSet;
 import java.util.Map.Entry;
 import java.util.Set;
 
+import org.apache.accumulo.core.client.AccumuloException;
+import org.apache.accumulo.core.client.AccumuloSecurityException;
+import org.apache.accumulo.core.client.MultiTableBatchWriter;
+import org.apache.accumulo.core.client.MutationsRejectedException;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.ColumnVisibility;
@@ -112,6 +116,7 @@ public class WikipediaPartitionedMapper 
     }
   }
   
+  MultiTableBatchWriter mtbw;
 
   @Override
   public void setup(final Context context) {
@@ -121,6 +126,14 @@ public class WikipediaPartitionedMapper 
     reverseIndexTableName = new Text(tablename + "ReverseIndex");
     metadataTableName = new Text(tablename + "Metadata");
     
+    try {
+      mtbw = WikipediaConfiguration.getConnector(conf).createMultiTableBatchWriter(10000000,
1000, 10);
+    } catch (AccumuloException e) {
+      throw new RuntimeException(e);
+    } catch (AccumuloSecurityException e) {
+      throw new RuntimeException(e);
+    }
+    
     final Text metadataTableNameFinal = metadataTableName;
     final Text indexTableNameFinal = indexTableName;
     final Text reverseIndexTableNameFinal = reverseIndexTableName;
@@ -163,7 +176,7 @@ public class WikipediaPartitionedMapper 
           Mutation m = new Mutation(key.row);
           m.put(key.colfam, key.colqual, key.cv, key.timestamp, val);
           try {
-            context.write(indexTableNameFinal, m);
+            mtbw.getBatchWriter(indexTableNameFinal.toString()).addMutation(m);
           } catch (Exception e) {
             throw new RuntimeException(e);
           }
@@ -189,7 +202,7 @@ public class WikipediaPartitionedMapper 
           Mutation m = new Mutation(key.row);
           m.put(key.colfam, key.colqual, key.cv, key.timestamp, val);
           try {
-            context.write(reverseIndexTableNameFinal, m);
+            mtbw.getBatchWriter(reverseIndexTableNameFinal.toString()).addMutation(m);
           } catch (Exception e) {
             throw new RuntimeException(e);
           }
@@ -210,7 +223,7 @@ public class WikipediaPartitionedMapper 
             Mutation m = new Mutation(key.row);
             m.put(key.colfam, key.colqual, key.cv, key.timestamp, value);
             try {
-              context.write(metadataTableNameFinal, m);
+              mtbw.getBatchWriter(metadataTableNameFinal.toString()).addMutation(m);
             } catch (Exception e) {
               throw new RuntimeException(e);
             }
@@ -224,6 +237,11 @@ public class WikipediaPartitionedMapper 
     wikiIndexOutput.flush();
     wikiMetadataOutput.flush();
     wikiReverseIndexOutput.flush();
+    try {
+      mtbw.close();
+    } catch (MutationsRejectedException e) {
+      throw new RuntimeException(e);
+    }
   }
 
 

Modified: incubator/accumulo/trunk/src/examples/wikisearch/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/output/BufferingRFileRecordWriter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/wikisearch/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/output/BufferingRFileRecordWriter.java?rev=1245233&r1=1245232&r2=1245233&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/wikisearch/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/output/BufferingRFileRecordWriter.java
(original)
+++ incubator/accumulo/trunk/src/examples/wikisearch/ingest/src/main/java/org/apache/accumulo/examples/wikisearch/output/BufferingRFileRecordWriter.java
Thu Feb 16 22:47:01 2012
@@ -69,8 +69,8 @@ final class BufferingRFileRecordWriter e
     if (buffer.size() == 0)
       return;
     
-    // TODO fix the filename
     String file = filenamePrefix + "/" + tablename + "/" + taskID + "_" + (fileCount++) +
".rf";
+    // TODO get the table configuration for the given table?
     FileSKVWriter writer = RFileOperations.getInstance().openWriter(file, fs, conf, acuconf);
     
     // forget locality groups for now, just write everything to the default
@@ -110,17 +110,18 @@ final class BufferingRFileRecordWriter e
     {
       Key k = new Key(mutation.getRow(),update.getColumnFamily(),update.getColumnQualifier(),update.getColumnVisibility(),update.getTimestamp(),update.isDeleted());
       Value v = new Value(update.getValue());
+      // TODO account for object overhead
       mutationSize += k.getSize();
       mutationSize += v.getSize();
       buffer.put(k, v);
     }
     size += mutationSize;
     long bufferSize = bufferSizes.get(table);
+    
+    // TODO use a MutableLong instead
     bufferSize += mutationSize;
     bufferSizes.put(table, bufferSize);
-    
-    // TODO add object overhead size
-    
+
     while (size >= maxSize) {
       flushLargestTable();
     }



Mime
View raw message