You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by vi...@apache.org on 2011/10/27 17:25:17 UTC
svn commit: r1189806 [35/46] - in /incubator/accumulo: branches/1.3/contrib/
branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/
branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/admin/
branches/1.3/src/core/src/main/...
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnFamilySkippingIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnFamilySkippingIterator.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnFamilySkippingIterator.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnFamilySkippingIterator.java Thu Oct 27 15:24:51 2011
@@ -56,35 +56,37 @@ public class ColumnFamilySkippingIterato
protected void consume() throws IOException {
int count = 0;
- if (inclusive) while (getSource().hasTop() && !colFamSet.contains(getSource().getTopKey().getColumnFamilyData())) {
- if (count < 10) {
- // it is quicker to call next if we are close, but we never know if we are close
- // so give next a try a few times
- getSource().next();
- count++;
- } else {
- ByteSequence higherCF = sortedColFams.higher(getSource().getTopKey().getColumnFamilyData());
- if (higherCF == null) {
- // seek to the next row
- reseek(getSource().getTopKey().followingKey(PartialKey.ROW));
+ if (inclusive)
+ while (getSource().hasTop() && !colFamSet.contains(getSource().getTopKey().getColumnFamilyData())) {
+ if (count < 10) {
+ // it is quicker to call next if we are close, but we never know if we are close
+ // so give next a try a few times
+ getSource().next();
+ count++;
} else {
- // seek to the next column family in the sorted list of column families
- reseek(new Key(getSource().getTopKey().getRowData().toArray(), higherCF.toArray(), new byte[0], new byte[0], Long.MAX_VALUE));
+ ByteSequence higherCF = sortedColFams.higher(getSource().getTopKey().getColumnFamilyData());
+ if (higherCF == null) {
+ // seek to the next row
+ reseek(getSource().getTopKey().followingKey(PartialKey.ROW));
+ } else {
+ // seek to the next column family in the sorted list of column families
+ reseek(new Key(getSource().getTopKey().getRowData().toArray(), higherCF.toArray(), new byte[0], new byte[0], Long.MAX_VALUE));
+ }
+
+ count = 0;
}
-
- count = 0;
}
- }
- else if (colFamSet != null && colFamSet.size() > 0) while (getSource().hasTop() && colFamSet.contains(getSource().getTopKey().getColumnFamilyData())) {
- if (count < 10) {
- getSource().next();
- count++;
- } else {
- // seek to the next column family in the data
- reseek(getSource().getTopKey().followingKey(PartialKey.ROW_COLFAM));
- count = 0;
+ else if (colFamSet != null && colFamSet.size() > 0)
+ while (getSource().hasTop() && colFamSet.contains(getSource().getTopKey().getColumnFamilyData())) {
+ if (count < 10) {
+ getSource().next();
+ count++;
+ } else {
+ // seek to the next column family in the data
+ reseek(getSource().getTopKey().followingKey(PartialKey.ROW_COLFAM));
+ count = 0;
+ }
}
- }
}
private void reseek(Key key) throws IOException {
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnQualifierFilter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnQualifierFilter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnQualifierFilter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/ColumnQualifierFilter.java Thu Oct 27 15:24:51 2011
@@ -50,9 +50,11 @@ public class ColumnQualifierFilter exten
}
public boolean accept(Key key, Value v) {
- if (!scanColumns) return true;
+ if (!scanColumns)
+ return true;
- if (columnFamilies.contains(key.getColumnFamilyData())) return true;
+ if (columnFamilies.contains(key.getColumnFamilyData()))
+ return true;
HashSet<ByteSequence> cfset = columnsQualifiers.get(key.getColumnQualifierData());
// ensure the columm qualifier goes with a paired column family,
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/DeletingIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/DeletingIterator.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/DeletingIterator.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/DeletingIterator.java Thu Oct 27 15:24:51 2011
@@ -52,8 +52,10 @@ public class DeletingIterator extends Wr
@Override
public void next() throws IOException {
- if (super.getTopKey().isDeleted()) skipRowColumn();
- else getSource().next();
+ if (super.getTopKey().isDeleted())
+ skipRowColumn();
+ else
+ getSource().next();
findTop();
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/HeapIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/HeapIterator.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/HeapIterator.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/HeapIterator.java Thu Oct 27 15:24:51 2011
@@ -48,7 +48,8 @@ public abstract class HeapIterator imple
}
protected void createHeap(int maxSize) {
- if (heap != null) throw new IllegalStateException("heap already exist");
+ if (heap != null)
+ throw new IllegalStateException("heap already exist");
heap = new PriorityBuffer(maxSize == 0 ? 1 : maxSize);
}
@@ -102,10 +103,13 @@ public abstract class HeapIterator imple
final protected void addSource(SortedKeyValueIterator<Key,Value> source) {
- if (source.hasTop()) heap.add(new Index(source));
+ if (source.hasTop())
+ heap.add(new Index(source));
- if (heap.size() > 0) currentIter = ((Index) heap.get()).iter;
- else currentIter = null;
+ if (heap.size() > 0)
+ currentIter = ((Index) heap.get()).iter;
+ else
+ currentIter = null;
}
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/MultiIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/MultiIterator.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/MultiIterator.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/MultiIterator.java Thu Oct 27 15:24:51 2011
@@ -97,7 +97,8 @@ public class MultiIterator extends HeapI
if (fence != null) {
range = fence.clip(range, true);
- if (range == null) return;
+ if (range == null)
+ return;
}
for (SortedKeyValueIterator<Key,Value> skvi : iters) {
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/SequenceFileIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/SequenceFileIterator.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/SequenceFileIterator.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/SequenceFileIterator.java Thu Oct 27 15:24:51 2011
@@ -54,7 +54,8 @@ public class SequenceFileIterator implem
top_key = new Key();
- if (readValue) top_value = new Value();
+ if (readValue)
+ top_value = new Value();
next();
}
@@ -73,8 +74,10 @@ public class SequenceFileIterator implem
public void next() throws IOException {
boolean valid;
- if (readValue) valid = reader.next(top_key, top_value);
- else valid = reader.next(top_key);
+ if (readValue)
+ valid = reader.next(top_key, top_value);
+ else
+ valid = reader.next(top_key);
if (!valid) {
top_key = null;
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/SourceSwitchingIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/SourceSwitchingIterator.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/SourceSwitchingIterator.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/SourceSwitchingIterator.java Thu Oct 27 15:24:51 2011
@@ -111,8 +111,11 @@ public class SourceSwitchingIterator imp
// circuit the call to switchSource
boolean seekNeeded = (!onlySwitchAfterRow && switchSource()) || initialSeek;
- if (seekNeeded) if (initialSeek) iter.seek(range, columnFamilies, inclusive);
- else iter.seek(new Range(key, false, range.getEndKey(), range.isEndKeyInclusive()), columnFamilies, inclusive);
+ if (seekNeeded)
+ if (initialSeek)
+ iter.seek(range, columnFamilies, inclusive);
+ else
+ iter.seek(new Range(key, false, range.getEndKey(), range.isEndKeyInclusive()), columnFamilies, inclusive);
else {
iter.next();
if (onlySwitchAfterRow && iter.hasTop() && !source.isCurrent() && !key.getRowData().equals(iter.getTopKey().getRowData())) {
@@ -141,7 +144,8 @@ public class SourceSwitchingIterator imp
while (!source.isCurrent()) {
source = source.getNewDataSource();
iter = source.iterator();
- if (iflag != null) ((InterruptibleIterator) iter).setInterruptFlag(iflag);
+ if (iflag != null)
+ ((InterruptibleIterator) iter).setInterruptFlag(iflag);
return true;
}
@@ -157,14 +161,16 @@ public class SourceSwitchingIterator imp
if (iter == null) {
iter = source.iterator();
- if (iflag != null) ((InterruptibleIterator) iter).setInterruptFlag(iflag);
+ if (iflag != null)
+ ((InterruptibleIterator) iter).setInterruptFlag(iflag);
}
readNext(true);
}
private synchronized void _switchNow() throws IOException {
- if (onlySwitchAfterRow) throw new IllegalStateException("Can only switch on row boundries");
+ if (onlySwitchAfterRow)
+ throw new IllegalStateException("Can only switch on row boundries");
if (switchSource()) {
if (key != null) {
@@ -182,10 +188,12 @@ public class SourceSwitchingIterator imp
@Override
public synchronized void setInterruptFlag(AtomicBoolean flag) {
- if (copies.size() != 1) throw new IllegalStateException("setInterruptFlag() called after deep copies made " + copies.size());
+ if (copies.size() != 1)
+ throw new IllegalStateException("setInterruptFlag() called after deep copies made " + copies.size());
this.iflag = flag;
- if (iter != null) ((InterruptibleIterator) iter).setInterruptFlag(flag);
+ if (iter != null)
+ ((InterruptibleIterator) iter).setInterruptFlag(flag);
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/VisibilityFilter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/VisibilityFilter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/VisibilityFilter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/system/VisibilityFilter.java Thu Oct 27 15:24:51 2011
@@ -57,11 +57,14 @@ public class VisibilityFilter extends Fi
public boolean accept(Key k, Value v) {
Text testVis = k.getColumnVisibility(tmpVis);
- if (testVis.getLength() == 0 && defaultVisibility.getLength() == 0) return true;
- else if (testVis.getLength() == 0) testVis = defaultVisibility;
+ if (testVis.getLength() == 0 && defaultVisibility.getLength() == 0)
+ return true;
+ else if (testVis.getLength() == 0)
+ testVis = defaultVisibility;
Boolean b = (Boolean) cache.get(testVis);
- if (b != null) return b;
+ if (b != null)
+ return b;
try {
Boolean bb = ve.evaluate(new ColumnVisibility(testVis));
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/AgeOffFilter.java Thu Oct 27 15:24:51 2011
@@ -41,7 +41,8 @@ public class AgeOffFilter extends Filter
@Override
public boolean accept(Key k, Value v) {
- if (currentTime - k.getTimestamp() > threshold) return false;
+ if (currentTime - k.getTimestamp() > threshold)
+ return false;
return true;
}
@@ -49,16 +50,20 @@ public class AgeOffFilter extends Filter
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");
+ if (options == null)
+ throw new IllegalArgumentException(TTL + " must be set for AgeOffFilter");
String ttl = options.get(TTL);
- if (ttl == null) throw new IllegalArgumentException(TTL + " must be set for AgeOffFilter");
+ if (ttl == null)
+ throw new IllegalArgumentException(TTL + " must be set for AgeOffFilter");
threshold = Long.parseLong(ttl);
String time = options.get("currentTime");
- if (time != null) currentTime = Long.parseLong(time);
- else currentTime = System.currentTimeMillis();
+ if (time != null)
+ currentTime = Long.parseLong(time);
+ else
+ currentTime = System.currentTimeMillis();
// add sanity checks for threshold and currentTime?
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/ColumnAgeOffFilter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/ColumnAgeOffFilter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/ColumnAgeOffFilter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/ColumnAgeOffFilter.java Thu Oct 27 15:24:51 2011
@@ -66,8 +66,10 @@ public class ColumnAgeOffFilter extends
@Override
public boolean accept(Key k, Value v) {
Long threshold = ttls.getObject(k);
- if (threshold == null) return true;
- if (currentTime - k.getTimestamp() > threshold) return false;
+ if (threshold == null)
+ return true;
+ if (currentTime - k.getTimestamp() > threshold)
+ return false;
return true;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/MaxCombiner.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/MaxCombiner.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/MaxCombiner.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/MaxCombiner.java Thu Oct 27 15:24:51 2011
@@ -27,7 +27,8 @@ public class MaxCombiner extends LongCom
long max = Long.MIN_VALUE;
while (iter.hasNext()) {
Long l = iter.next();
- if (l > max) max = l;
+ if (l > max)
+ max = l;
}
return max;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/MinCombiner.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/MinCombiner.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/MinCombiner.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/MinCombiner.java Thu Oct 27 15:24:51 2011
@@ -27,7 +27,8 @@ public class MinCombiner extends LongCom
long min = Long.MAX_VALUE;
while (iter.hasNext()) {
Long l = iter.next();
- if (l < min) min = l;
+ if (l < min)
+ min = l;
}
return min;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/RegExFilter.java Thu Oct 27 15:24:51 2011
@@ -85,8 +85,9 @@ public class RegExFilter extends Filter
@Override
public boolean accept(Key key, Value value) {
- if (orFields) return matches(rowMatcher, key.getRowData()) || matches(colfMatcher, key.getColumnFamilyData())
- || matches(colqMatcher, key.getColumnQualifierData()) || matches(valueMatcher, value.get(), 0, value.get().length);
+ if (orFields)
+ return matches(rowMatcher, key.getRowData()) || matches(colfMatcher, key.getColumnFamilyData()) || matches(colqMatcher, key.getColumnQualifierData())
+ || matches(valueMatcher, value.get(), 0, value.get().length);
return matches(rowMatcher, key.getRowData()) && matches(colfMatcher, key.getColumnFamilyData()) && matches(colqMatcher, key.getColumnQualifierData())
&& matches(valueMatcher, value.get(), 0, value.get().length);
}
@@ -140,13 +141,17 @@ public class RegExFilter extends Filter
@Override
public boolean validateOptions(Map<String,String> options) {
- if (options.containsKey(ROW_REGEX)) Pattern.compile(options.get(ROW_REGEX)).matcher("");
+ if (options.containsKey(ROW_REGEX))
+ Pattern.compile(options.get(ROW_REGEX)).matcher("");
- if (options.containsKey(COLF_REGEX)) Pattern.compile(options.get(COLF_REGEX)).matcher("");
+ if (options.containsKey(COLF_REGEX))
+ Pattern.compile(options.get(COLF_REGEX)).matcher("");
- if (options.containsKey(COLQ_REGEX)) Pattern.compile(options.get(COLQ_REGEX)).matcher("");
+ if (options.containsKey(COLQ_REGEX))
+ Pattern.compile(options.get(COLQ_REGEX)).matcher("");
- if (options.containsKey(VALUE_REGEX)) Pattern.compile(options.get(VALUE_REGEX)).matcher("");
+ if (options.containsKey(VALUE_REGEX))
+ Pattern.compile(options.get(VALUE_REGEX)).matcher("");
return true;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java Thu Oct 27 15:24:51 2011
@@ -62,7 +62,8 @@ public class SummingArrayCombiner extend
@Override
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
super.init(source, options, env);
- if (options.get(LongCombiner.TYPE) == null) throw new IOException("no type specified");
+ if (options.get(LongCombiner.TYPE) == null)
+ throw new IOException("no type specified");
switch (Type.valueOf(options.get(LongCombiner.TYPE))) {
case VARNUM:
encoder = new VarNumArrayEncoder();
@@ -89,7 +90,8 @@ public class SummingArrayCombiner extend
@Override
public boolean validateOptions(Map<String,String> options) {
- if (options.get(LongCombiner.TYPE) == null) return false;
+ if (options.get(LongCombiner.TYPE) == null)
+ return false;
try {
Type.valueOf(options.get(LongCombiner.TYPE));
} catch (Exception e) {
@@ -161,7 +163,8 @@ public class SummingArrayCombiner extend
public static class StringArrayEncoder implements Encoder<List<Long>> {
@Override
public byte[] encode(List<Long> la) {
- if (la.size() == 0) return new byte[] {};
+ if (la.size() == 0)
+ return new byte[] {};
StringBuilder sb = new StringBuilder(Long.toString(la.get(0)));
for (int i = 1; i < la.size(); i++) {
sb.append(",");
@@ -175,8 +178,10 @@ public class SummingArrayCombiner extend
String[] longstrs = new String(b).split(",");
List<Long> la = new ArrayList<Long>(longstrs.length);
for (String s : longstrs) {
- if (s.length() == 0) la.add(0l);
- else la.add(Long.parseLong(s));
+ if (s.length() == 0)
+ la.add(0l);
+ else
+ la.add(Long.parseLong(s));
}
return la;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/iterators/user/TimestampFilter.java Thu Oct 27 15:24:51 2011
@@ -52,9 +52,12 @@ public class TimestampFilter extends Fil
@Override
public boolean accept(Key k, Value v) {
long ts = k.getTimestamp();
- if (ts < start || ts > end) return false;
- if (!startInclusive && ts == start) return false;
- if (!endInclusive && ts == end) return false;
+ if (ts < start || ts > end)
+ return false;
+ if (!startInclusive && ts == start)
+ return false;
+ if (!endInclusive && ts == end)
+ return false;
return true;
}
@@ -62,7 +65,8 @@ public class TimestampFilter extends Fil
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("ttl must be set for AgeOffFilter");
+ if (options == null)
+ throw new IllegalArgumentException("ttl must be set for AgeOffFilter");
startInclusive = true;
endInclusive = true;
@@ -72,8 +76,10 @@ public class TimestampFilter extends Fil
} catch (Exception e) {
throw new IOException(e);
}
- if (options.get(START_INCL) != null) startInclusive = Boolean.parseBoolean(options.get(START_INCL));
- if (options.get(END_INCL) != null) endInclusive = Boolean.parseBoolean(options.get(END_INCL));
+ if (options.get(START_INCL) != null)
+ startInclusive = Boolean.parseBoolean(options.get(START_INCL));
+ if (options.get(END_INCL) != null)
+ endInclusive = Boolean.parseBoolean(options.get(END_INCL));
}
@Override
@@ -98,8 +104,10 @@ public class TimestampFilter extends Fil
try {
dateParser.parse(options.get(START));
dateParser.parse(options.get(END));
- if (options.get(START_INCL) != null) Boolean.parseBoolean(options.get(START_INCL));
- if (options.get(END_INCL) != null) Boolean.parseBoolean(options.get(END_INCL));
+ if (options.get(START_INCL) != null)
+ Boolean.parseBoolean(options.get(START_INCL));
+ if (options.get(END_INCL) != null)
+ Boolean.parseBoolean(options.get(END_INCL));
} catch (Exception e) {
return false;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/AuditLevel.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/AuditLevel.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/AuditLevel.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/AuditLevel.java Thu Oct 27 15:24:51 2011
@@ -28,7 +28,8 @@ public class AuditLevel extends Level {
}
static public Level toLevel(int val) {
- if (val == Level.INFO_INT + 100) return Level.INFO;
+ if (val == Level.INFO_INT + 100)
+ return Level.INFO;
return Level.toLevel(val);
}
}
\ No newline at end of file
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/Authorizations.java Thu Oct 27 15:24:51 2011
@@ -99,7 +99,8 @@ public class Authorizations implements I
public Authorizations(byte[] authorizations) {
ArgumentChecker.notNull(authorizations);
- if (authorizations.length > 0) setAuthorizations(new String(authorizations).split(","));
+ if (authorizations.length > 0)
+ setAuthorizations(new String(authorizations).split(","));
}
public Authorizations() {}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/ColumnVisibility.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/ColumnVisibility.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/ColumnVisibility.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/ColumnVisibility.java Thu Oct 27 15:24:51 2011
@@ -67,7 +67,8 @@ public class ColumnVisibility {
}
public void add(Node child) {
- if (children == EMPTY) children = new ArrayList<Node>();
+ if (children == EMPTY)
+ children = new ArrayList<Node>();
children.add(child);
}
@@ -100,17 +101,20 @@ public class ColumnVisibility {
@Override
public int compare(Node a, Node b) {
int diff = a.type.ordinal() - b.type.ordinal();
- if (diff != 0) return diff;
+ if (diff != 0)
+ return diff;
switch (a.type) {
case TERM:
return WritableComparator.compareBytes(text, a.start, a.end - a.start, text, b.start, b.end - b.start);
case OR:
case AND:
diff = a.children.size() - b.children.size();
- if (diff != 0) return diff;
+ if (diff != 0)
+ return diff;
for (int i = 0; i < a.children.size(); i++) {
diff = compare(a.children.get(i), b.children.get(i));
- if (diff != 0) return diff;
+ if (diff != 0)
+ return diff;
}
}
return 0;
@@ -118,16 +122,19 @@ public class ColumnVisibility {
}
static private void flatten(Node root, byte[] expression, StringBuilder out) {
- if (root.type == NodeType.TERM) out.append(new String(expression, root.start, root.end - root.start));
+ if (root.type == NodeType.TERM)
+ out.append(new String(expression, root.start, root.end - root.start));
else {
String sep = "";
Collections.sort(root.children, new NodeComparator(expression));
for (Node c : root.children) {
out.append(sep);
boolean parens = (c.type != NodeType.TERM && root.type != c.type);
- if (parens) out.append("(");
+ if (parens)
+ out.append("(");
flatten(c, expression, out);
- if (parens) out.append(")");
+ if (parens)
+ out.append(")");
sep = root.type == NodeType.AND ? "&" : "|";
}
}
@@ -161,10 +168,12 @@ public class ColumnVisibility {
Node processTerm(int start, int end, Node expr, byte[] expression) {
if (start != end) {
- if (expr != null) throw new BadArgumentException("expression needs | or &", new String(expression), start);
+ if (expr != null)
+ throw new BadArgumentException("expression needs | or &", new String(expression), start);
return new Node(start, end);
}
- if (expr == null) throw new BadArgumentException("empty term", new String(expression), start);
+ if (expr == null)
+ throw new BadArgumentException("empty term", new String(expression), start);
return expr;
}
@@ -177,7 +186,8 @@ public class ColumnVisibility {
case '&': {
expr = processTerm(termStart, index - 1, expr, expression);
if (result != null) {
- if (!result.type.equals(NodeType.AND)) throw new BadArgumentException("cannot mix & and |", new String(expression), index - 1);
+ if (!result.type.equals(NodeType.AND))
+ throw new BadArgumentException("cannot mix & and |", new String(expression), index - 1);
} else {
result = new Node(NodeType.AND);
}
@@ -189,7 +199,8 @@ public class ColumnVisibility {
case '|': {
expr = processTerm(termStart, index - 1, expr, expression);
if (result != null) {
- if (!result.type.equals(NodeType.OR)) throw new BadArgumentException("cannot mix | and &", new String(expression), index - 1);
+ if (!result.type.equals(NodeType.OR))
+ throw new BadArgumentException("cannot mix | and &", new String(expression), index - 1);
} else {
result = new Node(NodeType.OR);
}
@@ -200,7 +211,8 @@ public class ColumnVisibility {
}
case '(': {
parens++;
- if (termStart != index - 1 || expr != null) throw new BadArgumentException("expression needs & or |", new String(expression), index - 1);
+ if (termStart != index - 1 || expr != null)
+ throw new BadArgumentException("expression needs & or |", new String(expression), index - 1);
expr = parse_(expression);
termStart = index;
break;
@@ -208,24 +220,33 @@ public class ColumnVisibility {
case ')': {
parens--;
Node child = processTerm(termStart, index - 1, expr, expression);
- if (child == null && result == null) throw new BadArgumentException("empty expression not allowed", new String(expression), index);
- if (result == null) return child;
- if (result.type == child.type) for (Node c : child.children)
- result.add(c);
- else result.add(child);
+ if (child == null && result == null)
+ throw new BadArgumentException("empty expression not allowed", new String(expression), index);
+ if (result == null)
+ return child;
+ if (result.type == child.type)
+ for (Node c : child.children)
+ result.add(c);
+ else
+ result.add(child);
result.end = index - 1;
return result;
}
default: {
byte c = expression[index - 1];
- if (!Authorizations.isValidAuthChar(c)) throw new BadArgumentException("bad character (" + c + ")", new String(expression), index - 1);
+ if (!Authorizations.isValidAuthChar(c))
+ throw new BadArgumentException("bad character (" + c + ")", new String(expression), index - 1);
}
}
}
Node child = processTerm(termStart, index, expr, expression);
- if (result != null) result.add(child);
- else result = child;
- if (result.type != NodeType.TERM) if (result.children.size() < 2) throw new BadArgumentException("missing term", new String(expression), index);
+ if (result != null)
+ result.add(child);
+ else
+ result = child;
+ if (result.type != NodeType.TERM)
+ if (result.children.size() < 2)
+ throw new BadArgumentException("missing term", new String(expression), index);
return result;
}
}
@@ -300,7 +321,8 @@ public class ColumnVisibility {
*/
@Override
public boolean equals(Object obj) {
- if (obj instanceof ColumnVisibility) return equals((ColumnVisibility) obj);
+ if (obj instanceof ColumnVisibility)
+ return equals((ColumnVisibility) obj);
return false;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/SystemPermission.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/SystemPermission.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/SystemPermission.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/SystemPermission.java Thu Oct 27 15:24:51 2011
@@ -60,7 +60,8 @@ public enum SystemPermission {
}
public static SystemPermission getPermissionById(byte id) {
- if (mapping.containsKey(id)) return mapping.get(id);
+ if (mapping.containsKey(id))
+ return mapping.get(id);
throw new IndexOutOfBoundsException("No such permission");
}
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/TablePermission.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/TablePermission.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/TablePermission.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/TablePermission.java Thu Oct 27 15:24:51 2011
@@ -59,7 +59,8 @@ public enum TablePermission {
public static TablePermission getPermissionById(byte id) {
TablePermission result = mapping[id];
- if (result != null) return result;
+ if (result != null)
+ return result;
throw new IndexOutOfBoundsException("No such permission");
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/VisibilityConstraint.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/VisibilityConstraint.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/VisibilityConstraint.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/VisibilityConstraint.java Thu Oct 27 15:24:51 2011
@@ -44,7 +44,8 @@ public class VisibilityConstraint implem
List<ColumnUpdate> updates = mutation.getUpdates();
HashSet<String> ok = null;
- if (updates.size() > 1) ok = new HashSet<String>();
+ if (updates.size() > 1)
+ ok = new HashSet<String>();
VisibilityEvaluator ve = null;
@@ -53,13 +54,16 @@ public class VisibilityConstraint implem
byte[] cv = update.getColumnVisibility();
if (cv.length > 0) {
String key = null;
- if (ok != null && ok.contains(key = new String(cv))) continue;
+ if (ok != null && ok.contains(key = new String(cv)))
+ continue;
try {
- if (ve == null) ve = new VisibilityEvaluator(env.getAuthorizations());
+ if (ve == null)
+ ve = new VisibilityEvaluator(env.getAuthorizations());
- if (!ve.evaluate(new ColumnVisibility(cv))) return Collections.singletonList(new Short((short) 2));
+ if (!ve.evaluate(new ColumnVisibility(cv)))
+ return Collections.singletonList(new Short((short) 2));
} catch (BadArgumentException bae) {
return Collections.singletonList(new Short((short) 1));
@@ -67,7 +71,8 @@ public class VisibilityConstraint implem
return Collections.singletonList(new Short((short) 1));
}
- if (ok != null) ok.add(key);
+ if (ok != null)
+ ok.add(key);
}
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/security/VisibilityEvaluator.java Thu Oct 27 15:24:51 2011
@@ -49,15 +49,19 @@ public class VisibilityEvaluator {
int len = root.getTermEnd() - root.getTermStart();
return auths.contains(new ArrayByteSequence(expression, root.getTermStart(), len));
case AND:
- if (root.children == null || root.children.size() < 2) throw new VisibilityParseException("AND has less than 2 children", expression, root.start);
+ if (root.children == null || root.children.size() < 2)
+ throw new VisibilityParseException("AND has less than 2 children", expression, root.start);
for (Node child : root.children) {
- if (!evaluate(expression, child)) return false;
+ if (!evaluate(expression, child))
+ return false;
}
return true;
case OR:
- if (root.children == null || root.children.size() < 2) throw new VisibilityParseException("OR has less than 2 children", expression, root.start);
+ if (root.children == null || root.children.size() < 2)
+ throw new VisibilityParseException("OR has less than 2 children", expression, root.start);
for (Node child : root.children) {
- if (evaluate(expression, child)) return true;
+ if (evaluate(expression, child))
+ return true;
}
return false;
default:
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/trace/SpanTree.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/trace/SpanTree.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/trace/SpanTree.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/trace/SpanTree.java Thu Oct 27 15:24:51 2011
@@ -34,16 +34,19 @@ public class SpanTree {
public void addNode(RemoteSpan span) {
nodes.put(span.spanId, span);
- if (parentChildren.get(span.parentId) == null) parentChildren.put(span.parentId, new ArrayList<Long>());
+ if (parentChildren.get(span.parentId) == null)
+ parentChildren.put(span.parentId, new ArrayList<Long>());
parentChildren.get(span.parentId).add(span.spanId);
}
public Set<Long> visit(SpanTreeVisitor visitor) {
Set<Long> visited = new HashSet<Long>();
List<Long> root = parentChildren.get(new Long(Span.ROOT_SPAN_ID));
- if (root == null || root.isEmpty()) return visited;
+ if (root == null || root.isEmpty())
+ return visited;
RemoteSpan rootSpan = nodes.get(root.iterator().next());
- if (rootSpan == null) return visited;
+ if (rootSpan == null)
+ return visited;
recurse(0, null, rootSpan, visitor, visited);
return visited;
}
@@ -51,7 +54,8 @@ public class SpanTree {
private void recurse(int level, RemoteSpan parent, RemoteSpan node, SpanTreeVisitor visitor, Set<Long> visited) {
// improbable case: duplicate spanId in a trace tree: prevent
// infinite recursion
- if (visited.contains(node.spanId)) return;
+ if (visited.contains(node.spanId))
+ return;
visited.add(node.spanId);
List<RemoteSpan> children = new ArrayList<RemoteSpan>();
List<Long> childrenIds = parentChildren.get(node.spanId);
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/trace/TraceDump.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/trace/TraceDump.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/trace/TraceDump.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/trace/TraceDump.java Thu Oct 27 15:24:51 2011
@@ -151,7 +151,8 @@ public class TraceDump {
RemoteSpan span = TraceFormatter.getRemoteSpan(entry);
tree.addNode(span);
start = min(start, span.start);
- if (span.parentId <= 0) count++;
+ if (span.parentId <= 0)
+ count++;
}
out.print(String.format("Trace started at %s", TraceFormatter.formatDate(new Date(start))));
out.print("Time Start Service@Location Name");
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/AddressUtil.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/AddressUtil.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/AddressUtil.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/AddressUtil.java Thu Oct 27 15:24:51 2011
@@ -25,7 +25,8 @@ public class AddressUtil {
static public InetSocketAddress parseAddress(String address, int defaultPort) throws NumberFormatException {
final String[] parts = address.split(":", 2);
if (parts.length == 2) {
- if (parts[1].isEmpty()) return new InetSocketAddress(parts[0], defaultPort);
+ if (parts[1].isEmpty())
+ return new InetSocketAddress(parts[0], defaultPort);
return new InetSocketAddress(parts[0], Integer.parseInt(parts[1]));
}
return new InetSocketAddress(address, defaultPort);
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ArgumentChecker.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ArgumentChecker.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ArgumentChecker.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ArgumentChecker.java Thu Oct 27 15:24:51 2011
@@ -27,27 +27,32 @@ public class ArgumentChecker {
private static final String NULL_ARG_MSG = "argument was null";
public static final void notNull(final Object arg1) {
- if (arg1 == null) throw new IllegalArgumentException(NULL_ARG_MSG + ":Is null- arg1? " + (arg1 == null));
+ if (arg1 == null)
+ throw new IllegalArgumentException(NULL_ARG_MSG + ":Is null- arg1? " + (arg1 == null));
}
public static final void notNull(final Object arg1, final Object arg2) {
- if (arg1 == null || arg2 == null) throw new IllegalArgumentException(NULL_ARG_MSG + ":Is null- arg1? " + (arg1 == null) + " arg2? " + (arg2 == null));
+ if (arg1 == null || arg2 == null)
+ throw new IllegalArgumentException(NULL_ARG_MSG + ":Is null- arg1? " + (arg1 == null) + " arg2? " + (arg2 == null));
}
public static final void notNull(final Object arg1, final Object arg2, final Object arg3) {
- if (arg1 == null || arg2 == null || arg3 == null) throw new IllegalArgumentException(NULL_ARG_MSG + ":Is null- arg1? " + (arg1 == null) + " arg2? "
- + (arg2 == null) + " arg3? " + (arg3 == null));
+ if (arg1 == null || arg2 == null || arg3 == null)
+ throw new IllegalArgumentException(NULL_ARG_MSG + ":Is null- arg1? " + (arg1 == null) + " arg2? " + (arg2 == null) + " arg3? " + (arg3 == null));
}
public static final void notNull(final Object arg1, final Object arg2, final Object arg3, final Object arg4) {
- if (arg1 == null || arg2 == null || arg3 == null || arg4 == null) throw new IllegalArgumentException(NULL_ARG_MSG + ":Is null- arg1? " + (arg1 == null)
- + " arg2? " + (arg2 == null) + " arg3? " + (arg3 == null) + " arg4? " + (arg4 == null));
+ if (arg1 == null || arg2 == null || arg3 == null || arg4 == null)
+ throw new IllegalArgumentException(NULL_ARG_MSG + ":Is null- arg1? " + (arg1 == null) + " arg2? " + (arg2 == null) + " arg3? " + (arg3 == null)
+ + " arg4? " + (arg4 == null));
}
public static final void notNull(final Object[] args) {
- if (args == null) throw new IllegalArgumentException(NULL_ARG_MSG + ":arg array is null");
+ if (args == null)
+ throw new IllegalArgumentException(NULL_ARG_MSG + ":arg array is null");
for (int i = 0; i < args.length; i++)
- if (args[i] == null) throw new IllegalArgumentException(NULL_ARG_MSG + ":arg" + i + " is null");
+ if (args[i] == null)
+ throw new IllegalArgumentException(NULL_ARG_MSG + ":arg" + i + " is null");
}
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/BinaryTree.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/BinaryTree.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/BinaryTree.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/BinaryTree.java Thu Oct 27 15:24:51 2011
@@ -66,16 +66,19 @@ public class BinaryTree<T> {
}
public boolean isEmpty() {
- if (parent == null && left == null && right == null && contents == null) return true;
+ if (parent == null && left == null && right == null && contents == null)
+ return true;
return false;
}
@Override
public String toString() {
String out = "[";
- if (left != null) out += left.toString();
+ if (left != null)
+ out += left.toString();
out += contents;
- if (right != null) out += right.toString();
+ if (right != null)
+ out += right.toString();
out += "]";
return out;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ByteBufferUtil.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ByteBufferUtil.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ByteBufferUtil.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ByteBufferUtil.java Thu Oct 27 15:24:51 2011
@@ -26,12 +26,14 @@ import org.apache.hadoop.io.Text;
public class ByteBufferUtil {
public static byte[] toBytes(ByteBuffer buffer) {
- if (buffer == null) return null;
+ if (buffer == null)
+ return null;
return Arrays.copyOfRange(buffer.array(), buffer.position(), buffer.remaining());
}
public static List<ByteBuffer> toByteBuffers(Collection<byte[]> bytesList) {
- if (bytesList == null) return null;
+ if (bytesList == null)
+ return null;
ArrayList<ByteBuffer> result = new ArrayList<ByteBuffer>();
for (byte[] bytes : bytesList) {
result.add(ByteBuffer.wrap(bytes));
@@ -40,7 +42,8 @@ public class ByteBufferUtil {
}
public static List<byte[]> toBytesList(Collection<ByteBuffer> bytesList) {
- if (bytesList == null) return null;
+ if (bytesList == null)
+ return null;
ArrayList<byte[]> result = new ArrayList<byte[]>();
for (ByteBuffer bytes : bytesList) {
result.add(toBytes(bytes));
@@ -49,7 +52,8 @@ public class ByteBufferUtil {
}
public static Text toText(ByteBuffer bytes) {
- if (bytes == null) return null;
+ if (bytes == null)
+ return null;
Text result = new Text();
result.set(bytes.array(), bytes.position(), bytes.remaining());
return result;
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/CachedConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/CachedConfiguration.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/CachedConfiguration.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/CachedConfiguration.java Thu Oct 27 15:24:51 2011
@@ -22,7 +22,8 @@ public class CachedConfiguration {
private static Configuration configuration = null;
public synchronized static Configuration getInstance() {
- if (configuration == null) setInstance(new Configuration());
+ if (configuration == null)
+ setInstance(new Configuration());
return configuration;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ColumnFQ.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ColumnFQ.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ColumnFQ.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ColumnFQ.java Thu Oct 27 15:24:51 2011
@@ -74,8 +74,10 @@ public class ColumnFQ implements Compara
@Override
public boolean equals(Object o) {
- if (!(o instanceof ColumnFQ)) return false;
- if (this == o) return true;
+ if (!(o instanceof ColumnFQ))
+ return false;
+ if (this == o)
+ return true;
ColumnFQ ocfq = (ColumnFQ) o;
return ocfq.colf.equals(colf) && ocfq.colq.equals(colq);
}
@@ -97,7 +99,8 @@ public class ColumnFQ implements Compara
public int compareTo(ColumnFQ o) {
int cmp = colf.compareTo(o.colf);
- if (cmp == 0) cmp = colq.compareTo(o.colq);
+ if (cmp == 0)
+ cmp = colq.compareTo(o.colq);
return cmp;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Duration.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Duration.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Duration.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Duration.java Thu Oct 27 15:24:51 2011
@@ -29,22 +29,28 @@ public class Duration {
public static String format(long time, String space, String zero) {
long ms, sec, min, hr, day, yr;
ms = sec = min = hr = day = yr = -1;
- if (time == 0) return zero;
+ if (time == 0)
+ return zero;
ms = time % 1000;
time /= 1000;
- if (time == 0) return String.format("%dms", ms);
+ if (time == 0)
+ return String.format("%dms", ms);
sec = time % 60;
time /= 60;
- if (time == 0) return String.format("%ds" + space + "%dms", sec, ms);
+ if (time == 0)
+ return String.format("%ds" + space + "%dms", sec, ms);
min = time % 60;
time /= 60;
- if (time == 0) return String.format("%dm" + space + "%ds", min, sec);
+ if (time == 0)
+ return String.format("%dm" + space + "%ds", min, sec);
hr = time % 24;
time /= 24;
- if (time == 0) return String.format("%dh" + space + "%dm", hr, min);
+ if (time == 0)
+ return String.format("%dh" + space + "%dm", hr, min);
day = time % 365;
time /= 365;
- if (time == 0) return String.format("%dd" + space + "%dh", day, hr);
+ if (time == 0)
+ return String.format("%dd" + space + "%dh", day, hr);
yr = time;
return String.format("%dy" + space + "%dd", yr, day);
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java Thu Oct 27 15:24:51 2011
@@ -60,7 +60,8 @@ public class LocalityGroupUtil {
Map<String,Set<ByteSequence>> result = new HashMap<String,Set<ByteSequence>>();
String[] groups = acuconf.get(Property.TABLE_LOCALITY_GROUPS).split(",");
for (String group : groups) {
- if (group.length() > 0) result.put(group, new HashSet<ByteSequence>());
+ if (group.length() > 0)
+ result.put(group, new HashSet<ByteSequence>());
}
HashSet<ByteSequence> all = new HashSet<ByteSequence>();
for (Entry<String,String> entry : acuconf) {
@@ -163,9 +164,12 @@ public class LocalityGroupUtil {
for (int i = 0; i < len; i++) {
int c = 0xff & ba[i];
- if (c == '\\') sb.append("\\\\");
- else if (c >= 32 && c <= 126 && c != ',') sb.append((char) c);
- else sb.append("\\x").append(String.format("%02X", c));
+ if (c == '\\')
+ sb.append("\\\\");
+ else if (c >= 32 && c <= 126 && c != ',')
+ sb.append((char) c);
+ else
+ sb.append("\\x").append(String.format("%02X", c));
}
String ecf = sb.toString();
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Merge.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Merge.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Merge.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Merge.java Thu Oct 27 15:24:51 2011
@@ -155,7 +155,8 @@ public class Merge {
totalSize = mergeMany(conn, table, sizes, goalSize, force, false);
}
}
- if (sizes.size() > 1) mergeMany(conn, table, sizes, goalSize, force, true);
+ if (sizes.size() > 1)
+ mergeMany(conn, table, sizes, goalSize, force, true);
} catch (Exception ex) {
throw new MergeException(ex);
}
@@ -164,7 +165,8 @@ public class Merge {
protected long mergeMany(Connector conn, String table, List<Size> sizes, long goalSize, boolean force, boolean last) throws MergeException {
// skip the big tablets, which will be the typical case
while (!sizes.isEmpty()) {
- if (sizes.get(0).size < goalSize) break;
+ if (sizes.get(0).size < goalSize)
+ break;
sizes.remove(0);
}
if (sizes.isEmpty()) {
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java Thu Oct 27 15:24:51 2011
@@ -65,8 +65,10 @@ public class MetadataTable {
size = Long.parseLong(ba[0]);
numEntries = Long.parseLong(ba[1]);
- if (ba.length == 3) time = Long.parseLong(ba[2]);
- else time = -1;
+ if (ba.length == 3)
+ time = Long.parseLong(ba[2]);
+ else
+ time = -1;
}
public long getSize() {
@@ -86,7 +88,8 @@ public class MetadataTable {
}
public byte[] encode() {
- if (time >= 0) return ("" + size + "," + numEntries + "," + time).getBytes();
+ if (time >= 0)
+ return ("" + size + "," + numEntries + "," + time).getBytes();
return ("" + size + "," + numEntries).getBytes();
}
@@ -109,7 +112,8 @@ public class MetadataTable {
}
public void setTime(long time) {
- if (time < 0) throw new IllegalArgumentException();
+ if (time < 0)
+ throw new IllegalArgumentException();
this.time = time;
}
}
@@ -143,9 +147,10 @@ public class MetadataTable {
colq = key.getColumnQualifier(colq);
// interpret the row id as a key extent
- if (colf.equals(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY) || colf.equals(Constants.METADATA_FUTURE_LOCATION_COLUMN_FAMILY)) location = new Text(
- val.toString());
- else if (Constants.METADATA_PREV_ROW_COLUMN.equals(colf, colq)) prevRow = new Value(val);
+ if (colf.equals(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY) || colf.equals(Constants.METADATA_FUTURE_LOCATION_COLUMN_FAMILY))
+ location = new Text(val.toString());
+ else if (Constants.METADATA_PREV_ROW_COLUMN.equals(colf, colq))
+ prevRow = new Value(val);
if (location != null && prevRow != null) {
ke = new KeyExtent(key.getRow(), prevRow);
@@ -258,13 +263,15 @@ public class MetadataTable {
haveLocation = false;
row = entry.getKey().getRow();
}
- } else row = entry.getKey().getRow();
+ } else
+ row = entry.getKey().getRow();
colf = entry.getKey().getColumnFamily(colf);
colq = entry.getKey().getColumnQualifier(colq);
// stop scanning metadata table when another table is reached
- if (!(new KeyExtent(entry.getKey().getRow(), (Text) null)).getTableId().toString().equals(tableId)) break;
+ if (!(new KeyExtent(entry.getKey().getRow(), (Text) null)).getTableId().toString().equals(tableId))
+ break;
if (Constants.METADATA_PREV_ROW_COLUMN.equals(colf, colq)) {
currentKeyExtent = new KeyExtent(entry.getKey().getRow(), entry.getValue());
@@ -289,23 +296,25 @@ public class MetadataTable {
public static void validateEntries(String tableId, SortedSet<KeyExtent> tablets) throws AccumuloException {
// sanity check of metadata table entries
// make sure tablets has no holes, and that it starts and ends w/ null
- if (tablets.size() == 0) throw new AccumuloException("No entries found in metadata table for table " + tableId);
+ if (tablets.size() == 0)
+ throw new AccumuloException("No entries found in metadata table for table " + tableId);
- if (tablets.first().getPrevEndRow() != null) throw new AccumuloException("Problem with metadata table, first entry for table " + tableId + "- "
- + tablets.first() + " - has non null prev end row");
+ if (tablets.first().getPrevEndRow() != null)
+ throw new AccumuloException("Problem with metadata table, first entry for table " + tableId + "- " + tablets.first() + " - has non null prev end row");
- if (tablets.last().getEndRow() != null) throw new AccumuloException("Problem with metadata table, last entry for table " + tableId + "- " + tablets.first()
- + " - has non null end row");
+ if (tablets.last().getEndRow() != null)
+ throw new AccumuloException("Problem with metadata table, last entry for table " + tableId + "- " + tablets.first() + " - has non null end row");
Iterator<KeyExtent> tabIter = tablets.iterator();
Text lastEndRow = tabIter.next().getEndRow();
while (tabIter.hasNext()) {
KeyExtent tabke = tabIter.next();
- if (tabke.getPrevEndRow() == null) throw new AccumuloException("Problem with metadata table, it has null prev end row in middle of table " + tabke);
+ if (tabke.getPrevEndRow() == null)
+ throw new AccumuloException("Problem with metadata table, it has null prev end row in middle of table " + tabke);
- if (!tabke.getPrevEndRow().equals(lastEndRow)) throw new AccumuloException("Problem with metadata table, it has a hole " + tabke.getPrevEndRow() + " != "
- + lastEndRow);
+ if (!tabke.getPrevEndRow().equals(lastEndRow))
+ throw new AccumuloException("Problem with metadata table, it has a hole " + tabke.getPrevEndRow() + " != " + lastEndRow);
lastEndRow = tabke.getEndRow();
}
@@ -314,9 +323,11 @@ public class MetadataTable {
}
public static boolean isContiguousRange(KeyExtent ke, SortedSet<KeyExtent> children) {
- if (children.size() == 0) return false;
+ if (children.size() == 0)
+ return false;
- if (children.size() == 1) return children.first().equals(ke);
+ if (children.size() == 1)
+ return children.first().equals(ke);
Text per = children.first().getPrevEndRow();
Text er = children.last().getEndRow();
@@ -325,7 +336,8 @@ public class MetadataTable {
boolean erEqual = (er == ke.getEndRow() || er != null && ke.getEndRow() != null && ke.getEndRow().compareTo(er) == 0);
- if (!perEqual || !erEqual) return false;
+ if (!perEqual || !erEqual)
+ return false;
Iterator<KeyExtent> iter = children.iterator();
@@ -338,9 +350,11 @@ public class MetadataTable {
// something in the middle should not be null
- if (per == null || lastEndRow == null) return false;
+ if (per == null || lastEndRow == null)
+ return false;
- if (per.compareTo(lastEndRow) != 0) return false;
+ if (per.compareTo(lastEndRow) != 0)
+ return false;
lastEndRow = cke.getEndRow();
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/OpTimer.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/OpTimer.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/OpTimer.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/OpTimer.java Thu Oct 27 15:24:51 2011
@@ -35,7 +35,8 @@ public class OpTimer {
public OpTimer start(String msg) {
opid = nextOpid.getAndIncrement();
- if (log.isEnabledFor(level)) log.log(level, "tid=" + Thread.currentThread().getId() + " oid=" + opid + " " + msg);
+ if (log.isEnabledFor(level))
+ log.log(level, "tid=" + Thread.currentThread().getId() + " oid=" + opid + " " + msg);
t1 = System.currentTimeMillis();
return this;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Pair.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Pair.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Pair.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Pair.java Thu Oct 27 15:24:51 2011
@@ -26,7 +26,8 @@ public class Pair<A,B> {
}
private int hashCode(Object o) {
- if (o == null) return 0;
+ if (o == null)
+ return 0;
return o.hashCode();
}
@@ -36,7 +37,8 @@ public class Pair<A,B> {
}
private boolean equals(Object o1, Object o2) {
- if (o1 == null || o2 == null) return o1 == o2;
+ if (o1 == null || o2 == null)
+ return o1 == o2;
return o1.equals(o2);
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/PeekingIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/PeekingIterator.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/PeekingIterator.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/PeekingIterator.java Thu Oct 27 15:24:51 2011
@@ -24,8 +24,10 @@ public class PeekingIterator<E> implemen
public PeekingIterator(Iterator<E> source) {
this.source = source;
- if (source.hasNext()) top = source.next();
- else top = null;
+ if (source.hasNext())
+ top = source.next();
+ else
+ top = null;
}
public E peek() {
@@ -34,8 +36,10 @@ public class PeekingIterator<E> implemen
public E next() {
E lastPeeked = top;
- if (source.hasNext()) top = source.next();
- else top = null;
+ if (source.hasNext())
+ top = source.next();
+ else
+ top = null;
return lastPeeked;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ServerServices.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ServerServices.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ServerServices.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ServerServices.java Thu Oct 27 15:24:51 2011
@@ -69,7 +69,8 @@ public class ServerServices implements C
String address = getAddressString(service);
String[] parts = address.split(":", 2);
if (parts.length == 2) {
- if (parts[1].isEmpty()) return new InetSocketAddress(parts[0], service.getDefaultPort());
+ if (parts[1].isEmpty())
+ return new InetSocketAddress(parts[0], service.getDefaultPort());
return new InetSocketAddress(parts[0], Integer.parseInt(parts[1]));
}
return new InetSocketAddress(address, service.getDefaultPort());
@@ -98,7 +99,8 @@ public class ServerServices implements C
@Override
public boolean equals(Object o) {
- if (o instanceof ServerServices) return toString().equals(((ServerServices) o).toString());
+ if (o instanceof ServerServices)
+ return toString().equals(((ServerServices) o).toString());
return false;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Stat.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Stat.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Stat.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Stat.java Thu Oct 27 15:24:51 2011
@@ -25,8 +25,10 @@ public class Stat {
double partialStdDev = 0;
public void addStat(long stat) {
- if (stat > max) max = stat;
- if (stat < min) min = stat;
+ if (stat > max)
+ max = stat;
+ if (stat < min)
+ min = stat;
sum += stat;
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/StopWatch.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/StopWatch.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/StopWatch.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/StopWatch.java Thu Oct 27 15:24:51 2011
@@ -35,7 +35,8 @@ public class StopWatch<K extends Enum<K>
}
public synchronized void stopIfActive(K timer) {
- if (startTime.containsKey(timer)) stop(timer);
+ if (startTime.containsKey(timer))
+ stop(timer);
}
public synchronized void stop(K timer) {
@@ -47,7 +48,8 @@ public class StopWatch<K extends Enum<K>
}
Long existingTime = totalTime.get(timer);
- if (existingTime == null) existingTime = 0L;
+ if (existingTime == null)
+ existingTime = 0L;
totalTime.put(timer, existingTime + (System.currentTimeMillis() - st));
startTime.remove(timer);
@@ -59,13 +61,15 @@ public class StopWatch<K extends Enum<K>
public synchronized long get(K timer) {
Long existingTime = totalTime.get(timer);
- if (existingTime == null) existingTime = 0L;
+ if (existingTime == null)
+ existingTime = 0L;
return existingTime;
}
public synchronized double getSecs(K timer) {
Long existingTime = totalTime.get(timer);
- if (existingTime == null) existingTime = 0L;
+ if (existingTime == null)
+ existingTime = 0L;
return existingTime / 1000.0;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/TableDiskUsage.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/TableDiskUsage.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/TableDiskUsage.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/TableDiskUsage.java Thu Oct 27 15:24:51 2011
@@ -52,7 +52,8 @@ public class TableDiskUsage {
private Map<String,Long> fileSizes = new HashMap<String,Long>();
void addTable(String tableId) {
- if (internalIds.containsKey(tableId)) throw new IllegalArgumentException("Already added table " + tableId);
+ if (internalIds.containsKey(tableId))
+ throw new IllegalArgumentException("Already added table " + tableId);
int iid = nextInternalId++;
@@ -87,7 +88,8 @@ public class TableDiskUsage {
Long size = fileSizes.get(entry.getKey());
Long tablesUsage = usage.get(key);
- if (tablesUsage == null) tablesUsage = 0l;
+ if (tablesUsage == null)
+ tablesUsage = 0l;
tablesUsage += size;
@@ -101,7 +103,8 @@ public class TableDiskUsage {
List<String> externalKey = new ArrayList<String>();
List<Integer> key = entry.getKey();
for (int i = 0; i < key.size(); i++)
- if (key.get(i) != 0) externalKey.add(externalIds.get(i));
+ if (key.get(i) != 0)
+ externalKey.add(externalIds.get(i));
externalUsage.put(externalKey, entry.getValue());
}
@@ -118,7 +121,8 @@ public class TableDiskUsage {
for (String tableName : tables) {
String tableId = conn.tableOperations().tableIdMap().get(tableName);
- if (tableId == null) throw new TableNotFoundException(null, tableName, "Table " + tableName + " not found");
+ if (tableId == null)
+ throw new TableNotFoundException(null, tableName, "Table " + tableName + " not found");
tableIds.add(tableId);
}
@@ -138,7 +142,8 @@ public class TableDiskUsage {
if (file.startsWith("../")) {
file = file.substring(2);
tablesReferenced.add(file.split("\\/")[1]);
- } else file = "/" + tableId + file;
+ } else
+ file = "/" + tableId + file;
tdu.linkFileAndTable(tableId, file);
}
@@ -180,7 +185,8 @@ public class TableDiskUsage {
int cmp = s1.compareTo(s2);
- if (cmp != 0) return cmp;
+ if (cmp != 0)
+ return cmp;
count++;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/TextUtil.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/TextUtil.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/TextUtil.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/TextUtil.java Thu Oct 27 15:24:51 2011
@@ -32,7 +32,8 @@ public final class TextUtil {
}
public static ByteBuffer getByteBuffer(Text text) {
- if (text == null) return null;
+ if (text == null)
+ return null;
byte[] bytes = text.getBytes();
return ByteBuffer.wrap(bytes, 0, text.getLength());
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ThriftUtil.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ThriftUtil.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ThriftUtil.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/ThriftUtil.java Thu Oct 27 15:24:51 2011
@@ -94,7 +94,8 @@ public class ThriftUtil {
} catch (Exception e) {
throw new AccumuloException(e);
} finally {
- if (client != null) returnClient(client);
+ if (client != null)
+ returnClient(client);
}
}
}
@@ -113,7 +114,8 @@ public class ThriftUtil {
} catch (Exception e) {
throw new AccumuloException(e);
} finally {
- if (client != null) returnClient(client);
+ if (client != null)
+ returnClient(client);
}
}
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Version.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Version.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Version.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/Version.java Thu Oct 27 15:24:51 2011
@@ -33,14 +33,19 @@ public class Version {
private void parse(String everything) {
Pattern pattern = Pattern.compile("(([^-]*)-)?(\\d+)(\\.(\\d+)(\\.(\\d+))?)?(-(.*))?");
Matcher parser = pattern.matcher(everything);
- if (!parser.matches()) throw new IllegalArgumentException("Unable to parse: " + everything + " as a version");
+ if (!parser.matches())
+ throw new IllegalArgumentException("Unable to parse: " + everything + " as a version");
- if (parser.group(1) != null) package_ = parser.group(2);
+ if (parser.group(1) != null)
+ package_ = parser.group(2);
major = Integer.valueOf(parser.group(3));
minor = 0;
- if (parser.group(5) != null) minor = Integer.valueOf(parser.group(5));
- if (parser.group(7) != null) release = Integer.valueOf(parser.group(7));
- if (parser.group(9) != null) etcetera = parser.group(9);
+ if (parser.group(5) != null)
+ minor = Integer.valueOf(parser.group(5));
+ if (parser.group(7) != null)
+ release = Integer.valueOf(parser.group(7));
+ if (parser.group(9) != null)
+ etcetera = parser.group(9);
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/format/BinaryFormatter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/format/BinaryFormatter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/format/BinaryFormatter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/format/BinaryFormatter.java Thu Oct 27 15:24:51 2011
@@ -52,8 +52,10 @@ public class BinaryFormatter implements
}
static void checkState(Iterator<Entry<Key,Value>> si, boolean expectInitialized) {
- if (expectInitialized && si == null) throw new IllegalStateException("Not initialized");
- if (!expectInitialized && si != null) throw new IllegalStateException("Already initialized");
+ if (expectInitialized && si == null)
+ throw new IllegalStateException("Not initialized");
+ if (!expectInitialized && si != null)
+ throw new IllegalStateException("Already initialized");
}
// this should be replaced with something like Record.toString();
@@ -73,7 +75,8 @@ public class BinaryFormatter implements
sb.append(new ColumnVisibility(entry.getKey().getColumnVisibility()));
// append timestamp
- if (showTimestamps) sb.append(" ").append(entry.getKey().getTimestamp());
+ if (showTimestamps)
+ sb.append(" ").append(entry.getKey().getTimestamp());
// append value
if (entry.getValue() != null && entry.getValue().getSize() > 0) {
@@ -97,9 +100,12 @@ public class BinaryFormatter implements
if (len > showLength) {
for (int i = 0; i < showLength; i++) {
int c = 0xff & ba[offset + i];
- if (c == '\\') sb.append("\\\\");
- else if (c >= 32 && c <= 126) sb.append((char) c);
- else sb.append("\\x").append(String.format("%02X", c));
+ if (c == '\\')
+ sb.append("\\\\");
+ else if (c >= 32 && c <= 126)
+ sb.append((char) c);
+ else
+ sb.append("\\x").append(String.format("%02X", c));
}
return sb;
}
@@ -108,9 +114,12 @@ public class BinaryFormatter implements
for (int i = 0; i < len; i++) {
int c = 0xff & ba[offset + i];
- if (c == '\\') sb.append("\\\\");
- else if (c >= 32 && c <= 126) sb.append((char) c);
- else sb.append("\\x").append(String.format("%02X", c));
+ if (c == '\\')
+ sb.append("\\\\");
+ else if (c >= 32 && c <= 126)
+ sb.append((char) c);
+ else
+ sb.append("\\x").append(String.format("%02X", c));
}
return sb;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java Thu Oct 27 15:24:51 2011
@@ -51,8 +51,10 @@ public class DefaultFormatter implements
}
static void checkState(Iterator<Entry<Key,Value>> si, boolean expectInitialized) {
- if (expectInitialized && si == null) throw new IllegalStateException("Not initialized");
- if (!expectInitialized && si != null) throw new IllegalStateException("Already initialized");
+ if (expectInitialized && si == null)
+ throw new IllegalStateException("Not initialized");
+ if (!expectInitialized && si != null)
+ throw new IllegalStateException("Already initialized");
}
// this should be replaced with something like Record.toString();
@@ -72,7 +74,8 @@ public class DefaultFormatter implements
sb.append(new ColumnVisibility(entry.getKey().getColumnVisibility()));
// append timestamp
- if (showTimestamps) sb.append(" ").append(entry.getKey().getTimestamp());
+ if (showTimestamps)
+ sb.append(" ").append(entry.getKey().getTimestamp());
// append value
if (entry.getValue() != null && entry.getValue().getSize() > 0) {
@@ -94,9 +97,12 @@ public class DefaultFormatter implements
static StringBuilder appendBytes(StringBuilder sb, byte ba[], int offset, int len) {
for (int i = 0; i < len; i++) {
int c = 0xff & ba[offset + i];
- if (c == '\\') sb.append("\\\\");
- else if (c >= 32 && c <= 126) sb.append((char) c);
- else sb.append("\\x").append(String.format("%02X", c));
+ if (c == '\\')
+ sb.append("\\\\");
+ else if (c >= 32 && c <= 126)
+ sb.append((char) c);
+ else
+ sb.append("\\x").append(String.format("%02X", c));
}
return sb;
}
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/format/DeleterFormatter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/format/DeleterFormatter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/format/DeleterFormatter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/format/DeleterFormatter.java Thu Oct 27 15:24:51 2011
@@ -54,8 +54,9 @@ public class DeleterFormatter extends De
writer.close();
} catch (MutationsRejectedException e) {
log.error(e.toString());
- if (Shell.isDebuggingEnabled()) for (ConstraintViolationSummary cvs : e.getConstraintViolationSummaries())
- log.trace(cvs.toString());
+ if (Shell.isDebuggingEnabled())
+ for (ConstraintViolationSummary cvs : e.getConstraintViolationSummaries())
+ log.trace(cvs.toString());
}
return false;
}
@@ -82,8 +83,9 @@ public class DeleterFormatter extends De
writer.addMutation(m);
} catch (MutationsRejectedException e) {
log.error(e.toString());
- if (Shell.isDebuggingEnabled()) for (ConstraintViolationSummary cvs : e.getConstraintViolationSummaries())
- log.trace(cvs.toString());
+ if (Shell.isDebuggingEnabled())
+ for (ConstraintViolationSummary cvs : e.getConstraintViolationSummaries())
+ log.trace(cvs.toString());
}
}
shellState.getReader().printString(String.format("[%s] %s\n", delete ? "DELETED" : "SKIPPED", entryStr));
Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/format/ShardedTableDistributionFormatter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/format/ShardedTableDistributionFormatter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/format/ShardedTableDistributionFormatter.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/util/format/ShardedTableDistributionFormatter.java Thu Oct 27 15:24:51 2011
@@ -59,9 +59,11 @@ public class ShardedTableDistributionFor
if (semicolon != -1) {
semicolon++;
day = row.substring(semicolon, semicolon + 8);
- } else day = "NULL ";
+ } else
+ day = "NULL ";
String server = entry.getValue().toString();
- if (countsByDay.get(day) == null) countsByDay.put(day, new HashSet<String>());
+ if (countsByDay.get(day) == null)
+ countsByDay.put(day, new HashSet<String>());
countsByDay.get(day).add(server);
}
}