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 [23/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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TooManyFilesException.java Thu Oct 27 15:24:51 2011
@@ -5,99 +5,94 @@
*/
package org.apache.accumulo.core.tabletserver.thrift;
-
-
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
@SuppressWarnings("serial")
-public class TooManyFilesException extends Exception implements TBase<TooManyFilesException, TooManyFilesException._Fields>, java.io.Serializable, Cloneable {
+public class TooManyFilesException extends Exception implements TBase<TooManyFilesException,TooManyFilesException._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("TooManyFilesException");
-
- private static final TField EXTENT_FIELD_DESC = new TField("extent", TType.STRUCT, (short)1);
-
+
+ private static final TField EXTENT_FIELD_DESC = new TField("extent", TType.STRUCT, (short) 1);
+
public org.apache.accumulo.core.data.thrift.TKeyExtent extent;
-
+
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements TFieldIdEnum {
- EXTENT((short)1, "extent");
-
- private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
-
+ EXTENT((short) 1, "extent");
+
+ private static final java.util.Map<String,_Fields> byName = new java.util.HashMap<String,_Fields>();
+
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
-
+
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
+ switch (fieldId) {
case 1: // EXTENT
return EXTENT;
default:
return null;
}
}
-
+
/**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
+ * Find the _Fields constant that matches fieldId, throwing an exception if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ if (fields == null)
+ throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
-
+
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
-
+
private final short _thriftId;
private final String _fieldName;
-
+
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
-
+
public short getThriftFieldId() {
return _thriftId;
}
-
+
public String getFieldName() {
return _fieldName;
}
}
-
+
// isset id assignments
-
- public static final java.util.Map<_Fields, FieldMetaData> metaDataMap;
+
+ public static final java.util.Map<_Fields,FieldMetaData> metaDataMap;
static {
- java.util.Map<_Fields, FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.EXTENT, new FieldMetaData("extent", TFieldRequirementType.DEFAULT,
- new StructMetaData(TType.STRUCT, org.apache.accumulo.core.data.thrift.TKeyExtent.class)));
+ java.util.Map<_Fields,FieldMetaData> tmpMap = new java.util.EnumMap<_Fields,FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.EXTENT, new FieldMetaData("extent", TFieldRequirementType.DEFAULT, new StructMetaData(TType.STRUCT,
+ org.apache.accumulo.core.data.thrift.TKeyExtent.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(TooManyFilesException.class, metaDataMap);
}
-
- public TooManyFilesException() {
- }
-
- public TooManyFilesException(
- org.apache.accumulo.core.data.thrift.TKeyExtent extent)
- {
+
+ public TooManyFilesException() {}
+
+ public TooManyFilesException(org.apache.accumulo.core.data.thrift.TKeyExtent extent) {
this();
this.extent = extent;
}
-
+
/**
* Performs a deep copy on <i>other</i>.
*/
@@ -106,96 +101,96 @@ public class TooManyFilesException exten
this.extent = new org.apache.accumulo.core.data.thrift.TKeyExtent(other.extent);
}
}
-
+
public TooManyFilesException deepCopy() {
return new TooManyFilesException(this);
}
-
+
@Deprecated
public TooManyFilesException clone() {
return new TooManyFilesException(this);
}
-
+
public org.apache.accumulo.core.data.thrift.TKeyExtent getExtent() {
return this.extent;
}
-
+
public TooManyFilesException setExtent(org.apache.accumulo.core.data.thrift.TKeyExtent extent) {
this.extent = extent;
return this;
}
-
+
public void unsetExtent() {
this.extent = null;
}
-
+
/** Returns true if field extent is set (has been asigned a value) and false otherwise */
public boolean isSetExtent() {
return this.extent != null;
}
-
+
public void setExtentIsSet(boolean value) {
if (!value) {
this.extent = null;
}
}
-
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
- case EXTENT:
- if (value == null) {
- unsetExtent();
- } else {
- setExtent((org.apache.accumulo.core.data.thrift.TKeyExtent)value);
- }
- break;
-
+ case EXTENT:
+ if (value == null) {
+ unsetExtent();
+ } else {
+ setExtent((org.apache.accumulo.core.data.thrift.TKeyExtent) value);
+ }
+ break;
+
}
}
-
+
public void setFieldValue(int fieldID, Object value) {
setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
}
-
+
public Object getFieldValue(_Fields field) {
switch (field) {
- case EXTENT:
- return getExtent();
-
+ case EXTENT:
+ return getExtent();
+
}
throw new IllegalStateException();
}
-
+
public Object getFieldValue(int fieldId) {
return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
}
-
+
/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
public boolean isSet(_Fields field) {
switch (field) {
- case EXTENT:
- return isSetExtent();
+ case EXTENT:
+ return isSetExtent();
}
throw new IllegalStateException();
}
-
+
public boolean isSet(int fieldID) {
return isSet(_Fields.findByThriftIdOrThrow(fieldID));
}
-
+
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof TooManyFilesException)
- return this.equals((TooManyFilesException)that);
+ return this.equals((TooManyFilesException) that);
return false;
}
-
+
public boolean equals(TooManyFilesException that) {
if (that == null)
return false;
-
+
boolean this_present_extent = true && this.isSetExtent();
boolean that_present_extent = true && that.isSetExtent();
if (this_present_extent || that_present_extent) {
@@ -204,42 +199,42 @@ public class TooManyFilesException exten
if (!this.extent.equals(that.extent))
return false;
}
-
+
return true;
}
-
+
@Override
public int hashCode() {
return 0;
}
-
+
public int compareTo(TooManyFilesException other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
-
+
int lastComparison = 0;
- TooManyFilesException typedOther = (TooManyFilesException)other;
-
+ TooManyFilesException typedOther = (TooManyFilesException) other;
+
lastComparison = Boolean.valueOf(isSetExtent()).compareTo(typedOther.isSetExtent());
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetExtent()) { lastComparison = TBaseHelper.compareTo(this.extent, typedOther.extent);
+ if (isSetExtent()) {
+ lastComparison = TBaseHelper.compareTo(this.extent, typedOther.extent);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
-
+
public void read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();
- while (true)
- {
+ while (true) {
field = iprot.readFieldBegin();
- if (field.type == TType.STOP) {
+ if (field.type == TType.STOP) {
break;
}
switch (field.id) {
@@ -247,7 +242,7 @@ public class TooManyFilesException exten
if (field.type == TType.STRUCT) {
this.extent = new org.apache.accumulo.core.data.thrift.TKeyExtent();
this.extent.read(iprot);
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
@@ -257,14 +252,14 @@ public class TooManyFilesException exten
iprot.readFieldEnd();
}
iprot.readStructEnd();
-
+
// check for required fields of primitive type, which can't be checked in the validate method
validate();
}
-
+
public void write(TProtocol oprot) throws TException {
validate();
-
+
oprot.writeStructBegin(STRUCT_DESC);
if (this.extent != null) {
oprot.writeFieldBegin(EXTENT_FIELD_DESC);
@@ -274,7 +269,7 @@ public class TooManyFilesException exten
oprot.writeFieldStop();
oprot.writeStructEnd();
}
-
+
@Override
public String toString() {
StringBuilder sb = new StringBuilder("TooManyFilesException(");
@@ -287,10 +282,9 @@ public class TooManyFilesException exten
sb.append(")");
return sb.toString();
}
-
+
public void validate() throws TException {
// check for required fields
}
-
+
}
-
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/trace/SpanTree.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/trace/SpanTree.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/trace/SpanTree.java (original)
+++ incubator/accumulo/branches/1.3/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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/trace/TraceDump.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/trace/TraceDump.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/trace/TraceDump.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/trace/TraceDump.java Thu Oct 27 15:24:51 2011
@@ -152,7 +152,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.DATE_FORMAT.format(new Date(start))));
out.print("Time Start Service@Location Name");
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/AcquireNewTable.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/AcquireNewTable.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/AcquireNewTable.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/AcquireNewTable.java Thu Oct 27 15:24:51 2011
@@ -61,7 +61,8 @@ public class AcquireNewTable {
log.info("scanning filesystem for tables ...");
for (FileStatus table : tables) {
log.info("found " + table.getPath().getName());
- if (table.getPath().getName().equals(Constants.METADATA_TABLE_ID)) continue;
+ if (table.getPath().getName().equals(Constants.METADATA_TABLE_ID))
+ continue;
FileStatus[] tablets = fs.globStatus(new Path(table.getPath().toString() + "/*"));
for (FileStatus tablet : tablets) {
@@ -127,8 +128,10 @@ public class AcquireNewTable {
Constants.METADATA_DIRECTORY_COLUMN.getColumnQualifier());
mfw.append(key, entry.getValue());
- if (endRow == null) prevEndRow = null;
- else prevEndRow = new Text(endRow);
+ if (endRow == null)
+ prevEndRow = null;
+ else
+ prevEndRow = new Text(endRow);
}
mfw.close();
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/AddressUtil.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/AddressUtil.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/AddressUtil.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/AddressUtil.java Thu Oct 27 15:24:51 2011
@@ -27,7 +27,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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/ArgumentChecker.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/ArgumentChecker.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/ArgumentChecker.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/ArgumentChecker.java Thu Oct 27 15:24:51 2011
@@ -27,25 +27,31 @@ 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);
+ if (arg1 == null)
+ throw new IllegalArgumentException(NULL_ARG_MSG);
}
public static final void notNull(final Object arg1, final Object arg2) {
- if (arg1 == null || arg2 == null) throw new IllegalArgumentException(NULL_ARG_MSG);
+ if (arg1 == null || arg2 == null)
+ throw new IllegalArgumentException(NULL_ARG_MSG);
}
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);
+ if (arg1 == null || arg2 == null || arg3 == null)
+ throw new IllegalArgumentException(NULL_ARG_MSG);
}
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);
+ if (arg1 == null || arg2 == null || arg3 == null || arg4 == null)
+ throw new IllegalArgumentException(NULL_ARG_MSG);
}
public static final void notNull(final Object[] args) {
- if (args == null) throw new IllegalArgumentException(NULL_ARG_MSG);
+ if (args == null)
+ throw new IllegalArgumentException(NULL_ARG_MSG);
for (Object arg : args)
- if (arg == null) throw new IllegalArgumentException(NULL_ARG_MSG);
+ if (arg == null)
+ throw new IllegalArgumentException(NULL_ARG_MSG);
}
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BinaryTree.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BinaryTree.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BinaryTree.java (original)
+++ incubator/accumulo/branches/1.3/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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/BulkImportHelper.java Thu Oct 27 15:24:51 2011
@@ -195,8 +195,10 @@ public class BulkImportHelper {
ArrayList<KeyExtent> tabletsToAssignMapFileTo = findOverlappingTablets(tableId, tablets, mapFile.getValue().getFirstRow(), mapFile.getValue()
.getLastRow());
- if (tabletsToAssignMapFileTo.size() == 0) completeFailures.put(mapFile.getKey(), tabletsToAssignMapFileTo);
- else assignments.put(mapFile.getKey(), tabletsToAssignMapFileTo);
+ if (tabletsToAssignMapFileTo.size() == 0)
+ completeFailures.put(mapFile.getKey(), tabletsToAssignMapFileTo);
+ else
+ assignments.put(mapFile.getKey(), tabletsToAssignMapFileTo);
}
assignmentStats.attemptingAssignments(assignments);
@@ -279,10 +281,12 @@ public class BulkImportHelper {
tabletsToAssignMapFileTo.addAll(findOverlappingTablets(tableId, children, mapFileRange.getFirstRow(), mapFileRange.getLastRow()));
keListIter.remove();
}
- } else log.warn("will retry tablet " + ke + " later it does not have contiguous children " + children);
+ } else
+ log.warn("will retry tablet " + ke + " later it does not have contiguous children " + children);
}
- if (tabletsToAssignMapFileTo.size() > 0) assignments.put(entry.getKey(), tabletsToAssignMapFileTo);
+ if (tabletsToAssignMapFileTo.size() > 0)
+ assignments.put(entry.getKey(), tabletsToAssignMapFileTo);
}
assignmentStats.attemptingAssignments(assignments);
@@ -295,7 +299,8 @@ public class BulkImportHelper {
assignmentFailures.get(entry.getKey()).addAll(entry.getValue());
Integer fc = failureCount.get(entry.getKey());
- if (fc == null) fc = 0;
+ if (fc == null)
+ fc = 0;
failureCount.put(entry.getKey(), fc + 1);
}
@@ -304,7 +309,8 @@ public class BulkImportHelper {
Iterator<Entry<Path,List<KeyExtent>>> afIter = assignmentFailures.entrySet().iterator();
while (afIter.hasNext()) {
Entry<Path,List<KeyExtent>> entry = afIter.next();
- if (entry.getValue().size() == 0) afIter.remove();
+ if (entry.getValue().size() == 0)
+ afIter.remove();
}
Set<Entry<Path,Integer>> failureIter = failureCount.entrySet();
@@ -332,14 +338,16 @@ public class BulkImportHelper {
printReport();
return assignmentStats;
} finally {
- if (client != null) ServerClient.close(client);
+ if (client != null)
+ ServerClient.close(client);
}
}
private void printReport() {
long totalTime = 0;
for (Timers t : Timers.values()) {
- if (t == Timers.TOTAL) continue;
+ if (t == Timers.TOTAL)
+ continue;
totalTime += timer.get(t);
}
@@ -366,7 +374,8 @@ public class BulkImportHelper {
Set<Entry<Path,List<KeyExtent>>> es = completeFailures.entrySet();
- if (completeFailures.size() == 0) return Collections.emptySet();
+ if (completeFailures.size() == 0)
+ return Collections.emptySet();
log.error("The following map files failed completely, saving this info to : " + new Path(failureDir, "failures.seq"));
@@ -431,7 +440,8 @@ public class BulkImportHelper {
try {
for (FileStatus fileStatus : fs.globStatus(new Path(bulkDir.toString() + "/[0-9]*")))
- if (!fileStatus.getPath().getName().endsWith("." + MyMapFile.EXTENSION)) mapFileSizes.put(fileStatus.getPath(), fileStatus.getLen());
+ if (!fileStatus.getPath().getName().endsWith("." + MyMapFile.EXTENSION))
+ mapFileSizes.put(fileStatus.getPath(), fileStatus.getLen());
for (FileStatus fileStatus : fs.globStatus(new Path(bulkDir.toString() + "/[0-9]*." + MyMapFile.EXTENSION + "/" + MyMapFile.DATA_FILE_NAME)))
mapFileSizes.put(fileStatus.getPath().getParent(), fileStatus.getLen());
@@ -716,7 +726,8 @@ public class BulkImportHelper {
Text tabletPrevEndRow = ke.getPrevEndRow();
- if (tabletPrevEndRow != null && tabletPrevEndRow.compareTo(mapFileLastRow) >= 0) break;
+ if (tabletPrevEndRow != null && tabletPrevEndRow.compareTo(mapFileLastRow) >= 0)
+ break;
tabletsToAssignMapFileTo.add(ke);
}
@@ -795,11 +806,14 @@ public class BulkImportHelper {
for (Entry<KeyExtent,Integer> entry : counts.entrySet()) {
totalAssignments += entry.getValue();
- if (entry.getValue() > 0) tabletsImportedTo++;
+ if (entry.getValue() > 0)
+ tabletsImportedTo++;
- if (entry.getValue() < min) min = entry.getValue();
+ if (entry.getValue() < min)
+ min = entry.getValue();
- if (entry.getValue() > max) max = entry.getValue();
+ if (entry.getValue() > max)
+ max = entry.getValue();
}
double stddev = 0;
@@ -865,22 +879,24 @@ public class BulkImportHelper {
successful = false;
failures++;
log.warn("Failed to read map file " + file.getPath() + " [" + ioe.getMessage() + "] failures = " + failures);
- if (failures < 3) try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- e.printStackTrace();
- throw new RuntimeException(e);
- }
+ if (failures < 3)
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
} catch (Throwable t) {
successful = false;
failures = 3;
log.warn("Failed to read map file " + file.getPath(), t);
} finally {
- if (reader != null) try {
- reader.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
+ if (reader != null)
+ try {
+ reader.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
}
} while (!successful && failures < 3);
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/CachedConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/CachedConfiguration.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/CachedConfiguration.java (original)
+++ incubator/accumulo/branches/1.3/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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/ColumnFQ.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/ColumnFQ.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/ColumnFQ.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/ColumnFQ.java Thu Oct 27 15:24:51 2011
@@ -94,7 +94,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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/Duration.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/Duration.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/Duration.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/Duration.java Thu Oct 27 15:24:51 2011
@@ -25,22 +25,28 @@ public class Duration {
public static String format(long time, String space) {
long ms, sec, min, hr, day, yr;
ms = sec = min = hr = day = yr = -1;
- if (time == 0) return "-";
+ if (time == 0)
+ return "-";
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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java (original)
+++ incubator/accumulo/branches/1.3/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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java Thu Oct 27 15:24:51 2011
@@ -118,9 +118,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);
@@ -233,13 +234,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());
@@ -264,23 +267,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();
}
@@ -289,9 +294,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();
@@ -300,7 +307,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();
@@ -313,9 +321,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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/OpTimer.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/OpTimer.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/OpTimer.java (original)
+++ incubator/accumulo/branches/1.3/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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/Pair.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/Pair.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/Pair.java (original)
+++ incubator/accumulo/branches/1.3/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();
}
@@ -35,7 +36,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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/ServerServices.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/ServerServices.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/ServerServices.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/ServerServices.java Thu Oct 27 15:24:51 2011
@@ -68,7 +68,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());
@@ -95,7 +96,8 @@ public class ServerServices implements C
}
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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/Stat.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/Stat.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/Stat.java (original)
+++ incubator/accumulo/branches/1.3/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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/StopWatch.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/StopWatch.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/StopWatch.java (original)
+++ incubator/accumulo/branches/1.3/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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/TabletOperations.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/TabletOperations.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/TabletOperations.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/TabletOperations.java Thu Oct 27 15:24:51 2011
@@ -47,7 +47,8 @@ public class TabletOperations {
// and creating it
while (true) {
try {
- if (fs.exists(new Path(tableDir))) throw new RuntimeException("Table dir already exist " + tableDir);
+ if (fs.exists(new Path(tableDir)))
+ throw new RuntimeException("Table dir already exist " + tableDir);
break;
} catch (IOException ioe) {
log.warn(ioe);
@@ -109,7 +110,8 @@ public class TabletOperations {
if (endRow == null) {
lowDirectory = Constants.DEFAULT_TABLET_LOCATION;
Path lowDirectoryPath = new Path(tableDir + lowDirectory);
- if (fs.mkdirs(lowDirectoryPath)) return lowDirectory;
+ if (fs.mkdirs(lowDirectoryPath))
+ return lowDirectory;
log.warn("Failed to create " + lowDirectoryPath + " for unknown reason");
} else {
@@ -126,7 +128,8 @@ public class TabletOperations {
if (fs.createNewFile(lockPath)) {
try {
if (!fs.exists(lowDirectoryPath)) {
- if (fs.mkdirs(lowDirectoryPath)) return lowDirectory;
+ if (fs.mkdirs(lowDirectoryPath))
+ return lowDirectory;
log.warn("Failed to create " + lowDirectoryPath + " for unknown reason");
} else {
// name collision
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/Version.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/Version.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/Version.java (original)
+++ incubator/accumulo/branches/1.3/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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/format/DefaultFormatter.java (original)
+++ incubator/accumulo/branches/1.3/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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/format/DeleterFormatter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/format/DeleterFormatter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/format/DeleterFormatter.java (original)
+++ incubator/accumulo/branches/1.3/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.reader.printString(String.format("[%s] %s\n", delete ? "DELETED" : "SKIPPED", entryStr));
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/format/ShardedTableDistributionFormatter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/format/ShardedTableDistributionFormatter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/format/ShardedTableDistributionFormatter.java (original)
+++ incubator/accumulo/branches/1.3/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);
}
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/shell/EscapeTokenizer.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/shell/EscapeTokenizer.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/shell/EscapeTokenizer.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/shell/EscapeTokenizer.java Thu Oct 27 15:24:51 2011
@@ -54,16 +54,20 @@ public class EscapeTokenizer implements
inEscape = false;
} else {
inEscape = current.endsWith("\\");
- if (inEscape) prev = current.substring(0, current.length() - 1);
+ if (inEscape)
+ prev = current.substring(0, current.length() - 1);
else {
if (current.length() == 1 && delimeters.contains(current)) {
- if (!prev.isEmpty()) toks.add(prev);
- } else toks.add(prev + current);
+ if (!prev.isEmpty())
+ toks.add(prev);
+ } else
+ toks.add(prev + current);
prev = "";
}
}
}
- if (!prev.isEmpty()) toks.add(prev);
+ if (!prev.isEmpty())
+ toks.add(prev);
this.tokens = toks;
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/shell/QuotedStringTokenizer.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/shell/QuotedStringTokenizer.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/shell/QuotedStringTokenizer.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/util/shell/QuotedStringTokenizer.java Thu Oct 27 15:24:51 2011
@@ -56,20 +56,25 @@ public class QuotedStringTokenizer imple
// if I ended up in an escape sequence, check for valid escapable character, and add it as a literal
if (inEscapeSequence) {
inEscapeSequence = false;
- if (ch == 'x') hexChars = "";
- else if (ch == ' ' || ch == '\'' || ch == '"' || ch == '\\') sb.append(ch);
- else throw new BadArgumentException("can only escape single quotes, double quotes, the space character, the backslash, and hex input", input, i);
+ if (ch == 'x')
+ hexChars = "";
+ else if (ch == ' ' || ch == '\'' || ch == '"' || ch == '\\')
+ sb.append(ch);
+ else
+ throw new BadArgumentException("can only escape single quotes, double quotes, the space character, the backslash, and hex input", input, i);
}
// in a hex escape sequence
else if (hexChars != null) {
int digit = Character.digit(ch, 16);
- if (digit < 0) throw new BadArgumentException("expected hex character", input, i);
+ if (digit < 0)
+ throw new BadArgumentException("expected hex character", input, i);
hexChars += ch;
if (hexChars.length() == 2) {
byte b;
try {
b = (byte) (0xff & Short.parseShort(hexChars, 16));
- if (!Character.isValidCodePoint(b)) throw new NumberFormatException();
+ if (!Character.isValidCodePoint(b))
+ throw new NumberFormatException();
} catch (NumberFormatException e) {
throw new BadArgumentException("unsupported non-ascii character", input, i);
}
@@ -83,8 +88,10 @@ public class QuotedStringTokenizer imple
inQuote = false;
tokens.add(sb.toString());
sb = new StringBuilder();
- } else if (ch == '\\') inEscapeSequence = true;
- else sb.append(ch);
+ } else if (ch == '\\')
+ inEscapeSequence = true;
+ else
+ sb.append(ch);
}
// not in a quote, either enter a quote, end a token, start escape, or continue a token
else {
@@ -98,13 +105,18 @@ public class QuotedStringTokenizer imple
} else if (ch == ' ' && sb.length() > 0) {
tokens.add(sb.toString());
sb = new StringBuilder();
- } else if (ch == '\\') inEscapeSequence = true;
- else if (ch != ' ') sb.append(ch);
+ } else if (ch == '\\')
+ inEscapeSequence = true;
+ else if (ch != ' ')
+ sb.append(ch);
}
}
- if (inQuote) throw new BadArgumentException("missing terminating quote", input, input.length());
- else if (inEscapeSequence || hexChars != null) throw new BadArgumentException("escape sequence not complete", input, input.length());
- if (sb.length() > 0) tokens.add(sb.toString());
+ if (inQuote)
+ throw new BadArgumentException("missing terminating quote", input, input.length());
+ else if (inEscapeSequence || hexChars != null)
+ throw new BadArgumentException("escape sequence not complete", input, input.length());
+ if (sb.length() > 0)
+ tokens.add(sb.toString());
}
@Override