You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2015/01/09 03:44:52 UTC
[48/66] [abbrv] accumulo git commit: ACCUMULO-3451 Format master
branch (1.7.0-SNAPSHOT)
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/bloomfilter/DynamicBloomFilter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/bloomfilter/DynamicBloomFilter.java b/core/src/main/java/org/apache/accumulo/core/bloomfilter/DynamicBloomFilter.java
index 9b14f32..740bdda 100644
--- a/core/src/main/java/org/apache/accumulo/core/bloomfilter/DynamicBloomFilter.java
+++ b/core/src/main/java/org/apache/accumulo/core/bloomfilter/DynamicBloomFilter.java
@@ -2,30 +2,30 @@
*
* Copyright (c) 2005, European Commission project OneLab under contract 034819 (http://www.one-lab.org)
* All rights reserved.
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
* conditions are met:
- * - Redistributions of source code must retain the above copyright
+ * - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the distribution.
* - Neither the name of the University Catholique de Louvain - UCL
- * nor the names of its contributors may be used to endorse or
- * promote products derived from this software without specific prior
+ * nor the names of its contributors may be used to endorse or
+ * promote products derived from this software without specific prior
* written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
@@ -71,10 +71,10 @@ import org.apache.hadoop.util.bloom.Key;
* one. A given key is said to belong to the DBF if the <code>k</code> positions are set to one in one of the matrix rows.
* <p>
* Originally created by <a href="http://www.one-lab.org">European Commission One-Lab Project 034819</a>.
- *
+ *
* @see Filter The general behavior of a filter
* @see BloomFilter A Bloom filter
- *
+ *
* @see <a href="http://www.cse.fau.edu/~jie/research/publications/Publication_files/infocom2006.pdf">Theory and Network Applications of Dynamic Bloom
* Filters</a>
*/
@@ -83,27 +83,27 @@ public class DynamicBloomFilter extends Filter {
* Threshold for the maximum number of key to record in a dynamic Bloom filter row.
*/
private int nr;
-
+
/**
* The number of keys recorded in the current standard active Bloom filter.
*/
private int currentNbRecord;
-
+
/**
* The matrix of Bloom filter.
*/
private BloomFilter[] matrix;
-
+
/**
* Zero-args constructor for the serialization.
*/
public DynamicBloomFilter() {}
-
+
/**
* Constructor.
* <p>
* Builds an empty Dynamic Bloom filter.
- *
+ *
* @param vectorSize
* The number of bits in the vector.
* @param nbHash
@@ -115,83 +115,83 @@ public class DynamicBloomFilter extends Filter {
*/
public DynamicBloomFilter(final int vectorSize, final int nbHash, final int hashType, final int nr) {
super(vectorSize, nbHash, hashType);
-
+
this.nr = nr;
this.currentNbRecord = 0;
-
+
matrix = new BloomFilter[1];
matrix[0] = new BloomFilter(this.vectorSize, this.nbHash, this.hashType);
}
-
+
@Override
public boolean add(final Key key) {
if (key == null) {
throw new NullPointerException("Key can not be null");
}
-
+
BloomFilter bf = getActiveStandardBF();
-
+
if (bf == null) {
addRow();
bf = matrix[matrix.length - 1];
currentNbRecord = 0;
}
-
+
boolean added = bf.add(key);
-
+
if (added)
currentNbRecord++;
-
+
return added;
}
-
+
@Override
public void and(final Filter filter) {
if (filter == null || !(filter instanceof DynamicBloomFilter) || filter.vectorSize != this.vectorSize || filter.nbHash != this.nbHash) {
throw new IllegalArgumentException("filters cannot be and-ed");
}
-
+
DynamicBloomFilter dbf = (DynamicBloomFilter) filter;
-
+
if (dbf.matrix.length != this.matrix.length || dbf.nr != this.nr) {
throw new IllegalArgumentException("filters cannot be and-ed");
}
-
+
for (int i = 0; i < matrix.length; i++) {
matrix[i].and(dbf.matrix[i]);
}
}
-
+
@Override
public boolean membershipTest(final Key key) {
if (key == null) {
return true;
}
-
+
for (int i = 0; i < matrix.length; i++) {
if (matrix[i].membershipTest(key)) {
return true;
}
}
-
+
return false;
}
-
+
@Override
public void not() {
for (int i = 0; i < matrix.length; i++) {
matrix[i].not();
}
}
-
+
@Override
public void or(final Filter filter) {
if (filter == null || !(filter instanceof DynamicBloomFilter) || filter.vectorSize != this.vectorSize || filter.nbHash != this.nbHash) {
throw new IllegalArgumentException("filters cannot be or-ed");
}
-
+
DynamicBloomFilter dbf = (DynamicBloomFilter) filter;
-
+
if (dbf.matrix.length != this.matrix.length || dbf.nr != this.nr) {
throw new IllegalArgumentException("filters cannot be or-ed");
}
@@ -199,36 +199,36 @@ public class DynamicBloomFilter extends Filter {
matrix[i].or(dbf.matrix[i]);
}
}
-
+
@Override
public void xor(final Filter filter) {
if (filter == null || !(filter instanceof DynamicBloomFilter) || filter.vectorSize != this.vectorSize || filter.nbHash != this.nbHash) {
throw new IllegalArgumentException("filters cannot be xor-ed");
}
DynamicBloomFilter dbf = (DynamicBloomFilter) filter;
-
+
if (dbf.matrix.length != this.matrix.length || dbf.nr != this.nr) {
throw new IllegalArgumentException("filters cannot be xor-ed");
}
-
+
for (int i = 0; i < matrix.length; i++) {
matrix[i].xor(dbf.matrix[i]);
}
}
-
+
@Override
public String toString() {
StringBuilder res = new StringBuilder();
-
+
for (int i = 0; i < matrix.length; i++) {
res.append(matrix[i]);
res.append(Character.LINE_SEPARATOR);
}
return res.toString();
}
-
+
// Writable
-
+
@Override
public void write(final DataOutput out) throws IOException {
super.write(out);
@@ -239,12 +239,12 @@ public class DynamicBloomFilter extends Filter {
matrix[i].write(out);
}
}
-
+
@Override
public void readFields(final DataInput in) throws IOException {
-
+
super.readFields(in);
-
+
nr = in.readInt();
currentNbRecord = in.readInt();
int len = in.readInt();
@@ -254,32 +254,32 @@ public class DynamicBloomFilter extends Filter {
matrix[i].readFields(in);
}
}
-
+
/**
* Adds a new row to <i>this</i> dynamic Bloom filter.
*/
private void addRow() {
BloomFilter[] tmp = new BloomFilter[matrix.length + 1];
-
+
for (int i = 0; i < matrix.length; i++) {
tmp[i] = matrix[i];
}
-
+
tmp[tmp.length - 1] = new BloomFilter(vectorSize, nbHash, hashType);
-
+
matrix = tmp;
}
-
+
/**
* Returns the active standard Bloom filter in <i>this</i> dynamic Bloom filter.
- *
+ *
* @return BloomFilter The active standard Bloom filter. <code>Null</code> otherwise.
*/
private BloomFilter getActiveStandardBF() {
if (currentNbRecord >= nr) {
return null;
}
-
+
return matrix[matrix.length - 1];
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/bloomfilter/Filter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/bloomfilter/Filter.java b/core/src/main/java/org/apache/accumulo/core/bloomfilter/Filter.java
index eec1c51..12961a9 100644
--- a/core/src/main/java/org/apache/accumulo/core/bloomfilter/Filter.java
+++ b/core/src/main/java/org/apache/accumulo/core/bloomfilter/Filter.java
@@ -2,32 +2,32 @@
*
* Copyright (c) 2005, European Commission project OneLab under contract 034819
* (http://www.one-lab.org)
- *
+ *
* All rights reserved.
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
* conditions are met:
- * - Redistributions of source code must retain the above copyright
+ * - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the distribution.
* - Neither the name of the University Catholique de Louvain - UCL
- * nor the names of its contributors may be used to endorse or
- * promote products derived from this software without specific prior
+ * nor the names of its contributors may be used to endorse or
+ * promote products derived from this software without specific prior
* written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
@@ -70,7 +70,7 @@ import org.apache.hadoop.util.hash.Hash;
* Typically, a filter will be implemented as a Bloom filter (or a Bloom filter extension).
* <p>
* It must be extended in order to define the real behavior.
- *
+ *
* @see Key The general behavior of a key
* @see HashFunction A hash function
*/
@@ -78,22 +78,22 @@ public abstract class Filter implements Writable {
private static final int VERSION = -2; // negative to accommodate for old format
/** The vector size of <i>this</i> filter. */
protected int vectorSize;
-
+
private int rVersion;
/** The hash function used to map a key to several positions in the vector. */
protected HashFunction hash;
-
+
/** The number of hash function to consider. */
protected int nbHash;
-
+
/** Type of hashing function to use. */
protected int hashType;
-
+
protected Filter() {}
-
+
/**
* Constructor.
- *
+ *
* @param vectorSize
* The vector size of <i>this</i> filter.
* @param nbHash
@@ -107,65 +107,65 @@ public abstract class Filter implements Writable {
this.hashType = hashType;
this.hash = new HashFunction(this.vectorSize, this.nbHash, this.hashType);
}
-
+
/**
* Adds a key to <i>this</i> filter.
- *
+ *
* @param key
* The key to add.
* @return true if the key was added, false otherwise.
*/
public abstract boolean add(Key key);
-
+
/**
* Determines whether a specified key belongs to <i>this</i> filter.
- *
+ *
* @param key
* The key to test.
* @return boolean True if the specified key belongs to <i>this</i> filter. False otherwise.
*/
public abstract boolean membershipTest(Key key);
-
+
/**
* Peforms a logical AND between <i>this</i> filter and a specified filter.
* <p>
* <b>Invariant</b>: The result is assigned to <i>this</i> filter.
- *
+ *
* @param filter
* The filter to AND with.
*/
public abstract void and(Filter filter);
-
+
/**
* Peforms a logical OR between <i>this</i> filter and a specified filter.
* <p>
* <b>Invariant</b>: The result is assigned to <i>this</i> filter.
- *
+ *
* @param filter
* The filter to OR with.
*/
public abstract void or(Filter filter);
-
+
/**
* Peforms a logical XOR between <i>this</i> filter and a specified filter.
* <p>
* <b>Invariant</b>: The result is assigned to <i>this</i> filter.
- *
+ *
* @param filter
* The filter to XOR with.
*/
public abstract void xor(Filter filter);
-
+
/**
* Performs a logical NOT on <i>this</i> filter.
* <p>
* The result is assigned to <i>this</i> filter.
*/
public abstract void not();
-
+
/**
* Adds a list of keys to <i>this</i> filter.
- *
+ *
* @param keys
* The list of keys.
*/
@@ -173,15 +173,15 @@ public abstract class Filter implements Writable {
if (keys == null) {
throw new IllegalArgumentException("ArrayList<Key> may not be null");
}
-
+
for (Key key : keys) {
add(key);
}
}// end add()
-
+
/**
* Adds a collection of keys to <i>this</i> filter.
- *
+ *
* @param keys
* The collection of keys.
*/
@@ -193,10 +193,10 @@ public abstract class Filter implements Writable {
add(key);
}
}// end add()
-
+
/**
* Adds an array of keys to <i>this</i> filter.
- *
+ *
* @param keys
* The array of keys.
*/
@@ -208,31 +208,31 @@ public abstract class Filter implements Writable {
add(keys[i]);
}
}// end add()
-
+
// Writable interface
-
+
public void write(final DataOutput out) throws IOException {
out.writeInt(VERSION);
out.writeInt(this.nbHash);
out.writeByte(this.hashType);
out.writeInt(this.vectorSize);
}
-
+
protected int getSerialVersion() {
return rVersion;
}
-
+
protected int getVersion() {
return VERSION;
}
-
+
public void readFields(final DataInput in) throws IOException {
final int ver = in.readInt();
rVersion = ver;
if (ver > 0) { // old unversioned format
this.nbHash = ver;
this.hashType = Hash.JENKINS_HASH;
-
+
} else if (ver == VERSION | ver == VERSION + 1) { // Support for directly serialzing the bitset
this.nbHash = in.readInt();
this.hashType = in.readByte();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/cli/BatchScannerOpts.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/cli/BatchScannerOpts.java b/core/src/main/java/org/apache/accumulo/core/cli/BatchScannerOpts.java
index 4503df4..2d5b51d 100644
--- a/core/src/main/java/org/apache/accumulo/core/cli/BatchScannerOpts.java
+++ b/core/src/main/java/org/apache/accumulo/core/cli/BatchScannerOpts.java
@@ -21,10 +21,10 @@ import org.apache.accumulo.core.cli.ClientOpts.TimeConverter;
import com.beust.jcommander.Parameter;
public class BatchScannerOpts {
- @Parameter(names="--scanThreads", description="Number of threads to use when batch scanning")
+ @Parameter(names = "--scanThreads", description = "Number of threads to use when batch scanning")
public Integer scanThreads = 10;
-
- @Parameter(names="--scanTimeout", converter=TimeConverter.class, description="timeout used to fail a batch scan")
+
+ @Parameter(names = "--scanTimeout", converter = TimeConverter.class, description = "timeout used to fail a batch scan")
public Long scanTimeout = Long.MAX_VALUE;
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/cli/BatchWriterOpts.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/cli/BatchWriterOpts.java b/core/src/main/java/org/apache/accumulo/core/cli/BatchWriterOpts.java
index 45a1bc7..02fb3da 100644
--- a/core/src/main/java/org/apache/accumulo/core/cli/BatchWriterOpts.java
+++ b/core/src/main/java/org/apache/accumulo/core/cli/BatchWriterOpts.java
@@ -26,19 +26,19 @@ import com.beust.jcommander.Parameter;
public class BatchWriterOpts {
private static final BatchWriterConfig BWDEFAULTS = new BatchWriterConfig();
-
- @Parameter(names="--batchThreads", description="Number of threads to use when writing large batches")
+
+ @Parameter(names = "--batchThreads", description = "Number of threads to use when writing large batches")
public Integer batchThreads = BWDEFAULTS.getMaxWriteThreads();
- @Parameter(names="--batchLatency", converter=TimeConverter.class, description="The maximum time to wait before flushing data to servers when writing")
+ @Parameter(names = "--batchLatency", converter = TimeConverter.class, description = "The maximum time to wait before flushing data to servers when writing")
public Long batchLatency = BWDEFAULTS.getMaxLatency(TimeUnit.MILLISECONDS);
-
- @Parameter(names="--batchMemory", converter=MemoryConverter.class, description="memory used to batch data when writing")
+
+ @Parameter(names = "--batchMemory", converter = MemoryConverter.class, description = "memory used to batch data when writing")
public Long batchMemory = BWDEFAULTS.getMaxMemory();
-
- @Parameter(names="--batchTimeout", converter=TimeConverter.class, description="timeout used to fail a batch write")
+
+ @Parameter(names = "--batchTimeout", converter = TimeConverter.class, description = "timeout used to fail a batch write")
public Long batchTimeout = BWDEFAULTS.getTimeout(TimeUnit.MILLISECONDS);
-
+
public BatchWriterConfig getBatchWriterConfig() {
BatchWriterConfig config = new BatchWriterConfig();
config.setMaxWriteThreads(this.batchThreads);
@@ -47,5 +47,5 @@ public class BatchWriterOpts {
config.setTimeout(this.batchTimeout, TimeUnit.MILLISECONDS);
return config;
}
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/cli/ClientOnDefaultTable.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/cli/ClientOnDefaultTable.java b/core/src/main/java/org/apache/accumulo/core/cli/ClientOnDefaultTable.java
index d12f4a5..42dec8f 100644
--- a/core/src/main/java/org/apache/accumulo/core/cli/ClientOnDefaultTable.java
+++ b/core/src/main/java/org/apache/accumulo/core/cli/ClientOnDefaultTable.java
@@ -25,7 +25,7 @@ public class ClientOnDefaultTable extends ClientOpts {
public ClientOnDefaultTable(String table) {
this.tableName = table;
}
-
+
public String getTableName() {
return tableName;
}
@@ -33,5 +33,5 @@ public class ClientOnDefaultTable extends ClientOpts {
public void setTableName(String tableName) {
this.tableName = tableName;
}
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/cli/ClientOnRequiredTable.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/cli/ClientOnRequiredTable.java b/core/src/main/java/org/apache/accumulo/core/cli/ClientOnRequiredTable.java
index e6d331c..e41e351 100644
--- a/core/src/main/java/org/apache/accumulo/core/cli/ClientOnRequiredTable.java
+++ b/core/src/main/java/org/apache/accumulo/core/cli/ClientOnRequiredTable.java
@@ -18,7 +18,6 @@ package org.apache.accumulo.core.cli;
import com.beust.jcommander.Parameter;
-
public class ClientOnRequiredTable extends ClientOpts {
@Parameter(names = {"-t", "--table"}, required = true, description = "table to use")
private String tableName;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java b/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
index f6ea934..fa690e6 100644
--- a/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
+++ b/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
@@ -55,77 +55,77 @@ import com.beust.jcommander.IStringConverter;
import com.beust.jcommander.Parameter;
public class ClientOpts extends Help {
-
+
public static class TimeConverter implements IStringConverter<Long> {
@Override
public Long convert(String value) {
return AccumuloConfiguration.getTimeInMillis(value);
}
}
-
+
public static class MemoryConverter implements IStringConverter<Long> {
@Override
public Long convert(String value) {
return AccumuloConfiguration.getMemoryInBytes(value);
}
}
-
+
public static class AuthConverter implements IStringConverter<Authorizations> {
@Override
public Authorizations convert(String value) {
return new Authorizations(value.split(","));
}
}
-
+
public static class Password {
public byte[] value;
-
+
public Password(String dfault) {
value = dfault.getBytes(UTF_8);
}
-
+
@Override
public String toString() {
return new String(value, UTF_8);
}
}
-
+
public static class PasswordConverter implements IStringConverter<Password> {
@Override
public Password convert(String value) {
return new Password(value);
}
}
-
+
public static class VisibilityConverter implements IStringConverter<ColumnVisibility> {
@Override
public ColumnVisibility convert(String value) {
return new ColumnVisibility(value);
}
}
-
+
@Parameter(names = {"-u", "--user"}, description = "Connection user")
public String principal = System.getProperty("user.name");
-
+
@Parameter(names = "-p", converter = PasswordConverter.class, description = "Connection password")
public Password password = null;
-
+
@Parameter(names = "--password", converter = PasswordConverter.class, description = "Enter the connection password", password = true)
public Password securePassword = null;
-
+
@Parameter(names = {"-tc", "--tokenClass"}, description = "Token class")
public String tokenClassName = PasswordToken.class.getName();
-
+
@DynamicParameter(names = "-l",
description = "login properties in the format key=value. Reuse -l for each property (prompt for properties if this option is missing")
public Map<String,String> loginProps = new LinkedHashMap<String,String>();
-
+
public AuthenticationToken getToken() {
if (!loginProps.isEmpty()) {
Properties props = new Properties();
for (Entry<String,String> loginOption : loginProps.entrySet())
props.put(loginOption.getKey(), loginOption.getValue());
-
+
try {
AuthenticationToken token = Class.forName(tokenClassName).asSubclass(AuthenticationToken.class).newInstance();
token.init(props);
@@ -133,70 +133,72 @@ public class ClientOpts extends Help {
} catch (Exception e) {
throw new RuntimeException(e);
}
-
+
}
-
+
if (securePassword != null)
return new PasswordToken(securePassword.value);
-
+
if (password != null)
return new PasswordToken(password.value);
-
+
return null;
}
-
+
@Parameter(names = {"-z", "--keepers"}, description = "Comma separated list of zookeeper hosts (host:port,host:port)")
public String zookeepers = "localhost:2181";
-
+
@Parameter(names = {"-i", "--instance"}, description = "The name of the accumulo instance")
public String instance = null;
-
+
@Parameter(names = {"-auths", "--auths"}, converter = AuthConverter.class, description = "the authorizations to use when reading or writing")
public Authorizations auths = Authorizations.EMPTY;
-
+
@Parameter(names = "--debug", description = "turn on TRACE-level log messages")
public boolean debug = false;
-
+
@Parameter(names = {"-fake", "--mock"}, description = "Use a mock Instance")
public boolean mock = false;
-
+
@Parameter(names = "--site-file", description = "Read the given accumulo site file to find the accumulo instance")
public String siteFile = null;
-
+
@Parameter(names = "--ssl", description = "Connect to accumulo over SSL")
public boolean sslEnabled = false;
- @Parameter(names = "--config-file", description = "Read the given client config file. If omitted, the path searched can be specified with $ACCUMULO_CLIENT_CONF_PATH, which defaults to ~/.accumulo/config:$ACCUMULO_CONF_DIR/client.conf:/etc/accumulo/client.conf")
+ @Parameter(
+ names = "--config-file",
+ description = "Read the given client config file. If omitted, the path searched can be specified with $ACCUMULO_CLIENT_CONF_PATH, which defaults to ~/.accumulo/config:$ACCUMULO_CONF_DIR/client.conf:/etc/accumulo/client.conf")
public String clientConfigFile = null;
public void startDebugLogging() {
if (debug)
Logger.getLogger(Constants.CORE_PACKAGE_NAME).setLevel(Level.TRACE);
}
-
+
@Parameter(names = "--trace", description = "turn on distributed tracing")
public boolean trace = false;
-
+
public void startTracing(String applicationName) {
if (trace) {
Trace.on(applicationName);
}
}
-
+
public void stopTracing() {
Trace.off();
}
-
+
@Override
public void parseArgs(String programName, String[] args, Object... others) {
super.parseArgs(programName, args, others);
startDebugLogging();
startTracing(programName);
}
-
+
protected Instance cachedInstance = null;
protected ClientConfiguration cachedClientConfig = null;
-
+
synchronized public Instance getInstance() {
if (cachedInstance != null)
return cachedInstance;
@@ -232,7 +234,7 @@ public class ClientOpts extends Help {
{
xml.addResource(new Path(siteFile));
}
-
+
@Override
public void getProperties(Map<String,String> props, PropertyFilter filter) {
for (Entry<String,String> prop : DefaultConfiguration.getInstance())
@@ -242,7 +244,7 @@ public class ClientOpts extends Help {
if (filter.accept(prop.getKey()))
props.put(prop.getKey(), prop.getValue());
}
-
+
@Override
public String get(Property property) {
String value = xml.get(property.getKey());
@@ -262,5 +264,5 @@ public class ClientOpts extends Help {
}
return cachedClientConfig = clientConfig.withInstance(instance).withZkHosts(zookeepers);
}
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/cli/Help.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/cli/Help.java b/core/src/main/java/org/apache/accumulo/core/cli/Help.java
index b5b16bc..68475e2 100644
--- a/core/src/main/java/org/apache/accumulo/core/cli/Help.java
+++ b/core/src/main/java/org/apache/accumulo/core/cli/Help.java
@@ -21,10 +21,10 @@ import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterException;
public class Help {
- @Parameter(names={"-h", "-?", "--help", "-help"}, help=true)
+ @Parameter(names = {"-h", "-?", "--help", "-help"}, help = true)
public boolean help = false;
-
- public void parseArgs(String programName, String[] args, Object ... others) {
+
+ public void parseArgs(String programName, String[] args, Object... others) {
JCommander commander = new JCommander();
commander.addObject(this);
for (Object other : others)
@@ -41,11 +41,11 @@ public class Help {
exit(0);
}
}
-
+
public void exit(int status) {
System.exit(status);
}
-
+
public void exitWithError(String message, int status) {
System.err.println(message);
exit(status);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/cli/ScannerOpts.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/cli/ScannerOpts.java b/core/src/main/java/org/apache/accumulo/core/cli/ScannerOpts.java
index 54e3619..439b374 100644
--- a/core/src/main/java/org/apache/accumulo/core/cli/ScannerOpts.java
+++ b/core/src/main/java/org/apache/accumulo/core/cli/ScannerOpts.java
@@ -19,6 +19,6 @@ package org.apache.accumulo.core.cli;
import com.beust.jcommander.Parameter;
public class ScannerOpts {
- @Parameter(names="--scanBatchSize", description="the number of key-values to pull during a scan")
- public int scanBatchSize = 1000;
+ @Parameter(names = "--scanBatchSize", description = "the number of key-values to pull during a scan")
+ public int scanBatchSize = 1000;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/client/AccumuloException.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/AccumuloException.java b/core/src/main/java/org/apache/accumulo/core/client/AccumuloException.java
index 9de0b96..97bfebd 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/AccumuloException.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/AccumuloException.java
@@ -18,12 +18,12 @@ package org.apache.accumulo.core.client;
/**
* A generic Accumulo Exception for general accumulo failures.
- *
+ *
*/
public class AccumuloException extends Exception {
-
+
private static final long serialVersionUID = 1L;
-
+
/**
* @param why
* is the reason for the error being thrown
@@ -31,7 +31,7 @@ public class AccumuloException extends Exception {
public AccumuloException(final String why) {
super(why);
}
-
+
/**
* @param cause
* is the exception that this exception wraps
@@ -39,7 +39,7 @@ public class AccumuloException extends Exception {
public AccumuloException(final Throwable cause) {
super(cause);
}
-
+
/**
* @param why
* is the reason for the error being thrown
@@ -49,5 +49,5 @@ public class AccumuloException extends Exception {
public AccumuloException(final String why, final Throwable cause) {
super(why, cause);
}
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/client/AccumuloSecurityException.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/AccumuloSecurityException.java b/core/src/main/java/org/apache/accumulo/core/client/AccumuloSecurityException.java
index 35ea188..a614e8c 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/AccumuloSecurityException.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/AccumuloSecurityException.java
@@ -22,11 +22,11 @@ import org.apache.commons.lang.StringUtils;
/**
* An Accumulo Exception for security violations, authentication failures, authorization failures, etc.
- *
+ *
*/
public class AccumuloSecurityException extends Exception {
private static final long serialVersionUID = 1L;
-
+
private static String getDefaultErrorMessage(final SecurityErrorCode errorcode) {
switch (errorcode == null ? SecurityErrorCode.DEFAULT_SECURITY_ERROR : errorcode) {
case BAD_CREDENTIALS:
@@ -62,21 +62,23 @@ public class AccumuloSecurityException extends Exception {
return "Unknown security exception";
}
}
-
+
private String user;
private String tableInfo;
private SecurityErrorCode errorCode;
-
+
/**
* @return this exception as a thrift exception
*/
public ThriftSecurityException asThriftException() {
return new ThriftSecurityException(user, errorCode);
}
-
+
/**
* Construct a user-facing exception from a serialized version.
- * @param thrift a serialized version
+ *
+ * @param thrift
+ * a serialized version
*/
public AccumuloSecurityException(final ThriftSecurityException thrift) {
this(thrift.getUser(), thrift.getCode(), thrift);
@@ -95,7 +97,7 @@ public class AccumuloSecurityException extends Exception {
this.user = user;
this.errorCode = errorcode == null ? SecurityErrorCode.DEFAULT_SECURITY_ERROR : errorcode;
}
-
+
/**
* @param user
* the relevant user for the security violation
@@ -112,7 +114,7 @@ public class AccumuloSecurityException extends Exception {
this.errorCode = errorcode == null ? SecurityErrorCode.DEFAULT_SECURITY_ERROR : errorcode;
this.tableInfo = tableInfo;
}
-
+
/**
* @param user
* the relevant user for the security violation
@@ -124,7 +126,7 @@ public class AccumuloSecurityException extends Exception {
this.user = user;
this.errorCode = errorcode == null ? SecurityErrorCode.DEFAULT_SECURITY_ERROR : errorcode;
}
-
+
/**
* @param user
* the relevant user for the security violation
@@ -139,38 +141,38 @@ public class AccumuloSecurityException extends Exception {
this.errorCode = errorcode == null ? SecurityErrorCode.DEFAULT_SECURITY_ERROR : errorcode;
this.tableInfo = tableInfo;
}
-
+
/**
* @return the relevant user for the security violation
*/
public String getUser() {
return user;
}
-
+
public void setUser(String s) {
this.user = s;
}
-
+
/**
* @return the relevant tableInfo for the security violation
*/
public String getTableInfo() {
return tableInfo;
}
-
+
public void setTableInfo(String tableInfo) {
this.tableInfo = tableInfo;
}
-
+
/**
* @return the specific reason for this exception
* @since 1.5.0
*/
-
+
public org.apache.accumulo.core.client.security.SecurityErrorCode getSecurityErrorCode() {
return org.apache.accumulo.core.client.security.SecurityErrorCode.valueOf(errorCode.name());
}
-
+
@Override
public String getMessage() {
StringBuilder message = new StringBuilder();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/client/BatchDeleter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/BatchDeleter.java b/core/src/main/java/org/apache/accumulo/core/client/BatchDeleter.java
index 2bfc347..54d49d1 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/BatchDeleter.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/BatchDeleter.java
@@ -22,28 +22,28 @@ import org.apache.accumulo.core.data.Range;
/**
* Implementations of BatchDeleter support efficient deletion of ranges in accumulo.
- *
+ *
*/
public interface BatchDeleter extends ScannerBase {
/**
* Deletes the ranges specified by {@link #setRanges}.
- *
+ *
* @throws MutationsRejectedException
* this can be thrown when deletion mutations fail
* @throws TableNotFoundException
* when the table does not exist
*/
void delete() throws MutationsRejectedException, TableNotFoundException;
-
+
/**
* Allows deleting multiple ranges efficiently.
- *
+ *
* @param ranges
* specifies the non-overlapping ranges to query
*/
void setRanges(Collection<Range> ranges);
-
+
/**
* Releases any resources.
*/
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/client/BatchScanner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/BatchScanner.java b/core/src/main/java/org/apache/accumulo/core/client/BatchScanner.java
index aa57297..39f96f5 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/BatchScanner.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/BatchScanner.java
@@ -23,37 +23,37 @@ import org.apache.accumulo.core.data.Range;
/**
* Implementations of BatchScanner support efficient lookups of many ranges in accumulo.
- *
+ *
* Use this when looking up lots of ranges and you expect each range to contain a small amount of data. Also only use this when you do not care about the
* returned data being in sorted order.
- *
+ *
* If you want to lookup a few ranges and expect those ranges to contain a lot of data, then use the Scanner instead. Also, the Scanner will return data in
* sorted order, this will not.
*/
public interface BatchScanner extends ScannerBase {
-
+
/**
* Allows scanning over multiple ranges efficiently.
- *
+ *
* @param ranges
* specifies the non-overlapping ranges to query
*/
void setRanges(Collection<Range> ranges);
-
+
/**
* Cleans up and finalizes the scanner
*/
void close();
-
+
/**
* Sets a timeout threshold for a server to respond. The batch scanner will accomplish as much work as possible before throwing an exception. BatchScanner
* iterators will throw a {@link TimedOutException} when all needed servers timeout. Setting the timeout to zero or Long.MAX_VALUE and TimeUnit.MILLISECONDS
* means no timeout.
- *
+ *
* <p>
* If not set, there is not timeout. The BatchScanner will retry forever.
- *
+ *
* @param timeUnit
* determines how timeout is interpreted
* @since 1.5.0
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/client/BatchWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/BatchWriter.java b/core/src/main/java/org/apache/accumulo/core/client/BatchWriter.java
index b321411..94d988d 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/BatchWriter.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/BatchWriter.java
@@ -20,52 +20,49 @@ import org.apache.accumulo.core.data.Mutation;
/**
* Send Mutations to a single Table in Accumulo.
- *
- * When the user uses a Connector to create a BatchWriter,
- * they specify how much memory and how many threads it should use.
- * As the user adds mutations to the batch writer, it buffers them.
- * Once the buffered mutations have used half of the user specified buffer,
- * the mutations are dumped into the background to be written by a thread pool.
- * If the user specified memory completely fills up, then writes are held.
- * When a user calls flush, it does not return until all buffered mutations are written.
+ *
+ * When the user uses a Connector to create a BatchWriter, they specify how much memory and how many threads it should use. As the user adds mutations to the
+ * batch writer, it buffers them. Once the buffered mutations have used half of the user specified buffer, the mutations are dumped into the background to be
+ * written by a thread pool. If the user specified memory completely fills up, then writes are held. When a user calls flush, it does not return until all
+ * buffered mutations are written.
*/
public interface BatchWriter {
-
+
/**
* Queues one mutation to write.
- *
+ *
* @param m
* the mutation to add
* @throws MutationsRejectedException
* this could be thrown because current or previous mutations failed
*/
-
+
void addMutation(Mutation m) throws MutationsRejectedException;
-
+
/**
* Queues several mutations to write.
- *
+ *
* @param iterable
* allows adding any number of mutations iteratively
* @throws MutationsRejectedException
* this could be thrown because current or previous mutations failed
*/
void addMutations(Iterable<Mutation> iterable) throws MutationsRejectedException;
-
+
/**
* Send any buffered mutations to Accumulo immediately.
- *
+ *
* @throws MutationsRejectedException
* this could be thrown because current or previous mutations failed
*/
void flush() throws MutationsRejectedException;
-
+
/**
* Flush and release any resources.
- *
+ *
* @throws MutationsRejectedException
* this could be thrown because current or previous mutations failed
*/
void close() throws MutationsRejectedException;
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/client/BatchWriterConfig.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/BatchWriterConfig.java b/core/src/main/java/org/apache/accumulo/core/client/BatchWriterConfig.java
index ecb031b..6ceefad 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/BatchWriterConfig.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/BatchWriterConfig.java
@@ -180,11 +180,11 @@ public class BatchWriterConfig implements Writable {
}
/**
- * Change the durability for the BatchWriter session. The default durability is "default" which
- * is the table's durability setting. If the durability is set to something other than the default,
- * it will override the durability setting of the table.
+ * Change the durability for the BatchWriter session. The default durability is "default" which is the table's durability setting. If the durability is set to
+ * something other than the default, it will override the durability setting of the table.
*
- * @param durability the Durability to be used by the BatchWriter
+ * @param durability
+ * the Durability to be used by the BatchWriter
* @since 1.7.0
*
*/
@@ -320,8 +320,7 @@ public class BatchWriterConfig implements Writable {
public String toString() {
StringBuilder sb = new StringBuilder(32);
sb.append("[maxMemory=").append(getMaxMemory()).append(", maxLatency=").append(getMaxLatency(TimeUnit.MILLISECONDS)).append(", maxWriteThreads=")
- .append(getMaxWriteThreads()).append(", timeout=").append(getTimeout(TimeUnit.MILLISECONDS))
- .append(", durability=").append(durability).append("]");
+ .append(getMaxWriteThreads()).append(", timeout=").append(getTimeout(TimeUnit.MILLISECONDS)).append(", durability=").append(durability).append("]");
return sb.toString();
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java b/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
index 6fe61a5..df53645 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ClientConfiguration.java
@@ -17,6 +17,7 @@
package org.apache.accumulo.core.client;
import static com.google.common.base.Preconditions.checkArgument;
+
import java.io.File;
import java.io.StringReader;
import java.io.StringWriter;
@@ -224,9 +225,11 @@ public class ClientConfiguration extends CompositeConfiguration {
/**
* Gets all properties under the given prefix in this configuration.
*
- * @param property prefix property, must be of type PropertyType.PREFIX
+ * @param property
+ * prefix property, must be of type PropertyType.PREFIX
* @return a map of property keys to values
- * @throws IllegalArgumentException if property is not a prefix
+ * @throws IllegalArgumentException
+ * if property is not a prefix
*/
public Map<String,String> getAllPropertiesWithPrefix(ClientProperty property) {
checkType(property, PropertyType.PREFIX);
@@ -234,7 +237,7 @@ public class ClientConfiguration extends CompositeConfiguration {
Map<String,String> propMap = new HashMap<String,String>();
Iterator<?> iter = this.getKeys(property.getKey());
while (iter.hasNext()) {
- String p = (String)iter.next();
+ String p = (String) iter.next();
propMap.put(p, getString(p));
}
return propMap;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java b/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java
index 4903656..d6261fb 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ClientSideIteratorScanner.java
@@ -55,11 +55,11 @@ import org.apache.hadoop.io.Text;
*/
public class ClientSideIteratorScanner extends ScannerOptions implements Scanner {
private int size;
-
+
private Range range;
private boolean isolated = false;
private long readaheadThreshold = Constants.SCANNER_DEFAULT_READAHEAD_THRESHOLD;
-
+
/**
* A class that wraps a Scanner in a SortedKeyValueIterator so that other accumulo iterators can use it as a source.
*/
@@ -67,27 +67,27 @@ public class ClientSideIteratorScanner extends ScannerOptions implements Scanner
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(final Scanner scanner) {
this.scanner = scanner;
}
-
+
@Override
public void init(final SortedKeyValueIterator<Key,Value> source, final Map<String,String> options, final IteratorEnvironment env) throws IOException {
throw new UnsupportedOperationException();
}
-
+
@Override
public boolean hasTop() {
return top != null;
}
-
+
@Override
public void next() throws IOException {
if (iter.hasNext())
@@ -95,7 +95,7 @@ public class ClientSideIteratorScanner extends ScannerOptions implements Scanner
else
top = null;
}
-
+
@Override
public void seek(final Range range, final Collection<ByteSequence> columnFamilies, final boolean inclusive) throws IOException {
if (!inclusive && columnFamilies.size() > 0) {
@@ -109,28 +109,28 @@ public class ClientSideIteratorScanner extends ScannerOptions implements Scanner
iter = scanner.iterator();
next();
}
-
+
@Override
public Key getTopKey() {
return top.getKey();
}
-
+
@Override
public Value getTopValue() {
return top.getValue();
}
-
+
@Override
public SortedKeyValueIterator<Key,Value> deepCopy(final IteratorEnvironment env) {
return new ScannerTranslator(scanner);
}
}
-
+
private ScannerTranslator smi;
-
+
/**
* Constructs a scanner that can execute client-side iterators.
- *
+ *
* @param scanner
* the source scanner
*/
@@ -141,14 +141,14 @@ public class ClientSideIteratorScanner extends ScannerOptions implements Scanner
this.timeOut = scanner.getTimeout(TimeUnit.MILLISECONDS);
this.readaheadThreshold = scanner.getReadaheadThreshold();
}
-
+
/**
* Sets the source Scanner.
*/
public void setSource(final Scanner scanner) {
smi = new ScannerTranslator(scanner);
}
-
+
@Override
public Iterator<Entry<Key,Value>> iterator() {
smi.scanner.setBatchSize(size);
@@ -158,13 +158,13 @@ public class ClientSideIteratorScanner extends ScannerOptions implements Scanner
smi.scanner.enableIsolation();
else
smi.scanner.disableIsolation();
-
+
final TreeMap<Integer,IterInfo> tm = new TreeMap<Integer,IterInfo>();
-
+
for (IterInfo iterInfo : serverSideIteratorList) {
tm.put(iterInfo.getPriority(), iterInfo);
}
-
+
SortedKeyValueIterator<Key,Value> skvi;
try {
skvi = IteratorUtil.loadIterators(smi, tm.values(), serverSideIteratorOptions, new IteratorEnvironment() {
@@ -172,43 +172,43 @@ public class ClientSideIteratorScanner extends ScannerOptions implements Scanner
public SortedKeyValueIterator<Key,Value> reserveMapFileReader(final String mapFileName) throws IOException {
return null;
}
-
+
@Override
public AccumuloConfiguration getConfig() {
return null;
}
-
+
@Override
public IteratorScope getIteratorScope() {
return null;
}
-
+
@Override
public boolean isFullMajorCompaction() {
return false;
}
-
+
@Override
public void registerSideChannel(final SortedKeyValueIterator<Key,Value> iter) {}
}, false, null);
} catch (IOException e) {
throw new RuntimeException(e);
}
-
+
final Set<ByteSequence> colfs = new TreeSet<ByteSequence>();
for (Column c : this.getFetchedColumns()) {
colfs.add(new ArrayByteSequence(c.getColumnFamily()));
}
-
+
try {
skvi.seek(range, colfs, true);
} catch (IOException e) {
throw new RuntimeException(e);
}
-
+
return new IteratorAdapter(skvi);
}
-
+
@Deprecated
@Override
public void setTimeOut(int timeOut) {
@@ -217,7 +217,7 @@ public class ClientSideIteratorScanner extends ScannerOptions implements Scanner
else
setTimeout(timeOut, TimeUnit.SECONDS);
}
-
+
@Deprecated
@Override
public int getTimeOut() {
@@ -226,32 +226,32 @@ public class ClientSideIteratorScanner extends ScannerOptions implements Scanner
return Integer.MAX_VALUE;
return (int) timeout;
}
-
+
@Override
public void setRange(final Range range) {
this.range = range;
}
-
+
@Override
public Range getRange() {
return range;
}
-
+
@Override
public void setBatchSize(final int size) {
this.size = size;
}
-
+
@Override
public int getBatchSize() {
return size;
}
-
+
@Override
public void enableIsolation() {
this.isolated = true;
}
-
+
@Override
public void disableIsolation() {
this.isolated = false;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/client/ConditionalWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/ConditionalWriter.java b/core/src/main/java/org/apache/accumulo/core/client/ConditionalWriter.java
index f9848c4..62244e6 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ConditionalWriter.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ConditionalWriter.java
@@ -25,23 +25,23 @@ import org.apache.accumulo.core.data.ConditionalMutation;
/**
* ConditionalWriter provides the ability to do efficient, atomic read-modify-write operations on rows. These operations are performed on the tablet server
* while a row lock is held.
- *
+ *
* @since 1.6.0
*/
public interface ConditionalWriter {
class Result {
-
+
private Status status;
private ConditionalMutation mutation;
private String server;
private Exception exception;
-
+
public Result(Status s, ConditionalMutation m, String server) {
this.status = s;
this.mutation = m;
this.server = server;
}
-
+
public Result(Exception e, ConditionalMutation cm, String server) {
this.exception = e;
this.mutation = cm;
@@ -51,7 +51,7 @@ public interface ConditionalWriter {
/**
* If this method throws an exception, then its possible the mutation is still being actively processed. Therefore if code chooses to continue after seeing
* an exception it should take this into consideration.
- *
+ *
* @return status of a conditional mutation
*/
@@ -62,31 +62,30 @@ public interface ConditionalWriter {
if (exception instanceof AccumuloSecurityException) {
AccumuloSecurityException ase = (AccumuloSecurityException) exception;
throw new AccumuloSecurityException(ase.getUser(), SecurityErrorCode.valueOf(ase.getSecurityErrorCode().name()), ase.getTableInfo(), ase);
- }
- else
+ } else
throw new AccumuloException(exception);
}
return status;
}
-
+
/**
- *
+ *
* @return A copy of the mutation previously submitted by a user. The mutation will reference the same data, but the object may be different.
*/
public ConditionalMutation getMutation() {
return mutation;
}
-
+
/**
- *
+ *
* @return The server this mutation was sent to. Returns null if was not sent to a server.
*/
public String getTabletServer() {
return server;
}
}
-
+
public static enum Status {
/**
* conditions were met and mutation was written
@@ -115,15 +114,15 @@ public interface ConditionalWriter {
/**
* This method returns one result for each mutation passed to it. This method is thread safe. Multiple threads can safely use a single conditional writer.
* Sharing a conditional writer between multiple threads may result in batching of request to tablet servers.
- *
+ *
* @return Result for each mutation submitted. The mutations may still be processing in the background when this method returns, if so the iterator will
* block.
*/
Iterator<Result> write(Iterator<ConditionalMutation> mutations);
-
+
/**
* This method has the same thread safety guarantees as @link {@link #write(Iterator)}
- *
+ *
* @return Result for the submitted mutation
*/
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/client/ConditionalWriterConfig.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/ConditionalWriterConfig.java b/core/src/main/java/org/apache/accumulo/core/client/ConditionalWriterConfig.java
index 52c6a76..b5cb474 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ConditionalWriterConfig.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ConditionalWriterConfig.java
@@ -109,6 +109,7 @@ public class ConditionalWriterConfig {
* Sets the Durability for the mutation, if applied.
* <p>
* <b>Default:</b> Durability.DEFAULT: use the table's durability configuration.
+ *
* @return {@code this} to allow chaining of set methods
* @since 1.7.0
*/
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/client/Connector.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/Connector.java b/core/src/main/java/org/apache/accumulo/core/client/Connector.java
index 301577c..e36cc82 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/Connector.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/Connector.java
@@ -26,14 +26,14 @@ import org.apache.accumulo.core.security.Authorizations;
/**
* 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.
- *
+ *
* The Connector enforces security on the client side by forcing all API calls to be accompanied by user credentials.
*/
public abstract class Connector {
/**
* Factory method to create a BatchScanner connected to Accumulo.
- *
+ *
* @param tableName
* the name of the table to query
* @param authorizations
@@ -42,7 +42,7 @@ public abstract class Connector {
* passed, then an exception will be thrown.
* @param numQueryThreads
* the number of concurrent threads to spawn for querying
- *
+ *
* @return BatchScanner object for configuring and querying
* @throws TableNotFoundException
* when the specified table doesn't exist
@@ -51,7 +51,7 @@ public abstract class Connector {
/**
* Factory method to create a BatchDeleter connected to Accumulo.
- *
+ *
* @param tableName
* the name of the table to query and delete from
* @param authorizations
@@ -66,7 +66,7 @@ public abstract class Connector {
* size in milliseconds; set to 0 or Long.MAX_VALUE to allow the maximum time to hold a batch before writing
* @param maxWriteThreads
* the maximum number of threads to use for writing data to the tablet servers
- *
+ *
* @return BatchDeleter object for configuring and deleting
* @throws TableNotFoundException
* when the specified table doesn't exist
@@ -77,7 +77,7 @@ public abstract class Connector {
int maxWriteThreads) throws TableNotFoundException;
/**
- *
+ *
* @param tableName
* the name of the table to query and delete from
* @param authorizations
@@ -97,7 +97,7 @@ public abstract class Connector {
/**
* Factory method to create a BatchWriter connected to Accumulo.
- *
+ *
* @param tableName
* the name of the table to insert data into
* @param maxMemory
@@ -106,7 +106,7 @@ public abstract class Connector {
* time in milliseconds; set to 0 or Long.MAX_VALUE to allow the maximum time to hold a batch before writing
* @param maxWriteThreads
* the maximum number of threads to use for writing data to the tablet servers
- *
+ *
* @return BatchWriter object for configuring and writing data to
* @throws TableNotFoundException
* when the specified table doesn't exist
@@ -117,7 +117,7 @@ public abstract class Connector {
/**
* Factory method to create a BatchWriter connected to Accumulo.
- *
+ *
* @param tableName
* the name of the table to insert data into
* @param config
@@ -131,14 +131,14 @@ public abstract class Connector {
/**
* Factory method to create a Multi-Table BatchWriter connected to Accumulo. Multi-table batch writers can queue data for multiple tables, which is good for
* ingesting data into multiple tables from the same source
- *
+ *
* @param maxMemory
* size in bytes of the maximum memory to batch before writing
* @param maxLatency
* size in milliseconds; set to 0 or Long.MAX_VALUE to allow the maximum time to hold a batch before writing
* @param maxWriteThreads
* the maximum number of threads to use for writing data to the tablet servers
- *
+ *
* @return MultiTableBatchWriter object for configuring and writing data to
* @deprecated since 1.5.0; Use {@link #createMultiTableBatchWriter(BatchWriterConfig)} instead.
*/
@@ -148,7 +148,7 @@ public abstract class Connector {
/**
* Factory method to create a Multi-Table BatchWriter connected to Accumulo. Multi-table batch writers can queue data for multiple tables. Also data for
* multiple tables can be sent to a server in a single batch. Its an efficient way to ingest data into multiple tables from a single process.
- *
+ *
* @param config
* configuration used to create multi-table batch writer
* @return MultiTableBatchWriter object for configuring and writing data to
@@ -159,14 +159,14 @@ public abstract class Connector {
/**
* Factory method to create a Scanner connected to Accumulo.
- *
+ *
* @param tableName
* the name of the table to query data from
* @param authorizations
* A set of authorization labels that will be checked against the column visibility of each key in order to filter data. The authorizations passed in
* must be a subset of the accumulo user's set of authorizations. If the accumulo user has authorizations (A1, A2) and authorizations (A2, A3) are
* passed, then an exception will be thrown.
- *
+ *
* @return Scanner object for configuring and querying data with
* @throws TableNotFoundException
* when the specified table doesn't exist
@@ -175,12 +175,12 @@ public abstract class Connector {
/**
* Factory method to create a ConditionalWriter connected to Accumulo.
- *
+ *
* @param tableName
* the name of the table to query data from
* @param config
* configuration used to create conditional writer
- *
+ *
* @return ConditionalWriter object for writing ConditionalMutations
* @throws TableNotFoundException
* when the specified table doesn't exist
@@ -190,49 +190,49 @@ public abstract class Connector {
/**
* Accessor method for internal instance object.
- *
+ *
* @return the internal instance object
*/
public abstract Instance getInstance();
/**
* Get the current user for this connector
- *
+ *
* @return the user name
*/
public abstract String whoami();
/**
* Retrieves a TableOperations object to perform table functions, such as create and delete.
- *
+ *
* @return an object to manipulate tables
*/
public abstract TableOperations tableOperations();
/**
* Retrieves a NamespaceOperations object to perform namespace functions, such as create and delete.
- *
+ *
* @return an object to manipulate namespaces
*/
public abstract NamespaceOperations namespaceOperations();
/**
* Retrieves a SecurityOperations object to perform user security operations, such as creating users.
- *
+ *
* @return an object to modify users and permissions
*/
public abstract SecurityOperations securityOperations();
/**
* Retrieves an InstanceOperations object to modify instance configuration.
- *
+ *
* @return an object to modify instance configuration
*/
public abstract InstanceOperations instanceOperations();
/**
* Retrieves a ReplicationOperations object to manage replication configuration.
- *
+ *
* @return an object to modify replication configuration
* @since 1.7.0
*/
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/client/Durability.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/Durability.java b/core/src/main/java/org/apache/accumulo/core/client/Durability.java
index 3e69cb2..08b2092 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/Durability.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/Durability.java
@@ -18,6 +18,7 @@ package org.apache.accumulo.core.client;
/**
* The value for the durability of a BatchWriter or ConditionalWriter.
+ *
* @since 1.7.0
*/
public enum Durability {
@@ -42,4 +43,4 @@ public enum Durability {
* Write mutations to the write-ahead log, and ensure the data is saved to persistent storage.
*/
SYNC
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/client/IsolatedScanner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/IsolatedScanner.java b/core/src/main/java/org/apache/accumulo/core/client/IsolatedScanner.java
index 443596a..3546cdf 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/IsolatedScanner.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/IsolatedScanner.java
@@ -34,33 +34,33 @@ import org.apache.hadoop.io.Text;
/**
* A scanner that presents a row isolated view of an accumulo table. Rows are buffered in memory on the client side. If you think your rows may not fit into
* memory, then you can provide an alternative row buffer factory to the constructor. This would allow rows to be buffered to disk for example.
- *
+ *
*/
public class IsolatedScanner extends ScannerOptions implements Scanner {
-
+
private static class RowBufferingIterator implements Iterator<Entry<Key,Value>> {
-
+
private Iterator<Entry<Key,Value>> source;
private RowBuffer buffer;
private Entry<Key,Value> nextRowStart;
private Iterator<Entry<Key,Value>> rowIter;
private ByteSequence lastRow = null;
private long timeout;
-
+
private final Scanner scanner;
private ScannerOptions opts;
private Range range;
private int batchSize;
private long readaheadThreshold;
-
+
private void readRow() {
-
+
ByteSequence row = null;
-
+
while (true) {
buffer.clear();
-
+
try {
if (nextRowStart != null) {
buffer.add(nextRowStart);
@@ -71,10 +71,10 @@ public class IsolatedScanner extends ScannerOptions implements Scanner {
buffer.add(entry);
row = entry.getKey().getRowData();
}
-
+
while (source.hasNext()) {
Entry<Key,Value> entry = source.next();
-
+
if (entry.getKey().getRowData().equals(row)) {
buffer.add(entry);
} else {
@@ -82,16 +82,16 @@ public class IsolatedScanner extends ScannerOptions implements Scanner {
break;
}
}
-
+
lastRow = row;
rowIter = buffer.iterator();
// System.out.println("lastRow <- "+lastRow + " "+buffer);
return;
} catch (IsolationException ie) {
Range seekRange = null;
-
+
nextRowStart = null;
-
+
if (lastRow == null)
seekRange = range;
else {
@@ -103,21 +103,21 @@ public class IsolatedScanner extends ScannerOptions implements Scanner {
}
// System.out.println(seekRange);
}
-
+
if (seekRange == null) {
buffer.clear();
rowIter = buffer.iterator();
return;
}
-
+
// wait a moment before retrying
UtilWaitThread.sleep(100);
-
+
source = newIterator(seekRange);
}
}
}
-
+
private Iterator<Entry<Key,Value>> newIterator(Range r) {
synchronized (scanner) {
scanner.enableIsolation();
@@ -126,101 +126,102 @@ public class IsolatedScanner extends ScannerOptions implements Scanner {
scanner.setRange(r);
scanner.setReadaheadThreshold(readaheadThreshold);
setOptions((ScannerOptions) scanner, opts);
-
+
return scanner.iterator();
// return new FaultyIterator(scanner.iterator());
}
}
-
- public RowBufferingIterator(Scanner scanner, ScannerOptions opts, Range range, long timeout, int batchSize, long readaheadThreshold, RowBufferFactory bufferFactory) {
+
+ public RowBufferingIterator(Scanner scanner, ScannerOptions opts, Range range, long timeout, int batchSize, long readaheadThreshold,
+ RowBufferFactory bufferFactory) {
this.scanner = scanner;
this.opts = new ScannerOptions(opts);
this.range = range;
this.timeout = timeout;
this.batchSize = batchSize;
this.readaheadThreshold = readaheadThreshold;
-
+
buffer = bufferFactory.newBuffer();
-
+
this.source = newIterator(range);
-
+
readRow();
}
-
+
@Override
public boolean hasNext() {
return rowIter.hasNext();
}
-
+
@Override
public Entry<Key,Value> next() {
Entry<Key,Value> next = rowIter.next();
if (!rowIter.hasNext()) {
readRow();
}
-
+
return next;
}
-
+
@Override
public void remove() {
throw new UnsupportedOperationException();
}
-
+
}
-
+
interface RowBufferFactory {
RowBuffer newBuffer();
}
-
+
interface RowBuffer extends Iterable<Entry<Key,Value>> {
void add(Entry<Key,Value> entry);
-
+
@Override
Iterator<Entry<Key,Value>> iterator();
-
+
void clear();
}
-
+
public static class MemoryRowBufferFactory implements RowBufferFactory {
-
+
@Override
public RowBuffer newBuffer() {
return new MemoryRowBuffer();
}
}
-
+
public static class MemoryRowBuffer implements RowBuffer {
-
+
private ArrayList<Entry<Key,Value>> buffer = new ArrayList<Entry<Key,Value>>();
-
+
@Override
public void add(Entry<Key,Value> entry) {
buffer.add(entry);
}
-
+
@Override
public Iterator<Entry<Key,Value>> iterator() {
return buffer.iterator();
}
-
+
@Override
public void clear() {
buffer.clear();
}
-
+
}
-
+
private Scanner scanner;
private Range range;
private int batchSize;
private long readaheadThreshold;
private RowBufferFactory bufferFactory;
-
+
public IsolatedScanner(Scanner scanner) {
this(scanner, new MemoryRowBufferFactory());
}
-
+
public IsolatedScanner(Scanner scanner, RowBufferFactory bufferFactory) {
this.scanner = scanner;
this.range = scanner.getRange();
@@ -229,12 +230,12 @@ public class IsolatedScanner extends ScannerOptions implements Scanner {
this.readaheadThreshold = scanner.getReadaheadThreshold();
this.bufferFactory = bufferFactory;
}
-
+
@Override
public Iterator<Entry<Key,Value>> iterator() {
return new RowBufferingIterator(scanner, this, range, timeOut, batchSize, readaheadThreshold, bufferFactory);
}
-
+
@Deprecated
@Override
public void setTimeOut(int timeOut) {
@@ -243,7 +244,7 @@ public class IsolatedScanner extends ScannerOptions implements Scanner {
else
setTimeout(timeOut, TimeUnit.SECONDS);
}
-
+
@Deprecated
@Override
public int getTimeOut() {
@@ -252,32 +253,32 @@ public class IsolatedScanner extends ScannerOptions implements Scanner {
return Integer.MAX_VALUE;
return (int) timeout;
}
-
+
@Override
public void setRange(Range range) {
this.range = range;
}
-
+
@Override
public Range getRange() {
return range;
}
-
+
@Override
public void setBatchSize(int size) {
this.batchSize = size;
}
-
+
@Override
public int getBatchSize() {
return batchSize;
}
-
+
@Override
public void enableIsolation() {
// aye aye captain, already done sir
}
-
+
@Override
public void disableIsolation() {
throw new UnsupportedOperationException();
@@ -293,7 +294,7 @@ public class IsolatedScanner extends ScannerOptions implements Scanner {
if (0 > batches) {
throw new IllegalArgumentException("Number of batches before read-ahead must be non-negative");
}
-
+
this.readaheadThreshold = batches;
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java b/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java
index b966a4a..baf9860 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/IteratorSetting.java
@@ -17,6 +17,7 @@
package org.apache.accumulo.core.client;
import static com.google.common.base.Preconditions.checkArgument;
+
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
@@ -36,11 +37,11 @@ import org.apache.hadoop.io.WritableUtils;
/**
* Configure an iterator for minc, majc, and/or scan. By default, IteratorSetting will be configured for scan.
- *
+ *
* Every iterator has a priority, a name, a class, a set of scopes, and configuration parameters.
- *
+ *
* A typical use case configured for scan:
- *
+ *
* <pre>
* IteratorSetting cfg = new IteratorSetting(priority, "myIter", MyIterator.class);
* MyIterator.addOption(cfg, 42);
@@ -52,19 +53,19 @@ public class IteratorSetting implements Writable {
private String name;
private String iteratorClass;
private Map<String,String> properties;
-
+
/**
* Get layer at which this iterator applies. See {@link #setPriority(int)} for how the priority is used.
- *
+ *
* @return the priority of this Iterator
*/
public int getPriority() {
return priority;
}
-
+
/**
* Set layer at which this iterator applies.
- *
+ *
* @param priority
* determines the order in which iterators are applied (system iterators are always applied first, then user-configured iterators, lowest priority
* first)
@@ -73,16 +74,16 @@ public class IteratorSetting implements Writable {
checkArgument(priority > 0, "property must be strictly positive");
this.priority = priority;
}
-
+
/**
* Get the iterator's name.
- *
+ *
* @return the name of the iterator
*/
public String getName() {
return name;
}
-
+
/**
* Set the iterator's name. Must be a simple alphanumeric identifier.
*/
@@ -90,16 +91,16 @@ public class IteratorSetting implements Writable {
checkArgument(name != null, "name is null");
this.name = name;
}
-
+
/**
* Get the name of the class that implements the iterator.
- *
+ *
* @return the iterator's class name
*/
public String getIteratorClass() {
return iteratorClass;
}
-
+
/**
* Set the name of the class that implements the iterator. The class does not have to be present on the client, but it must be available to all tablet
* servers.
@@ -108,10 +109,10 @@ public class IteratorSetting implements Writable {
checkArgument(iteratorClass != null, "iteratorClass is null");
this.iteratorClass = iteratorClass;
}
-
+
/**
* Constructs an iterator setting configured for the scan scope with no parameters. (Parameters can be added later.)
- *
+ *
* @param priority
* the priority for the iterator (see {@link #setPriority(int)})
* @param name
@@ -122,10 +123,10 @@ public class IteratorSetting implements Writable {
public IteratorSetting(int priority, String name, String iteratorClass) {
this(priority, name, iteratorClass, new HashMap<String,String>());
}
-
+
/**
* Constructs an iterator setting configured for the specified scopes with the specified parameters.
- *
+ *
* @param priority
* the priority for the iterator (see {@link #setPriority(int)})
* @param name
@@ -142,11 +143,11 @@ public class IteratorSetting implements Writable {
this.properties = new HashMap<String,String>();
addOptions(properties);
}
-
+
/**
* Constructs an iterator setting using the given class's SimpleName for the iterator name. The iterator setting will be configured for the scan scope with no
* parameters.
- *
+ *
* @param priority
* the priority for the iterator (see {@link #setPriority(int)})
* @param iteratorClass
@@ -155,12 +156,12 @@ public class IteratorSetting implements Writable {
public IteratorSetting(int priority, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass) {
this(priority, iteratorClass.getSimpleName(), iteratorClass.getName());
}
-
+
/**
- *
+ *
* Constructs an iterator setting using the given class's SimpleName for the iterator name and configured for the specified scopes with the specified
* parameters.
- *
+ *
* @param priority
* the priority for the iterator (see {@link #setPriority(int)})
* @param iteratorClass
@@ -171,10 +172,10 @@ public class IteratorSetting implements Writable {
public IteratorSetting(int priority, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass, Map<String,String> properties) {
this(priority, iteratorClass.getSimpleName(), iteratorClass.getName(), properties);
}
-
+
/**
* Constructs an iterator setting configured for the scan scope with no parameters.
- *
+ *
* @param priority
* the priority for the iterator (see {@link #setPriority(int)})
* @param name
@@ -185,21 +186,25 @@ public class IteratorSetting implements Writable {
public IteratorSetting(int priority, String name, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass) {
this(priority, name, iteratorClass.getName());
}
-
+
/**
* Constructs an iterator setting using the provided name and the provided class's name for the scan scope with the provided parameters.
- *
- * @param priority The priority for the iterator (see {@link #setPriority(int)})
- * @param name The distinguishing name for the iterator
- * @param iteratorClass The class for the iterator
- * @param properties Any properties for the iterator
- *
+ *
+ * @param priority
+ * The priority for the iterator (see {@link #setPriority(int)})
+ * @param name
+ * The distinguishing name for the iterator
+ * @param iteratorClass
+ * The class for the iterator
+ * @param properties
+ * Any properties for the iterator
+ *
* @since 1.6.0
*/
public IteratorSetting(int priority, String name, Class<? extends SortedKeyValueIterator<Key,Value>> iteratorClass, Map<String,String> properties) {
this(priority, name, iteratorClass.getName(), properties);
}
-
+
/**
* @since 1.5.0
*/
@@ -207,10 +212,10 @@ public class IteratorSetting implements Writable {
this.properties = new HashMap<String,String>();
this.readFields(din);
}
-
+
/**
* Add another option to the iterator.
- *
+ *
* @param option
* the name of the option
* @param value
@@ -221,10 +226,10 @@ public class IteratorSetting implements Writable {
checkArgument(value != null, "value is null");
properties.put(option, value);
}
-
+
/**
* Remove an option from the iterator.
- *
+ *
* @param option
* the name of the option
* @return the value previously associated with the option, or null if no such option existed
@@ -233,10 +238,10 @@ public class IteratorSetting implements Writable {
checkArgument(option != null, "option is null");
return properties.remove(option);
}
-
+
/**
* Add many options to the iterator.
- *
+ *
* @param propertyEntries
* a set of entries to add to the options
*/
@@ -246,10 +251,10 @@ public class IteratorSetting implements Writable {
addOption(keyValue.getKey(), keyValue.getValue());
}
}
-
+
/**
* Add many options to the iterator.
- *
+ *
* @param properties
* a map of entries to add to the options
*/
@@ -257,23 +262,23 @@ public class IteratorSetting implements Writable {
checkArgument(properties != null, "properties is null");
addOptions(properties.entrySet());
}
-
+
/**
* Get the configuration parameters for this iterator.
- *
+ *
* @return the properties
*/
public Map<String,String> getOptions() {
return Collections.unmodifiableMap(properties);
}
-
+
/**
* Remove all options from the iterator.
*/
public void clearOptions() {
properties.clear();
}
-
+
/**
* @see java.lang.Object#hashCode()
*/
@@ -287,7 +292,7 @@ public class IteratorSetting implements Writable {
result = prime * result + ((properties == null) ? 0 : properties.hashCode());
return result;
}
-
+
@Override
public boolean equals(Object obj) {
if (this == obj)
@@ -316,7 +321,7 @@ public class IteratorSetting implements Writable {
return false;
return true;
}
-
+
/**
* @see java.lang.Object#toString()
*/
@@ -333,38 +338,38 @@ public class IteratorSetting implements Writable {
sb.append(properties);
return sb.toString();
}
-
+
/**
* A convenience class for passing column family and column qualifiers to iterator configuration methods.
*/
public static class Column extends Pair<Text,Text> {
-
+
public Column(Text columnFamily, Text columnQualifier) {
super(columnFamily, columnQualifier);
}
-
+
public Column(Text columnFamily) {
super(columnFamily, null);
}
-
+
public Column(String columnFamily, String columnQualifier) {
super(new Text(columnFamily), new Text(columnQualifier));
}
-
+
public Column(String columnFamily) {
super(new Text(columnFamily), null);
}
-
+
public Text getColumnFamily() {
return getFirst();
}
-
+
public Text getColumnQualifier() {
return getSecond();
}
-
+
}
-
+
/**
* @since 1.5.0
*/
@@ -380,7 +385,7 @@ public class IteratorSetting implements Writable {
size--;
}
}
-
+
/**
* @since 1.5.0
*/
http://git-wip-us.apache.org/repos/asf/accumulo/blob/6bc67602/core/src/main/java/org/apache/accumulo/core/client/MultiTableBatchWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/MultiTableBatchWriter.java b/core/src/main/java/org/apache/accumulo/core/client/MultiTableBatchWriter.java
index 39287e8..5495598 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/MultiTableBatchWriter.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/MultiTableBatchWriter.java
@@ -19,13 +19,13 @@ 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 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
@@ -36,28 +36,28 @@ public interface MultiTableBatchWriter {
* @throws TableNotFoundException
* when the table does not exist
*/
- BatchWriter getBatchWriter(String table) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
-
+ BatchWriter getBatchWriter(String table) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
+
/**
* Send mutations for all tables to accumulo.
- *
+ *
* @throws MutationsRejectedException
* when queued mutations are unable to be inserted
*/
void flush() throws MutationsRejectedException;
-
+
/**
* Flush and release all resources.
- *
+ *
* @throws MutationsRejectedException
* when queued mutations are unable to be inserted
- *
+ *
*/
void close() throws MutationsRejectedException;
-
+
/**
* Returns true if this batch writer has been closed.
- *
+ *
* @return true if this batch writer has been closed
*/
boolean isClosed();