You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2014/01/09 00:33:16 UTC
[1/6] git commit: ACCUMULO-2125 - bumping up guava
Updated Branches:
refs/heads/master 7903d0968 -> 0c92a63f9
ACCUMULO-2125 - bumping up guava
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/1a9ae3cc
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/1a9ae3cc
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/1a9ae3cc
Branch: refs/heads/master
Commit: 1a9ae3cccf9e390ed6a6019a38fb3ee30965572a
Parents: 43b3533
Author: John Vines <vi...@apache.org>
Authored: Wed Jan 8 16:51:02 2014 -0500
Committer: John Vines <vi...@apache.org>
Committed: Wed Jan 8 16:51:02 2014 -0500
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/1a9ae3cc/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 87f8ed6..e41b75c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -146,7 +146,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- <version>14.0.1</version>
+ <version>15.0</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
[4/6] ACCUMULO-2160 fixed up a lot of findbugs/pmd complaints
Posted by ec...@apache.org.
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
index dc99d5e..5586d9c 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
@@ -397,14 +397,14 @@ public class TabletServerBatchWriter {
log.trace(String.format("Total bin time : %,10.2f secs %6.2f%s", totalBinTime.get() / 1000.0,
100.0 * totalBinTime.get() / (finishTime - startTime), "%"));
log.trace(String.format("Average bin rate : %,10.2f mutations/sec", totalBinned.get() / (totalBinTime.get() / 1000.0)));
- log.trace(String.format("tservers per batch : %,8.2f avg %,6d min %,6d max", (tabletServersBatchSum / (double) numBatches), minTabletServersBatch,
+ log.trace(String.format("tservers per batch : %,8.2f avg %,6d min %,6d max", tabletServersBatchSum / (double) numBatches, minTabletServersBatch,
maxTabletServersBatch));
- log.trace(String.format("tablets per batch : %,8.2f avg %,6d min %,6d max", (tabletBatchSum / (double) numBatches), minTabletBatch, maxTabletBatch));
+ log.trace(String.format("tablets per batch : %,8.2f avg %,6d min %,6d max", tabletBatchSum / (double) numBatches, minTabletBatch, maxTabletBatch));
log.trace("");
log.trace("SYSTEM STATISTICS");
log.trace(String.format("JVM GC Time : %,10.2f secs", ((finalGCTimes - initialGCTimes) / 1000.0)));
if (compMxBean.isCompilationTimeMonitoringSupported()) {
- log.trace(String.format("JVM Compile Time : %,10.2f secs", ((finalCompileTimes - initialCompileTimes) / 1000.0)));
+ log.trace(String.format("JVM Compile Time : %,10.2f secs", (finalCompileTimes - initialCompileTimes) / 1000.0));
}
log.trace(String.format("System load average : initial=%6.2f final=%6.2f", initialSystemLoad, finalSystemLoad));
}
@@ -506,7 +506,7 @@ public class TabletServerBatchWriter {
somethingFailed = true;
this.serverSideErrors.add(server);
this.notifyAll();
- log.error("Server side error on " + server);
+ log.error("Server side error on " + server + ": " + e);
}
private synchronized void updateUnknownErrors(String msg, Throwable t) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/impl/Translator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/Translator.java b/core/src/main/java/org/apache/accumulo/core/client/impl/Translator.java
index 1f6aa19..cfdd080 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/Translator.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/Translator.java
@@ -51,14 +51,14 @@ public abstract class Translator<IT,OT> {
}
}
- public static class TCVSTranslator extends Translator<TConstraintViolationSummary,org.apache.accumulo.core.data.ConstraintViolationSummary> {
+ public static class TCVSTranslator extends Translator<TConstraintViolationSummary,ConstraintViolationSummary> {
@Override
public ConstraintViolationSummary translate(TConstraintViolationSummary input) {
return new ConstraintViolationSummary(input);
}
}
- public static class CVSTranslator extends Translator<org.apache.accumulo.core.data.ConstraintViolationSummary,TConstraintViolationSummary> {
+ public static class CVSTranslator extends Translator<ConstraintViolationSummary,TConstraintViolationSummary> {
@Override
public TConstraintViolationSummary translate(ConstraintViolationSummary input) {
return input.toThrift();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java b/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
index 4e04cf2..ef7bcab 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
@@ -25,6 +25,7 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Random;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -449,8 +450,9 @@ public abstract class AbstractInputFormat<K,V> implements InputFormat<K,V> {
throw new IOException(e);
}
+
// setup a scanner within the bounds of this split
- for (Pair<Text,Text> c : tableConfig.getFetchedColumns()) {
+ for (Pair<Text,Text> c : columns) {
if (c.getSecond() != null) {
log.debug("Fetching column " + c.getFirst() + ":" + c.getSecond());
scanner.fetchColumn(c.getFirst(), c.getSecond());
@@ -505,6 +507,7 @@ public abstract class AbstractInputFormat<K,V> implements InputFormat<K,V> {
log.setLevel(logLevel);
validateOptions(job);
+ Random random = new Random();
LinkedList<InputSplit> splits = new LinkedList<InputSplit>();
Map<String,InputTableConfig> tableConfigs = getInputTableConfigs(job);
for (Map.Entry<String,InputTableConfig> tableConfigEntry : tableConfigs.entrySet()) {
@@ -546,7 +549,7 @@ public abstract class AbstractInputFormat<K,V> implements InputFormat<K,V> {
binnedRanges = binOfflineTable(job, tableId, ranges);
while (binnedRanges == null) {
// Some tablets were still online, try again
- UtilWaitThread.sleep(100 + (int) (Math.random() * 100)); // sleep randomly between 100 and 200 ms
+ UtilWaitThread.sleep(100 + random.nextInt(100)); // sleep randomly between 100 and 200 ms
binnedRanges = binOfflineTable(job, tableId, ranges);
}
} else {
@@ -564,7 +567,7 @@ public abstract class AbstractInputFormat<K,V> implements InputFormat<K,V> {
}
binnedRanges.clear();
log.warn("Unable to locate bins for specified ranges. Retrying.");
- UtilWaitThread.sleep(100 + (int) (Math.random() * 100)); // sleep randomly between 100 and 200 ms
+ UtilWaitThread.sleep(100 + random.nextInt(100)); // sleep randomly between 100 and 200 ms
tl.invalidateCache();
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
index 35587d4..971dff5 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
@@ -26,6 +26,7 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Random;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -525,7 +526,7 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V> {
Level logLevel = getLogLevel(context);
log.setLevel(logLevel);
validateOptions(context);
-
+ Random random = new Random();
LinkedList<InputSplit> splits = new LinkedList<InputSplit>();
Map<String,InputTableConfig> tableConfigs = getInputTableConfigs(context);
for (Map.Entry<String,InputTableConfig> tableConfigEntry : tableConfigs.entrySet()) {
@@ -568,7 +569,7 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V> {
binnedRanges = binOfflineTable(context, tableId, ranges);
while (binnedRanges == null) {
// Some tablets were still online, try again
- UtilWaitThread.sleep(100 + (int) (Math.random() * 100)); // sleep randomly between 100 and 200 ms
+ UtilWaitThread.sleep(100 + random.nextInt(100)); // sleep randomly between 100 and 200 ms
binnedRanges = binOfflineTable(context, tableId, ranges);
}
@@ -587,7 +588,7 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V> {
}
binnedRanges.clear();
log.warn("Unable to locate bins for specified ranges. Retrying.");
- UtilWaitThread.sleep(100 + (int) (Math.random() * 100)); // sleep randomly between 100 and 200 ms
+ UtilWaitThread.sleep(100 + random.nextInt(100)); // sleep randomly between 100 and 200 ms
tl.invalidateCache();
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplit.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplit.java b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplit.java
index 98b1a32..b238903 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplit.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplit.java
@@ -21,6 +21,7 @@ import java.io.DataOutput;
import java.io.IOException;
import java.math.BigInteger;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
@@ -318,7 +319,7 @@ public class RangeInputSplit extends InputSplit implements Writable {
public String toString() {
StringBuilder sb = new StringBuilder(256);
sb.append("Range: ").append(range);
- sb.append(" Locations: ").append(locations);
+ sb.append(" Locations: ").append(Arrays.asList(locations));
sb.append(" Table: ").append(tableName);
sb.append(" TableID: ").append(tableId);
sb.append(" InstanceName: ").append(instanceName);
@@ -417,7 +418,7 @@ public class RangeInputSplit extends InputSplit implements Writable {
}
public void setLocations(String[] locations) {
- this.locations = locations;
+ this.locations = Arrays.copyOf(locations, locations.length);
}
public Boolean isMockInstance() {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/security/tokens/AuthenticationToken.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/AuthenticationToken.java b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/AuthenticationToken.java
index 8e2af63..99cc721 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/AuthenticationToken.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/AuthenticationToken.java
@@ -126,7 +126,7 @@ public interface AuthenticationToken extends Writable, Destroyable, Cloneable {
}
}
- public class Properties implements Destroyable, Map<String,char[]> {
+ class Properties implements Destroyable, Map<String,char[]> {
private boolean destroyed = false;
private HashMap<String,char[]> map = new HashMap<String,char[]>();
@@ -233,13 +233,13 @@ public interface AuthenticationToken extends Writable, Destroyable, Cloneable {
}
@Override
- public Set<java.util.Map.Entry<String,char[]>> entrySet() {
+ public Set<Map.Entry<String,char[]>> entrySet() {
checkDestroyed();
return map.entrySet();
}
}
- public static class TokenProperty implements Comparable<TokenProperty> {
+ static class TokenProperty implements Comparable<TokenProperty> {
private String key, description;
private boolean masked;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/security/tokens/NullToken.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/NullToken.java b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/NullToken.java
index 8673963..474b4a1 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/NullToken.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/NullToken.java
@@ -31,17 +31,14 @@ public class NullToken implements AuthenticationToken {
@Override
public void readFields(DataInput arg0) throws IOException {
- return;
}
@Override
public void write(DataOutput arg0) throws IOException {
- return;
}
@Override
public void destroy() throws DestroyFailedException {
- return;
}
@Override
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/security/tokens/PasswordToken.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/PasswordToken.java b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/PasswordToken.java
index 11bbf49..1474435 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/PasswordToken.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/PasswordToken.java
@@ -40,7 +40,7 @@ public class PasswordToken implements AuthenticationToken {
private byte[] password = null;
public byte[] getPassword() {
- return password;
+ return Arrays.copyOf(password, password.length);
}
/**
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java b/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
index 8685d43..6d20cb0 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
@@ -32,7 +32,7 @@ import org.apache.log4j.Logger;
public abstract class AccumuloConfiguration implements Iterable<Entry<String,String>> {
- public static interface PropertyFilter {
+ public interface PropertyFilter {
boolean accept(String key);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/conf/ConfigSanityCheck.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/ConfigSanityCheck.java b/core/src/main/java/org/apache/accumulo/core/conf/ConfigSanityCheck.java
index 6724670..f9781f4 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/ConfigSanityCheck.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/ConfigSanityCheck.java
@@ -43,7 +43,7 @@ public class ConfigSanityCheck {
checkTimeDuration(acuconf, Property.INSTANCE_ZK_TIMEOUT, new CheckTimeDurationBetween(1000, 300000));
}
- private static interface CheckTimeDuration {
+ private interface CheckTimeDuration {
boolean check(long propVal);
String getDescription(Property prop);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java b/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java
index 688b186..16f22e4 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java
@@ -17,6 +17,7 @@
package org.apache.accumulo.core.conf;
import java.util.regex.Pattern;
+import java.util.Arrays;
import org.apache.accumulo.core.Constants;
import org.apache.hadoop.fs.Path;
@@ -49,9 +50,9 @@ public enum PropertyType {
"A floating point number that represents either a fraction or, if suffixed with the '%' character, a percentage.<br />"
+ "Examples of valid fractions/percentages are '10', '1000%', '0.05', '5%', '0.2%', '0.0005'.<br />"
+ "Examples of invalid fractions/percentages are '', '10 percent', 'Hulk Hogan'"),
-
+
PATH("path", ".*",
- "A string that represents a filesystem path, which can be either relative or absolute to some directory. The filesystem depends on the property. The following environment variables will be substituted: " + Constants.PATH_PROPERTY_ENV_VARS),
+ "A string that represents a filesystem path, which can be either relative or absolute to some directory. The filesystem depends on the property. The following environment variables will be substituted: " + Arrays.asList(Constants.PATH_PROPERTY_ENV_VARS)),
ABSOLUTEPATH("absolute path", null,
"An absolute filesystem path. The filesystem depends on the property. This is the same as path, but enforces that its root is explicitly specified.") {
@Override
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/constraints/Constraint.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/constraints/Constraint.java b/core/src/main/java/org/apache/accumulo/core/constraints/Constraint.java
index 89b2dc8..1ddc892 100644
--- a/core/src/main/java/org/apache/accumulo/core/constraints/Constraint.java
+++ b/core/src/main/java/org/apache/accumulo/core/constraints/Constraint.java
@@ -42,7 +42,7 @@ import org.apache.accumulo.core.security.Authorizations;
public interface Constraint {
- public interface Environment {
+ interface Environment {
KeyExtent getExtent();
String getUser();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/data/ColumnUpdate.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/data/ColumnUpdate.java b/core/src/main/java/org/apache/accumulo/core/data/ColumnUpdate.java
index 641ca3a..38589af 100644
--- a/core/src/main/java/org/apache/accumulo/core/data/ColumnUpdate.java
+++ b/core/src/main/java/org/apache/accumulo/core/data/ColumnUpdate.java
@@ -77,8 +77,8 @@ public class ColumnUpdate {
@Override
public String toString() {
- return new String(Arrays.toString(columnFamily)) + ":" + new String(Arrays.toString(columnQualifier)) + " ["
- + new String(Arrays.toString(columnVisibility)) + "] " + (hasTimestamp ? timestamp : "NO_TIME_STAMP") + " " + Arrays.toString(val) + " " + deleted;
+ return Arrays.toString(columnFamily) + ":" + Arrays.toString(columnQualifier) + " ["
+ + Arrays.toString(columnVisibility) + "] " + (hasTimestamp ? timestamp : "NO_TIME_STAMP") + " " + Arrays.toString(val) + " " + deleted;
}
@Override
@@ -94,7 +94,7 @@ public class ColumnUpdate {
@Override
public int hashCode() {
return Arrays.hashCode(columnFamily) + Arrays.hashCode(columnQualifier) + Arrays.hashCode(columnVisibility)
- + (hasTimestamp ? (Boolean.TRUE.hashCode() + new Long(timestamp).hashCode()) : Boolean.FALSE.hashCode())
+ + (hasTimestamp ? (Boolean.TRUE.hashCode() + Long.valueOf(timestamp).hashCode()) : Boolean.FALSE.hashCode())
+ (deleted ? Boolean.TRUE.hashCode() : (Boolean.FALSE.hashCode() + Arrays.hashCode(val)));
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/data/Condition.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/data/Condition.java b/core/src/main/java/org/apache/accumulo/core/data/Condition.java
index fc8f2bf..c80dcd6 100644
--- a/core/src/main/java/org/apache/accumulo/core/data/Condition.java
+++ b/core/src/main/java/org/apache/accumulo/core/data/Condition.java
@@ -205,7 +205,7 @@ public class Condition {
if (o == this) {
return true;
}
- if (o == null || o.getClass() != Condition.class) {
+ if (o == null || !(o instanceof Condition)) {
return false;
}
Condition c = (Condition) o;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/data/ConditionalMutation.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/data/ConditionalMutation.java b/core/src/main/java/org/apache/accumulo/core/data/ConditionalMutation.java
index da72493..c1206e5 100644
--- a/core/src/main/java/org/apache/accumulo/core/data/ConditionalMutation.java
+++ b/core/src/main/java/org/apache/accumulo/core/data/ConditionalMutation.java
@@ -84,7 +84,7 @@ public class ConditionalMutation extends Mutation {
if (o == this) {
return true;
}
- if (o == null || o.getClass() != ConditionalMutation.class) {
+ if (o == null || !(o instanceof ConditionalMutation)) {
return false;
}
ConditionalMutation cm = (ConditionalMutation) o;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/data/KeyExtent.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/data/KeyExtent.java b/core/src/main/java/org/apache/accumulo/core/data/KeyExtent.java
index 9dc8db5..dda78fb 100644
--- a/core/src/main/java/org/apache/accumulo/core/data/KeyExtent.java
+++ b/core/src/main/java/org/apache/accumulo/core/data/KeyExtent.java
@@ -357,7 +357,7 @@ public class KeyExtent implements WritableComparable<KeyExtent> {
}
} else {
// no null prevend or endrows and no empty string start or end rows
- if ((ckes.getPrevEndRow().compareTo(endRow) < 0 && ckes.getEndRow().compareTo(startRow) >= 0)) {
+ if (ckes.getPrevEndRow().compareTo(endRow) < 0 && ckes.getEndRow().compareTo(startRow) >= 0) {
keys.add(ckes);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/data/Range.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/data/Range.java b/core/src/main/java/org/apache/accumulo/core/data/Range.java
index 65873c3..26faea8 100644
--- a/core/src/main/java/org/apache/accumulo/core/data/Range.java
+++ b/core/src/main/java/org/apache/accumulo/core/data/Range.java
@@ -408,7 +408,7 @@ public class Range implements WritableComparable<Range> {
boolean startKeysEqual;
if (range.infiniteStartKey) {
// previous start key must be infinite because it is sorted
- assert (currentRange.infiniteStartKey);
+ assert currentRange.infiniteStartKey;
startKeysEqual = true;
} else if (currentRange.infiniteStartKey) {
startKeysEqual = false;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/FileSKVIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/FileSKVIterator.java b/core/src/main/java/org/apache/accumulo/core/file/FileSKVIterator.java
index b5674bf..2de5cfc 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/FileSKVIterator.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/FileSKVIterator.java
@@ -23,13 +23,13 @@ import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.iterators.system.InterruptibleIterator;
public interface FileSKVIterator extends InterruptibleIterator {
- public Key getFirstKey() throws IOException;
+ Key getFirstKey() throws IOException;
- public Key getLastKey() throws IOException;
+ Key getLastKey() throws IOException;
- public DataInputStream getMetaStore(String name) throws IOException, NoSuchMetaStoreException;
+ DataInputStream getMetaStore(String name) throws IOException, NoSuchMetaStoreException;
- public void closeDeepCopies() throws IOException;
+ void closeDeepCopies() throws IOException;
- public void close() throws IOException;
+ void close() throws IOException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java b/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java
index 33e1835..b06a9bf 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java
@@ -26,6 +26,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.Random;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
@@ -74,10 +75,10 @@ public class FileUtil {
private static String createTmpDir(AccumuloConfiguration acuConf, FileSystem fs) throws IOException {
String accumuloDir = acuConf.get(Property.INSTANCE_DFS_DIR);
-
+ Random random = new Random();
String tmpDir = null;
while (tmpDir == null) {
- tmpDir = accumuloDir + "/tmp/idxReduce_" + String.format("%09d", (int) (Math.random() * Integer.MAX_VALUE));
+ tmpDir = accumuloDir + "/tmp/idxReduce_" + String.format("%09d", random.nextInt(Integer.MAX_VALUE));
try {
fs.getFileStatus(new Path(tmpDir));
@@ -338,7 +339,7 @@ public class FileUtil {
long t2 = System.currentTimeMillis();
- log.debug(String.format("Found midPoint from indexes in %6.2f secs.%n", ((t2 - t1) / 1000.0)));
+ log.debug(String.format("Found midPoint from indexes in %6.2f secs.%n", (t2 - t1) / 1000.0));
ret.put(.5, mmfi.getTopKey());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockReader.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockReader.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockReader.java
index af95060..592d325 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockReader.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockReader.java
@@ -28,26 +28,26 @@ import java.io.IOException;
public interface ABlockReader extends DataInput {
- public long getRawSize();
+ long getRawSize();
- public DataInputStream getStream() throws IOException;
+ DataInputStream getStream() throws IOException;
- public void close() throws IOException;
+ void close() throws IOException;
/**
* An indexable block supports seeking, getting a position, and associating an arbitrary index with the block
*
* @return true, if the block is indexable; otherwise false.
*/
- public boolean isIndexable();
+ boolean isIndexable();
- public void seek(int position);
+ void seek(int position);
/** Get the file position.
* @return the file position.
*/
- public int getPosition();
+ int getPosition();
<T> T getIndex(Class<T> clazz);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockWriter.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockWriter.java
index 1ab4668..19b6f0c 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockWriter.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/ABlockWriter.java
@@ -28,14 +28,14 @@ import java.io.IOException;
public interface ABlockWriter extends DataOutput {
- public long getCompressedSize() throws IOException;
+ long getCompressedSize() throws IOException;
- public void close() throws IOException;
+ void close() throws IOException;
- public long getRawSize() throws IOException;
+ long getRawSize() throws IOException;
- public long getStartPos() throws IOException;
+ long getStartPos() throws IOException;
- public DataOutputStream getStream() throws IOException;
+ DataOutputStream getStream() throws IOException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/blockfile/BlockFileReader.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/BlockFileReader.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/BlockFileReader.java
index c5a1d5e..2c918aa 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/BlockFileReader.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/BlockFileReader.java
@@ -28,14 +28,14 @@ import java.io.IOException;
public interface BlockFileReader {
- public ABlockReader getMetaBlock(String name) throws IOException;
+ ABlockReader getMetaBlock(String name) throws IOException;
- public ABlockReader getDataBlock(int blockIndex) throws IOException;
+ ABlockReader getDataBlock(int blockIndex) throws IOException;
- public void close() throws IOException;
+ void close() throws IOException;
- public ABlockReader getMetaBlock(long offset, long compressedSize, long rawSize) throws IOException;
+ ABlockReader getMetaBlock(long offset, long compressedSize, long rawSize) throws IOException;
- public ABlockReader getDataBlock(long offset, long compressedSize, long rawSize) throws IOException;
+ ABlockReader getDataBlock(long offset, long compressedSize, long rawSize) throws IOException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/blockfile/BlockFileWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/BlockFileWriter.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/BlockFileWriter.java
index 56c1797..cf86006 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/BlockFileWriter.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/BlockFileWriter.java
@@ -28,11 +28,11 @@ import java.io.IOException;
public interface BlockFileWriter {
- public ABlockWriter prepareMetaBlock(String name, String compressionName) throws IOException;
+ ABlockWriter prepareMetaBlock(String name, String compressionName) throws IOException;
- public ABlockWriter prepareMetaBlock(String name) throws IOException;
+ ABlockWriter prepareMetaBlock(String name) throws IOException;
- public ABlockWriter prepareDataBlock() throws IOException;
+ ABlockWriter prepareDataBlock() throws IOException;
- public void close() throws IOException;
+ void close() throws IOException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCache.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCache.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCache.java
index adbc586..8673385 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCache.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/BlockCache.java
@@ -33,7 +33,7 @@ public interface BlockCache {
* @param inMemory
* Whether block should be treated as in-memory
*/
- public CacheEntry cacheBlock(String blockName, byte buf[], boolean inMemory);
+ CacheEntry cacheBlock(String blockName, byte buf[], boolean inMemory);
/**
* Add block to cache (defaults to not in-memory).
@@ -43,7 +43,7 @@ public interface BlockCache {
* @param buf
* The block contents wrapped in a ByteBuffer.
*/
- public CacheEntry cacheBlock(String blockName, byte buf[]);
+ CacheEntry cacheBlock(String blockName, byte buf[]);
/**
* Fetch block from cache.
@@ -52,17 +52,17 @@ public interface BlockCache {
* Block number to fetch.
* @return Block or null if block is not in the cache.
*/
- public CacheEntry getBlock(String blockName);
+ CacheEntry getBlock(String blockName);
/**
* Shutdown the cache.
*/
- public void shutdown();
+ void shutdown();
/**
* Get the maximum size of this cache.
*
* @return max size in bytes
*/
- public long getMaxSize();
+ long getMaxSize();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CacheEntry.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CacheEntry.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CacheEntry.java
index 609e374..0e628d3 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CacheEntry.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CacheEntry.java
@@ -19,8 +19,8 @@ package org.apache.accumulo.core.file.blockfile.cache;
public interface CacheEntry {
byte[] getBuffer();
- public Object getIndex();
+ Object getIndex();
- public void setIndex(Object idx);
+ void setIndex(Object idx);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/HeapSize.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/HeapSize.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/HeapSize.java
index 0aa7e06..ca2402e 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/HeapSize.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/HeapSize.java
@@ -40,6 +40,6 @@ public interface HeapSize {
/**
* @return Approximate 'exclusive deep size' of implementing object. Includes count of payload and hosting object sizings.
*/
- public long heapSize();
+ long heapSize();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
index 007e8a0..83f363e 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
@@ -436,11 +436,19 @@ public class LruBlockCache implements BlockCache, HeapSize {
return totalSize;
}
+ @Override
public int compareTo(BlockBucket that) {
if (this.overflow() == that.overflow())
return 0;
return this.overflow() > that.overflow() ? 1 : -1;
}
+
+ @Override
+ public boolean equals(Object that) {
+ if (that instanceof BlockBucket)
+ return compareTo((BlockBucket)that) == 0;
+ return false;
+ }
}
/**
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/ColumnFamilyFunctor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/ColumnFamilyFunctor.java b/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/ColumnFamilyFunctor.java
index 244bd49..e200b44 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/ColumnFamilyFunctor.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/ColumnFamilyFunctor.java
@@ -26,7 +26,7 @@ public class ColumnFamilyFunctor implements KeyFunctor {
public static final PartialKey kDepth = PartialKey.ROW_COLFAM;
@Override
- public org.apache.hadoop.util.bloom.Key transform(org.apache.accumulo.core.data.Key acuKey) {
+ public Key transform(org.apache.accumulo.core.data.Key acuKey) {
byte keyData[];
@@ -36,7 +36,7 @@ public class ColumnFamilyFunctor implements KeyFunctor {
System.arraycopy(row.getBackingArray(), row.offset(), keyData, 0, row.length());
System.arraycopy(cf.getBackingArray(), cf.offset(), keyData, row.length(), cf.length());
- return new org.apache.hadoop.util.bloom.Key(keyData, 1.0);
+ return new Key(keyData, 1.0);
}
@Override
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/KeyFunctor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/KeyFunctor.java b/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/KeyFunctor.java
index c5a0e59..69902a4 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/KeyFunctor.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/KeyFunctor.java
@@ -24,7 +24,7 @@ public interface KeyFunctor {
* Implementations should return null if a range can not be converted to a bloom key.
*
*/
- public org.apache.hadoop.util.bloom.Key transform(Range range);
+ org.apache.hadoop.util.bloom.Key transform(Range range);
- public org.apache.hadoop.util.bloom.Key transform(Key key);
+ org.apache.hadoop.util.bloom.Key transform(Key key);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/RowFunctor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/RowFunctor.java b/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/RowFunctor.java
index 06597a3..20eb26c 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/RowFunctor.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/RowFunctor.java
@@ -24,14 +24,14 @@ import org.apache.hadoop.util.bloom.Key;
public class RowFunctor implements KeyFunctor {
@Override
- public org.apache.hadoop.util.bloom.Key transform(org.apache.accumulo.core.data.Key acuKey) {
+ public Key transform(org.apache.accumulo.core.data.Key acuKey) {
byte keyData[];
ByteSequence row = acuKey.getRowData();
keyData = new byte[row.length()];
System.arraycopy(row.getBackingArray(), 0, keyData, 0, row.length());
- return new org.apache.hadoop.util.bloom.Key(keyData, 1.0);
+ return new Key(keyData, 1.0);
}
@Override
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/rfile/BlockIndex.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/BlockIndex.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/BlockIndex.java
index 2b3cdf5..e8829f9 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/BlockIndex.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/BlockIndex.java
@@ -86,6 +86,13 @@ public class BlockIndex {
}
@Override
+ public boolean equals(Object o) {
+ if (o instanceof BlockIndexEntry)
+ return compareTo((BlockIndexEntry) o) == 0;
+ return false;
+ }
+
+ @Override
public String toString() {
return prevKey + " " + entriesLeft + " " + pos;
}
@@ -93,6 +100,12 @@ public class BlockIndex {
public Key getPrevKey() {
return prevKey;
}
+
+ @Override
+ public int hashCode() {
+ assert false : "hashCode not designed";
+ return 42; // any arbitrary constant will do
+ }
}
public BlockIndexEntry seekBlock(Key startKey, ABlockReader cacheBlock) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/rfile/MultiLevelIndex.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/MultiLevelIndex.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/MultiLevelIndex.java
index 15918ec..632968e 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/MultiLevelIndex.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/MultiLevelIndex.java
@@ -114,6 +114,19 @@ public class MultiLevelIndex {
public int compareTo(IndexEntry o) {
return key.compareTo(o.key);
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (o instanceof IndexEntry)
+ return compareTo((IndexEntry)o) == 0;
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ assert false : "hashCode not designed";
+ return 42; // any arbitrary constant will do
+ }
}
// a list that deserializes index entries on demand
@@ -585,7 +598,7 @@ public class MultiLevelIndex {
}
}
- public class IndexIterator implements ListIterator<IndexEntry> {
+ static public class IndexIterator implements ListIterator<IndexEntry> {
private Node node;
private ListIterator<IndexEntry> liter;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
index d6a2532..da5a3ea 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
@@ -260,7 +260,7 @@ public class RFile {
out.println("\tFirst key : " + firstKey);
Key lastKey = null;
- if (indexReader != null && indexReader.size() > 0) {
+ if (indexReader.size() > 0) {
lastKey = indexReader.getLastKey();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java
index f91ac59..6083a62 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java
@@ -106,7 +106,7 @@ public final class BCFile {
/**
* Call-back interface to register a block after a block is closed.
*/
- private static interface BlockRegister {
+ private interface BlockRegister {
/**
* Register a block that is fully closed.
*
@@ -117,7 +117,7 @@ public final class BCFile {
* @param offsetEnd
* One byte after the end of the block. Compressed block size is offsetEnd - offsetStart.
*/
- public void register(long raw, long offsetStart, long offsetEnd);
+ void register(long raw, long offsetStart, long offsetEnd);
}
/**
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/CompareUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/CompareUtils.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/CompareUtils.java
index 9dba4b1..4642fc1 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/CompareUtils.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/CompareUtils.java
@@ -52,7 +52,7 @@ class CompareUtils {
/**
* Interface for all objects that has a single integer magnitude.
*/
- static interface Scalar {
+ interface Scalar {
long magnitude();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/RawComparable.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/RawComparable.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/RawComparable.java
index e45a950..48c0bfe 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/RawComparable.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/RawComparable.java
@@ -35,19 +35,19 @@ public interface RawComparable {
*
* @return The underlying byte array.
*/
- abstract byte[] buffer();
+ byte[] buffer();
/**
* Get the offset of the first byte in the byte array.
*
* @return The offset of the first byte in the byte array.
*/
- abstract int offset();
+ int offset();
/**
* Get the size of the byte range in the byte array.
*
* @return The size of the byte range in the byte array.
*/
- abstract int size();
+ int size();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/iterators/OptionDescriber.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/OptionDescriber.java b/core/src/main/java/org/apache/accumulo/core/iterators/OptionDescriber.java
index 209d3d9..6069a39 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/OptionDescriber.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/OptionDescriber.java
@@ -31,7 +31,7 @@ import java.util.Map;
*
*/
public interface OptionDescriber {
- public static class IteratorOptions {
+ public class IteratorOptions {
public LinkedHashMap<String,String> namedOptions;
public ArrayList<String> unnamedOptionDescriptions;
public String name;
@@ -115,7 +115,7 @@ public interface OptionDescriber {
*
* @return an iterator options object
*/
- public IteratorOptions describeOptions();
+ IteratorOptions describeOptions();
/**
* Check to see if an options map contains all options required by an iterator and that the option values are in the expected formats.
@@ -126,5 +126,5 @@ public interface OptionDescriber {
* @exception IllegalArgumentException
* if there are problems with the options
*/
- public boolean validateOptions(Map<String,String> options);
+ boolean validateOptions(Map<String,String> options);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/iterators/TypedValueCombiner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/TypedValueCombiner.java b/core/src/main/java/org/apache/accumulo/core/iterators/TypedValueCombiner.java
index 54a1333..00fa89a 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/TypedValueCombiner.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/TypedValueCombiner.java
@@ -107,10 +107,10 @@ public abstract class TypedValueCombiner<V> extends Combiner {
/**
* An interface for translating from byte[] to V and back.
*/
- public static interface Encoder<V> {
- public byte[] encode(V v);
+ public interface Encoder<V> {
+ byte[] encode(V v);
- public V decode(byte[] b) throws ValueFormatException;
+ V decode(byte[] b) throws ValueFormatException;
}
/**
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/iterators/system/InterruptibleIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/system/InterruptibleIterator.java b/core/src/main/java/org/apache/accumulo/core/iterators/system/InterruptibleIterator.java
index 08a86b2..a9a871d 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/system/InterruptibleIterator.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/system/InterruptibleIterator.java
@@ -23,5 +23,5 @@ import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
public interface InterruptibleIterator extends SortedKeyValueIterator<Key,Value> {
- public void setInterruptFlag(AtomicBoolean flag);
+ void setInterruptFlag(AtomicBoolean flag);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java b/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java
index 54c9597..6e9a571 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java
@@ -51,8 +51,6 @@ public class AgeOffFilter extends Filter {
@Override
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
- super.init(source, options, env);
- threshold = -1;
if (options == null)
throw new IllegalArgumentException(TTL + " must be set for AgeOffFilter");
@@ -60,6 +58,8 @@ public class AgeOffFilter extends Filter {
if (ttl == null)
throw new IllegalArgumentException(TTL + " must be set for AgeOffFilter");
+ super.init(source, options, env);
+ threshold = -1;
threshold = Long.parseLong(ttl);
String time = options.get(CURRENT_TIME);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java b/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java
index 1134529..8747aa6 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java
@@ -69,11 +69,11 @@ public class TimestampFilter extends Filter {
@Override
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
- super.init(source, options, env);
-
if (options == null)
throw new IllegalArgumentException("start and/or end must be set for " + TimestampFilter.class.getName());
+ super.init(source, options, env);
+
hasStart = false;
hasEnd = false;
startInclusive = true;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/iterators/user/TransformingIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/user/TransformingIterator.java b/core/src/main/java/org/apache/accumulo/core/iterators/user/TransformingIterator.java
index f439437..f851eac 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/user/TransformingIterator.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/user/TransformingIterator.java
@@ -627,7 +627,7 @@ abstract public class TransformingIterator extends WrappingIterator implements O
*/
abstract protected PartialKey getKeyPrefix();
- public static interface KVBuffer {
+ public interface KVBuffer {
void append(Key key, Value val);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/iterators/user/VisibilityFilter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/user/VisibilityFilter.java b/core/src/main/java/org/apache/accumulo/core/iterators/user/VisibilityFilter.java
index 4e8aa95..6a5db49 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/user/VisibilityFilter.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/user/VisibilityFilter.java
@@ -97,12 +97,6 @@ public class VisibilityFilter extends org.apache.accumulo.core.iterators.system.
return io;
}
- @Override
- public boolean validateOptions(Map<String,String> options) {
- // All local options are valid; only check super options
- return super.validateOptions(options);
- }
-
public static void setAuthorizations(IteratorSetting setting, Authorizations auths) {
setting.addOption(AUTHS, auths.serialize());
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/security/AuthorizationContainer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/security/AuthorizationContainer.java b/core/src/main/java/org/apache/accumulo/core/security/AuthorizationContainer.java
index 382e20b..029b622 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/AuthorizationContainer.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/AuthorizationContainer.java
@@ -28,5 +28,5 @@ public interface AuthorizationContainer {
* @param auth authorization, as a string encoded in UTF-8
* @return true if authorization is in this collection
*/
- public boolean contains(ByteSequence auth);
+ boolean contains(ByteSequence auth);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java b/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
index 6047352..8350e2e 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
@@ -274,7 +274,7 @@ public class Authorizations implements Iterable<byte[]>, Serializable, Authoriza
* @return true if authorization is in this collection
*/
public boolean contains(String auth) {
- return auths.contains(auth.getBytes(Constants.UTF8));
+ return auths.contains(new ArrayByteSequence(auth));
}
@Override
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/security/crypto/CryptoModule.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/security/crypto/CryptoModule.java b/core/src/main/java/org/apache/accumulo/core/security/crypto/CryptoModule.java
index 01f7888..783709a 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/crypto/CryptoModule.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/crypto/CryptoModule.java
@@ -50,7 +50,7 @@ public interface CryptoModule {
* That stream may be exactly the same stream as {@link CryptoModuleParameters#getPlaintextInputStream()} if the params object specifies no cryptography.
* @throws IOException
*/
- public CryptoModuleParameters getEncryptingOutputStream(CryptoModuleParameters params) throws IOException;
+ CryptoModuleParameters getEncryptingOutputStream(CryptoModuleParameters params) throws IOException;
@@ -72,7 +72,7 @@ public interface CryptoModule {
* That stream may be exactly the same stream as {@link CryptoModuleParameters#getEncryptedInputStream()} if the params object specifies no cryptography.
* @throws IOException
*/
- public CryptoModuleParameters getDecryptingInputStream(CryptoModuleParameters params) throws IOException;
+ CryptoModuleParameters getDecryptingInputStream(CryptoModuleParameters params) throws IOException;
/**
@@ -83,7 +83,7 @@ public interface CryptoModule {
* @param params a {@link CryptoModuleParameters} object contained a correctly instantiated set of properties.
* @return the same {@link CryptoModuleParameters} object with the plaintext key set
*/
- public CryptoModuleParameters generateNewRandomSessionKey(CryptoModuleParameters params);
+ CryptoModuleParameters generateNewRandomSessionKey(CryptoModuleParameters params);
/**
* Generates a {@link Cipher} object based on the parameters in the given {@link CryptoModuleParameters} object and places it into the
@@ -93,6 +93,6 @@ public interface CryptoModule {
* @param params a {@link CryptoModuleParameters} object contained a correctly instantiated set of properties.
* @return the same {@link CryptoModuleParameters} object with the cipher set.
*/
- public CryptoModuleParameters initializeCipher(CryptoModuleParameters params);
+ CryptoModuleParameters initializeCipher(CryptoModuleParameters params);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/security/crypto/SecretKeyEncryptionStrategy.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/security/crypto/SecretKeyEncryptionStrategy.java b/core/src/main/java/org/apache/accumulo/core/security/crypto/SecretKeyEncryptionStrategy.java
index 637ed4b..0cd9bd0 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/crypto/SecretKeyEncryptionStrategy.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/crypto/SecretKeyEncryptionStrategy.java
@@ -21,8 +21,8 @@ package org.apache.accumulo.core.security.crypto;
*/
public interface SecretKeyEncryptionStrategy {
- public CryptoModuleParameters encryptSecretKey(CryptoModuleParameters params);
- public CryptoModuleParameters decryptSecretKey(CryptoModuleParameters params);
+ CryptoModuleParameters encryptSecretKey(CryptoModuleParameters params);
+ CryptoModuleParameters decryptSecretKey(CryptoModuleParameters params);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/security/crypto/SecretKeyEncryptionStrategyContext.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/security/crypto/SecretKeyEncryptionStrategyContext.java b/core/src/main/java/org/apache/accumulo/core/security/crypto/SecretKeyEncryptionStrategyContext.java
index d46d459..dfe948d 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/crypto/SecretKeyEncryptionStrategyContext.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/crypto/SecretKeyEncryptionStrategyContext.java
@@ -20,12 +20,12 @@ package org.apache.accumulo.core.security.crypto;
import java.util.Map;
public interface SecretKeyEncryptionStrategyContext {
- public String getOpaqueKeyEncryptionKeyID();
- public void setOpaqueKeyEncryptionKeyID(String id);
- public byte[] getPlaintextSecretKey();
- public void setPlaintextSecretKey(byte[] key);
- public byte[] getEncryptedSecretKey();
- public void setEncryptedSecretKey(byte[] key);
- public Map<String, String> getContext();
- public void setContext(Map<String, String> context);
+ String getOpaqueKeyEncryptionKeyID();
+ void setOpaqueKeyEncryptionKeyID(String id);
+ byte[] getPlaintextSecretKey();
+ void setPlaintextSecretKey(byte[] key);
+ byte[] getEncryptedSecretKey();
+ void setEncryptedSecretKey(byte[] key);
+ Map<String, String> getContext();
+ void setContext(Map<String, String> context);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/trace/SpanTree.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/trace/SpanTree.java b/core/src/main/java/org/apache/accumulo/core/trace/SpanTree.java
index 2a5d72e..772a133 100644
--- a/core/src/main/java/org/apache/accumulo/core/trace/SpanTree.java
+++ b/core/src/main/java/org/apache/accumulo/core/trace/SpanTree.java
@@ -42,7 +42,7 @@ public class SpanTree {
public Set<Long> visit(SpanTreeVisitor visitor) {
Set<Long> visited = new HashSet<Long>();
- List<Long> root = parentChildren.get(new Long(Span.ROOT_SPAN_ID));
+ List<Long> root = parentChildren.get(Long.valueOf(Span.ROOT_SPAN_ID));
if (root == null || root.isEmpty())
return visited;
RemoteSpan rootSpan = nodes.get(root.iterator().next());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/util/CreateToken.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/CreateToken.java b/core/src/main/java/org/apache/accumulo/core/util/CreateToken.java
index 083720b..cc6762a 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/CreateToken.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/CreateToken.java
@@ -113,6 +113,5 @@ public class CreateToken {
} catch (Exception e) {
throw new RuntimeException(e);
}
- return;
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/util/format/Formatter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/format/Formatter.java b/core/src/main/java/org/apache/accumulo/core/util/format/Formatter.java
index 0c1fc5f..497cc74 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/format/Formatter.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/format/Formatter.java
@@ -23,5 +23,5 @@ import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
public interface Formatter extends Iterator<String> {
- public void initialize(Iterable<Entry<Key,Value>> scanner, boolean printTimestamps);
+ void initialize(Iterable<Entry<Key,Value>> scanner, boolean printTimestamps);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/util/interpret/ScanInterpreter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/interpret/ScanInterpreter.java b/core/src/main/java/org/apache/accumulo/core/util/interpret/ScanInterpreter.java
index ca43487..315767e 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/interpret/ScanInterpreter.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/interpret/ScanInterpreter.java
@@ -23,13 +23,13 @@ import org.apache.hadoop.io.Text;
*/
public interface ScanInterpreter {
- public Text interpretRow(Text row);
+ Text interpretRow(Text row);
- public Text interpretBeginRow(Text row);
+ Text interpretBeginRow(Text row);
- public Text interpretEndRow(Text row);
+ Text interpretEndRow(Text row);
- public Text interpretColumnFamily(Text cf);
+ Text interpretColumnFamily(Text cf);
- public Text interpretColumnQualifier(Text cq);
+ Text interpretColumnQualifier(Text cq);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java b/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
index 837b4b8..0c4d731 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
@@ -877,9 +877,8 @@ public class Shell extends ShellOptions {
}
public interface PrintLine {
- public void print(String s);
-
- public void close();
+ void print(String s);
+ void close();
}
public static class PrintShell implements PrintLine {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java b/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java
index 7f20286..c2b40c4 100644
--- a/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java
+++ b/core/src/test/java/org/apache/accumulo/core/cli/TestClientOpts.java
@@ -43,9 +43,9 @@ public class TestClientOpts {
assertEquals(System.getProperty("user.name"), args.principal);
assertNull(args.securePassword);
assertNull(args.getToken());
- assertEquals(new Long(cfg.getMaxLatency(TimeUnit.MILLISECONDS)), bwOpts.batchLatency);
- assertEquals(new Long(cfg.getTimeout(TimeUnit.MILLISECONDS)), bwOpts.batchTimeout);
- assertEquals(new Long(cfg.getMaxMemory()), bwOpts.batchMemory);
+ assertEquals(Long.valueOf(cfg.getMaxLatency(TimeUnit.MILLISECONDS)), bwOpts.batchLatency);
+ assertEquals(Long.valueOf(cfg.getTimeout(TimeUnit.MILLISECONDS)), bwOpts.batchTimeout);
+ assertEquals(Long.valueOf(cfg.getMaxMemory()), bwOpts.batchMemory);
assertFalse(args.debug);
assertFalse(args.trace);
assertEquals(10, bsOpts.scanThreads.intValue());
@@ -63,9 +63,9 @@ public class TestClientOpts {
assertEquals("bar", args.principal);
assertNull(args.securePassword);
assertEquals(new PasswordToken("foo"), args.getToken());
- assertEquals(new Long(3000), bwOpts.batchLatency);
- assertEquals(new Long(2000), bwOpts.batchTimeout);
- assertEquals(new Long(1024 * 1024), bwOpts.batchMemory);
+ assertEquals(Long.valueOf(3000), bwOpts.batchLatency);
+ assertEquals(Long.valueOf(2000), bwOpts.batchTimeout);
+ assertEquals(Long.valueOf(1024 * 1024), bwOpts.batchMemory);
assertTrue(args.debug);
assertTrue(args.trace);
assertEquals(7, bsOpts.scanThreads.intValue());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/test/java/org/apache/accumulo/core/client/IteratorSettingTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/IteratorSettingTest.java b/core/src/test/java/org/apache/accumulo/core/client/IteratorSettingTest.java
index 39d7512..72342f9 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/IteratorSettingTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/IteratorSettingTest.java
@@ -36,7 +36,7 @@ public class IteratorSettingTest {
IteratorSetting setting2 = new IteratorSetting(500, "combiner", Combiner.class.getName());
IteratorSetting setting3 = new IteratorSetting(500, "combiner", Combiner.class.getName());
IteratorSetting devnull = new IteratorSetting(500, "devNull", DevNull.class.getName());
- IteratorSetting nullsetting = null;
+ final IteratorSetting nullsetting = null;
IteratorSetting setting4 = new IteratorSetting(300, "combiner", Combiner.class.getName());
IteratorSetting setting5 = new IteratorSetting(500, "foocombiner", Combiner.class.getName());
IteratorSetting setting6 = new IteratorSetting(500, "combiner", "MySuperCombiner");
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/TestLruBlockCache.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/TestLruBlockCache.java b/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/TestLruBlockCache.java
index bc515cb..8d6a61a 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/TestLruBlockCache.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/TestLruBlockCache.java
@@ -19,6 +19,7 @@
*/
package org.apache.accumulo.core.file.blockfile.cache;
+import java.util.Arrays;
import java.util.Random;
import junit.framework.TestCase;
@@ -138,7 +139,7 @@ public class TestLruBlockCache extends TestCase {
assertTrue(cache.getBlock(blocks[0].blockName) == null);
assertTrue(cache.getBlock(blocks[1].blockName) == null);
for (int i = 2; i < blocks.length; i++) {
- assertEquals(cache.getBlock(blocks[i].blockName).getBuffer(), blocks[i].buf);
+ assertTrue(Arrays.equals(cache.getBlock(blocks[i].blockName).getBuffer(), blocks[i].buf));
}
}
@@ -163,7 +164,7 @@ public class TestLruBlockCache extends TestCase {
for (Block block : multiBlocks) {
cache.cacheBlock(block.blockName, block.buf);
expectedCacheSize += block.heapSize();
- assertEquals(cache.getBlock(block.blockName).getBuffer(), block.buf);
+ assertTrue(Arrays.equals(cache.getBlock(block.blockName).getBuffer(), block.buf));
}
// Add the single blocks (no get)
@@ -196,8 +197,8 @@ public class TestLruBlockCache extends TestCase {
// And all others to be cached
for (int i = 1; i < 4; i++) {
- assertEquals(cache.getBlock(singleBlocks[i].blockName).getBuffer(), singleBlocks[i].buf);
- assertEquals(cache.getBlock(multiBlocks[i].blockName).getBuffer(), multiBlocks[i].buf);
+ assertTrue(Arrays.equals(cache.getBlock(singleBlocks[i].blockName).getBuffer(), singleBlocks[i].buf));
+ assertTrue(Arrays.equals(cache.getBlock(multiBlocks[i].blockName).getBuffer(), multiBlocks[i].buf));
}
}
@@ -429,9 +430,9 @@ public class TestLruBlockCache extends TestCase {
// And the newest 5 blocks should still be accessible
for (int i = 5; i < 10; i++) {
- assertEquals(singleBlocks[i].buf, cache.getBlock(singleBlocks[i].blockName).getBuffer());
- assertEquals(multiBlocks[i].buf, cache.getBlock(multiBlocks[i].blockName).getBuffer());
- assertEquals(memoryBlocks[i].buf, cache.getBlock(memoryBlocks[i].blockName).getBuffer());
+ assertTrue(Arrays.equals(singleBlocks[i].buf, cache.getBlock(singleBlocks[i].blockName).getBuffer()));
+ assertTrue(Arrays.equals(multiBlocks[i].buf, cache.getBlock(multiBlocks[i].blockName).getBuffer()));
+ assertTrue(Arrays.equals(memoryBlocks[i].buf, cache.getBlock(memoryBlocks[i].blockName).getBuffer()));
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java b/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java
index afc94c6..cffe2cb 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java
@@ -20,13 +20,11 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -167,8 +165,6 @@ public class RFileTest {
public static class TestRFile {
- public File preGeneratedInputFile = null;
- public File outputFile = null;
private Configuration conf = CachedConfiguration.getInstance();
public RFile.Writer writer;
private ByteArrayOutputStream baos;
@@ -180,14 +176,8 @@ public class RFileTest {
public void openWriter(boolean startDLG) throws IOException {
- if (outputFile == null) {
- baos = new ByteArrayOutputStream();
-
- dos = new FSDataOutputStream(baos, new FileSystem.Statistics("a"));
- } else {
- BufferedOutputStream bufos = new BufferedOutputStream(new FileOutputStream(outputFile));
- dos = new FSDataOutputStream(bufos, new FileSystem.Statistics("a"));
- }
+ baos = new ByteArrayOutputStream();
+ dos = new FSDataOutputStream(baos, new FileSystem.Statistics("a"));
CachableBlockFile.Writer _cbw = new CachableBlockFile.Writer(dos, "gz", conf);
writer = new RFile.Writer(_cbw, 1000, 1000);
@@ -212,14 +202,7 @@ public class RFileTest {
int fileLength = 0;
byte[] data = null;
- if (preGeneratedInputFile != null) {
- data = new byte[(int) preGeneratedInputFile.length()];
- DataInputStream in = new DataInputStream(new FileInputStream(preGeneratedInputFile));
- in.readFully(data);
- in.close();
- } else {
- data = baos.toByteArray();
- }
+ data = baos.toByteArray();
bais = new SeekableByteArrayInputStream(data);
in = new FSDataInputStream(bais);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/test/java/org/apache/accumulo/core/iterators/user/BigDecimalCombinerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/BigDecimalCombinerTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/BigDecimalCombinerTest.java
index 47d8212..4cf4d5d 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/BigDecimalCombinerTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/BigDecimalCombinerTest.java
@@ -50,9 +50,9 @@ public class BigDecimalCombinerTest {
TreeMap<Key,Value> tm1 = new TreeMap<Key,Value>();
// keys that do not aggregate
- CombinerTest.nkv(tm1, 1, 1, 1, 1, false, new BigDecimal(2), encoder);
- CombinerTest.nkv(tm1, 1, 1, 1, 2, false, new BigDecimal(2.3), encoder);
- CombinerTest.nkv(tm1, 1, 1, 1, 3, false, new BigDecimal(-1.4E1), encoder);
+ CombinerTest.nkv(tm1, 1, 1, 1, 1, false, BigDecimal.valueOf(2), encoder);
+ CombinerTest.nkv(tm1, 1, 1, 1, 2, false, BigDecimal.valueOf(2.3), encoder);
+ CombinerTest.nkv(tm1, 1, 1, 1, 3, false, BigDecimal.valueOf(-1.4E1), encoder);
Combiner ai = new BigDecimalCombiner.BigDecimalSummingCombiner();
IteratorSetting is = new IteratorSetting(1, BigDecimalCombiner.BigDecimalSummingCombiner.class);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java
index 2ae82b4..06e9ef7 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchScanner.java
@@ -99,7 +99,7 @@ public class RandomBatchScanner {
static void generateRandomQueries(int num, long min, long max, Random r, HashSet<Range> ranges, HashMap<Text,Boolean> expectedRows) {
log.info(String.format("Generating %,d random queries...", num));
while (ranges.size() < num) {
- long rowid = (Math.abs(r.nextLong()) % (max - min)) + min;
+ long rowid = (abs(r.nextLong()) % (max - min)) + min;
Text row1 = new Text(String.format("row_%010d", rowid));
@@ -111,6 +111,12 @@ public class RandomBatchScanner {
log.info("finished");
}
+ private static long abs(long l) {
+ if (l < 0)
+ return -l;
+ return l;
+ }
+
/**
* Prints a count of the number of rows mapped to false.
*
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
index 689f07c..6748797 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RandomBatchWriter.java
@@ -110,6 +110,12 @@ public class RandomBatchWriter {
Long seed = null;
}
+ private static long abs(long l) {
+ if (l < 0)
+ return -l;
+ return l;
+ }
+
/**
* Writes a specified number of entries to Accumulo using a {@link BatchWriter}.
*
@@ -121,7 +127,7 @@ public class RandomBatchWriter {
Opts opts = new Opts();
BatchWriterOpts bwOpts = new BatchWriterOpts();
opts.parseArgs(RandomBatchWriter.class.getName(), args, bwOpts);
- if ((opts.max - opts.min) < opts.num) {
+ if ((opts.max - opts.min) < (long)opts.num) {
System.err
.println(String
.format(
@@ -144,7 +150,7 @@ public class RandomBatchWriter {
// Generate num unique row ids in the given range
HashSet<Long> rowids = new HashSet<Long>(opts.num);
while (rowids.size() < opts.num) {
- rowids.add((Math.abs(r.nextLong()) % (opts.max - opts.min)) + opts.min);
+ rowids.add((abs(r.nextLong()) % (opts.max - opts.min)) + opts.min);
}
for (long rowid : rowids) {
Mutation m = createMutation(rowid, opts.size, cv);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RowOperations.java
----------------------------------------------------------------------
diff --git a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RowOperations.java b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RowOperations.java
index 56d4840..7f19bc4 100644
--- a/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RowOperations.java
+++ b/examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RowOperations.java
@@ -106,9 +106,9 @@ public class RowOperations {
bw.flush();
// Now lets look at the rows
- Scanner rowThree = getRow(opts, scanOpts, new Text("row3"));
- Scanner rowTwo = getRow(opts, scanOpts, new Text("row2"));
- Scanner rowOne = getRow(opts, scanOpts, new Text("row1"));
+ Scanner rowThree = getRow(scanOpts, new Text("row3"));
+ Scanner rowTwo = getRow(scanOpts, new Text("row2"));
+ Scanner rowOne = getRow(scanOpts, new Text("row1"));
// And print them
log.info("This is everything");
@@ -118,13 +118,13 @@ public class RowOperations {
System.out.flush();
// Now lets delete rowTwo with the iterator
- rowTwo = getRow(opts, scanOpts, new Text("row2"));
+ rowTwo = getRow(scanOpts, new Text("row2"));
deleteRow(rowTwo);
// Now lets look at the rows again
- rowThree = getRow(opts, scanOpts, new Text("row3"));
- rowTwo = getRow(opts, scanOpts, new Text("row2"));
- rowOne = getRow(opts, scanOpts, new Text("row1"));
+ rowThree = getRow(scanOpts, new Text("row3"));
+ rowTwo = getRow(scanOpts, new Text("row2"));
+ rowOne = getRow(scanOpts, new Text("row1"));
// And print them
log.info("This is row1 and row3");
@@ -136,12 +136,12 @@ public class RowOperations {
// Should only see the two rows
// Now lets delete rowOne without passing in the iterator
- deleteRow(opts, scanOpts, row1);
+ deleteRow(scanOpts, row1);
// Now lets look at the rows one last time
- rowThree = getRow(opts, scanOpts, new Text("row3"));
- rowTwo = getRow(opts, scanOpts, new Text("row2"));
- rowOne = getRow(opts, scanOpts, new Text("row1"));
+ rowThree = getRow(scanOpts, new Text("row3"));
+ rowTwo = getRow(scanOpts, new Text("row2"));
+ rowOne = getRow(scanOpts, new Text("row1"));
// And print them
log.info("This is just row3");
@@ -173,8 +173,8 @@ public class RowOperations {
* @throws AccumuloSecurityException
* @throws AccumuloException
*/
- private static void deleteRow(ClientOpts opts, ScannerOpts scanOpts, Text row) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
- deleteRow(getRow(opts, scanOpts, row));
+ private static void deleteRow(ScannerOpts scanOpts, Text row) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ deleteRow(getRow(scanOpts, row));
}
/**
@@ -210,7 +210,7 @@ public class RowOperations {
/**
* Gets a scanner over one row
*/
- private static Scanner getRow(ClientOpts opts, ScannerOpts scanOpts, Text row) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ private static Scanner getRow(ScannerOpts scanOpts, Text row) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
// Create a scanner
Scanner scanner = connector.createScanner(table, Authorizations.EMPTY);
scanner.setBatchSize(scanOpts.scanBatchSize);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/fate/src/main/java/org/apache/accumulo/fate/AgeOffStore.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/AgeOffStore.java b/fate/src/main/java/org/apache/accumulo/fate/AgeOffStore.java
index 3f52e70..4fe1184 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/AgeOffStore.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/AgeOffStore.java
@@ -34,7 +34,7 @@ import org.apache.log4j.Logger;
*/
public class AgeOffStore<T> implements TStore<T> {
- public static interface TimeSource {
+ public interface TimeSource {
long currentTimeMillis();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/fate/src/main/java/org/apache/accumulo/fate/Fate.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/Fate.java b/fate/src/main/java/org/apache/accumulo/fate/Fate.java
index 5ddec9c..2d69647 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/Fate.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/Fate.java
@@ -138,6 +138,7 @@ public class Fate<T> {
}
+ // TODO: move thread creation to another method ACCUMULO-2136
public Fate(T environment, TStore<T> store, int numThreads) {
this.store = store;
this.environment = environment;
@@ -171,7 +172,7 @@ public class Fate<T> {
}
if (autoCleanUp)
- store.setProperty(tid, AUTO_CLEAN_PROP, new Boolean(autoCleanUp));
+ store.setProperty(tid, AUTO_CLEAN_PROP, Boolean.valueOf(autoCleanUp));
store.setProperty(tid, DEBUG_PROP, repo.getDescription());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/fate/src/main/java/org/apache/accumulo/fate/TStore.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/TStore.java b/fate/src/main/java/org/apache/accumulo/fate/TStore.java
index 3554064..98e936c 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/TStore.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/TStore.java
@@ -49,7 +49,7 @@ public interface TStore<T> {
*
* @return a transaction id
*/
- public long create();
+ long create();
/**
* Reserve a transaction that is IN_PROGRESS or FAILED_IN_PROGRESS.
@@ -57,7 +57,7 @@ public interface TStore<T> {
*/
long reserve();
- public void reserve(long tid);
+ void reserve(long tid);
/**
* Return the given transaction to the store
@@ -84,7 +84,7 @@ public interface TStore<T> {
* @param repo
* the operation
*/
- public void push(long tid, Repo<T> repo) throws StackOverflowException;
+ void push(long tid, Repo<T> repo) throws StackOverflowException;
/**
* Remove the last pushed operation from the given transaction.
@@ -100,7 +100,7 @@ public interface TStore<T> {
* transaction id
* @return execution status
*/
- public TStatus getStatus(long tid);
+ TStatus getStatus(long tid);
/**
* Update the state of a given transaction
@@ -110,7 +110,7 @@ public interface TStore<T> {
* @param status
* execution status
*/
- public void setStatus(long tid, TStatus status);
+ void setStatus(long tid, TStatus status);
/**
* Wait for the satus of a transaction to change
@@ -118,11 +118,11 @@ public interface TStore<T> {
* @param tid
* transaction id
*/
- public TStatus waitForStatusChange(long tid, EnumSet<TStatus> expected);
+ TStatus waitForStatusChange(long tid, EnumSet<TStatus> expected);
- public void setProperty(long tid, String prop, Serializable val);
+ void setProperty(long tid, String prop, Serializable val);
- public Serializable getProperty(long tid, String prop);
+ Serializable getProperty(long tid, String prop);
/**
* Remove the transaction from the store.
@@ -130,13 +130,13 @@ public interface TStore<T> {
* @param tid
* the transaction id
*/
- public void delete(long tid);
+ void delete(long tid);
/**
* list all transaction ids in store
*
*/
- public List<Long> list();
+ List<Long> list();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/fate/src/main/java/org/apache/accumulo/fate/zookeeper/DistributedReadWriteLock.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/DistributedReadWriteLock.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/DistributedReadWriteLock.java
index a9e4f1e..cde84dc 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/DistributedReadWriteLock.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/DistributedReadWriteLock.java
@@ -101,7 +101,6 @@ public class DistributedReadWriteLock implements java.util.concurrent.locks.Read
QueueLock qlock;
byte[] userData;
long entry = -1;
- long lastRead = -1;
ReadLock(QueueLock qlock, byte[] userData) {
this.qlock = qlock;
[3/6] ACCUMULO-2160 fixed up a lot of findbugs/pmd complaints
Posted by ec...@apache.org.
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/fate/src/main/java/org/apache/accumulo/fate/zookeeper/IZooReader.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/IZooReader.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/IZooReader.java
index 3902a5c..0610e79 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/IZooReader.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/IZooReader.java
@@ -24,20 +24,20 @@ import org.apache.zookeeper.data.Stat;
public interface IZooReader {
- public abstract byte[] getData(String zPath, Stat stat) throws KeeperException, InterruptedException;
+ byte[] getData(String zPath, Stat stat) throws KeeperException, InterruptedException;
- public abstract Stat getStatus(String zPath) throws KeeperException, InterruptedException;
+ Stat getStatus(String zPath) throws KeeperException, InterruptedException;
- public abstract Stat getStatus(String zPath, Watcher watcher) throws KeeperException, InterruptedException;
+ Stat getStatus(String zPath, Watcher watcher) throws KeeperException, InterruptedException;
- public abstract List<String> getChildren(String zPath) throws KeeperException, InterruptedException;
+ List<String> getChildren(String zPath) throws KeeperException, InterruptedException;
- public abstract List<String> getChildren(String zPath, Watcher watcher) throws KeeperException, InterruptedException;
+ List<String> getChildren(String zPath, Watcher watcher) throws KeeperException, InterruptedException;
- public abstract boolean exists(String zPath) throws KeeperException, InterruptedException;
+ boolean exists(String zPath) throws KeeperException, InterruptedException;
- public abstract boolean exists(String zPath, Watcher watcher) throws KeeperException, InterruptedException;
+ boolean exists(String zPath, Watcher watcher) throws KeeperException, InterruptedException;
- public abstract void sync(final String path) throws KeeperException, InterruptedException;
+ void sync(final String path) throws KeeperException, InterruptedException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/fate/src/main/java/org/apache/accumulo/fate/zookeeper/IZooReaderWriter.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/IZooReaderWriter.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/IZooReaderWriter.java
index a43ae7c..afc2250 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/IZooReaderWriter.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/IZooReaderWriter.java
@@ -26,43 +26,43 @@ import org.apache.zookeeper.data.ACL;
public interface IZooReaderWriter extends IZooReader {
- public abstract ZooKeeper getZooKeeper();
+ ZooKeeper getZooKeeper();
- public abstract void recursiveDelete(String zPath, NodeMissingPolicy policy) throws KeeperException, InterruptedException;
+ void recursiveDelete(String zPath, NodeMissingPolicy policy) throws KeeperException, InterruptedException;
- public abstract void recursiveDelete(String zPath, int version, NodeMissingPolicy policy) throws KeeperException, InterruptedException;
+ void recursiveDelete(String zPath, int version, NodeMissingPolicy policy) throws KeeperException, InterruptedException;
/**
* Create a persistent node with the default ACL
*
* @return true if the node was created or altered; false if it was skipped
*/
- public abstract boolean putPersistentData(String zPath, byte[] data, NodeExistsPolicy policy) throws KeeperException, InterruptedException;
+ boolean putPersistentData(String zPath, byte[] data, NodeExistsPolicy policy) throws KeeperException, InterruptedException;
- public abstract boolean putPrivatePersistentData(String zPath, byte[] data, NodeExistsPolicy policy) throws KeeperException, InterruptedException;
+ boolean putPrivatePersistentData(String zPath, byte[] data, NodeExistsPolicy policy) throws KeeperException, InterruptedException;
- public abstract void putPersistentData(String zPath, byte[] data, int version, NodeExistsPolicy policy) throws KeeperException, InterruptedException;
+ void putPersistentData(String zPath, byte[] data, int version, NodeExistsPolicy policy) throws KeeperException, InterruptedException;
- public abstract String putPersistentSequential(String zPath, byte[] data) throws KeeperException, InterruptedException;
+ String putPersistentSequential(String zPath, byte[] data) throws KeeperException, InterruptedException;
- public abstract String putEphemeralSequential(String zPath, byte[] data) throws KeeperException, InterruptedException;
+ String putEphemeralSequential(String zPath, byte[] data) throws KeeperException, InterruptedException;
- public String putEphemeralData(String zPath, byte[] data) throws KeeperException, InterruptedException;
+ String putEphemeralData(String zPath, byte[] data) throws KeeperException, InterruptedException;
- public abstract void recursiveCopyPersistent(String source, String destination, NodeExistsPolicy policy) throws KeeperException, InterruptedException;
+ void recursiveCopyPersistent(String source, String destination, NodeExistsPolicy policy) throws KeeperException, InterruptedException;
- public abstract void delete(String path, int version) throws InterruptedException, KeeperException;
+ void delete(String path, int version) throws InterruptedException, KeeperException;
- public interface Mutator {
+ interface Mutator {
byte[] mutate(byte[] currentValue) throws Exception;
}
- public abstract byte[] mutate(String zPath, byte[] createValue, List<ACL> acl, Mutator mutator) throws Exception;
+ byte[] mutate(String zPath, byte[] createValue, List<ACL> acl, Mutator mutator) throws Exception;
- public abstract boolean isLockHeld(ZooUtil.LockID lockID) throws KeeperException, InterruptedException;
+ boolean isLockHeld(ZooUtil.LockID lockID) throws KeeperException, InterruptedException;
- public abstract void mkdirs(String path) throws KeeperException, InterruptedException;
+ void mkdirs(String path) throws KeeperException, InterruptedException;
- public abstract void sync(String path) throws KeeperException, InterruptedException;
+ void sync(String path) throws KeeperException, InterruptedException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/fate/src/main/java/org/apache/accumulo/fate/zookeeper/TransactionWatcher.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/TransactionWatcher.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/TransactionWatcher.java
index 856d43b..cc4bebf 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/TransactionWatcher.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/TransactionWatcher.java
@@ -25,15 +25,15 @@ import org.apache.log4j.Logger;
public class TransactionWatcher {
- private static final Logger log = Logger.getLogger(TransactionWatcher.class);
- final private Map<Long,AtomicInteger> counts = new HashMap<Long,AtomicInteger>();
- final private Arbitrator arbitrator;
-
public interface Arbitrator {
boolean transactionAlive(String type, long tid) throws Exception;
boolean transactionComplete(String type, long tid) throws Exception;
}
+ private static final Logger log = Logger.getLogger(TransactionWatcher.class);
+ final private Map<Long,AtomicInteger> counts = new HashMap<Long,AtomicInteger>();
+ final private Arbitrator arbitrator;
+
public TransactionWatcher(Arbitrator arbitrator) {
this.arbitrator = arbitrator;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java
index e57b0b6..489dc98 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java
@@ -114,7 +114,7 @@ public class ZooCache {
this.externalWatcher = watcher;
}
- private static interface ZooRunnable {
+ private interface ZooRunnable {
void run(ZooKeeper zooKeeper) throws KeeperException, InterruptedException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java
index 8772a83..3240862 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java
@@ -346,9 +346,7 @@ public class ZooLock implements Watcher {
watchingParent = false;
if (event.getState() == KeeperState.Expired && lock != null) {
- if (lock != null) {
lostLock(LockLossReason.SESSION_EXPIRED);
- }
} else {
try { // set the watch on the parent node again
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriter.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriter.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriter.java
index 13c3c1a..2a327b0 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriter.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReaderWriter.java
@@ -21,6 +21,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.security.SecurityPermission;
+import java.util.Arrays;
import java.util.List;
import org.apache.accumulo.fate.util.UtilWaitThread;
@@ -56,7 +57,7 @@ public class ZooReaderWriter extends ZooReader implements IZooReaderWriter {
public ZooReaderWriter(String string, int timeInMillis, String scheme, byte[] auth) {
super(string, timeInMillis);
this.scheme = scheme;
- this.auth = auth;
+ this.auth = Arrays.copyOf(auth, auth.length);
}
@Override
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReservation.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReservation.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReservation.java
index e938e88..655f382 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReservation.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReservation.java
@@ -45,7 +45,7 @@ public class ZooReservation {
String idInZoo = new String(zooData).split(":")[0];
- return idInZoo.equals(new String(reservationID));
+ return idInZoo.equals(reservationID);
}
}
@@ -65,8 +65,8 @@ public class ZooReservation {
String idInZoo = new String(zooData).split(":")[0];
- if (!idInZoo.equals(new String(reservationID))) {
- throw new IllegalStateException("Tried to release reservation " + path + " with data mismatch " + new String(reservationID) + " " + new String(zooData));
+ if (!idInZoo.equals(reservationID)) {
+ throw new IllegalStateException("Tried to release reservation " + path + " with data mismatch " + reservationID + " " + new String(zooData));
}
zk.recursiveDelete(path, stat.getVersion(), NodeMissingPolicy.SKIP);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
index 7fdd0a1..2a751cf 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
@@ -67,7 +67,7 @@ public class ZooSession {
final int TIME_BETWEEN_CONNECT_CHECKS_MS = 100;
int connectTimeWait = Math.min(10 * 1000, timeout);
boolean tryAgain = true;
- int sleepTime = 100;
+ long sleepTime = 100;
ZooKeeper zooKeeper = null;
long startTime = System.currentTimeMillis();
@@ -106,7 +106,7 @@ public class ZooSession {
if (tryAgain) {
if (startTime + 2 * timeout < System.currentTimeMillis() + sleepTime + connectTimeWait)
- sleepTime = (int) (startTime + 2 * timeout - System.currentTimeMillis() - connectTimeWait);
+ sleepTime = startTime + 2 * timeout - System.currentTimeMillis() - connectTimeWait;
if (sleepTime < 0)
{
connectTimeWait -= sleepTime;
@@ -114,7 +114,7 @@ public class ZooSession {
}
UtilWaitThread.sleep(sleepTime);
if (sleepTime < 10000)
- sleepTime = (int) (sleepTime + sleepTime * Math.random());
+ sleepTime = sleepTime + (long)(sleepTime * Math.random());
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
index 6a8d24e..2ed2434 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
@@ -586,8 +586,8 @@ public class MiniAccumuloCluster {
if (masterProcess != null) {
masterProcess.destroy();
}
- synchronized (tabletServerProcesses) {
- if (tabletServerProcesses != null) {
+ if (tabletServerProcesses != null) {
+ synchronized (tabletServerProcesses) {
for (Process tserver : tabletServerProcesses) {
tserver.destroy();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/minicluster/src/main/java/org/apache/accumulo/minicluster/ProcessReference.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/ProcessReference.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/ProcessReference.java
index 5c801e4..b033c0d 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/ProcessReference.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/ProcessReference.java
@@ -39,6 +39,9 @@ public class ProcessReference {
@Override
public boolean equals(Object obj) {
- return process.equals(obj);
+ if (obj instanceof Process) {
+ return process == obj;
+ }
+ return this == obj;
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java
----------------------------------------------------------------------
diff --git a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java
index a29bbc0..86a8950 100644
--- a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterGCTest.java
@@ -63,7 +63,7 @@ public class MiniAccumuloClusterGCTest {
Assert.assertEquals(true, macConfig.shouldRunGC());
} finally {
- if (null != f && f.exists()) {
+ if (f.exists()) {
f.delete();
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e41b75c..f620e8e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1073,6 +1073,7 @@
<xmlOutput>true</xmlOutput>
<effort>Max</effort>
<threshold>Medium</threshold>
+ <failOnError>false</failOnError>
</configuration>
</plugin>
</plugins>
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java
----------------------------------------------------------------------
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java b/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java
index 72231f0..7597fc7 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java
@@ -106,7 +106,8 @@ public class Proxy {
} catch (Exception e) {
throw new RuntimeException();
} finally {
- folder.delete();
+ if (!folder.delete())
+ log.warn("Unexpected error removing " + folder);
}
}
});
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
----------------------------------------------------------------------
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java b/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
index 89a79b7..3413c94 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
@@ -419,10 +419,11 @@ public class ProxyServer implements AccumuloProxy.Iface {
try {
Map<String,Set<Text>> groups = getConnector(login).tableOperations().getLocalityGroups(tableName);
Map<String,Set<String>> ret = new HashMap<String,Set<String>>();
- for (String key : groups.keySet()) {
- ret.put(key, new HashSet<String>());
- for (Text val : groups.get(key)) {
- ret.get(key).add(val.toString());
+ for (Entry<String,Set<Text>> entry : groups.entrySet()) {
+ Set<String> value = new HashSet<String>();
+ ret.put(entry.getKey(), value);
+ for (Text val : entry.getValue()) {
+ value.add(val.toString());
}
}
return ret;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java b/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
index bcde150..83f54b0 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
@@ -172,7 +172,7 @@ public class Accumulo {
DOMConfigurator.configureAndWatch(logConfig, 5000);
// Read the auditing config
- String auditConfig = String.format("%s/auditLog.xml", System.getenv("ACCUMULO_CONF_DIR"), application);
+ String auditConfig = String.format("%s/auditLog.xml", System.getenv("ACCUMULO_CONF_DIR"));
DOMConfigurator.configureAndWatch(auditConfig, 5000);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfiguration.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfiguration.java b/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfiguration.java
index 2a1f9a1..c0ac0b8 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfiguration.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfiguration.java
@@ -75,13 +75,10 @@ public class NamespaceConfiguration extends AccumuloConfiguration {
return value;
}
- private static ZooCache getPropCache() {
+ private synchronized static ZooCache getPropCache() {
Instance inst = HdfsZooInstance.getInstance();
if (propCache == null)
- synchronized (NamespaceConfiguration.class) {
- if (propCache == null)
- propCache = new ZooCache(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut(), new NamespaceConfWatcher(inst));
- }
+ propCache = new ZooCache(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut(), new NamespaceConfWatcher(inst));
return propCache;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
index ce7a882..3c348f4 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
@@ -51,13 +51,10 @@ public class TableConfiguration extends AccumuloConfiguration {
this.observers = Collections.synchronizedSet(new HashSet<ConfigurationObserver>());
}
- private static ZooCache getTablePropCache() {
+ private synchronized static ZooCache getTablePropCache() {
Instance inst = HdfsZooInstance.getInstance();
if (tablePropCache == null)
- synchronized (TableConfiguration.class) {
- if (tablePropCache == null)
- tablePropCache = new ZooCache(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut(), new TableConfWatcher(inst));
- }
+ tablePropCache = new ZooCache(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut(), new TableConfWatcher(inst));
return tablePropCache;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
index a89572d..3e9cc26 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
@@ -445,7 +445,7 @@ public class VolumeManagerImpl implements VolumeManager {
if (uri1.getScheme().equals(uri3.getScheme())) {
String a1 = uri1.getAuthority();
String a2 = uri3.getAuthority();
- if (a1 == a2 || (a1 != null && a1.equals(a2)))
+ if ((a1 == null && a2 == null) || (a1 != null && a1.equals(a2)))
return new Path(option);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/master/recovery/LogCloser.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/recovery/LogCloser.java b/server/base/src/main/java/org/apache/accumulo/server/master/recovery/LogCloser.java
index deeea61..1365742 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/recovery/LogCloser.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/recovery/LogCloser.java
@@ -23,5 +23,5 @@ import org.apache.accumulo.server.fs.VolumeManager;
import org.apache.hadoop.fs.Path;
public interface LogCloser {
- public long close(AccumuloConfiguration conf, VolumeManager fs, Path path) throws IOException;
+ long close(AccumuloConfiguration conf, VolumeManager fs, Path path) throws IOException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/master/state/Assignment.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/state/Assignment.java b/server/base/src/main/java/org/apache/accumulo/server/master/state/Assignment.java
index b2510fc..40b7a93 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/state/Assignment.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/state/Assignment.java
@@ -17,7 +17,6 @@
package org.apache.accumulo.server.master.state;
import org.apache.accumulo.core.data.KeyExtent;
-import org.apache.accumulo.server.master.state.TServerInstance;
public class Assignment {
public KeyExtent tablet;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/master/state/DistributedStore.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/state/DistributedStore.java b/server/base/src/main/java/org/apache/accumulo/server/master/state/DistributedStore.java
index ad658df..10a1311 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/state/DistributedStore.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/state/DistributedStore.java
@@ -23,12 +23,12 @@ import java.util.List;
*/
public interface DistributedStore {
- public List<String> getChildren(String path) throws DistributedStoreException;
+ List<String> getChildren(String path) throws DistributedStoreException;
- public byte[] get(String path) throws DistributedStoreException;
+ byte[] get(String path) throws DistributedStoreException;
- public void put(String path, byte[] bs) throws DistributedStoreException;
+ void put(String path, byte[] bs) throws DistributedStoreException;
- public void remove(String path) throws DistributedStoreException;
+ void remove(String path) throws DistributedStoreException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/master/state/MetaDataStateStore.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/state/MetaDataStateStore.java b/server/base/src/main/java/org/apache/accumulo/server/master/state/MetaDataStateStore.java
index 082f2ca..57d38eb 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/state/MetaDataStateStore.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/state/MetaDataStateStore.java
@@ -31,9 +31,6 @@ import org.apache.accumulo.core.metadata.schema.MetadataSchema;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection;
import org.apache.accumulo.core.security.Credentials;
import org.apache.accumulo.server.client.HdfsZooInstance;
-import org.apache.accumulo.server.master.state.CurrentState;
-import org.apache.accumulo.server.master.state.MetaDataTableScanner;
-import org.apache.accumulo.server.master.state.TabletLocationState;
import org.apache.accumulo.server.security.SystemCredentials;
import org.apache.hadoop.io.Text;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/master/state/RootTabletStateStore.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/state/RootTabletStateStore.java b/server/base/src/main/java/org/apache/accumulo/server/master/state/RootTabletStateStore.java
index d8220fe..bdf5478 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/state/RootTabletStateStore.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/state/RootTabletStateStore.java
@@ -22,9 +22,6 @@ import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.metadata.RootTable;
import org.apache.accumulo.core.metadata.schema.MetadataSchema;
import org.apache.accumulo.core.security.Credentials;
-import org.apache.accumulo.server.master.state.CurrentState;
-import org.apache.accumulo.server.master.state.MetaDataTableScanner;
-import org.apache.accumulo.server.master.state.TabletLocationState;
public class RootTabletStateStore extends MetaDataStateStore {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletStateStore.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletStateStore.java b/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletStateStore.java
index 5e19976..ed68b4e 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletStateStore.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/master/state/TabletStateStore.java
@@ -20,8 +20,6 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
-import org.apache.accumulo.server.master.state.TabletLocationState;
-
/**
* Interface for storing information about tablet assignments. There are three implementations:
*
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/metrics/MetricsConfiguration.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/metrics/MetricsConfiguration.java b/server/base/src/main/java/org/apache/accumulo/server/metrics/MetricsConfiguration.java
index 446a548..087ca12 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/metrics/MetricsConfiguration.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/metrics/MetricsConfiguration.java
@@ -107,15 +107,19 @@ public class MetricsConfiguration {
}
public Configuration getEnvironmentConfiguration() {
- if (null == envConfig)
- envConfig = new EnvironmentConfiguration();
- return envConfig;
+ synchronized (MetricsConfiguration.class) {
+ if (null == envConfig)
+ envConfig = new EnvironmentConfiguration();
+ return envConfig;
+ }
}
public Configuration getSystemConfiguration() {
- if (null == sysConfig)
- sysConfig = new SystemConfiguration();
- return sysConfig;
+ synchronized (MetricsConfiguration.class) {
+ if (null == sysConfig)
+ sysConfig = new SystemConfiguration();
+ return sysConfig;
+ }
}
public Configuration getMetricsConfiguration() {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/metrics/ThriftMetricsMBean.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/metrics/ThriftMetricsMBean.java b/server/base/src/main/java/org/apache/accumulo/server/metrics/ThriftMetricsMBean.java
index 11f94c2..403cffe 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/metrics/ThriftMetricsMBean.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/metrics/ThriftMetricsMBean.java
@@ -18,25 +18,25 @@ package org.apache.accumulo.server.metrics;
public interface ThriftMetricsMBean {
- public static final String idle = "idle";
- public static final String execute = "execute";
+ static final String idle = "idle";
+ static final String execute = "execute";
- public long getIdleCount();
+ long getIdleCount();
- public long getIdleMinTime();
+ long getIdleMinTime();
- public long getIdleMaxTime();
+ long getIdleMaxTime();
- public long getIdleAvgTime();
+ long getIdleAvgTime();
- public long getExecutionCount();
+ long getExecutionCount();
- public long getExecutionMinTime();
+ long getExecutionMinTime();
- public long getExecutionMaxTime();
+ long getExecutionMaxTime();
- public long getExecutionAvgTime();
+ long getExecutionAvgTime();
- public void reset();
+ void reset();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java b/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java
index 53a1fe7..23d4de5 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java
@@ -159,11 +159,7 @@ public class ProblemReports implements Iterable<ProblemReport> {
Scanner scanner = connector.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
scanner.addScanIterator(new IteratorSetting(1, "keys-only", SortedKeyIterator.class));
- if (table == null) {
- scanner.setRange(new Range(new Text("~err_"), false, new Text("~err`"), false));
- } else {
- scanner.setRange(new Range(new Text("~err_" + table)));
- }
+ scanner.setRange(new Range(new Text("~err_" + table)));
Mutation delMut = new Mutation(new Text("~err_" + table));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/security/handler/Authenticator.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/handler/Authenticator.java b/server/base/src/main/java/org/apache/accumulo/server/security/handler/Authenticator.java
index 7012065..5f0da82 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/security/handler/Authenticator.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/security/handler/Authenticator.java
@@ -30,28 +30,28 @@ import org.apache.accumulo.core.security.thrift.TCredentials;
public interface Authenticator {
- public void initialize(String instanceId, boolean initialize);
+ void initialize(String instanceId, boolean initialize);
- public boolean validSecurityHandlers(Authorizor auth, PermissionHandler pm);
+ boolean validSecurityHandlers(Authorizor auth, PermissionHandler pm);
- public void initializeSecurity(TCredentials credentials, String principal, byte[] token) throws AccumuloSecurityException, ThriftSecurityException;
+ void initializeSecurity(TCredentials credentials, String principal, byte[] token) throws AccumuloSecurityException, ThriftSecurityException;
- public boolean authenticateUser(String principal, AuthenticationToken token) throws AccumuloSecurityException;
+ boolean authenticateUser(String principal, AuthenticationToken token) throws AccumuloSecurityException;
- public Set<String> listUsers() throws AccumuloSecurityException;
+ Set<String> listUsers() throws AccumuloSecurityException;
- public void createUser(String principal, AuthenticationToken token) throws AccumuloSecurityException;
+ void createUser(String principal, AuthenticationToken token) throws AccumuloSecurityException;
- public void dropUser(String user) throws AccumuloSecurityException;
+ void dropUser(String user) throws AccumuloSecurityException;
- public void changePassword(String principal, AuthenticationToken token) throws AccumuloSecurityException;
+ void changePassword(String principal, AuthenticationToken token) throws AccumuloSecurityException;
- public boolean userExists(String user) throws AccumuloSecurityException;
+ boolean userExists(String user) throws AccumuloSecurityException;
- public Set<Class<? extends AuthenticationToken>> getSupportedTokenTypes();
+ Set<Class<? extends AuthenticationToken>> getSupportedTokenTypes();
/**
* Returns true if the given token is appropriate for this Authenticator
*/
- public boolean validTokenClass(String tokenClass);
+ boolean validTokenClass(String tokenClass);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/security/handler/Authorizor.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/handler/Authorizor.java b/server/base/src/main/java/org/apache/accumulo/server/security/handler/Authorizor.java
index 569d893..5131bd3 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/security/handler/Authorizor.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/security/handler/Authorizor.java
@@ -33,40 +33,40 @@ public interface Authorizor {
/**
* Sets up the authorizor for a new instance of Accumulo
*/
- public void initialize(String instanceId, boolean initialize);
+ void initialize(String instanceId, boolean initialize);
/**
* Used to validate that the Authorizor, Authenticator, and permission handler can coexist
*/
- public boolean validSecurityHandlers(Authenticator auth, PermissionHandler pm);
+ boolean validSecurityHandlers(Authenticator auth, PermissionHandler pm);
/**
* Used to initialize security for the root user
*/
- public void initializeSecurity(TCredentials credentials, String rootuser) throws AccumuloSecurityException, ThriftSecurityException;
+ void initializeSecurity(TCredentials credentials, String rootuser) throws AccumuloSecurityException, ThriftSecurityException;
/**
* Used to change the authorizations for the user
*/
- public void changeAuthorizations(String user, Authorizations authorizations) throws AccumuloSecurityException;
+ void changeAuthorizations(String user, Authorizations authorizations) throws AccumuloSecurityException;
/**
* Used to get the authorizations for the user
*/
- public Authorizations getCachedUserAuthorizations(String user) throws AccumuloSecurityException;
+ Authorizations getCachedUserAuthorizations(String user) throws AccumuloSecurityException;
/**
* Used to check if a user has valid auths.
*/
- public boolean isValidAuthorizations(String user, List<ByteBuffer> list) throws AccumuloSecurityException;
+ boolean isValidAuthorizations(String user, List<ByteBuffer> list) throws AccumuloSecurityException;
/**
* Initializes a new user
*/
- public void initUser(String user) throws AccumuloSecurityException;
+ void initUser(String user) throws AccumuloSecurityException;
/**
* Deletes a user
*/
- public void dropUser(String user) throws AccumuloSecurityException;
+ void dropUser(String user) throws AccumuloSecurityException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/security/handler/InsecureAuthenticator.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/handler/InsecureAuthenticator.java b/server/base/src/main/java/org/apache/accumulo/server/security/handler/InsecureAuthenticator.java
index 38574fa..5b374d9 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/security/handler/InsecureAuthenticator.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/security/handler/InsecureAuthenticator.java
@@ -33,7 +33,6 @@ public class InsecureAuthenticator implements Authenticator {
@Override
public void initialize(String instanceId, boolean initialize) {
- return;
}
@Override
@@ -43,7 +42,6 @@ public class InsecureAuthenticator implements Authenticator {
@Override
public void initializeSecurity(TCredentials credentials, String principal, byte[] token) throws AccumuloSecurityException {
- return;
}
@Override
@@ -58,17 +56,14 @@ public class InsecureAuthenticator implements Authenticator {
@Override
public void createUser(String principal, AuthenticationToken token) throws AccumuloSecurityException {
- return;
}
@Override
public void dropUser(String user) throws AccumuloSecurityException {
- return;
}
@Override
public void changePassword(String user, AuthenticationToken token) throws AccumuloSecurityException {
- return;
}
@Override
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/security/handler/InsecurePermHandler.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/handler/InsecurePermHandler.java b/server/base/src/main/java/org/apache/accumulo/server/security/handler/InsecurePermHandler.java
index 99c3bbe..dfe3c88 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/security/handler/InsecurePermHandler.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/security/handler/InsecurePermHandler.java
@@ -31,7 +31,6 @@ public class InsecurePermHandler implements PermissionHandler {
@Override
public void initialize(String instanceId, boolean initialize) {
- return;
}
@Override
@@ -41,7 +40,6 @@ public class InsecurePermHandler implements PermissionHandler {
@Override
public void initializeSecurity(TCredentials token, String rootuser) throws AccumuloSecurityException {
- return;
}
@Override
@@ -66,37 +64,30 @@ public class InsecurePermHandler implements PermissionHandler {
@Override
public void grantSystemPermission(String user, SystemPermission permission) throws AccumuloSecurityException {
- return;
}
@Override
public void revokeSystemPermission(String user, SystemPermission permission) throws AccumuloSecurityException {
- return;
}
@Override
public void grantTablePermission(String user, String table, TablePermission permission) throws AccumuloSecurityException, TableNotFoundException {
- return;
}
@Override
public void revokeTablePermission(String user, String table, TablePermission permission) throws AccumuloSecurityException, TableNotFoundException {
- return;
}
@Override
public void cleanTablePermissions(String table) throws AccumuloSecurityException, TableNotFoundException {
- return;
}
@Override
public void initUser(String user) throws AccumuloSecurityException {
- return;
}
@Override
public void cleanUser(String user) throws AccumuloSecurityException {
- return;
}
@Override
@@ -117,18 +108,15 @@ public class InsecurePermHandler implements PermissionHandler {
@Override
public void grantNamespacePermission(String user, String namespace, NamespacePermission permission) throws AccumuloSecurityException,
NamespaceNotFoundException {
- return;
}
@Override
public void revokeNamespacePermission(String user, String namespace, NamespacePermission permission) throws AccumuloSecurityException,
NamespaceNotFoundException {
- return;
}
@Override
public void cleanNamespacePermissions(String namespace) throws AccumuloSecurityException, NamespaceNotFoundException {
- return;
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/security/handler/PermissionHandler.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/handler/PermissionHandler.java b/server/base/src/main/java/org/apache/accumulo/server/security/handler/PermissionHandler.java
index b93ff1e..914bab3 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/security/handler/PermissionHandler.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/security/handler/PermissionHandler.java
@@ -34,105 +34,105 @@ public interface PermissionHandler {
/**
* Sets up the permission handler for a new instance of Accumulo
*/
- public void initialize(String instanceId, boolean initialize);
+ void initialize(String instanceId, boolean initialize);
/**
* Used to validate that the Authorizor, Authenticator, and permission handler can coexist
*/
- public boolean validSecurityHandlers(Authenticator authent, Authorizor author);
+ boolean validSecurityHandlers(Authenticator authent, Authorizor author);
/**
* Used to initialize security for the root user
*/
- public void initializeSecurity(TCredentials credentials, String rootuser) throws AccumuloSecurityException, ThriftSecurityException;
+ void initializeSecurity(TCredentials credentials, String rootuser) throws AccumuloSecurityException, ThriftSecurityException;
/**
* Used to get the system permission for the user
*/
- public boolean hasSystemPermission(String user, SystemPermission permission) throws AccumuloSecurityException;
+ boolean hasSystemPermission(String user, SystemPermission permission) throws AccumuloSecurityException;
/**
* Used to get the system permission for the user, with caching due to high frequency operation. NOTE: At this time, this method is unused but is included
* just in case we need it in the future.
*/
- public boolean hasCachedSystemPermission(String user, SystemPermission permission) throws AccumuloSecurityException;
+ boolean hasCachedSystemPermission(String user, SystemPermission permission) throws AccumuloSecurityException;
/**
* Used to get the table permission of a user for a table
*/
- public boolean hasTablePermission(String user, String table, TablePermission permission) throws AccumuloSecurityException, TableNotFoundException;
+ boolean hasTablePermission(String user, String table, TablePermission permission) throws AccumuloSecurityException, TableNotFoundException;
/**
* Used to get the table permission of a user for a table, with caching. This method is for high frequency operations
*/
- public boolean hasCachedTablePermission(String user, String table, TablePermission permission) throws AccumuloSecurityException, TableNotFoundException;
+ boolean hasCachedTablePermission(String user, String table, TablePermission permission) throws AccumuloSecurityException, TableNotFoundException;
/**
* Used to get the namespace permission of a user for a namespace
*/
- public boolean hasNamespacePermission(String user, String namespace, NamespacePermission permission) throws AccumuloSecurityException,
+ boolean hasNamespacePermission(String user, String namespace, NamespacePermission permission) throws AccumuloSecurityException,
NamespaceNotFoundException;
/**
* Used to get the namespace permission of a user for a namespace, with caching. This method is for high frequency operations
*/
- public boolean hasCachedNamespacePermission(String user, String namespace, NamespacePermission permission) throws AccumuloSecurityException,
+ boolean hasCachedNamespacePermission(String user, String namespace, NamespacePermission permission) throws AccumuloSecurityException,
NamespaceNotFoundException;
/**
* Gives the user the given system permission
*/
- public void grantSystemPermission(String user, SystemPermission permission) throws AccumuloSecurityException;
+ void grantSystemPermission(String user, SystemPermission permission) throws AccumuloSecurityException;
/**
* Denies the user the given system permission
*/
- public void revokeSystemPermission(String user, SystemPermission permission) throws AccumuloSecurityException;
+ void revokeSystemPermission(String user, SystemPermission permission) throws AccumuloSecurityException;
/**
* Gives the user the given table permission
*/
- public void grantTablePermission(String user, String table, TablePermission permission) throws AccumuloSecurityException, TableNotFoundException;
+ void grantTablePermission(String user, String table, TablePermission permission) throws AccumuloSecurityException, TableNotFoundException;
/**
* Denies the user the given table permission.
*/
- public void revokeTablePermission(String user, String table, TablePermission permission) throws AccumuloSecurityException, TableNotFoundException;
+ void revokeTablePermission(String user, String table, TablePermission permission) throws AccumuloSecurityException, TableNotFoundException;
/**
* Gives the user the given namespace permission
*/
- public void grantNamespacePermission(String user, String namespace, NamespacePermission permission) throws AccumuloSecurityException,
+ void grantNamespacePermission(String user, String namespace, NamespacePermission permission) throws AccumuloSecurityException,
NamespaceNotFoundException;
/**
* Denies the user the given namespace permission.
*/
- public void revokeNamespacePermission(String user, String namespace, NamespacePermission permission) throws AccumuloSecurityException,
+ void revokeNamespacePermission(String user, String namespace, NamespacePermission permission) throws AccumuloSecurityException,
NamespaceNotFoundException;
/**
* Cleans up the permissions for a table. Used when a table gets deleted.
*/
- public void cleanTablePermissions(String table) throws AccumuloSecurityException, TableNotFoundException;
+ void cleanTablePermissions(String table) throws AccumuloSecurityException, TableNotFoundException;
/**
* Cleans up the permissions for a namespace. Used when a namespace gets deleted.
*/
- public void cleanNamespacePermissions(String namespace) throws AccumuloSecurityException, NamespaceNotFoundException;
+ void cleanNamespacePermissions(String namespace) throws AccumuloSecurityException, NamespaceNotFoundException;
/**
* Initializes a new user
*/
- public void initUser(String user) throws AccumuloSecurityException;
+ void initUser(String user) throws AccumuloSecurityException;
/**
* Initializes a new user
*/
- public void initTable(String table) throws AccumuloSecurityException;
+ void initTable(String table) throws AccumuloSecurityException;
/**
* Deletes a user
*/
- public void cleanUser(String user) throws AccumuloSecurityException;
+ void cleanUser(String user) throws AccumuloSecurityException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/util/DumpZookeeper.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/DumpZookeeper.java b/server/base/src/main/java/org/apache/accumulo/server/util/DumpZookeeper.java
index c688869..30aa2eb 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/DumpZookeeper.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/DumpZookeeper.java
@@ -58,8 +58,6 @@ public class DumpZookeeper {
Logger.getRootLogger().setLevel(Level.WARN);
PrintStream out = System.out;
- if (args.length > 0)
- opts.root = opts.root;
try {
zk = ZooReaderWriter.getInstance();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java
index 7e20853..b410dc1 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java
@@ -171,7 +171,6 @@ public class FileUtil {
}
try {
- if (writer != null)
writer.close();
} catch (IOException e) {
log.error(e, e);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/base/src/main/java/org/apache/accumulo/server/util/time/ProvidesTime.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/time/ProvidesTime.java b/server/base/src/main/java/org/apache/accumulo/server/util/time/ProvidesTime.java
index 92f0d2c..117fa5f 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/time/ProvidesTime.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/time/ProvidesTime.java
@@ -21,5 +21,5 @@ package org.apache.accumulo.server.util.time;
*
*/
public interface ProvidesTime {
- public long currentTime();
+ long currentTime();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
----------------------------------------------------------------------
diff --git a/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java b/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
index 111d1e7..ab2ab42 100644
--- a/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
@@ -67,6 +67,7 @@ public class GarbageCollectWriteAheadLogs {
GarbageCollectWriteAheadLogs(Instance instance, VolumeManager fs, boolean useTrash) throws IOException {
this.instance = instance;
this.fs = fs;
+ this.useTrash = useTrash;
}
public void collect(GCStatus status) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/master/src/main/java/org/apache/accumulo/master/recovery/RecoveryManager.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/recovery/RecoveryManager.java b/server/master/src/main/java/org/apache/accumulo/master/recovery/RecoveryManager.java
index 789d482..390b33f 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/recovery/RecoveryManager.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/recovery/RecoveryManager.java
@@ -123,7 +123,7 @@ public class RecoveryManager {
public boolean recoverLogs(KeyExtent extent, Collection<Collection<String>> walogs) throws IOException {
boolean recoveryNeeded = false;
- ;
+
for (Collection<String> logs : walogs) {
for (String walog : logs) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java b/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
index 2426898..5b85a14 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/BulkImport.java
@@ -462,9 +462,6 @@ class LoadFiles extends MasterRepo {
private static final long serialVersionUID = 1L;
private static ExecutorService threadPool = null;
- static {
-
- }
private static final Logger log = Logger.getLogger(BulkImport.class);
private String tableId;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/master/src/main/java/org/apache/accumulo/master/tableOps/TableRangeOp.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/TableRangeOp.java b/server/master/src/main/java/org/apache/accumulo/master/tableOps/TableRangeOp.java
index a0f0af4..a972d46 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/TableRangeOp.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/TableRangeOp.java
@@ -108,7 +108,7 @@ public class TableRangeOp extends MasterRepo {
@Override
public Repo<Master> call(long tid, Master env) throws Exception {
- if (RootTable.ID.equals(tableId) && TableOperation.MERGE.equals(op)) {
+ if (RootTable.ID.equals(tableId) && Operation.MERGE.equals(op)) {
log.warn("Attempt to merge tablets for " + RootTable.NAME + " does nothing. It is not splittable.");
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/monitor/src/main/java/org/apache/accumulo/monitor/EmbeddedWebServer.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/EmbeddedWebServer.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/EmbeddedWebServer.java
index e16b598..5439b8a 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/EmbeddedWebServer.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/EmbeddedWebServer.java
@@ -43,10 +43,10 @@ public class EmbeddedWebServer {
handler = new ContextHandlerCollection();
root = new Context(handler, "/", new SessionHandler(), null, null, null);
- if (Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_KEYSTORE) == ""
- || Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_KEYSTOREPASS) == ""
- || Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_TRUSTSTORE) == ""
- || Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_TRUSTSTOREPASS) == "") {
+ if (Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_KEYSTORE).equals("")
+ || Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_KEYSTOREPASS).equals("")
+ || Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_TRUSTSTORE).equals("")
+ || Monitor.getSystemConfiguration().get(Property.MONITOR_SSL_TRUSTSTOREPASS).equals("")) {
sock = new SocketConnector();
usingSsl = false;
} else {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/OperationServlet.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/OperationServlet.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/OperationServlet.java
index 961edc3..e403687 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/OperationServlet.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/OperationServlet.java
@@ -80,8 +80,8 @@ public class OperationServlet extends BasicServlet {
}
}
- private static interface WebOperation {
- public void execute(HttpServletRequest req, HttpServletResponse resp, Logger log) throws Exception;
+ private interface WebOperation {
+ void execute(HttpServletRequest req, HttpServletResponse resp, Logger log) throws Exception;
}
public static class RefreshOperation implements WebOperation {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/VisServlet.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/VisServlet.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/VisServlet.java
index 5d2d2db..fb56573 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/VisServlet.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/VisServlet.java
@@ -158,7 +158,7 @@ public class VisServlet extends BasicServlet {
return;
int width = (int) Math.ceil(Math.sqrt(tservers.size())) * cfg.spacing;
- int height = (int) Math.ceil(tservers.size() / width) * cfg.spacing;
+ int height = (int) Math.ceil(tservers.size() / (double)width) * cfg.spacing;
doSettings(sb, cfg, width < 640 ? 640 : width, height < 640 ? 640 : height);
doScript(sb, cfg, tservers);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/trace/ListType.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/trace/ListType.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/trace/ListType.java
index e29c5d7..1ba0590 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/trace/ListType.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/trace/ListType.java
@@ -63,7 +63,7 @@ public class ListType extends Basic {
for (Entry<Key,Value> entry : scanner) {
RemoteSpan span = TraceFormatter.getRemoteSpan(entry);
if (span.description.equals(type)) {
- trace.addRow(span, new Long(span.stop - span.start), span.svc + ":" + span.sender);
+ trace.addRow(span, Long.valueOf(span.stop - span.start), span.svc + ":" + span.sender);
}
}
trace.generate(req, sb);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/tserver/src/main/java/org/apache/accumulo/tserver/Compactor.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/Compactor.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/Compactor.java
index fdd8a29..0843c13 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/Compactor.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/Compactor.java
@@ -128,7 +128,7 @@ public class Compactor implements Callable<CompactionStats> {
private static final long serialVersionUID = 1L;
}
- static interface CompactionEnv {
+ interface CompactionEnv {
boolean isCompactionEnabled();
IteratorScope getIteratorScope();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionalMutationSet.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionalMutationSet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionalMutationSet.java
index 0cdb14c..32eaacf 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionalMutationSet.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/ConditionalMutationSet.java
@@ -33,7 +33,7 @@ import org.apache.hadoop.io.WritableComparator;
*/
public class ConditionalMutationSet {
- static interface DeferFilter {
+ interface DeferFilter {
void defer(List<ServerConditionalMutation> scml, List<ServerConditionalMutation> okMutations, List<ServerConditionalMutation> deferred);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java
index 9678638..5ee62c6 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/InMemoryMap.java
@@ -232,19 +232,19 @@ public class InMemoryMap {
}
private interface SimpleMap {
- public Value get(Key key);
+ Value get(Key key);
- public Iterator<Entry<Key,Value>> iterator(Key startKey);
+ Iterator<Entry<Key,Value>> iterator(Key startKey);
- public int size();
+ int size();
- public InterruptibleIterator skvIterator();
+ InterruptibleIterator skvIterator();
- public void delete();
+ void delete();
- public long getMemoryUsed();
+ long getMemoryUsed();
- public void mutate(List<Mutation> mutations, int kvCount);
+ void mutate(List<Mutation> mutations, int kvCount);
}
private static class LocalityGroupMap implements SimpleMap {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index d2b01ac..5c1f6ce 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -2915,7 +2915,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
openingTablets.remove(extent);
onlineTablets.put(extent, tablet);
openingTablets.notifyAll();
- recentlyUnloadedCache.remove(tablet);
+ recentlyUnloadedCache.remove(tablet.getExtent());
}
}
tablet = null; // release this reference
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMBean.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMBean.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMBean.java
index 228e743..3b7a637 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMBean.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMBean.java
@@ -18,33 +18,33 @@ package org.apache.accumulo.tserver.metrics;
public interface TabletServerMBean {
- public int getOnlineCount();
+ int getOnlineCount();
- public int getOpeningCount();
+ int getOpeningCount();
- public int getUnopenedCount();
+ int getUnopenedCount();
- public int getMajorCompactions();
+ int getMajorCompactions();
- public int getMajorCompactionsQueued();
+ int getMajorCompactionsQueued();
- public int getMinorCompactions();
+ int getMinorCompactions();
- public int getMinorCompactionsQueued();
+ int getMinorCompactionsQueued();
- public long getEntries();
+ long getEntries();
- public long getEntriesInMemory();
+ long getEntriesInMemory();
- public long getQueries();
+ long getQueries();
- public long getIngest();
+ long getIngest();
- public long getTotalMinorCompactions();
+ long getTotalMinorCompactions();
- public double getHoldTime();
+ double getHoldTime();
- public String getName();
+ String getName();
- public double getAverageFilesPerTablet();
+ double getAverageFilesPerTablet();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMinCMetricsMBean.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMinCMetricsMBean.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMinCMetricsMBean.java
index 4541701..0dc6cf3 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMinCMetricsMBean.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMinCMetricsMBean.java
@@ -18,25 +18,25 @@ package org.apache.accumulo.tserver.metrics;
public interface TabletServerMinCMetricsMBean {
- public static final String minc = "minc";
- public static final String queue = "queue";
+ static final String minc = "minc";
+ static final String queue = "queue";
- public long getMinorCompactionCount();
+ long getMinorCompactionCount();
- public long getMinorCompactionAvgTime();
+ long getMinorCompactionAvgTime();
- public long getMinorCompactionMinTime();
+ long getMinorCompactionMinTime();
- public long getMinorCompactionMaxTime();
+ long getMinorCompactionMaxTime();
- public long getMinorCompactionQueueCount();
+ long getMinorCompactionQueueCount();
- public long getMinorCompactionQueueAvgTime();
+ long getMinorCompactionQueueAvgTime();
- public long getMinorCompactionQueueMinTime();
+ long getMinorCompactionQueueMinTime();
- public long getMinorCompactionQueueMaxTime();
+ long getMinorCompactionQueueMaxTime();
- public void reset();
+ void reset();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerScanMetricsMBean.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerScanMetricsMBean.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerScanMetricsMBean.java
index 4bcf188..b532cfa 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerScanMetricsMBean.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerScanMetricsMBean.java
@@ -18,25 +18,25 @@ package org.apache.accumulo.tserver.metrics;
public interface TabletServerScanMetricsMBean {
- public static final String scan = "scan";
- public static final String resultSize = "result";
+ static final String scan = "scan";
+ static final String resultSize = "result";
- public long getScanCount();
+ long getScanCount();
- public long getScanAvgTime();
+ long getScanAvgTime();
- public long getScanMinTime();
+ long getScanMinTime();
- public long getScanMaxTime();
+ long getScanMaxTime();
- public long getResultCount();
+ long getResultCount();
- public long getResultAvgSize();
+ long getResultAvgSize();
- public long getResultMinSize();
+ long getResultMinSize();
- public long getResultMaxSize();
+ long getResultMaxSize();
- public void reset();
+ void reset();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerUpdateMetricsMBean.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerUpdateMetricsMBean.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerUpdateMetricsMBean.java
index 7e3b506..0292947 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerUpdateMetricsMBean.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerUpdateMetricsMBean.java
@@ -18,49 +18,49 @@ package org.apache.accumulo.tserver.metrics;
public interface TabletServerUpdateMetricsMBean {
- public final static String permissionErrors = "permissionErrors";
- public final static String unknownTabletErrors = "unknownTabletErrors";
- public final static String mutationArraySize = "mutationArraysSize";
- public final static String commitPrep = "commitPrep";
- public final static String constraintViolations = "constraintViolations";
- public final static String waLogWriteTime = "waLogWriteTime";
- public final static String commitTime = "commitTime";
+ final static String permissionErrors = "permissionErrors";
+ final static String unknownTabletErrors = "unknownTabletErrors";
+ final static String mutationArraySize = "mutationArraysSize";
+ final static String commitPrep = "commitPrep";
+ final static String constraintViolations = "constraintViolations";
+ final static String waLogWriteTime = "waLogWriteTime";
+ final static String commitTime = "commitTime";
- public long getPermissionErrorCount();
+ long getPermissionErrorCount();
- public long getUnknownTabletErrorCount();
+ long getUnknownTabletErrorCount();
- public long getMutationArrayAvgSize();
+ long getMutationArrayAvgSize();
- public long getMutationArrayMinSize();
+ long getMutationArrayMinSize();
- public long getMutationArrayMaxSize();
+ long getMutationArrayMaxSize();
- public long getCommitPrepCount();
+ long getCommitPrepCount();
- public long getCommitPrepMinTime();
+ long getCommitPrepMinTime();
- public long getCommitPrepMaxTime();
+ long getCommitPrepMaxTime();
- public long getCommitPrepAvgTime();
+ long getCommitPrepAvgTime();
- public long getConstraintViolationCount();
+ long getConstraintViolationCount();
- public long getWALogWriteCount();
+ long getWALogWriteCount();
- public long getWALogWriteMinTime();
+ long getWALogWriteMinTime();
- public long getWALogWriteMaxTime();
+ long getWALogWriteMaxTime();
- public long getWALogWriteAvgTime();
+ long getWALogWriteAvgTime();
- public long getCommitCount();
+ long getCommitCount();
- public long getCommitMinTime();
+ long getCommitMinTime();
- public long getCommitMaxTime();
+ long getCommitMaxTime();
- public long getCommitAvgTime();
+ long getCommitAvgTime();
- public void reset();
+ void reset();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoader.java
----------------------------------------------------------------------
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoader.java b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoader.java
index 2a70c9c..c485fe4 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoader.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoader.java
@@ -17,6 +17,7 @@
package org.apache.accumulo.start.classloader.vfs;
import java.util.ArrayList;
+import java.util.Arrays;
import org.apache.commons.vfs2.FileChangeEvent;
import org.apache.commons.vfs2.FileListener;
@@ -118,8 +119,8 @@ public class AccumuloReloadingVFSClassLoader implements FileListener, ReloadingC
this(uris, vfs, parent, DEFAULT_TIMEOUT, preDelegate);
}
- public FileObject[] getFiles() {
- return this.files;
+ synchronized public FileObject[] getFiles() {
+ return Arrays.copyOf(this.files, this.files.length);
}
/**
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/start/src/main/java/org/apache/accumulo/start/classloader/vfs/FinalCloseDefaultFileSystemManager.java
----------------------------------------------------------------------
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/FinalCloseDefaultFileSystemManager.java b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/FinalCloseDefaultFileSystemManager.java
index e4737ec..a6cc19a 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/FinalCloseDefaultFileSystemManager.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/FinalCloseDefaultFileSystemManager.java
@@ -19,7 +19,7 @@ package org.apache.accumulo.start.classloader.vfs;
import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
public class FinalCloseDefaultFileSystemManager extends DefaultFileSystemManager {
- public void finalize() {
+ protected void finalize() {
close();
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/start/src/main/java/org/apache/accumulo/start/classloader/vfs/MiniDFSUtil.java
----------------------------------------------------------------------
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/MiniDFSUtil.java b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/MiniDFSUtil.java
index 6227549..c822f64 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/MiniDFSUtil.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/MiniDFSUtil.java
@@ -29,15 +29,19 @@ public class MiniDFSUtil {
try {
Process p = Runtime.getRuntime().exec("/bin/sh -c umask");
BufferedReader bri = new BufferedReader(new InputStreamReader(p.getInputStream()));
- String line = bri.readLine();
- p.waitFor();
-
- Short umask = Short.parseShort(line.trim(), 8);
- // Need to set permission to 777 xor umask
- // leading zero makes java interpret as base 8
- int newPermission = 0777 ^ umask;
-
- return String.format("%03o", newPermission);
+ try {
+ String line = bri.readLine();
+ p.waitFor();
+
+ Short umask = Short.parseShort(line.trim(), 8);
+ // Need to set permission to 777 xor umask
+ // leading zero makes java interpret as base 8
+ int newPermission = 0777 ^ umask;
+
+ return String.format("%03o", newPermission);
+ } finally {
+ bri.close();
+ }
} catch (Exception e) {
throw new RuntimeException("Error getting umask from O/S", e);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/start/src/main/java/org/apache/accumulo/start/classloader/vfs/PostDelegatingVFSClassLoader.java
----------------------------------------------------------------------
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/PostDelegatingVFSClassLoader.java b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/PostDelegatingVFSClassLoader.java
index 723484c..b7d5fa9 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/PostDelegatingVFSClassLoader.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/PostDelegatingVFSClassLoader.java
@@ -38,13 +38,13 @@ public class PostDelegatingVFSClassLoader extends VFSClassLoader {
protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
Class<?> c = findLoadedClass(name);
- if (c == null) {
- try {
- // try finding this class here instead of parent
- c = findClass(name);
- } catch (ClassNotFoundException e) {
-
- }
+ if (c != null)
+ return c;
+ try {
+ // try finding this class here instead of parent
+ return findClass(name);
+ } catch (ClassNotFoundException e) {
+
}
return super.loadClass(name, resolve);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
----------------------------------------------------------------------
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
index cc19b6e..328bb54 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/UniqueFileReplicator.java
@@ -30,6 +30,7 @@ import org.apache.commons.vfs2.provider.FileReplicator;
import org.apache.commons.vfs2.provider.UriParser;
import org.apache.commons.vfs2.provider.VfsComponent;
import org.apache.commons.vfs2.provider.VfsComponentContext;
+import org.apache.log4j.Logger;
/**
*
@@ -37,6 +38,8 @@ import org.apache.commons.vfs2.provider.VfsComponentContext;
public class UniqueFileReplicator implements VfsComponent, FileReplicator {
private static final char[] TMP_RESERVED_CHARS = new char[] {'?', '/', '\\', ' ', '&', '"', '\'', '*', '#', ';', ':', '<', '>', '|'};
+
+ private static final Logger log = Logger.getLogger(UniqueFileReplicator.class);
private File tempDir;
private VfsComponentContext context;
@@ -51,7 +54,8 @@ public class UniqueFileReplicator implements VfsComponent, FileReplicator {
String baseName = srcFile.getName().getBaseName();
try {
- tempDir.mkdirs();
+ if (!tempDir.mkdirs())
+ log.warn("Unexpected error creating directory " + tempDir);
String safeBasename = UriParser.encode(baseName, TMP_RESERVED_CHARS).replace('%', '_');
File file = File.createTempFile("vfsr_", "_" + safeBasename, tempDir);
file.deleteOnExit();
@@ -85,10 +89,11 @@ public class UniqueFileReplicator implements VfsComponent, FileReplicator {
public void close() {
synchronized (tmpFiles) {
for (File tmpFile : tmpFiles) {
- tmpFile.delete();
+ if (!tmpFile.delete())
+ log.warn("File does not exist: " + tmpFile);
}
}
-
- tempDir.delete();
+ if (!tempDir.delete())
+ log.warn("Directory does not exists: " + tempDir);
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystem.java
----------------------------------------------------------------------
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystem.java b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystem.java
index 92b2720..c9fd2f5 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystem.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/providers/HdfsFileSystem.java
@@ -42,112 +42,112 @@ import org.apache.hadoop.fs.Path;
*/
public class HdfsFileSystem extends AbstractFileSystem
{
- private static final Log log = LogFactory.getLog(HdfsFileSystem.class);
-
- private FileSystem fs;
-
- /**
- *
- * @param rootName
- * @param fileSystemOptions
- */
- protected HdfsFileSystem(final FileName rootName, final FileSystemOptions fileSystemOptions)
+ private static final Log log = LogFactory.getLog(HdfsFileSystem.class);
+
+ private FileSystem fs;
+
+ /**
+ *
+ * @param rootName
+ * @param fileSystemOptions
+ */
+ protected HdfsFileSystem(final FileName rootName, final FileSystemOptions fileSystemOptions)
+ {
+ super(rootName, null, fileSystemOptions);
+ }
+
+ /**
+ * @see org.apache.commons.vfs2.provider.AbstractFileSystem#addCapabilities(java.util.Collection)
+ */
+ @Override
+ protected void addCapabilities(final Collection<Capability> capabilities)
+ {
+ capabilities.addAll(HdfsFileProvider.CAPABILITIES);
+ }
+
+ /**
+ * @see org.apache.commons.vfs2.provider.AbstractFileSystem#close()
+ */
+ @Override
+ synchronized public void close()
+ {
+ try
{
- super(rootName, null, fileSystemOptions);
+ if (null != fs)
+ {
+ fs.close();
+ }
}
-
- /**
- * @see org.apache.commons.vfs2.provider.AbstractFileSystem#addCapabilities(java.util.Collection)
- */
- @Override
- protected void addCapabilities(final Collection<Capability> capabilities)
+ catch (final IOException e)
{
- capabilities.addAll(HdfsFileProvider.CAPABILITIES);
+ throw new RuntimeException("Error closing HDFS client", e);
}
-
- /**
- * @see org.apache.commons.vfs2.provider.AbstractFileSystem#close()
- */
- @Override
- public void close()
+ super.close();
+ }
+
+ /**
+ * @see org.apache.commons.vfs2.provider.AbstractFileSystem#createFile(org.apache.commons.vfs2.provider.AbstractFileName)
+ */
+ @Override
+ protected FileObject createFile(final AbstractFileName name) throws Exception
+ {
+ throw new FileSystemException("Operation not supported");
+ }
+
+ /**
+ * @see org.apache.commons.vfs2.provider.AbstractFileSystem#resolveFile(org.apache.commons.vfs2.FileName)
+ */
+ @Override
+ public FileObject resolveFile(final FileName name) throws FileSystemException
+ {
+
+ synchronized (this)
{
+ if (null == this.fs)
+ {
+ final String hdfsUri = name.getRootURI();
+ final Configuration conf = new Configuration(true);
+ conf.set(org.apache.hadoop.fs.FileSystem.FS_DEFAULT_NAME_KEY, hdfsUri);
+ this.fs = null;
try
{
- if (null != fs)
- {
- fs.close();
- }
+ fs = org.apache.hadoop.fs.FileSystem.get(conf);
}
catch (final IOException e)
{
- throw new RuntimeException("Error closing HDFS client", e);
+ log.error("Error connecting to filesystem " + hdfsUri, e);
+ throw new FileSystemException("Error connecting to filesystem " + hdfsUri, e);
}
- super.close();
+ }
}
-
- /**
- * @see org.apache.commons.vfs2.provider.AbstractFileSystem#createFile(org.apache.commons.vfs2.provider.AbstractFileName)
- */
- @Override
- protected FileObject createFile(final AbstractFileName name) throws Exception
+
+ boolean useCache = (null != getContext().getFileSystemManager().getFilesCache());
+ FileObject file;
+ if (useCache)
{
- throw new FileSystemException("Operation not supported");
+ file = this.getFileFromCache(name);
}
-
- /**
- * @see org.apache.commons.vfs2.provider.AbstractFileSystem#resolveFile(org.apache.commons.vfs2.FileName)
- */
- @Override
- public FileObject resolveFile(final FileName name) throws FileSystemException
+ else
{
-
- synchronized (this)
- {
- if (null == this.fs)
- {
- final String hdfsUri = name.getRootURI();
- final Configuration conf = new Configuration(true);
- conf.set(org.apache.hadoop.fs.FileSystem.FS_DEFAULT_NAME_KEY, hdfsUri);
- this.fs = null;
- try
- {
- fs = org.apache.hadoop.fs.FileSystem.get(conf);
- }
- catch (final IOException e)
- {
- log.error("Error connecting to filesystem " + hdfsUri, e);
- throw new FileSystemException("Error connecting to filesystem " + hdfsUri, e);
- }
- }
- }
-
- boolean useCache = (null != getContext().getFileSystemManager().getFilesCache());
- FileObject file;
- if (useCache)
- {
- file = this.getFileFromCache(name);
- }
- else
- {
- file = null;
- }
- if (null == file)
- {
- String path = null;
- try
- {
- path = URLDecoder.decode(name.getPath(), "UTF-8");
- }
- catch (final UnsupportedEncodingException e)
- {
- path = name.getPath();
- }
- final Path filePath = new Path(path);
- file = new HdfsFileObject((AbstractFileName) name, this, fs, filePath);
- if (useCache)
- {
+ file = null;
+ }
+ if (null == file)
+ {
+ String path = null;
+ try
+ {
+ path = URLDecoder.decode(name.getPath(), "UTF-8");
+ }
+ catch (final UnsupportedEncodingException e)
+ {
+ path = name.getPath();
+ }
+ final Path filePath = new Path(path);
+ file = new HdfsFileObject((AbstractFileName) name, this, fs, filePath);
+ if (useCache)
+ {
this.putFileToCache(file);
- }
+ }
}
@@ -160,5 +160,5 @@ public class HdfsFileSystem extends AbstractFileSystem
return file;
}
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java b/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
index 8fdba5a..8aa899b 100644
--- a/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
+++ b/test/src/main/java/org/apache/accumulo/test/IMMLGBenchmark.java
@@ -135,6 +135,12 @@ public class IMMLGBenchmark {
return t2 - t1;
}
+
+ static long abs(long l) {
+ if (l < 0)
+ return -l;
+ return l;
+ }
private static long write(Connector conn, ArrayList<byte[]> cfset, String table) throws TableNotFoundException, MutationsRejectedException {
Random rand = new Random();
@@ -146,7 +152,7 @@ public class IMMLGBenchmark {
long t1 = System.currentTimeMillis();
for (int i = 0; i < 1 << 15; i++) {
- byte[] row = FastFormat.toZeroPaddedString(Math.abs(rand.nextLong()), 16, 16, new byte[0]);
+ byte[] row = FastFormat.toZeroPaddedString(abs(rand.nextLong()), 16, 16, new byte[0]);
Mutation m = new Mutation(row);
for (byte[] cf : cfset) {
[6/6] git commit: Merge branch '1.6.0-SNAPSHOT'
Posted by ec...@apache.org.
Merge branch '1.6.0-SNAPSHOT'
Conflicts:
core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/0c92a63f
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/0c92a63f
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/0c92a63f
Branch: refs/heads/master
Commit: 0c92a63f97f5a596ba286401aea37cbe8cf63afc
Parents: 7903d09 5bd4e27
Author: Eric Newton <er...@gmail.com>
Authored: Wed Jan 8 18:33:05 2014 -0500
Committer: Eric Newton <er...@gmail.com>
Committed: Wed Jan 8 18:33:05 2014 -0500
----------------------------------------------------------------------
.../accumulo/core/client/BatchDeleter.java | 2 +-
.../accumulo/core/client/BatchWriter.java | 8 +-
.../accumulo/core/client/ConditionalWriter.java | 8 +-
.../apache/accumulo/core/client/Instance.java | 24 +--
.../accumulo/core/client/IsolatedScanner.java | 5 +-
.../core/client/MultiTableBatchWriter.java | 8 +-
.../core/client/MutationsRejectedException.java | 15 +-
.../apache/accumulo/core/client/Scanner.java | 18 +-
.../accumulo/core/client/ScannerBase.java | 22 +--
.../core/client/admin/InstanceOperations.java | 18 +-
.../core/client/admin/NamespaceOperations.java | 38 ++--
.../core/client/admin/SecurityOperations.java | 42 ++---
.../core/client/admin/TableOperations.java | 94 +++++-----
.../core/client/admin/TableOperationsImpl.java | 22 ++-
.../core/client/impl/ConditionalWriterImpl.java | 8 +-
.../client/impl/MultiTableBatchWriterImpl.java | 14 +-
.../accumulo/core/client/impl/Tables.java | 4 +-
.../core/client/impl/TabletLocatorImpl.java | 9 +-
.../client/impl/TabletServerBatchWriter.java | 8 +-
.../accumulo/core/client/impl/Translator.java | 4 +-
.../core/client/mapred/AbstractInputFormat.java | 9 +-
.../client/mapreduce/AbstractInputFormat.java | 7 +-
.../core/client/mapreduce/RangeInputSplit.java | 5 +-
.../security/tokens/AuthenticationToken.java | 6 +-
.../core/client/security/tokens/NullToken.java | 3 -
.../client/security/tokens/PasswordToken.java | 2 +-
.../core/conf/AccumuloConfiguration.java | 2 +-
.../accumulo/core/conf/ConfigSanityCheck.java | 2 +-
.../apache/accumulo/core/conf/PropertyType.java | 5 +-
.../accumulo/core/constraints/Constraint.java | 2 +-
.../apache/accumulo/core/data/ColumnUpdate.java | 6 +-
.../apache/accumulo/core/data/Condition.java | 2 +-
.../accumulo/core/data/ConditionalMutation.java | 2 +-
.../apache/accumulo/core/data/KeyExtent.java | 2 +-
.../org/apache/accumulo/core/data/Range.java | 2 +-
.../accumulo/core/file/FileSKVIterator.java | 10 +-
.../org/apache/accumulo/core/file/FileUtil.java | 7 +-
.../core/file/blockfile/ABlockReader.java | 12 +-
.../core/file/blockfile/ABlockWriter.java | 10 +-
.../core/file/blockfile/BlockFileReader.java | 10 +-
.../core/file/blockfile/BlockFileWriter.java | 8 +-
.../core/file/blockfile/cache/BlockCache.java | 10 +-
.../core/file/blockfile/cache/CacheEntry.java | 4 +-
.../core/file/blockfile/cache/HeapSize.java | 2 +-
.../file/blockfile/cache/LruBlockCache.java | 8 +
.../file/keyfunctor/ColumnFamilyFunctor.java | 4 +-
.../core/file/keyfunctor/KeyFunctor.java | 4 +-
.../core/file/keyfunctor/RowFunctor.java | 4 +-
.../accumulo/core/file/rfile/BlockIndex.java | 13 ++
.../core/file/rfile/MultiLevelIndex.java | 15 +-
.../apache/accumulo/core/file/rfile/RFile.java | 2 +-
.../accumulo/core/file/rfile/bcfile/BCFile.java | 4 +-
.../core/file/rfile/bcfile/CompareUtils.java | 2 +-
.../core/file/rfile/bcfile/RawComparable.java | 6 +-
.../core/iterators/OptionDescriber.java | 6 +-
.../core/iterators/TypedValueCombiner.java | 6 +-
.../iterators/system/InterruptibleIterator.java | 2 +-
.../core/iterators/user/AgeOffFilter.java | 4 +-
.../core/iterators/user/TimestampFilter.java | 4 +-
.../iterators/user/TransformingIterator.java | 2 +-
.../core/iterators/user/VisibilityFilter.java | 6 -
.../core/security/AuthorizationContainer.java | 2 +-
.../accumulo/core/security/Authorizations.java | 2 +-
.../core/security/crypto/CryptoModule.java | 8 +-
.../crypto/SecretKeyEncryptionStrategy.java | 4 +-
.../SecretKeyEncryptionStrategyContext.java | 16 +-
.../apache/accumulo/core/trace/SpanTree.java | 2 +-
.../apache/accumulo/core/util/CreateToken.java | 1 -
.../accumulo/core/util/format/Formatter.java | 2 +-
.../core/util/interpret/ScanInterpreter.java | 10 +-
.../apache/accumulo/core/util/shell/Shell.java | 5 +-
.../accumulo/core/cli/TestClientOpts.java | 12 +-
.../core/client/IteratorSettingTest.java | 2 +-
.../file/blockfile/cache/TestLruBlockCache.java | 15 +-
.../accumulo/core/file/rfile/RFileTest.java | 23 +--
.../iterators/user/BigDecimalCombinerTest.java | 6 +-
.../simple/client/RandomBatchScanner.java | 8 +-
.../simple/client/RandomBatchWriter.java | 10 +-
.../examples/simple/client/RowOperations.java | 28 +--
.../org/apache/accumulo/fate/AgeOffStore.java | 2 +-
.../java/org/apache/accumulo/fate/Fate.java | 3 +-
.../java/org/apache/accumulo/fate/TStore.java | 20 +-
.../zookeeper/DistributedReadWriteLock.java | 1 -
.../accumulo/fate/zookeeper/IZooReader.java | 16 +-
.../fate/zookeeper/IZooReaderWriter.java | 32 ++--
.../fate/zookeeper/TransactionWatcher.java | 8 +-
.../accumulo/fate/zookeeper/ZooCache.java | 2 +-
.../apache/accumulo/fate/zookeeper/ZooLock.java | 2 -
.../fate/zookeeper/ZooReaderWriter.java | 3 +-
.../accumulo/fate/zookeeper/ZooReservation.java | 6 +-
.../accumulo/fate/zookeeper/ZooSession.java | 6 +-
.../minicluster/MiniAccumuloCluster.java | 4 +-
.../accumulo/minicluster/ProcessReference.java | 5 +-
.../minicluster/MiniAccumuloClusterGCTest.java | 2 +-
pom.xml | 3 +-
.../java/org/apache/accumulo/proxy/Proxy.java | 3 +-
.../org/apache/accumulo/proxy/ProxyServer.java | 9 +-
.../org/apache/accumulo/server/Accumulo.java | 2 +-
.../server/conf/NamespaceConfiguration.java | 7 +-
.../server/conf/TableConfiguration.java | 7 +-
.../accumulo/server/fs/VolumeManagerImpl.java | 2 +-
.../server/master/recovery/LogCloser.java | 2 +-
.../server/master/state/Assignment.java | 1 -
.../server/master/state/DistributedStore.java | 8 +-
.../server/master/state/MetaDataStateStore.java | 3 -
.../master/state/RootTabletStateStore.java | 3 -
.../server/master/state/TabletStateStore.java | 2 -
.../server/metrics/MetricsConfiguration.java | 16 +-
.../server/metrics/ThriftMetricsMBean.java | 22 +--
.../server/problems/ProblemReports.java | 6 +-
.../server/security/handler/Authenticator.java | 22 +--
.../server/security/handler/Authorizor.java | 16 +-
.../security/handler/InsecureAuthenticator.java | 5 -
.../security/handler/InsecurePermHandler.java | 12 --
.../security/handler/PermissionHandler.java | 40 ++--
.../accumulo/server/util/DumpZookeeper.java | 2 -
.../apache/accumulo/server/util/FileUtil.java | 1 -
.../accumulo/server/util/time/ProvidesTime.java | 2 +-
.../gc/GarbageCollectWriteAheadLogs.java | 1 +
.../master/recovery/RecoveryManager.java | 2 +-
.../accumulo/master/tableOps/BulkImport.java | 3 -
.../accumulo/master/tableOps/TableRangeOp.java | 2 +-
.../accumulo/monitor/EmbeddedWebServer.java | 8 +-
.../monitor/servlets/OperationServlet.java | 4 +-
.../accumulo/monitor/servlets/VisServlet.java | 2 +-
.../monitor/servlets/trace/ListType.java | 2 +-
.../org/apache/accumulo/tserver/Compactor.java | 2 +-
.../tserver/ConditionalMutationSet.java | 2 +-
.../apache/accumulo/tserver/InMemoryMap.java | 14 +-
.../apache/accumulo/tserver/TabletServer.java | 2 +-
.../tserver/metrics/TabletServerMBean.java | 30 +--
.../metrics/TabletServerMinCMetricsMBean.java | 22 +--
.../metrics/TabletServerScanMetricsMBean.java | 22 +--
.../metrics/TabletServerUpdateMetricsMBean.java | 52 +++---
.../vfs/AccumuloReloadingVFSClassLoader.java | 5 +-
.../vfs/FinalCloseDefaultFileSystemManager.java | 2 +-
.../start/classloader/vfs/MiniDFSUtil.java | 22 ++-
.../vfs/PostDelegatingVFSClassLoader.java | 14 +-
.../classloader/vfs/UniqueFileReplicator.java | 13 +-
.../vfs/providers/HdfsFileSystem.java | 182 +++++++++----------
.../apache/accumulo/test/IMMLGBenchmark.java | 8 +-
.../test/continuous/UndefinedAnalyzer.java | 4 +-
.../metadata/MetadataBatchScanTest.java | 4 +-
.../apache/accumulo/test/randomwalk/Module.java | 2 +-
.../accumulo/test/randomwalk/bulk/Setup.java | 2 +-
.../test/randomwalk/concurrent/AddSplits.java | 2 +-
.../test/randomwalk/concurrent/BatchScan.java | 2 +-
.../test/randomwalk/concurrent/BatchWrite.java | 4 +-
.../randomwalk/concurrent/CheckBalance.java | 2 +-
.../test/randomwalk/concurrent/Setup.java | 2 +-
.../accumulo/test/randomwalk/image/Commit.java | 2 +-
.../test/randomwalk/image/ImageFixture.java | 6 +-
.../test/randomwalk/image/ScanMeta.java | 2 +-
.../accumulo/test/randomwalk/image/Write.java | 2 +-
.../test/randomwalk/multitable/Commit.java | 2 +-
.../multitable/MultiTableFixture.java | 6 +-
.../randomwalk/security/SecurityHelper.java | 2 +-
.../randomwalk/security/WalkingSecurity.java | 2 +-
.../test/randomwalk/sequential/BatchVerify.java | 2 +-
.../test/randomwalk/sequential/Commit.java | 2 +-
.../randomwalk/sequential/MapRedVerifyTool.java | 2 +-
.../sequential/SequentialFixture.java | 4 +-
.../test/randomwalk/sequential/Write.java | 2 +-
.../test/randomwalk/shard/BulkInsert.java | 4 +-
.../accumulo/test/randomwalk/shard/Insert.java | 2 +-
.../test/randomwalk/shard/ShardFixture.java | 4 +-
.../apache/accumulo/test/scalability/Run.java | 1 -
.../accumulo/test/scalability/ScaleTest.java | 2 +-
.../accumulo/test/ConditionalWriterIT.java | 12 +-
.../apache/accumulo/test/TableOperationsIT.java | 2 +-
.../apache/accumulo/trace/instrument/Span.java | 2 +-
.../trace/instrument/receivers/LogSpans.java | 4 +-
172 files changed, 798 insertions(+), 768 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/0c92a63f/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
----------------------------------------------------------------------
diff --cc core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
index 9ffe065,6d20cb0..e0b6b32
--- a/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
@@@ -30,21 -30,9 +30,21 @@@ import org.apache.accumulo.core.client.
import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader;
import org.apache.log4j.Logger;
+/**
+ * A configuration object.
+ */
public abstract class AccumuloConfiguration implements Iterable<Entry<String,String>> {
+ /**
+ * A filter for properties, based on key.
+ */
- public static interface PropertyFilter {
+ public interface PropertyFilter {
+ /**
+ * Determines whether to accept a property based on its key.
+ *
+ * @param key property key
+ * @return true to accept property (pass filter)
+ */
boolean accept(String key);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/0c92a63f/core/src/main/java/org/apache/accumulo/core/conf/ConfigSanityCheck.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/0c92a63f/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/0c92a63f/core/src/main/java/org/apache/accumulo/core/data/ColumnUpdate.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/0c92a63f/core/src/main/java/org/apache/accumulo/core/data/Condition.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/0c92a63f/core/src/main/java/org/apache/accumulo/core/data/Range.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/0c92a63f/pom.xml
----------------------------------------------------------------------
[2/6] ACCUMULO-2160 fixed up a lot of findbugs/pmd complaints
Posted by ec...@apache.org.
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/continuous/UndefinedAnalyzer.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/continuous/UndefinedAnalyzer.java b/test/src/main/java/org/apache/accumulo/test/continuous/UndefinedAnalyzer.java
index 1c60640..8ef7d5f 100644
--- a/test/src/main/java/org/apache/accumulo/test/continuous/UndefinedAnalyzer.java
+++ b/test/src/main/java/org/apache/accumulo/test/continuous/UndefinedAnalyzer.java
@@ -71,7 +71,7 @@ public class UndefinedAnalyzer {
public IngestInfo(String logDir) throws Exception {
File dir = new File(logDir);
File[] ingestLogs = dir.listFiles(new FilenameFilter() {
- public boolean accept(java.io.File dir, String name) {
+ public boolean accept(File dir, String name) {
return name.endsWith("ingest.out");
}
});
@@ -162,7 +162,7 @@ public class UndefinedAnalyzer {
TabletHistory(String tableId, String acuLogDir) throws Exception {
File dir = new File(acuLogDir);
File[] masterLogs = dir.listFiles(new FilenameFilter() {
- public boolean accept(java.io.File dir, String name) {
+ public boolean accept(File dir, String name) {
return name.matches("master.*debug.log.*");
}
});
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java b/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
index 449d732..9af578c 100644
--- a/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
+++ b/test/src/main/java/org/apache/accumulo/test/performance/metadata/MetadataBatchScanTest.java
@@ -226,7 +226,7 @@ public class MetadataBatchScanTest {
bs.close();
long t2 = System.currentTimeMillis();
- ss.delta1 = (t2 - t1);
+ ss.delta1 = t2 - t1;
ss.count1 = count;
count = 0;
@@ -237,7 +237,7 @@ public class MetadataBatchScanTest {
t2 = System.currentTimeMillis();
- ss.delta2 = (t2 - t1);
+ ss.delta2 = t2 - t1;
ss.count2 = count;
return ss;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
index 397f2e8..c9da3a8 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/Module.java
@@ -355,7 +355,7 @@ public class Module extends Node {
private String getFullName(String name) {
int index = name.indexOf(".");
- if ((index == -1) || name.endsWith(".xml")) {
+ if (index == -1 || name.endsWith(".xml")) {
return name;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java
index c94c80e..dad2bcc 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/bulk/Setup.java
@@ -49,7 +49,7 @@ public class Setup extends Test {
try {
if (!tableOps.exists(getTableName())) {
tableOps.create(getTableName());
- IteratorSetting is = new IteratorSetting(10, org.apache.accumulo.core.iterators.user.SummingCombiner.class);
+ IteratorSetting is = new IteratorSetting(10, SummingCombiner.class);
SummingCombiner.setEncodingType(is, LongCombiner.Type.STRING);
SummingCombiner.setCombineAllColumns(is, true);
tableOps.attachIterator(getTableName(), is);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
index aa976f7..e03b7f6 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/AddSplits.java
@@ -47,7 +47,7 @@ public class AddSplits extends Test {
TreeSet<Text> splits = new TreeSet<Text>();
for (int i = 0; i < rand.nextInt(10) + 1; i++)
- splits.add(new Text(String.format("%016x", (rand.nextLong() & 0x7fffffffffffffffl))));
+ splits.add(new Text(String.format("%016x", rand.nextLong() & 0x7fffffffffffffffl)));
try {
conn.tableOperations().addSplits(tableName, splits);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
index 009dd44..3fa7d47 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchScan.java
@@ -53,7 +53,7 @@ public class BatchScan extends Test {
BatchScanner bs = conn.createBatchScanner(tableName, Authorizations.EMPTY, 3);
List<Range> ranges = new ArrayList<Range>();
for (int i = 0; i < rand.nextInt(2000) + 1; i++)
- ranges.add(new Range(String.format("%016x", (rand.nextLong() & 0x7fffffffffffffffl))));
+ ranges.add(new Range(String.format("%016x", rand.nextLong() & 0x7fffffffffffffffl)));
bs.setRanges(ranges);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchWrite.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchWrite.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchWrite.java
index f1c5e22..2e52f12 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchWrite.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/BatchWrite.java
@@ -50,8 +50,8 @@ public class BatchWrite extends Test {
try {
int numRows = rand.nextInt(100000);
for (int i = 0; i < numRows; i++) {
- Mutation m = new Mutation(String.format("%016x", (rand.nextLong() & 0x7fffffffffffffffl)));
- long val = (rand.nextLong() & 0x7fffffffffffffffl);
+ Mutation m = new Mutation(String.format("%016x", rand.nextLong() & 0x7fffffffffffffffl));
+ long val = rand.nextLong() & 0x7fffffffffffffffl;
for (int j = 0; j < 10; j++) {
m.put("cf", "cq" + j, new Value(String.format("%016x", val).getBytes()));
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
index f0a93ac..066ef63 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CheckBalance.java
@@ -48,7 +48,7 @@ public class CheckBalance extends Test {
String location = entry.getKey().getColumnQualifier().toString();
Long count = counts.get(location);
if (count == null)
- count = new Long(0);
+ count = Long.valueOf(0);
counts.put(location, count + 1);
}
double total = 0.;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Setup.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Setup.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Setup.java
index cb481f8..502e9e3 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Setup.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/Setup.java
@@ -43,7 +43,7 @@ public class Setup extends Test {
}
// Make tables in the default namespace
- double tableCeil = Math.ceil(numTables / (numNamespaces + 1));
+ double tableCeil = Math.ceil((double)numTables / (numNamespaces + 1));
for (int i = 0; i < tableCeil; i++) {
tables.add(String.format("ctt_%03d", i));
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java
index 854ad0c..3a805ef 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Commit.java
@@ -28,7 +28,7 @@ public class Commit extends Test {
state.getMultiTableBatchWriter().flush();
log.debug("Committed " + state.getLong("numWrites") + " writes. Total writes: " + state.getLong("totalWrites"));
- state.set("numWrites", new Long(0));
+ state.set("numWrites", Long.valueOf(0));
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
index 744c761..723bfa8 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ImageFixture.java
@@ -86,9 +86,9 @@ public class ImageFixture extends Fixture {
log.debug("Configured locality groups for " + imageTableName + " groups = " + groups);
}
- state.set("numWrites", new Long(0));
- state.set("totalWrites", new Long(0));
- state.set("verified", new Integer(0));
+ state.set("numWrites", Long.valueOf(0));
+ state.set("totalWrites", Long.valueOf(0));
+ state.set("verified", Integer.valueOf(0));
state.set("lastIndexRow", new Text(""));
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ScanMeta.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ScanMeta.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ScanMeta.java
index 7ee15f5..77c66ed 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ScanMeta.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/ScanMeta.java
@@ -60,7 +60,7 @@ public class ScanMeta extends Test {
int maxScan = Integer.parseInt(props.getProperty("maxScan"));
Random rand = new Random();
- int numToScan = rand.nextInt((maxScan - minScan)) + minScan;
+ int numToScan = rand.nextInt(maxScan - minScan) + minScan;
Map<Text,Text> hashes = new HashMap<Text,Text>();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Write.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Write.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Write.java
index 4206148..35e729f 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Write.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/image/Write.java
@@ -54,7 +54,7 @@ public class Write extends Test {
int minSize = Integer.parseInt(props.getProperty("minSize"));
Random rand = new Random();
- int numBytes = rand.nextInt((maxSize - minSize)) + minSize;
+ int numBytes = rand.nextInt(maxSize - minSize) + minSize;
byte[] imageBytes = new byte[numBytes];
rand.nextBytes(imageBytes);
m.put(CONTENT_COLUMN_FAMILY, IMAGE_COLUMN_QUALIFIER, new Value(imageBytes));
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
index 341ac02..1153634 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/Commit.java
@@ -33,7 +33,7 @@ public class Commit extends Test {
log.debug("Committed " + numWrites + " writes. Total writes: " + totalWrites);
state.set("totalWrites", totalWrites);
- state.set("numWrites", new Long(0));
+ state.set("numWrites", Long.valueOf(0));
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
index 7ea2eb3..8b209b3 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/multitable/MultiTableFixture.java
@@ -34,9 +34,9 @@ public class MultiTableFixture extends Fixture {
String hostname = InetAddress.getLocalHost().getHostName().replaceAll("[-.]", "_");
state.set("tableNamePrefix", String.format("multi_%s_%s_%d", hostname, state.getPid(), System.currentTimeMillis()));
- state.set("nextId", new Integer(0));
- state.set("numWrites", new Long(0));
- state.set("totalWrites", new Long(0));
+ state.set("nextId", Integer.valueOf(0));
+ state.set("numWrites", Long.valueOf(0));
+ state.set("totalWrites", Long.valueOf(0));
state.set("tableList", new ArrayList<String>());
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityHelper.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityHelper.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityHelper.java
index 685b05d..278635f 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityHelper.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityHelper.java
@@ -188,7 +188,7 @@ public class SecurityHelper {
try {
fs = (FileSystem) state.get(filesystem);
} catch (RuntimeException re) {}
- ;
+
if (fs == null) {
try {
fs = FileSystem.get(CachedConfiguration.getInstance());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
index 4bc072c..b3e693c 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
@@ -431,7 +431,7 @@ public class WalkingSecurity extends SecurityOperation implements Authorizor, Au
try {
fs = (FileSystem) state.get(filesystem);
} catch (RuntimeException re) {}
- ;
+
if (fs == null) {
try {
fs = FileSystem.get(CachedConfiguration.getInstance());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
index 77e1cd5..04da64d 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/BatchVerify.java
@@ -61,7 +61,7 @@ public class BatchVerify extends Test {
if (rangeEnd > (numWrites - 1)) {
rangeEnd = numWrites - 1;
}
- count += (rangeEnd - rangeStart) + 1;
+ count += rangeEnd - rangeStart + 1;
ranges.add(new Range(new Text(String.format("%010d", rangeStart)), new Text(String.format("%010d", rangeEnd))));
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
index 8abfb39..cd1ccab 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Commit.java
@@ -29,7 +29,7 @@ public class Commit extends Test {
state.getMultiTableBatchWriter().flush();
log.debug("Committed " + state.getLong("numWrites") + " writes. Total writes: " + state.getLong("totalWrites"));
- state.set("numWrites", new Long(0));
+ state.set("numWrites", Long.valueOf(0));
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerifyTool.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerifyTool.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerifyTool.java
index 22a7371..1af150f 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerifyTool.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/MapRedVerifyTool.java
@@ -60,7 +60,7 @@ public class MapRedVerifyTool extends Configured implements Tool {
int index = start;
while (iterator.hasNext()) {
int next = iterator.next().get();
- if (next != (index + 1)) {
+ if (next != index + 1) {
writeMutation(output, start, index);
start = next;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
index 2a5cfa1..927a803 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/SequentialFixture.java
@@ -51,8 +51,8 @@ public class SequentialFixture extends Fixture {
}
conn.tableOperations().setProperty(seqTableName, "table.scan.max.memory", "1K");
- state.set("numWrites", new Long(0));
- state.set("totalWrites", new Long(0));
+ state.set("numWrites", Long.valueOf(0));
+ state.set("totalWrites", Long.valueOf(0));
}
@Override
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
index 671055b..aa55276 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/sequential/Write.java
@@ -35,7 +35,7 @@ public class Write extends Test {
state.set("numWrites", state.getLong("numWrites") + 1);
Long totalWrites = state.getLong("totalWrites") + 1;
- if ((totalWrites % 10000) == 0) {
+ if (totalWrites % 10000 == 0) {
log.debug("Total writes: " + totalWrites);
}
state.set("totalWrites", totalWrites);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
index 0331552..c725e3b 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/BulkInsert.java
@@ -102,7 +102,7 @@ public class BulkInsert extends Test {
int minInsert = Integer.parseInt(props.getProperty("minInsert"));
int maxInsert = Integer.parseInt(props.getProperty("maxInsert"));
- int numToInsert = rand.nextInt((maxInsert - minInsert)) + minInsert;
+ int numToInsert = rand.nextInt(maxInsert - minInsert) + minInsert;
int maxSplits = Integer.parseInt(props.getProperty("maxSplits"));
@@ -121,7 +121,7 @@ public class BulkInsert extends Test {
log.debug("Bulk inserting document " + docID);
}
- state.set("nextDocID", new Long(nextDocID));
+ state.set("nextDocID", Long.valueOf(nextDocID));
dataWriter.close();
indexWriter.close();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
index 672dd2e..8e81acb 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/Insert.java
@@ -50,7 +50,7 @@ public class Insert extends Test {
log.debug("Inserted document " + docID);
- state.set("nextDocID", new Long(nextDocID));
+ state.set("nextDocID", Long.valueOf(nextDocID));
}
static String insertRandomDocument(long did, BatchWriter dataWriter, BatchWriter indexWriter, String indexTableName, String dataTableName, int numPartitions,
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
index a54229f..f93ef9a 100644
--- a/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
+++ b/test/src/main/java/org/apache/accumulo/test/randomwalk/shard/ShardFixture.java
@@ -35,7 +35,7 @@ public class ShardFixture extends Fixture {
static SortedSet<Text> genSplits(long max, int numTablets, String format) {
int numSplits = numTablets - 1;
- long distance = (max / numTablets);
+ long distance = max / numTablets;
long split = distance;
TreeSet<Text> splits = new TreeSet<Text>();
@@ -78,7 +78,7 @@ public class ShardFixture extends Fixture {
state.set("numPartitions", new Integer(numPartitions));
state.set("cacheIndex", rand.nextDouble() < .5);
state.set("rand", rand);
- state.set("nextDocID", new Long(0));
+ state.set("nextDocID", Long.valueOf(0));
Connector conn = state.getConnector();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/scalability/Run.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/scalability/Run.java b/test/src/main/java/org/apache/accumulo/test/scalability/Run.java
index 0c598c0..8c3e371 100644
--- a/test/src/main/java/org/apache/accumulo/test/scalability/Run.java
+++ b/test/src/main/java/org/apache/accumulo/test/scalability/Run.java
@@ -22,7 +22,6 @@ import java.net.InetAddress;
import org.apache.accumulo.core.cli.Help;
import org.apache.accumulo.core.util.CachedConfiguration;
-import org.apache.accumulo.test.scalability.ScaleTest;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java b/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java
index c4dd42d..46377d6 100644
--- a/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java
+++ b/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java
@@ -57,7 +57,7 @@ public abstract class ScaleTest {
protected void stopTimer(long numEntries, long numBytes) {
long endTime = System.currentTimeMillis();
- System.out.printf("ELAPSEDMS %d %d %d%n", (endTime - startTime), numEntries, numBytes);
+ System.out.printf("ELAPSEDMS %d %d %d%n", endTime - startTime, numEntries, numBytes);
}
public abstract void setup();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java b/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
index 05a8961..9dca7da 100644
--- a/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
@@ -578,6 +578,12 @@ public class ConditionalWriterIT extends SimpleMacIT {
cw.close();
}
+ static long abs(long l) {
+ if (l < 0)
+ return -l;
+ return l;
+ }
+
@Test(timeout = 60 * 1000)
public void testBigBatch() throws Exception {
@@ -598,7 +604,7 @@ public class ConditionalWriterIT extends SimpleMacIT {
byte[] e = new byte[0];
for (int i = 0; i < num; i++) {
- rows.add(FastFormat.toZeroPaddedString(Math.abs(r.nextLong()), 16, 16, e));
+ rows.add(FastFormat.toZeroPaddedString(abs(r.nextLong()), 16, 16, e));
}
for (int i = 0; i < num; i++) {
@@ -891,7 +897,7 @@ public class ConditionalWriterIT extends SimpleMacIT {
for (ByteSequence row : changes) {
scanner.setRange(new Range(row.toString()));
Stats stats = new Stats(scanner.iterator());
- stats.set(rand.nextInt(10), Math.abs(rand.nextInt()));
+ stats.set(rand.nextInt(10), rand.nextInt(Integer.MAX_VALUE));
mutations.add(stats.toMutation());
}
@@ -941,7 +947,7 @@ public class ConditionalWriterIT extends SimpleMacIT {
ArrayList<ByteSequence> rows = new ArrayList<ByteSequence>();
for (int i = 0; i < 1000; i++) {
- rows.add(new ArrayByteSequence(FastFormat.toZeroPaddedString(Math.abs(rand.nextLong()), 16, 16, new byte[0])));
+ rows.add(new ArrayByteSequence(FastFormat.toZeroPaddedString(abs(rand.nextLong()), 16, 16, new byte[0])));
}
ArrayList<ConditionalMutation> mutations = new ArrayList<ConditionalMutation>();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java b/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
index 7873df4..167c07f 100644
--- a/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java
@@ -124,7 +124,7 @@ public class TableOperationsIT {
List<DiskUsage> diskUsages = connector.tableOperations().getDiskUsage(Collections.singleton(tableName));
assertEquals(1, diskUsages.size());
assertEquals(1, diskUsages.get(0).getTables().size());
- assertEquals(new Long(0), diskUsages.get(0).getUsage());
+ assertEquals(Long.valueOf(0), diskUsages.get(0).getUsage());
assertEquals(tableName, diskUsages.get(0).getTables().first());
// add some data
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/trace/src/main/java/org/apache/accumulo/trace/instrument/Span.java
----------------------------------------------------------------------
diff --git a/trace/src/main/java/org/apache/accumulo/trace/instrument/Span.java b/trace/src/main/java/org/apache/accumulo/trace/instrument/Span.java
index 2aaade0..5267174 100644
--- a/trace/src/main/java/org/apache/accumulo/trace/instrument/Span.java
+++ b/trace/src/main/java/org/apache/accumulo/trace/instrument/Span.java
@@ -22,7 +22,7 @@ import java.util.Map;
* Base interface for gathering and reporting statistics about a block of execution.
*/
public interface Span {
- public static final long ROOT_SPAN_ID = 0;
+ static final long ROOT_SPAN_ID = 0;
/** Begin gathering timing information */
void start();
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/LogSpans.java
----------------------------------------------------------------------
diff --git a/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/LogSpans.java b/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/LogSpans.java
index acf9e5c..dfed660 100644
--- a/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/LogSpans.java
+++ b/trace/src/main/java/org/apache/accumulo/trace/instrument/receivers/LogSpans.java
@@ -16,7 +16,6 @@
*/
package org.apache.accumulo.trace.instrument.receivers;
-import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
@@ -28,7 +27,6 @@ import org.apache.log4j.Level;
*/
public class LogSpans implements SpanReceiver {
private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LogSpans.class);
- private static final DateFormat fmt = new SimpleDateFormat("HH:mm:ss.SSS");
static public class SpanLevel extends Level {
@@ -51,7 +49,7 @@ public class LogSpans implements SpanReceiver {
String parentStr = "";
if (parentId > 0)
parentStr = " parent:" + parentId;
- String startStr = fmt.format(new Date(start));
+ String startStr = new SimpleDateFormat("HH:mm:ss.SSS").format(new Date(start));
return String.format("%20s:%x id:%d%s start:%s ms:%d", description, traceId, spanId, parentStr, startStr, stop - start);
}
[5/6] git commit: ACCUMULO-2160 fixed up a lot of findbugs/pmd
complaints
Posted by ec...@apache.org.
ACCUMULO-2160 fixed up a lot of findbugs/pmd complaints
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/5bd4e27c
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/5bd4e27c
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/5bd4e27c
Branch: refs/heads/master
Commit: 5bd4e27cbc4dd800d88188c4b39f59447e02e44a
Parents: 1a9ae3c
Author: Eric Newton <er...@gmail.com>
Authored: Wed Jan 8 18:31:37 2014 -0500
Committer: Eric Newton <er...@gmail.com>
Committed: Wed Jan 8 18:31:37 2014 -0500
----------------------------------------------------------------------
.../accumulo/core/client/BatchDeleter.java | 2 +-
.../accumulo/core/client/BatchWriter.java | 8 +-
.../accumulo/core/client/ConditionalWriter.java | 8 +-
.../apache/accumulo/core/client/Instance.java | 24 +--
.../accumulo/core/client/IsolatedScanner.java | 5 +-
.../core/client/MultiTableBatchWriter.java | 8 +-
.../core/client/MutationsRejectedException.java | 15 +-
.../apache/accumulo/core/client/Scanner.java | 18 +-
.../accumulo/core/client/ScannerBase.java | 22 +--
.../core/client/admin/InstanceOperations.java | 18 +-
.../core/client/admin/NamespaceOperations.java | 38 ++--
.../core/client/admin/SecurityOperations.java | 42 ++---
.../core/client/admin/TableOperations.java | 94 +++++-----
.../core/client/admin/TableOperationsImpl.java | 22 ++-
.../core/client/impl/ConditionalWriterImpl.java | 8 +-
.../client/impl/MultiTableBatchWriterImpl.java | 14 +-
.../accumulo/core/client/impl/Tables.java | 4 +-
.../core/client/impl/TabletLocatorImpl.java | 9 +-
.../client/impl/TabletServerBatchWriter.java | 8 +-
.../accumulo/core/client/impl/Translator.java | 4 +-
.../core/client/mapred/AbstractInputFormat.java | 9 +-
.../client/mapreduce/AbstractInputFormat.java | 7 +-
.../core/client/mapreduce/RangeInputSplit.java | 5 +-
.../security/tokens/AuthenticationToken.java | 6 +-
.../core/client/security/tokens/NullToken.java | 3 -
.../client/security/tokens/PasswordToken.java | 2 +-
.../core/conf/AccumuloConfiguration.java | 2 +-
.../accumulo/core/conf/ConfigSanityCheck.java | 2 +-
.../apache/accumulo/core/conf/PropertyType.java | 5 +-
.../accumulo/core/constraints/Constraint.java | 2 +-
.../apache/accumulo/core/data/ColumnUpdate.java | 6 +-
.../apache/accumulo/core/data/Condition.java | 2 +-
.../accumulo/core/data/ConditionalMutation.java | 2 +-
.../apache/accumulo/core/data/KeyExtent.java | 2 +-
.../org/apache/accumulo/core/data/Range.java | 2 +-
.../accumulo/core/file/FileSKVIterator.java | 10 +-
.../org/apache/accumulo/core/file/FileUtil.java | 7 +-
.../core/file/blockfile/ABlockReader.java | 12 +-
.../core/file/blockfile/ABlockWriter.java | 10 +-
.../core/file/blockfile/BlockFileReader.java | 10 +-
.../core/file/blockfile/BlockFileWriter.java | 8 +-
.../core/file/blockfile/cache/BlockCache.java | 10 +-
.../core/file/blockfile/cache/CacheEntry.java | 4 +-
.../core/file/blockfile/cache/HeapSize.java | 2 +-
.../file/blockfile/cache/LruBlockCache.java | 8 +
.../file/keyfunctor/ColumnFamilyFunctor.java | 4 +-
.../core/file/keyfunctor/KeyFunctor.java | 4 +-
.../core/file/keyfunctor/RowFunctor.java | 4 +-
.../accumulo/core/file/rfile/BlockIndex.java | 13 ++
.../core/file/rfile/MultiLevelIndex.java | 15 +-
.../apache/accumulo/core/file/rfile/RFile.java | 2 +-
.../accumulo/core/file/rfile/bcfile/BCFile.java | 4 +-
.../core/file/rfile/bcfile/CompareUtils.java | 2 +-
.../core/file/rfile/bcfile/RawComparable.java | 6 +-
.../core/iterators/OptionDescriber.java | 6 +-
.../core/iterators/TypedValueCombiner.java | 6 +-
.../iterators/system/InterruptibleIterator.java | 2 +-
.../core/iterators/user/AgeOffFilter.java | 4 +-
.../core/iterators/user/TimestampFilter.java | 4 +-
.../iterators/user/TransformingIterator.java | 2 +-
.../core/iterators/user/VisibilityFilter.java | 6 -
.../core/security/AuthorizationContainer.java | 2 +-
.../accumulo/core/security/Authorizations.java | 2 +-
.../core/security/crypto/CryptoModule.java | 8 +-
.../crypto/SecretKeyEncryptionStrategy.java | 4 +-
.../SecretKeyEncryptionStrategyContext.java | 16 +-
.../apache/accumulo/core/trace/SpanTree.java | 2 +-
.../apache/accumulo/core/util/CreateToken.java | 1 -
.../accumulo/core/util/format/Formatter.java | 2 +-
.../core/util/interpret/ScanInterpreter.java | 10 +-
.../apache/accumulo/core/util/shell/Shell.java | 5 +-
.../accumulo/core/cli/TestClientOpts.java | 12 +-
.../core/client/IteratorSettingTest.java | 2 +-
.../file/blockfile/cache/TestLruBlockCache.java | 15 +-
.../accumulo/core/file/rfile/RFileTest.java | 23 +--
.../iterators/user/BigDecimalCombinerTest.java | 6 +-
.../simple/client/RandomBatchScanner.java | 8 +-
.../simple/client/RandomBatchWriter.java | 10 +-
.../examples/simple/client/RowOperations.java | 28 +--
.../org/apache/accumulo/fate/AgeOffStore.java | 2 +-
.../java/org/apache/accumulo/fate/Fate.java | 3 +-
.../java/org/apache/accumulo/fate/TStore.java | 20 +-
.../zookeeper/DistributedReadWriteLock.java | 1 -
.../accumulo/fate/zookeeper/IZooReader.java | 16 +-
.../fate/zookeeper/IZooReaderWriter.java | 32 ++--
.../fate/zookeeper/TransactionWatcher.java | 8 +-
.../accumulo/fate/zookeeper/ZooCache.java | 2 +-
.../apache/accumulo/fate/zookeeper/ZooLock.java | 2 -
.../fate/zookeeper/ZooReaderWriter.java | 3 +-
.../accumulo/fate/zookeeper/ZooReservation.java | 6 +-
.../accumulo/fate/zookeeper/ZooSession.java | 6 +-
.../minicluster/MiniAccumuloCluster.java | 4 +-
.../accumulo/minicluster/ProcessReference.java | 5 +-
.../minicluster/MiniAccumuloClusterGCTest.java | 2 +-
pom.xml | 1 +
.../java/org/apache/accumulo/proxy/Proxy.java | 3 +-
.../org/apache/accumulo/proxy/ProxyServer.java | 9 +-
.../org/apache/accumulo/server/Accumulo.java | 2 +-
.../server/conf/NamespaceConfiguration.java | 7 +-
.../server/conf/TableConfiguration.java | 7 +-
.../accumulo/server/fs/VolumeManagerImpl.java | 2 +-
.../server/master/recovery/LogCloser.java | 2 +-
.../server/master/state/Assignment.java | 1 -
.../server/master/state/DistributedStore.java | 8 +-
.../server/master/state/MetaDataStateStore.java | 3 -
.../master/state/RootTabletStateStore.java | 3 -
.../server/master/state/TabletStateStore.java | 2 -
.../server/metrics/MetricsConfiguration.java | 16 +-
.../server/metrics/ThriftMetricsMBean.java | 22 +--
.../server/problems/ProblemReports.java | 6 +-
.../server/security/handler/Authenticator.java | 22 +--
.../server/security/handler/Authorizor.java | 16 +-
.../security/handler/InsecureAuthenticator.java | 5 -
.../security/handler/InsecurePermHandler.java | 12 --
.../security/handler/PermissionHandler.java | 40 ++--
.../accumulo/server/util/DumpZookeeper.java | 2 -
.../apache/accumulo/server/util/FileUtil.java | 1 -
.../accumulo/server/util/time/ProvidesTime.java | 2 +-
.../gc/GarbageCollectWriteAheadLogs.java | 1 +
.../master/recovery/RecoveryManager.java | 2 +-
.../accumulo/master/tableOps/BulkImport.java | 3 -
.../accumulo/master/tableOps/TableRangeOp.java | 2 +-
.../accumulo/monitor/EmbeddedWebServer.java | 8 +-
.../monitor/servlets/OperationServlet.java | 4 +-
.../accumulo/monitor/servlets/VisServlet.java | 2 +-
.../monitor/servlets/trace/ListType.java | 2 +-
.../org/apache/accumulo/tserver/Compactor.java | 2 +-
.../tserver/ConditionalMutationSet.java | 2 +-
.../apache/accumulo/tserver/InMemoryMap.java | 14 +-
.../apache/accumulo/tserver/TabletServer.java | 2 +-
.../tserver/metrics/TabletServerMBean.java | 30 +--
.../metrics/TabletServerMinCMetricsMBean.java | 22 +--
.../metrics/TabletServerScanMetricsMBean.java | 22 +--
.../metrics/TabletServerUpdateMetricsMBean.java | 52 +++---
.../vfs/AccumuloReloadingVFSClassLoader.java | 5 +-
.../vfs/FinalCloseDefaultFileSystemManager.java | 2 +-
.../start/classloader/vfs/MiniDFSUtil.java | 22 ++-
.../vfs/PostDelegatingVFSClassLoader.java | 14 +-
.../classloader/vfs/UniqueFileReplicator.java | 13 +-
.../vfs/providers/HdfsFileSystem.java | 182 +++++++++----------
.../apache/accumulo/test/IMMLGBenchmark.java | 8 +-
.../test/continuous/UndefinedAnalyzer.java | 4 +-
.../metadata/MetadataBatchScanTest.java | 4 +-
.../apache/accumulo/test/randomwalk/Module.java | 2 +-
.../accumulo/test/randomwalk/bulk/Setup.java | 2 +-
.../test/randomwalk/concurrent/AddSplits.java | 2 +-
.../test/randomwalk/concurrent/BatchScan.java | 2 +-
.../test/randomwalk/concurrent/BatchWrite.java | 4 +-
.../randomwalk/concurrent/CheckBalance.java | 2 +-
.../test/randomwalk/concurrent/Setup.java | 2 +-
.../accumulo/test/randomwalk/image/Commit.java | 2 +-
.../test/randomwalk/image/ImageFixture.java | 6 +-
.../test/randomwalk/image/ScanMeta.java | 2 +-
.../accumulo/test/randomwalk/image/Write.java | 2 +-
.../test/randomwalk/multitable/Commit.java | 2 +-
.../multitable/MultiTableFixture.java | 6 +-
.../randomwalk/security/SecurityHelper.java | 2 +-
.../randomwalk/security/WalkingSecurity.java | 2 +-
.../test/randomwalk/sequential/BatchVerify.java | 2 +-
.../test/randomwalk/sequential/Commit.java | 2 +-
.../randomwalk/sequential/MapRedVerifyTool.java | 2 +-
.../sequential/SequentialFixture.java | 4 +-
.../test/randomwalk/sequential/Write.java | 2 +-
.../test/randomwalk/shard/BulkInsert.java | 4 +-
.../accumulo/test/randomwalk/shard/Insert.java | 2 +-
.../test/randomwalk/shard/ShardFixture.java | 4 +-
.../apache/accumulo/test/scalability/Run.java | 1 -
.../accumulo/test/scalability/ScaleTest.java | 2 +-
.../accumulo/test/ConditionalWriterIT.java | 12 +-
.../apache/accumulo/test/TableOperationsIT.java | 2 +-
.../apache/accumulo/trace/instrument/Span.java | 2 +-
.../trace/instrument/receivers/LogSpans.java | 4 +-
172 files changed, 797 insertions(+), 767 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/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 15405a0..2bfc347 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
@@ -34,7 +34,7 @@ public interface BatchDeleter extends ScannerBase {
* @throws TableNotFoundException
* when the table does not exist
*/
- public void delete() throws MutationsRejectedException, TableNotFoundException;
+ void delete() throws MutationsRejectedException, TableNotFoundException;
/**
* Allows deleting multiple ranges efficiently.
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/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 be88be0..b321411 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
@@ -40,7 +40,7 @@ public interface BatchWriter {
* this could be thrown because current or previous mutations failed
*/
- public void addMutation(Mutation m) throws MutationsRejectedException;
+ void addMutation(Mutation m) throws MutationsRejectedException;
/**
* Queues several mutations to write.
@@ -50,7 +50,7 @@ public interface BatchWriter {
* @throws MutationsRejectedException
* this could be thrown because current or previous mutations failed
*/
- public void addMutations(Iterable<Mutation> iterable) throws MutationsRejectedException;
+ void addMutations(Iterable<Mutation> iterable) throws MutationsRejectedException;
/**
* Send any buffered mutations to Accumulo immediately.
@@ -58,7 +58,7 @@ public interface BatchWriter {
* @throws MutationsRejectedException
* this could be thrown because current or previous mutations failed
*/
- public void flush() throws MutationsRejectedException;
+ void flush() throws MutationsRejectedException;
/**
* Flush and release any resources.
@@ -66,6 +66,6 @@ public interface BatchWriter {
* @throws MutationsRejectedException
* this could be thrown because current or previous mutations failed
*/
- public void close() throws MutationsRejectedException;
+ void close() throws MutationsRejectedException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/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 2c24a2e..5fdccf0 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
@@ -29,7 +29,7 @@ import org.apache.accumulo.core.data.ConditionalMutation;
* @since 1.6.0
*/
public interface ConditionalWriter {
- public static class Result {
+ class Result {
private Status status;
private ConditionalMutation mutation;
@@ -122,7 +122,7 @@ public interface ConditionalWriter {
* @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.
*/
- public abstract Iterator<Result> write(Iterator<ConditionalMutation> mutations);
+ Iterator<Result> write(Iterator<ConditionalMutation> mutations);
/**
* This method has the same thread safety guarantees as @link {@link #write(Iterator)}
@@ -132,10 +132,10 @@ public interface ConditionalWriter {
* @return Result for the submitted mutation
*/
- public abstract Result write(ConditionalMutation mutation);
+ Result write(ConditionalMutation mutation);
/**
* release any resources (like threads pools) used by conditional writer
*/
- public void close();
+ void close();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/Instance.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/Instance.java b/core/src/main/java/org/apache/accumulo/core/client/Instance.java
index 8912b51..9bf2a08 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/Instance.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/Instance.java
@@ -33,42 +33,42 @@ public interface Instance {
*
* @return location in "hostname:port" form
*/
- public abstract String getRootTabletLocation();
+ String getRootTabletLocation();
/**
* Returns the location(s) of the accumulo master and any redundant servers.
*
* @return a list of locations in "hostname:port" form
*/
- public abstract List<String> getMasterLocations();
+ List<String> getMasterLocations();
/**
* Returns a unique string that identifies this instance of accumulo.
*
* @return a UUID
*/
- public abstract String getInstanceID();
+ String getInstanceID();
/**
* Returns the instance name given at system initialization time.
*
* @return current instance name
*/
- public abstract String getInstanceName();
+ String getInstanceName();
/**
* 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();
+ String getZooKeepers();
/**
* Returns the zookeeper connection timeout.
*
* @return the configured timeout to connect to zookeeper
*/
- public abstract int getZooKeepersSessionTimeOut();
+ int getZooKeepersSessionTimeOut();
/**
* Returns a connection to accumulo.
@@ -85,7 +85,7 @@ public interface Instance {
* @deprecated since 1.5, use {@link #getConnector(String, AuthenticationToken)} with {@link PasswordToken}
*/
@Deprecated
- public abstract Connector getConnector(String user, byte[] pass) throws AccumuloException, AccumuloSecurityException;
+ Connector getConnector(String user, byte[] pass) throws AccumuloException, AccumuloSecurityException;
/**
* Returns a connection to accumulo.
@@ -102,7 +102,7 @@ public interface Instance {
* @deprecated since 1.5, use {@link #getConnector(String, AuthenticationToken)} with {@link PasswordToken}
*/
@Deprecated
- public abstract Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException;
+ Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException;
/**
* Returns a connection to this instance of accumulo.
@@ -119,7 +119,7 @@ public interface Instance {
* @deprecated since 1.5, use {@link #getConnector(String, AuthenticationToken)} with {@link PasswordToken}
*/
@Deprecated
- public abstract Connector getConnector(String user, CharSequence pass) throws AccumuloException, AccumuloSecurityException;
+ Connector getConnector(String user, CharSequence pass) throws AccumuloException, AccumuloSecurityException;
/**
* Returns the AccumuloConfiguration to use when interacting with this instance.
@@ -128,7 +128,7 @@ public interface Instance {
* @deprecated since 1.6.0
*/
@Deprecated
- public abstract AccumuloConfiguration getConfiguration();
+ AccumuloConfiguration getConfiguration();
/**
* Set the AccumuloConfiguration to use when interacting with this instance.
@@ -138,7 +138,7 @@ public interface Instance {
* @deprecated since 1.6.0
*/
@Deprecated
- public abstract void setConfiguration(AccumuloConfiguration conf);
+ void setConfiguration(AccumuloConfiguration conf);
/**
* Returns a connection to this instance of accumulo.
@@ -150,5 +150,5 @@ public interface Instance {
* {@link PasswordToken}
* @since 1.5.0
*/
- public abstract Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException;
+ Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/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 2e99abf..443596a 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
@@ -169,11 +169,11 @@ public class IsolatedScanner extends ScannerOptions implements Scanner {
}
- public static interface RowBufferFactory {
+ interface RowBufferFactory {
RowBuffer newBuffer();
}
- public static interface RowBuffer extends Iterable<Entry<Key,Value>> {
+ interface RowBuffer extends Iterable<Entry<Key,Value>> {
void add(Entry<Key,Value> entry);
@Override
@@ -256,7 +256,6 @@ public class IsolatedScanner extends ScannerOptions implements Scanner {
@Override
public void setRange(Range range) {
this.range = range;
- ;
}
@Override
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/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 eda5fa7..39287e8 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
@@ -36,7 +36,7 @@ public interface MultiTableBatchWriter {
* @throws TableNotFoundException
* when the table does not exist
*/
- public BatchWriter getBatchWriter(String table) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
+ BatchWriter getBatchWriter(String table) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
/**
* Send mutations for all tables to accumulo.
@@ -44,7 +44,7 @@ public interface MultiTableBatchWriter {
* @throws MutationsRejectedException
* when queued mutations are unable to be inserted
*/
- public void flush() throws MutationsRejectedException;
+ void flush() throws MutationsRejectedException;
/**
* Flush and release all resources.
@@ -53,12 +53,12 @@ public interface MultiTableBatchWriter {
* when queued mutations are unable to be inserted
*
*/
- public void close() throws MutationsRejectedException;
+ 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();
+ boolean isClosed();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/MutationsRejectedException.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/MutationsRejectedException.java b/core/src/main/java/org/apache/accumulo/core/client/MutationsRejectedException.java
index bfa62d3..fba2893 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/MutationsRejectedException.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/MutationsRejectedException.java
@@ -22,6 +22,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import org.apache.accumulo.core.client.impl.Tables;
@@ -62,19 +63,19 @@ public class MutationsRejectedException extends AccumuloException {
}
private static String format(HashMap<KeyExtent,Set<SecurityErrorCode>> hashMap, Instance instance) {
- Map<String,Set<SecurityErrorCode>> errorMap = new HashMap<String,Set<SecurityErrorCode>>();
+ Map<String,Set<SecurityErrorCode>> result = new HashMap<String,Set<SecurityErrorCode>>();
- for (KeyExtent ke : hashMap.keySet()) {
- String tableInfo = Tables.getPrintableTableInfoFromId(instance, ke.getTableId().toString());
+ for (Entry<KeyExtent,Set<SecurityErrorCode>> entry : hashMap.entrySet()) {
+ String tableInfo = Tables.getPrintableTableInfoFromId(instance, entry.getKey().getTableId().toString());
- if (!errorMap.containsKey(tableInfo)) {
- errorMap.put(tableInfo, new HashSet<SecurityErrorCode>());
+ if (!result.containsKey(tableInfo)) {
+ result.put(tableInfo, new HashSet<SecurityErrorCode>());
}
- errorMap.get(tableInfo).addAll(hashMap.get(ke));
+ result.get(tableInfo).addAll(hashMap.get(entry.getKey()));
}
- return errorMap.toString();
+ return result.toString();
}
/**
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/Scanner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/Scanner.java b/core/src/main/java/org/apache/accumulo/core/client/Scanner.java
index 245aa18..112179e 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/Scanner.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/Scanner.java
@@ -35,7 +35,7 @@ public interface Scanner extends ScannerBase {
* @deprecated Since 1.5. See {@link ScannerBase#setTimeout(long, java.util.concurrent.TimeUnit)}
*/
@Deprecated
- public void setTimeOut(int timeOut);
+ void setTimeOut(int timeOut);
/**
* Returns the setting for how long a scanner will automatically retry when a failure occurs.
@@ -44,7 +44,7 @@ public interface Scanner extends ScannerBase {
* @deprecated Since 1.5. See {@link ScannerBase#getTimeout(java.util.concurrent.TimeUnit)}
*/
@Deprecated
- public int getTimeOut();
+ int getTimeOut();
/**
* Sets the range of keys to scan over.
@@ -52,14 +52,14 @@ public interface Scanner extends ScannerBase {
* @param range
* key range to begin and end scan
*/
- public void setRange(Range range);
+ void setRange(Range range);
/**
* Returns the range of keys to scan over.
*
* @return the range configured for this scanner
*/
- public Range getRange();
+ Range getRange();
/**
* Sets the number of Key/Value pairs that will be fetched at a time from a tablet server.
@@ -67,19 +67,19 @@ public interface Scanner extends ScannerBase {
* @param size
* the number of Key/Value pairs to fetch per call to Accumulo
*/
- public void setBatchSize(int size);
+ 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();
+ 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();
+ 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.
@@ -91,12 +91,12 @@ public interface Scanner extends ScannerBase {
* @return Number of batches before read-ahead begins
* @since 1.6.0
*/
- public long getReadaheadThreshold();
+ long getReadaheadThreshold();
/**
* Sets the number of batches of Key/Value pairs returned before the {@link Scanner} will begin to prefetch the next batch
* @param batches Non-negative number of batches
* @since 1.6.0
*/
- public void setReadaheadThreshold(long batches);
+ void setReadaheadThreshold(long batches);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java b/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
index 873a3ad..26056b8 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
@@ -39,7 +39,7 @@ public interface ScannerBase extends Iterable<Entry<Key,Value>> {
* @throws IllegalArgumentException
* if the setting conflicts with existing iterators
*/
- public void addScanIterator(IteratorSetting cfg);
+ void addScanIterator(IteratorSetting cfg);
/**
* Remove an iterator from the list of iterators.
@@ -47,7 +47,7 @@ public interface ScannerBase extends Iterable<Entry<Key,Value>> {
* @param iteratorName
* nickname used for the iterator
*/
- public void removeScanIterator(String iteratorName);
+ void removeScanIterator(String iteratorName);
/**
* Update the options for an iterator. Note that this does <b>not</b> change the iterator options during a scan, it just replaces the given option on a
@@ -60,7 +60,7 @@ public interface ScannerBase extends Iterable<Entry<Key,Value>> {
* @param value
* the new value for the named option
*/
- public void updateScanIteratorOption(String iteratorName, String key, String value);
+ 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
@@ -69,7 +69,7 @@ public interface ScannerBase extends Iterable<Entry<Key,Value>> {
* @param col
* the column family to be fetched
*/
- public void fetchColumnFamily(Text col);
+ void fetchColumnFamily(Text col);
/**
* 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
@@ -80,17 +80,17 @@ public interface ScannerBase extends Iterable<Entry<Key,Value>> {
* @param colQual
* the column qualifier of the column to be fetched
*/
- public void fetchColumn(Text colFam, Text colQual);
+ void fetchColumn(Text colFam, Text colQual);
/**
* Clears the columns to be fetched (useful for resetting the scanner for reuse). Once cleared, the scanner will fetch all columns.
*/
- public void clearColumns();
+ void clearColumns();
/**
* Clears scan iterators prior to returning a scanner to the pool.
*/
- public void clearScanIterators();
+ 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
@@ -100,7 +100,7 @@ public interface ScannerBase extends Iterable<Entry<Key,Value>> {
*
* @return an iterator over Key,Value pairs which meet the restrictions set on the scanner
*/
- public Iterator<Entry<Key,Value>> iterator();
+ Iterator<Entry<Key,Value>> iterator();
/**
* This setting determines how long a scanner will automatically retry when a failure occurs. By default a scanner will retry forever.
@@ -112,7 +112,7 @@ public interface ScannerBase extends Iterable<Entry<Key,Value>> {
* determines how timeout is interpreted
* @since 1.5.0
*/
- public void setTimeout(long timeOut, TimeUnit timeUnit);
+ void setTimeout(long timeOut, TimeUnit timeUnit);
/**
* Returns the setting for how long a scanner will automatically retry when a failure occurs.
@@ -120,11 +120,11 @@ public interface ScannerBase extends Iterable<Entry<Key,Value>> {
* @return the timeout configured for this scanner
* @since 1.5.0
*/
- public long getTimeout(TimeUnit timeUnit);
+ long getTimeout(TimeUnit timeUnit);
/**
* Closes any underlying connections on the scanner
* @since 1.5.0
*/
- public void close();
+ void close();
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java b/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java
index fce0716..afa539a 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperations.java
@@ -40,7 +40,7 @@ public interface InstanceOperations {
* @throws AccumuloSecurityException
* if the user does not have permission
*/
- public void setProperty(final String property, final String value) throws AccumuloException, AccumuloSecurityException;
+ void setProperty(final String property, final String value) throws AccumuloException, AccumuloSecurityException;
/**
* Removes a system property from zookeeper. Changes can be seen using {@link #getSystemConfiguration()}
@@ -52,7 +52,7 @@ public interface InstanceOperations {
* @throws AccumuloSecurityException
* if the user does not have permission
*/
- public void removeProperty(final String property) throws AccumuloException, AccumuloSecurityException;
+ void removeProperty(final String property) throws AccumuloException, AccumuloSecurityException;
/**
*
@@ -62,7 +62,7 @@ public interface InstanceOperations {
* @throws AccumuloSecurityException
*/
- public Map<String,String> getSystemConfiguration() throws AccumuloException, AccumuloSecurityException;
+ Map<String,String> getSystemConfiguration() throws AccumuloException, AccumuloSecurityException;
/**
*
@@ -72,7 +72,7 @@ public interface InstanceOperations {
* @throws AccumuloSecurityException
*/
- public Map<String,String> getSiteConfiguration() throws AccumuloException, AccumuloSecurityException;
+ Map<String,String> getSiteConfiguration() throws AccumuloException, AccumuloSecurityException;
/**
* List the currently active tablet servers participating in the accumulo instance
@@ -80,7 +80,7 @@ public interface InstanceOperations {
* @return A list of currently active tablet servers.
*/
- public List<String> getTabletServers();
+ List<String> getTabletServers();
/**
* List the active scans on tablet server.
@@ -92,7 +92,7 @@ public interface InstanceOperations {
* @throws AccumuloSecurityException
*/
- public List<ActiveScan> getActiveScans(String tserver) throws AccumuloException, AccumuloSecurityException;
+ List<ActiveScan> getActiveScans(String tserver) throws AccumuloException, AccumuloSecurityException;
/**
* List the active compaction running on a tablet server
@@ -105,7 +105,7 @@ public interface InstanceOperations {
* @since 1.5.0
*/
- public List<ActiveCompaction> getActiveCompactions(String tserver) throws AccumuloException, AccumuloSecurityException;
+ List<ActiveCompaction> getActiveCompactions(String tserver) throws AccumuloException, AccumuloSecurityException;
/**
* Throws an exception if a tablet server can not be contacted.
@@ -115,7 +115,7 @@ public interface InstanceOperations {
* @throws AccumuloException
* @since 1.5.0
*/
- public void ping(String tserver) throws AccumuloException;
+ void ping(String tserver) throws AccumuloException;
/**
* Test to see if the instance can load the given class as the given type. This check does not consider per table classpaths, see
@@ -126,6 +126,6 @@ public interface InstanceOperations {
* @return true if the instance can load the given class as the given type, false otherwise
* @throws AccumuloException
*/
- public boolean testClassLoad(final String className, final String asTypeName) throws AccumuloException, AccumuloSecurityException;
+ boolean testClassLoad(final String className, final String asTypeName) throws AccumuloException, AccumuloSecurityException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/admin/NamespaceOperations.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/NamespaceOperations.java b/core/src/main/java/org/apache/accumulo/core/client/admin/NamespaceOperations.java
index b81310e..269e563 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/NamespaceOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/NamespaceOperations.java
@@ -49,7 +49,7 @@ public interface NamespaceOperations {
* if the user does not have permission
* @since 1.6.0
*/
- public SortedSet<String> list() throws AccumuloException, AccumuloSecurityException;
+ SortedSet<String> list() throws AccumuloException, AccumuloSecurityException;
/**
* A method to check if a namespace exists in Accumulo.
@@ -63,7 +63,7 @@ public interface NamespaceOperations {
* if the user does not have permission
* @since 1.6.0
*/
- public boolean exists(String namespace) throws AccumuloException, AccumuloSecurityException;
+ boolean exists(String namespace) throws AccumuloException, AccumuloSecurityException;
/**
* Create an empty namespace with no initial configuration. Valid names for a namespace contain letters, numbers, and the underscore character.
@@ -78,7 +78,7 @@ public interface NamespaceOperations {
* if the specified namespace already exists
* @since 1.6.0
*/
- public void create(String namespace) throws AccumuloException, AccumuloSecurityException, NamespaceExistsException;
+ void create(String namespace) throws AccumuloException, AccumuloSecurityException, NamespaceExistsException;
/**
* Delete an empty namespace
@@ -95,7 +95,7 @@ public interface NamespaceOperations {
* if the namespaces still contains tables
* @since 1.6.0
*/
- public void delete(String namespace) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException, NamespaceNotEmptyException;
+ void delete(String namespace) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException, NamespaceNotEmptyException;
/**
* Rename a namespace
@@ -114,7 +114,7 @@ public interface NamespaceOperations {
* if the new namespace already exists
* @since 1.6.0
*/
- public void rename(String oldNamespaceName, String newNamespaceName) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException,
+ void rename(String oldNamespaceName, String newNamespaceName) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException,
NamespaceExistsException;
/**
@@ -134,7 +134,7 @@ public interface NamespaceOperations {
* if the specified namespace doesn't exist
* @since 1.6.0
*/
- public void setProperty(String namespace, String property, String value) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException;
+ void setProperty(String namespace, String property, String value) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException;
/**
* Removes a property from a namespace. Note that it may take a few seconds to propagate the change everywhere.
@@ -151,7 +151,7 @@ public interface NamespaceOperations {
* if the specified namespace doesn't exist
* @since 1.6.0
*/
- public void removeProperty(String namespace, String property) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException;
+ void removeProperty(String namespace, String property) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException;
/**
* Gets properties of a namespace, which are inherited by tables in this namespace. Note that recently changed properties may not be available immediately.
@@ -167,7 +167,7 @@ public interface NamespaceOperations {
* if the specified namespace doesn't exist
* @since 1.6.0
*/
- public Iterable<Entry<String,String>> getProperties(String namespace) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException;
+ Iterable<Entry<String,String>> getProperties(String namespace) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException;
/**
* Get a mapping of namespace name to internal namespace id.
@@ -179,7 +179,7 @@ public interface NamespaceOperations {
* if the user does not have permission
* @since 1.6.0
*/
- public Map<String,String> namespaceIdMap() throws AccumuloException, AccumuloSecurityException;
+ Map<String,String> namespaceIdMap() throws AccumuloException, AccumuloSecurityException;
/**
* Add an iterator to a namespace on all scopes.
@@ -196,7 +196,7 @@ public interface NamespaceOperations {
* if the specified namespace doesn't exist
* @since 1.6.0
*/
- public void attachIterator(String namespace, IteratorSetting setting) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException;
+ void attachIterator(String namespace, IteratorSetting setting) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException;
/**
* Add an iterator to a namespace on the given scopes.
@@ -215,7 +215,7 @@ public interface NamespaceOperations {
* if the specified namespace doesn't exist
* @since 1.6.0
*/
- public void attachIterator(String namespace, IteratorSetting setting, EnumSet<IteratorScope> scopes) throws AccumuloException, AccumuloSecurityException,
+ void attachIterator(String namespace, IteratorSetting setting, EnumSet<IteratorScope> scopes) throws AccumuloException, AccumuloSecurityException,
NamespaceNotFoundException;
/**
@@ -235,7 +235,7 @@ public interface NamespaceOperations {
* if the specified namespace doesn't exist
* @since 1.6.0
*/
- public void removeIterator(String namespace, String name, EnumSet<IteratorScope> scopes) throws AccumuloException, AccumuloSecurityException,
+ void removeIterator(String namespace, String name, EnumSet<IteratorScope> scopes) throws AccumuloException, AccumuloSecurityException,
NamespaceNotFoundException;
/**
@@ -256,7 +256,7 @@ public interface NamespaceOperations {
* if the specified namespace doesn't exist
* @since 1.6.0
*/
- public IteratorSetting getIteratorSetting(String namespace, String name, IteratorScope scope) throws AccumuloException, AccumuloSecurityException,
+ IteratorSetting getIteratorSetting(String namespace, String name, IteratorScope scope) throws AccumuloException, AccumuloSecurityException,
NamespaceNotFoundException;
/**
@@ -273,7 +273,7 @@ public interface NamespaceOperations {
* if the specified namespace doesn't exist
* @since 1.6.0
*/
- public Map<String,EnumSet<IteratorScope>> listIterators(String namespace) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException;
+ Map<String,EnumSet<IteratorScope>> listIterators(String namespace) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException;
/**
* Check whether a given iterator configuration conflicts with existing configuration; in particular, determine if the name or priority are already in use for
@@ -293,7 +293,7 @@ public interface NamespaceOperations {
* if the specified namespace doesn't exist
* @since 1.6.0
*/
- public void checkIteratorConflicts(String namespace, IteratorSetting setting, EnumSet<IteratorScope> scopes) throws AccumuloException,
+ void checkIteratorConflicts(String namespace, IteratorSetting setting, EnumSet<IteratorScope> scopes) throws AccumuloException,
AccumuloSecurityException, NamespaceNotFoundException;
/**
@@ -312,7 +312,7 @@ public interface NamespaceOperations {
* if the specified namespace doesn't exist
* @since 1.6.0
*/
- public int addConstraint(String namespace, String constraintClassName) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException;
+ int addConstraint(String namespace, String constraintClassName) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException;
/**
* Remove a constraint from a namespace.
@@ -329,7 +329,7 @@ public interface NamespaceOperations {
* if the specified namespace doesn't exist
* @since 1.6.0
*/
- public void removeConstraint(String namespace, int id) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException;
+ void removeConstraint(String namespace, int id) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException;
/**
* List constraints on a namespace with their assigned numbers.
@@ -345,7 +345,7 @@ public interface NamespaceOperations {
* if the specified namespace doesn't exist
* @since 1.6.0
*/
- public Map<String,Integer> listConstraints(String namespace) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException;
+ Map<String,Integer> listConstraints(String namespace) throws AccumuloException, AccumuloSecurityException, NamespaceNotFoundException;
/**
* Test to see if the instance can load the given class as the given type. This check uses the table classpath property if it is set.
@@ -365,6 +365,6 @@ public interface NamespaceOperations {
* if the specified namespace doesn't exist
* @since 1.6.0
*/
- public boolean testClassLoad(String namespace, String className, String asTypeName) throws AccumuloException, AccumuloSecurityException,
+ boolean testClassLoad(String namespace, String className, String asTypeName) throws AccumuloException, AccumuloSecurityException,
NamespaceNotFoundException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperations.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperations.java b/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperations.java
index b3178fd..ea1fde1 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperations.java
@@ -48,7 +48,7 @@ public interface SecurityOperations {
* @deprecated since 1.5.0; use {@link #createLocalUser(String, PasswordToken)} or the user management functions of your configured authenticator instead.
*/
@Deprecated
- public void createUser(String user, byte[] password, Authorizations authorizations) throws AccumuloException, AccumuloSecurityException;
+ void createUser(String user, byte[] password, Authorizations authorizations) throws AccumuloException, AccumuloSecurityException;
/**
* Create a user
@@ -63,7 +63,7 @@ public interface SecurityOperations {
* if the user does not have permission to create a user
* @since 1.5.0
*/
- public void createLocalUser(String principal, PasswordToken password) throws AccumuloException, AccumuloSecurityException;
+ void createLocalUser(String principal, PasswordToken password) throws AccumuloException, AccumuloSecurityException;
/**
* Delete a user
@@ -77,7 +77,7 @@ public interface SecurityOperations {
* @deprecated since 1.5.0; use {@link #dropUser(String)} or the user management functions of your configured authenticator instead.
*/
@Deprecated
- public void dropUser(String user) throws AccumuloException, AccumuloSecurityException;
+ void dropUser(String user) throws AccumuloException, AccumuloSecurityException;
/**
* Delete a user
@@ -90,7 +90,7 @@ public interface SecurityOperations {
* if the user does not have permission to delete a user
* @since 1.5.0
*/
- public void dropLocalUser(String principal) throws AccumuloException, AccumuloSecurityException;
+ void dropLocalUser(String principal) throws AccumuloException, AccumuloSecurityException;
/**
* Verify a username/password combination is valid
@@ -107,7 +107,7 @@ public interface SecurityOperations {
* @deprecated since 1.5.0; use {@link #authenticateUser(String, AuthenticationToken)} instead.
*/
@Deprecated
- public boolean authenticateUser(String user, byte[] password) throws AccumuloException, AccumuloSecurityException;
+ boolean authenticateUser(String user, byte[] password) throws AccumuloException, AccumuloSecurityException;
/**
* Verify a username/password combination is valid
@@ -123,7 +123,7 @@ public interface SecurityOperations {
* if the user does not have permission to ask
* @since 1.5.0
*/
- public boolean authenticateUser(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException;
+ boolean authenticateUser(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException;
/**
* Set the user's password
@@ -140,7 +140,7 @@ public interface SecurityOperations {
* instead.
*/
@Deprecated
- public void changeUserPassword(String user, byte[] password) throws AccumuloException, AccumuloSecurityException;
+ void changeUserPassword(String user, byte[] password) throws AccumuloException, AccumuloSecurityException;
/**
* Set the user's password
@@ -155,7 +155,7 @@ public interface SecurityOperations {
* if the user does not have permission to modify a user
* @since 1.5.0
*/
- public void changeLocalUserPassword(String principal, PasswordToken token) throws AccumuloException, AccumuloSecurityException;
+ void changeLocalUserPassword(String principal, PasswordToken token) throws AccumuloException, AccumuloSecurityException;
/**
* Set the user's record-level authorizations
@@ -169,7 +169,7 @@ public interface SecurityOperations {
* @throws AccumuloSecurityException
* if the user does not have permission to modify a user
*/
- public void changeUserAuthorizations(String principal, Authorizations authorizations) throws AccumuloException, AccumuloSecurityException;
+ void changeUserAuthorizations(String principal, Authorizations authorizations) throws AccumuloException, AccumuloSecurityException;
/**
* Retrieves the user's authorizations for scanning
@@ -182,7 +182,7 @@ public interface SecurityOperations {
* @throws AccumuloSecurityException
* if the user does not have permission to query a user
*/
- public Authorizations getUserAuthorizations(String principal) throws AccumuloException, AccumuloSecurityException;
+ Authorizations getUserAuthorizations(String principal) throws AccumuloException, AccumuloSecurityException;
/**
* Verify the user has a particular system permission
@@ -197,7 +197,7 @@ public interface SecurityOperations {
* @throws AccumuloSecurityException
* if the user does not have permission to query a user
*/
- public boolean hasSystemPermission(String principal, SystemPermission perm) throws AccumuloException, AccumuloSecurityException;
+ boolean hasSystemPermission(String principal, SystemPermission perm) throws AccumuloException, AccumuloSecurityException;
/**
* Verify the user has a particular table permission
@@ -214,7 +214,7 @@ public interface SecurityOperations {
* @throws AccumuloSecurityException
* if the user does not have permission to query a user
*/
- public boolean hasTablePermission(String principal, String table, TablePermission perm) throws AccumuloException, AccumuloSecurityException;
+ boolean hasTablePermission(String principal, String table, TablePermission perm) throws AccumuloException, AccumuloSecurityException;
/**
* Verify the user has a particular namespace permission
@@ -231,7 +231,7 @@ public interface SecurityOperations {
* @throws AccumuloSecurityException
* if the user does not have permission to query a user
*/
- public boolean hasNamespacePermission(String principal, String namespace, NamespacePermission perm) throws AccumuloException, AccumuloSecurityException;
+ boolean hasNamespacePermission(String principal, String namespace, NamespacePermission perm) throws AccumuloException, AccumuloSecurityException;
/**
* Grant a user a system permission
@@ -245,7 +245,7 @@ public interface SecurityOperations {
* @throws AccumuloSecurityException
* if the user does not have permission to grant a user permissions
*/
- public void grantSystemPermission(String principal, SystemPermission permission) throws AccumuloException, AccumuloSecurityException;
+ void grantSystemPermission(String principal, SystemPermission permission) throws AccumuloException, AccumuloSecurityException;
/**
* Grant a user a specific permission for a specific table
@@ -261,7 +261,7 @@ public interface SecurityOperations {
* @throws AccumuloSecurityException
* if the user does not have permission to grant a user permissions
*/
- public void grantTablePermission(String principal, String table, TablePermission permission) throws AccumuloException, AccumuloSecurityException;
+ void grantTablePermission(String principal, String table, TablePermission permission) throws AccumuloException, AccumuloSecurityException;
/**
* Grant a user a specific permission for a specific namespace
@@ -277,7 +277,7 @@ public interface SecurityOperations {
* @throws AccumuloSecurityException
* if the user does not have permission to grant a user permissions
*/
- public void grantNamespacePermission(String principal, String namespace, NamespacePermission permission) throws AccumuloException, AccumuloSecurityException;
+ void grantNamespacePermission(String principal, String namespace, NamespacePermission permission) throws AccumuloException, AccumuloSecurityException;
/**
* Revoke a system permission from a user
@@ -291,7 +291,7 @@ public interface SecurityOperations {
* @throws AccumuloSecurityException
* if the user does not have permission to revoke a user's permissions
*/
- public void revokeSystemPermission(String principal, SystemPermission permission) throws AccumuloException, AccumuloSecurityException;
+ void revokeSystemPermission(String principal, SystemPermission permission) throws AccumuloException, AccumuloSecurityException;
/**
* Revoke a table permission for a specific user on a specific table
@@ -307,7 +307,7 @@ public interface SecurityOperations {
* @throws AccumuloSecurityException
* if the user does not have permission to revoke a user's permissions
*/
- public void revokeTablePermission(String principal, String table, TablePermission permission) throws AccumuloException, AccumuloSecurityException;
+ void revokeTablePermission(String principal, String table, TablePermission permission) throws AccumuloException, AccumuloSecurityException;
/**
* Revoke a namespace permission for a specific user on a specific namespace
@@ -323,7 +323,7 @@ public interface SecurityOperations {
* @throws AccumuloSecurityException
* if the user does not have permission to revoke a user's permissions
*/
- public void revokeNamespacePermission(String principal, String namespace, NamespacePermission permission) throws AccumuloException, AccumuloSecurityException;
+ void revokeNamespacePermission(String principal, String namespace, NamespacePermission permission) throws AccumuloException, AccumuloSecurityException;
/**
* Return a list of users in accumulo
@@ -336,7 +336,7 @@ public interface SecurityOperations {
* @deprecated since 1.5.0; use {@link #listLocalUsers()} or the user management functions of your configured authenticator instead.
*/
@Deprecated
- public Set<String> listUsers() throws AccumuloException, AccumuloSecurityException;
+ Set<String> listUsers() throws AccumuloException, AccumuloSecurityException;
/**
* Return a list of users in accumulo
@@ -348,6 +348,6 @@ public interface SecurityOperations {
* if the user does not have permission to query users
* @since 1.5.0
*/
- public Set<String> listLocalUsers() throws AccumuloException, AccumuloSecurityException;
+ Set<String> listLocalUsers() throws AccumuloException, AccumuloSecurityException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
index 4f6c315..253aa52 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
@@ -47,7 +47,7 @@ public interface TableOperations {
*
* @return List of tables in accumulo
*/
- public SortedSet<String> list();
+ SortedSet<String> list();
/**
* A method to check if a table exists in Accumulo.
@@ -56,7 +56,7 @@ public interface TableOperations {
* the name of the table
* @return true if the table exists
*/
- public boolean exists(String tableName);
+ boolean exists(String tableName);
/**
* Create a table with no special configuration
@@ -70,7 +70,7 @@ public interface TableOperations {
* @throws TableExistsException
* if the table already exists
*/
- public void create(String tableName) throws AccumuloException, AccumuloSecurityException, TableExistsException;
+ void create(String tableName) throws AccumuloException, AccumuloSecurityException, TableExistsException;
/**
* @param tableName
@@ -84,7 +84,7 @@ public interface TableOperations {
* @throws TableExistsException
* if the table already exists
*/
- public void create(String tableName, boolean limitVersion) throws AccumuloException, AccumuloSecurityException, TableExistsException;
+ void create(String tableName, boolean limitVersion) throws AccumuloException, AccumuloSecurityException, TableExistsException;
/**
* @param tableName
@@ -100,7 +100,7 @@ public interface TableOperations {
* @throws TableExistsException
* if the table already exists
*/
- public void create(String tableName, boolean versioningIter, TimeType timeType) throws AccumuloException, AccumuloSecurityException, TableExistsException;
+ void create(String tableName, boolean versioningIter, TimeType timeType) throws AccumuloException, AccumuloSecurityException, TableExistsException;
/**
* Imports a table exported via exportTable and copied via hadoop distcp.
@@ -114,7 +114,7 @@ public interface TableOperations {
* @throws AccumuloSecurityException
* @since 1.5.0
*/
- public void importTable(String tableName, String importDir) throws TableExistsException, AccumuloException, AccumuloSecurityException;
+ void importTable(String tableName, String importDir) throws TableExistsException, AccumuloException, AccumuloSecurityException;
/**
* Exports a table. The tables data is not exported, just table metadata and a list of files to distcp. The table being exported must be offline and stay
@@ -132,7 +132,7 @@ public interface TableOperations {
* @throws AccumuloSecurityException
* @since 1.5.0
*/
- public void exportTable(String tableName, String exportDir) throws TableNotFoundException, AccumuloException, AccumuloSecurityException;
+ void exportTable(String tableName, String exportDir) throws TableNotFoundException, AccumuloException, AccumuloSecurityException;
/**
* @param tableName
@@ -146,7 +146,7 @@ public interface TableOperations {
* @throws TableNotFoundException
* if the table does not exist
*/
- public void addSplits(String tableName, SortedSet<Text> partitionKeys) throws TableNotFoundException, AccumuloException, AccumuloSecurityException;
+ void addSplits(String tableName, SortedSet<Text> partitionKeys) throws TableNotFoundException, AccumuloException, AccumuloSecurityException;
/**
* @param tableName
@@ -157,7 +157,7 @@ public interface TableOperations {
* @deprecated since 1.5.0; use {@link #listSplits(String)} instead.
*/
@Deprecated
- public Collection<Text> getSplits(String tableName) throws TableNotFoundException;
+ Collection<Text> getSplits(String tableName) throws TableNotFoundException;
/**
* @param tableName
@@ -171,7 +171,7 @@ public interface TableOperations {
* if the user does not have permission
* @since 1.5.0
*/
- public Collection<Text> listSplits(String tableName) throws TableNotFoundException, AccumuloSecurityException, AccumuloException;
+ Collection<Text> listSplits(String tableName) throws TableNotFoundException, AccumuloSecurityException, AccumuloException;
/**
* @param tableName
@@ -183,7 +183,7 @@ public interface TableOperations {
* @deprecated since 1.5.0; use {@link #listSplits(String, int)} instead.
*/
@Deprecated
- public Collection<Text> getSplits(String tableName, int maxSplits) throws TableNotFoundException;
+ Collection<Text> getSplits(String tableName, int maxSplits) throws TableNotFoundException;
/**
* @param tableName
@@ -198,7 +198,7 @@ public interface TableOperations {
* @throws TableNotFoundException
* @since 1.5.0
*/
- public Collection<Text> listSplits(String tableName, int maxSplits) throws TableNotFoundException, AccumuloSecurityException, AccumuloException;
+ Collection<Text> listSplits(String tableName, int maxSplits) throws TableNotFoundException, AccumuloSecurityException, AccumuloException;
/**
* Finds the max row within a given range. To find the max row in a table, pass null for start and end row.
@@ -221,7 +221,7 @@ public interface TableOperations {
* @throws AccumuloException
* @throws TableNotFoundException
*/
- public Text getMaxRow(String tableName, Authorizations auths, Text startRow, boolean startInclusive, Text endRow, boolean endInclusive)
+ Text getMaxRow(String tableName, Authorizations auths, Text startRow, boolean startInclusive, Text endRow, boolean endInclusive)
throws TableNotFoundException, AccumuloException, AccumuloSecurityException;
/**
@@ -234,7 +234,7 @@ public interface TableOperations {
* @param end
* last tablet to be merged contains this row, null means the last tablet
*/
- public void merge(String tableName, Text start, Text end) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
+ void merge(String tableName, Text start, Text end) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
/**
* Delete rows between (start, end]
@@ -246,7 +246,7 @@ public interface TableOperations {
* @param end
* last row to be deleted, inclusive, null means the last row of the table
*/
- public void deleteRows(String tableName, Text start, Text end) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
+ void deleteRows(String tableName, Text start, Text end) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
/**
* Starts a full major compaction of the tablets in the range (start, end]. The compaction is preformed even for tablets that have only one file.
@@ -262,7 +262,7 @@ public interface TableOperations {
* @param wait
* when true, the call will not return until compactions are finished
*/
- public void compact(String tableName, Text start, Text end, boolean flush, boolean wait) throws AccumuloSecurityException, TableNotFoundException,
+ void compact(String tableName, Text start, Text end, boolean flush, boolean wait) throws AccumuloSecurityException, TableNotFoundException,
AccumuloException;
/**
@@ -282,7 +282,7 @@ public interface TableOperations {
* when true, the call will not return until compactions are finished
* @since 1.5.0
*/
- public void compact(String tableName, Text start, Text end, List<IteratorSetting> iterators, boolean flush, boolean wait) throws AccumuloSecurityException,
+ void compact(String tableName, Text start, Text end, List<IteratorSetting> iterators, boolean flush, boolean wait) throws AccumuloSecurityException,
TableNotFoundException, AccumuloException;
/**
@@ -300,7 +300,7 @@ public interface TableOperations {
* if the user does not have permission
* @since 1.5.0
*/
- public void cancelCompaction(String tableName) throws AccumuloSecurityException, TableNotFoundException, AccumuloException;
+ void cancelCompaction(String tableName) throws AccumuloSecurityException, TableNotFoundException, AccumuloException;
/**
* Delete a table
@@ -314,7 +314,7 @@ public interface TableOperations {
* @throws TableNotFoundException
* if the table does not exist
*/
- public void delete(String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
+ void delete(String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
/**
* Clone a table from an existing table. The cloned table will have the same data as the source table it was created from. After cloning, the two tables can
@@ -335,7 +335,7 @@ public interface TableOperations {
* do not copy these properties from the source table, just revert to system defaults
*/
- public void clone(String srcTableName, String newTableName, boolean flush, Map<String,String> propertiesToSet, Set<String> propertiesToExclude)
+ void clone(String srcTableName, String newTableName, boolean flush, Map<String,String> propertiesToSet, Set<String> propertiesToExclude)
throws AccumuloException, AccumuloSecurityException, TableNotFoundException, TableExistsException;
/**
@@ -354,7 +354,7 @@ public interface TableOperations {
* @throws TableExistsException
* if the new table name already exists
*/
- public void rename(String oldTableName, String newTableName) throws AccumuloSecurityException, TableNotFoundException, AccumuloException,
+ void rename(String oldTableName, String newTableName) throws AccumuloSecurityException, TableNotFoundException, AccumuloException,
TableExistsException;
/**
@@ -370,7 +370,7 @@ public interface TableOperations {
* @deprecated As of release 1.4, replaced by {@link #flush(String, Text, Text, boolean)}
*/
@Deprecated
- public void flush(String tableName) throws AccumuloException, AccumuloSecurityException;
+ void flush(String tableName) throws AccumuloException, AccumuloSecurityException;
/**
* Flush a table's data that is currently in memory.
@@ -386,7 +386,7 @@ public interface TableOperations {
* if the user does not have permission
* @throws TableNotFoundException
*/
- public void flush(String tableName, Text start, Text end, boolean wait) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
+ void flush(String tableName, Text start, Text end, boolean wait) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
/**
* Sets a property on a table. Note that it may take a short period of time (a second) to propagate the change everywhere.
@@ -402,7 +402,7 @@ public interface TableOperations {
* @throws AccumuloSecurityException
* if the user does not have permission
*/
- public void setProperty(String tableName, String property, String value) throws AccumuloException, AccumuloSecurityException;
+ void setProperty(String tableName, String property, String value) throws AccumuloException, AccumuloSecurityException;
/**
* Removes a property from a table. Note that it may take a short period of time (a second) to propagate the change everywhere.
@@ -416,7 +416,7 @@ public interface TableOperations {
* @throws AccumuloSecurityException
* if the user does not have permission
*/
- public void removeProperty(String tableName, String property) throws AccumuloException, AccumuloSecurityException;
+ void removeProperty(String tableName, String property) throws AccumuloException, AccumuloSecurityException;
/**
* Gets properties of a table. Note that recently changed properties may not be available immediately.
@@ -427,7 +427,7 @@ public interface TableOperations {
* @throws TableNotFoundException
* if the table does not exist
*/
- public Iterable<Entry<String,String>> getProperties(String tableName) throws AccumuloException, TableNotFoundException;
+ Iterable<Entry<String,String>> getProperties(String tableName) throws AccumuloException, TableNotFoundException;
/**
* Sets a table's locality groups. A table's locality groups can be changed at any time.
@@ -443,7 +443,7 @@ public interface TableOperations {
* @throws TableNotFoundException
* if the table does not exist
*/
- public void setLocalityGroups(String tableName, Map<String,Set<Text>> groups) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
+ void setLocalityGroups(String tableName, Map<String,Set<Text>> groups) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
/**
*
@@ -457,7 +457,7 @@ public interface TableOperations {
* @throws TableNotFoundException
* if the table does not exist
*/
- public Map<String,Set<Text>> getLocalityGroups(String tableName) throws AccumuloException, TableNotFoundException;
+ Map<String,Set<Text>> getLocalityGroups(String tableName) throws AccumuloException, TableNotFoundException;
/**
* @param tableName
@@ -474,7 +474,7 @@ public interface TableOperations {
* @throws TableNotFoundException
* if the table does not exist
*/
- public Set<Range> splitRangeByTablets(String tableName, Range range, int maxSplits) throws AccumuloException, AccumuloSecurityException,
+ Set<Range> splitRangeByTablets(String tableName, Range range, int maxSplits) throws AccumuloException, AccumuloSecurityException,
TableNotFoundException;
/**
@@ -498,7 +498,7 @@ public interface TableOperations {
* when the table no longer exists
*
*/
- public void importDirectory(String tableName, String dir, String failureDir, boolean setTime) throws TableNotFoundException, IOException, AccumuloException,
+ void importDirectory(String tableName, String dir, String failureDir, boolean setTime) throws TableNotFoundException, IOException, AccumuloException,
AccumuloSecurityException;
/**
@@ -512,7 +512,7 @@ public interface TableOperations {
* when the user does not have the proper permissions
* @throws TableNotFoundException
*/
- public void offline(String tableName) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
+ void offline(String tableName) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
/**
*
@@ -527,7 +527,7 @@ public interface TableOperations {
* @throws TableNotFoundException
* @since 1.6.0
*/
- public void offline(String tableName, boolean wait) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
+ void offline(String tableName, boolean wait) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
/**
* Initiates bringing a table online, but does not wait for action to complete
@@ -540,7 +540,7 @@ public interface TableOperations {
* when the user does not have the proper permissions
* @throws TableNotFoundException
*/
- public void online(String tableName) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
+ void online(String tableName) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
/**
*
@@ -555,7 +555,7 @@ public interface TableOperations {
* @throws TableNotFoundException
* @since 1.6.0
*/
- public void online(String tableName, boolean wait) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
+ void online(String tableName, boolean wait) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
/**
* Clears the tablet locator cache for a specified table
@@ -565,14 +565,14 @@ public interface TableOperations {
* @throws TableNotFoundException
* if table does not exist
*/
- public void clearLocatorCache(String tableName) throws TableNotFoundException;
+ void clearLocatorCache(String tableName) throws TableNotFoundException;
/**
* Get a mapping of table name to internal table id.
*
* @return the map from table name to internal table id
*/
- public Map<String,String> tableIdMap();
+ Map<String,String> tableIdMap();
/**
* Add an iterator to a table on all scopes.
@@ -589,7 +589,7 @@ public interface TableOperations {
* @throws IllegalArgumentException
* if the setting conflicts with any existing iterators
*/
- public void attachIterator(String tableName, IteratorSetting setting) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
+ void attachIterator(String tableName, IteratorSetting setting) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
/**
* Add an iterator to a table on the given scopes.
@@ -606,7 +606,7 @@ public interface TableOperations {
* @throws IllegalArgumentException
* if the setting conflicts with any existing iterators
*/
- public void attachIterator(String tableName, IteratorSetting setting, EnumSet<IteratorScope> scopes) throws AccumuloSecurityException, AccumuloException,
+ void attachIterator(String tableName, IteratorSetting setting, EnumSet<IteratorScope> scopes) throws AccumuloSecurityException, AccumuloException,
TableNotFoundException;
/**
@@ -624,7 +624,7 @@ public interface TableOperations {
* @throws TableNotFoundException
* throw if the table no longer exists
*/
- public void removeIterator(String tableName, String name, EnumSet<IteratorScope> scopes) throws AccumuloSecurityException, AccumuloException,
+ void removeIterator(String tableName, String name, EnumSet<IteratorScope> scopes) throws AccumuloSecurityException, AccumuloException,
TableNotFoundException;
/**
@@ -643,7 +643,7 @@ public interface TableOperations {
* @throws TableNotFoundException
* throw if the table no longer exists
*/
- public IteratorSetting getIteratorSetting(String tableName, String name, IteratorScope scope) throws AccumuloSecurityException, AccumuloException,
+ IteratorSetting getIteratorSetting(String tableName, String name, IteratorScope scope) throws AccumuloSecurityException, AccumuloException,
TableNotFoundException;
/**
@@ -656,7 +656,7 @@ public interface TableOperations {
* @throws AccumuloException
* @throws TableNotFoundException
*/
- public Map<String,EnumSet<IteratorScope>> listIterators(String tableName) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
+ Map<String,EnumSet<IteratorScope>> listIterators(String tableName) throws AccumuloSecurityException, AccumuloException, TableNotFoundException;
/**
* Check whether a given iterator configuration conflicts with existing configuration; in particular, determine if the name or priority are already in use for
@@ -669,7 +669,7 @@ public interface TableOperations {
* @throws AccumuloException
* @throws TableNotFoundException
*/
- public void checkIteratorConflicts(String tableName, IteratorSetting setting, EnumSet<IteratorScope> scopes) throws AccumuloException, TableNotFoundException;
+ void checkIteratorConflicts(String tableName, IteratorSetting setting, EnumSet<IteratorScope> scopes) throws AccumuloException, TableNotFoundException;
/**
* Add a new constraint to a table.
@@ -686,7 +686,7 @@ public interface TableOperations {
* @throws TableNotFoundException
* @since 1.5.0
*/
- public int addConstraint(String tableName, String constraintClassName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
+ int addConstraint(String tableName, String constraintClassName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
/**
* Remove a constraint from a table.
@@ -700,7 +700,7 @@ public interface TableOperations {
* thrown if the user doesn't have permission to remove the constraint
* @since 1.5.0
*/
- public void removeConstraint(String tableName, int number) throws AccumuloException, AccumuloSecurityException;
+ void removeConstraint(String tableName, int number) throws AccumuloException, AccumuloSecurityException;
/**
* List constraints on a table with their assigned numbers.
@@ -713,7 +713,7 @@ public interface TableOperations {
* @throws TableNotFoundException
* @since 1.5.0
*/
- public Map<String,Integer> listConstraints(String tableName) throws AccumuloException, TableNotFoundException;
+ Map<String,Integer> listConstraints(String tableName) throws AccumuloException, TableNotFoundException;
/**
* Gets the number of bytes being used in the files for a set of tables
@@ -724,7 +724,7 @@ public interface TableOperations {
* @throws AccumuloException
* @throws AccumuloSecurityException
*/
- public List<DiskUsage> getDiskUsage(Set<String> tables) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
+ List<DiskUsage> getDiskUsage(Set<String> tables) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
/**
* Test to see if the instance can load the given class as the given type. This check uses the table classpath if it is set.
@@ -737,6 +737,6 @@ public interface TableOperations {
*
* @since 1.5.0
*/
- public boolean testClassLoad(String tableName, final String className, final String asTypeName) throws AccumuloException, AccumuloSecurityException,
+ boolean testClassLoad(String tableName, final String className, final String asTypeName) throws AccumuloException, AccumuloSecurityException,
TableNotFoundException;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
index 9956538..4003e6f 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
@@ -32,6 +32,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.Random;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeMap;
@@ -1081,6 +1082,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
if (maxSplits == 1)
return Collections.singleton(range);
+ Random random = new Random();
Map<String,Map<KeyExtent,List<Range>>> binnedRanges = new HashMap<String,Map<KeyExtent,List<Range>>>();
String tableId = Tables.getTableId(instance, tableName);
TabletLocator tl = TabletLocator.getLocator(instance, new Text(tableId));
@@ -1094,7 +1096,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
log.warn("Unable to locate bins for specified range. Retrying.");
// sleep randomly between 100 and 200ms
- UtilWaitThread.sleep(100 + (int) (Math.random() * 100));
+ UtilWaitThread.sleep(100 + random.nextInt(100));
binnedRanges.clear();
tl.invalidateCache();
}
@@ -1454,10 +1456,14 @@ public class TableOperationsImpl extends TableOperationsHelper {
while ((zipEntry = zis.getNextEntry()) != null) {
if (zipEntry.getName().equals(Constants.EXPORT_TABLE_CONFIG_FILE)) {
BufferedReader in = new BufferedReader(new InputStreamReader(zis));
- String line;
- while ((line = in.readLine()) != null) {
- String sa[] = line.split("=", 2);
- props.put(sa[0], sa[1]);
+ try {
+ String line;
+ while ((line = in.readLine()) != null) {
+ String sa[] = line.split("=", 2);
+ props.put(sa[0], sa[1]);
+ }
+ } finally {
+ in.close();
}
break;
@@ -1483,10 +1489,10 @@ public class TableOperationsImpl extends TableOperationsHelper {
FileSystem fs = new Path(importDir).getFileSystem(CachedConfiguration.getInstance());
Map<String,String> props = getExportedProps(fs, new Path(importDir, Constants.EXPORT_FILE));
- for (String propKey : props.keySet()) {
- if (Property.isClassProperty(propKey) && !props.get(propKey).contains(Constants.CORE_PACKAGE_NAME)) {
+ for (Entry<String,String> entry : props.entrySet()) {
+ if (Property.isClassProperty(entry.getKey()) && !entry.getValue().contains(Constants.CORE_PACKAGE_NAME)) {
Logger.getLogger(this.getClass()).info(
- "Imported table sets '" + propKey + "' to '" + props.get(propKey) + "'. Ensure this class is on Accumulo classpath.");
+ "Imported table sets '" + entry.getKey() + "' to '" + entry.getValue() + "'. Ensure this class is on Accumulo classpath.");
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
index cd89adb..1ec6dee 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
@@ -181,6 +181,13 @@ class ConditionalWriterImpl implements ConditionalWriter {
}
@Override
+ public boolean equals(Object o) {
+ if (o instanceof QCMutation)
+ return compareTo((QCMutation) o) == 0;
+ return false;
+ }
+
+ @Override
public long getDelay(TimeUnit unit) {
return unit.convert(delay - (System.currentTimeMillis() - resetTime), TimeUnit.MILLISECONDS);
}
@@ -368,7 +375,6 @@ class ConditionalWriterImpl implements ConditionalWriter {
this.auths = config.getAuthorizations();
this.ve = new VisibilityEvaluator(config.getAuthorizations());
this.threadPool = new ScheduledThreadPoolExecutor(config.getMaxWriteThreads());
- this.threadPool.setMaximumPoolSize(config.getMaxWriteThreads());
this.locator = TabletLocator.getLocator(instance, new Text(tableId));
this.serverQueues = new HashMap<String,ServerQueue>();
this.tableId = tableId;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/impl/MultiTableBatchWriterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/MultiTableBatchWriterImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/MultiTableBatchWriterImpl.java
index 7eea455..f2478d9 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/MultiTableBatchWriterImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/MultiTableBatchWriterImpl.java
@@ -91,7 +91,7 @@ public class MultiTableBatchWriterImpl implements MultiTableBatchWriter {
String tableId = Tables.getNameToIdMap(instance).get(tableName);
if (tableId == null)
- throw new TableNotFoundException(tableId, tableName, null);
+ throw new TableNotFoundException(null, tableName, null);
if (Tables.getTableState(instance, tableId) == TableState.OFFLINE)
throw new TableOfflineException(instance, tableId);
@@ -215,12 +215,14 @@ public class MultiTableBatchWriterImpl implements MultiTableBatchWriter {
String tableId = getId(tableName);
- BatchWriter tbw = tableWriters.get(tableId);
- if (tbw == null) {
- tbw = new TableBatchWriter(tableId);
- tableWriters.put(tableId, tbw);
+ synchronized (tableWriters) {
+ BatchWriter tbw = tableWriters.get(tableId);
+ if (tbw == null) {
+ tbw = new TableBatchWriter(tableId);
+ tableWriters.put(tableId, tbw);
+ }
+ return tbw;
}
- return tbw;
}
@Override
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java b/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
index f3b5a8d..215f381 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
@@ -134,7 +134,7 @@ public class Tables {
// create fully qualified table name
if (nId == null) {
namespaceName = null;
- } else if (nId != null) {
+ } else {
String namespaceId = new String(nId, Constants.UTF8);
if (!namespaceId.equals(Namespaces.DEFAULT_NAMESPACE_ID)) {
try {
@@ -189,7 +189,7 @@ public class Tables {
public static String getTableName(Instance instance, String tableId) throws TableNotFoundException {
String tableName = getIdToNameMap(instance).get(tableId);
if (tableName == null)
- throw new TableNotFoundException(tableId, tableName, null);
+ throw new TableNotFoundException(tableId, null, null);
return tableName;
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/5bd4e27c/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
index 6f4e598..c550f15 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
@@ -16,6 +16,7 @@
*/
package org.apache.accumulo.core.client.impl;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -59,8 +60,10 @@ public class TabletLocatorImpl extends TabletLocator {
// putting null, put MAX_TEXT
static final Text MAX_TEXT = new Text();
- private static class EndRowComparator implements Comparator<Text> {
+ private static class EndRowComparator implements Comparator<Text>, Serializable {
+ private static final long serialVersionUID = 1L;
+
@Override
public int compare(Text o1, Text o2) {
@@ -96,7 +99,7 @@ public class TabletLocatorImpl extends TabletLocator {
private final Lock wLock = rwLock.writeLock();
- public static interface TabletLocationObtainer {
+ public interface TabletLocationObtainer {
/**
* @return null when unable to read information successfully
*/
@@ -634,7 +637,7 @@ public class TabletLocatorImpl extends TabletLocator {
if (badExtents.size() == 0)
return;
- boolean writeLockHeld = rwLock.isWriteLockedByCurrentThread();
+ final boolean writeLockHeld = rwLock.isWriteLockedByCurrentThread();
try {
if (!writeLockHeld) {
rLock.unlock();