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 [4/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/j...
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperation.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperation.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperation.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperation.java Thu Oct 27 15:24:51 2011
@@ -5,38 +5,30 @@
*/
package org.apache.accumulo.core.client.impl.thrift;
-
import org.apache.thrift.TEnum;
public enum TableOperation implements TEnum {
- CREATE(0),
- DELETE(1),
- RENAME(2),
- SET_PROPERTY(3),
- REMOVE_PROPERTY(4),
- OFFLINE(5),
- ONLINE(6),
- FLUSH(7),
- PERMISSION(8);
-
+ CREATE(0), DELETE(1), RENAME(2), SET_PROPERTY(3), REMOVE_PROPERTY(4), OFFLINE(5), ONLINE(6), FLUSH(7), PERMISSION(8);
+
private final int value;
-
+
private TableOperation(int value) {
this.value = value;
}
-
+
/**
* Get the integer value of this enum value, as defined in the Thrift IDL.
*/
public int getValue() {
return value;
}
-
+
/**
* Find a the enum type by its integer value, as defined in the Thrift IDL.
+ *
* @return null if the value is not found.
*/
- public static TableOperation findByValue(int value) {
+ public static TableOperation findByValue(int value) {
switch (value) {
case 0:
return CREATE;
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperationExceptionType.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperationExceptionType.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperationExceptionType.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperationExceptionType.java Thu Oct 27 15:24:51 2011
@@ -5,32 +5,30 @@
*/
package org.apache.accumulo.core.client.impl.thrift;
-
import org.apache.thrift.TEnum;
public enum TableOperationExceptionType implements TEnum {
- EXISTS(0),
- NOTFOUND(1),
- OTHER(2);
-
+ EXISTS(0), NOTFOUND(1), OTHER(2);
+
private final int value;
-
+
private TableOperationExceptionType(int value) {
this.value = value;
}
-
+
/**
* Get the integer value of this enum value, as defined in the Thrift IDL.
*/
public int getValue() {
return value;
}
-
+
/**
* Find a the enum type by its integer value, as defined in the Thrift IDL.
+ *
* @return null if the value is not found.
*/
- public static TableOperationExceptionType findByValue(int value) {
+ public static TableOperationExceptionType findByValue(int value) {
switch (value) {
case 0:
return EXISTS;
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftTableOperationException.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftTableOperationException.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftTableOperationException.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftTableOperationException.java Thu Oct 27 15:24:51 2011
@@ -5,22 +5,21 @@
*/
package org.apache.accumulo.core.client.impl.thrift;
-
-
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
@SuppressWarnings("serial")
-public class ThriftTableOperationException extends Exception implements TBase<ThriftTableOperationException, ThriftTableOperationException._Fields>, java.io.Serializable, Cloneable {
+public class ThriftTableOperationException extends Exception implements TBase<ThriftTableOperationException,ThriftTableOperationException._Fields>,
+ java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("ThriftTableOperationException");
-
- private static final TField TABLE_ID_FIELD_DESC = new TField("tableId", TType.STRING, (short)1);
- private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)2);
- private static final TField OP_FIELD_DESC = new TField("op", TType.I32, (short)3);
- private static final TField TYPE_FIELD_DESC = new TField("type", TType.I32, (short)4);
- private static final TField DESCRIPTION_FIELD_DESC = new TField("description", TType.STRING, (short)5);
-
+
+ private static final TField TABLE_ID_FIELD_DESC = new TField("tableId", TType.STRING, (short) 1);
+ private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short) 2);
+ private static final TField OP_FIELD_DESC = new TField("op", TType.I32, (short) 3);
+ private static final TField TYPE_FIELD_DESC = new TField("type", TType.I32, (short) 4);
+ private static final TField DESCRIPTION_FIELD_DESC = new TField("description", TType.STRING, (short) 5);
+
public String tableId;
public String tableName;
/**
@@ -34,36 +33,34 @@ public class ThriftTableOperationExcepti
*/
public TableOperationExceptionType type;
public String description;
-
+
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements TFieldIdEnum {
- TABLE_ID((short)1, "tableId"),
- TABLE_NAME((short)2, "tableName"),
+ TABLE_ID((short) 1, "tableId"), TABLE_NAME((short) 2, "tableName"),
/**
*
* @see TableOperation
*/
- OP((short)3, "op"),
+ OP((short) 3, "op"),
/**
*
* @see TableOperationExceptionType
*/
- TYPE((short)4, "type"),
- DESCRIPTION((short)5, "description");
-
- private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
-
+ TYPE((short) 4, "type"), DESCRIPTION((short) 5, "description");
+
+ 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: // TABLE_ID
return TABLE_ID;
case 2: // TABLE_NAME
@@ -78,70 +75,58 @@ public class ThriftTableOperationExcepti
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.TABLE_ID, new FieldMetaData("tableId", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- tmpMap.put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- tmpMap.put(_Fields.OP, new FieldMetaData("op", TFieldRequirementType.DEFAULT,
- new EnumMetaData(TType.ENUM, TableOperation.class)));
- tmpMap.put(_Fields.TYPE, new FieldMetaData("type", TFieldRequirementType.DEFAULT,
- new EnumMetaData(TType.ENUM, TableOperationExceptionType.class)));
- tmpMap.put(_Fields.DESCRIPTION, new FieldMetaData("description", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
+ java.util.Map<_Fields,FieldMetaData> tmpMap = new java.util.EnumMap<_Fields,FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.TABLE_ID, new FieldMetaData("tableId", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING)));
+ tmpMap.put(_Fields.TABLE_NAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING)));
+ tmpMap.put(_Fields.OP, new FieldMetaData("op", TFieldRequirementType.DEFAULT, new EnumMetaData(TType.ENUM, TableOperation.class)));
+ tmpMap.put(_Fields.TYPE, new FieldMetaData("type", TFieldRequirementType.DEFAULT, new EnumMetaData(TType.ENUM, TableOperationExceptionType.class)));
+ tmpMap.put(_Fields.DESCRIPTION, new FieldMetaData("description", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(ThriftTableOperationException.class, metaDataMap);
}
-
- public ThriftTableOperationException() {
- }
-
- public ThriftTableOperationException(
- String tableId,
- String tableName,
- TableOperation op,
- TableOperationExceptionType type,
- String description)
- {
+
+ public ThriftTableOperationException() {}
+
+ public ThriftTableOperationException(String tableId, String tableName, TableOperation op, TableOperationExceptionType type, String description) {
this();
this.tableId = tableId;
this.tableName = tableName;
@@ -149,7 +134,7 @@ public class ThriftTableOperationExcepti
this.type = type;
this.description = description;
}
-
+
/**
* Performs a deep copy on <i>other</i>.
*/
@@ -170,64 +155,64 @@ public class ThriftTableOperationExcepti
this.description = other.description;
}
}
-
+
public ThriftTableOperationException deepCopy() {
return new ThriftTableOperationException(this);
}
-
+
@Deprecated
public ThriftTableOperationException clone() {
return new ThriftTableOperationException(this);
}
-
+
public String getTableId() {
return this.tableId;
}
-
+
public ThriftTableOperationException setTableId(String tableId) {
this.tableId = tableId;
return this;
}
-
+
public void unsetTableId() {
this.tableId = null;
}
-
+
/** Returns true if field tableId is set (has been asigned a value) and false otherwise */
public boolean isSetTableId() {
return this.tableId != null;
}
-
+
public void setTableIdIsSet(boolean value) {
if (!value) {
this.tableId = null;
}
}
-
+
public String getTableName() {
return this.tableName;
}
-
+
public ThriftTableOperationException setTableName(String tableName) {
this.tableName = tableName;
return this;
}
-
+
public void unsetTableName() {
this.tableName = null;
}
-
+
/** Returns true if field tableName is set (has been asigned a value) and false otherwise */
public boolean isSetTableName() {
return this.tableName != null;
}
-
+
public void setTableNameIsSet(boolean value) {
if (!value) {
this.tableName = null;
}
}
-
+
/**
*
* @see TableOperation
@@ -235,7 +220,7 @@ public class ThriftTableOperationExcepti
public TableOperation getOp() {
return this.op;
}
-
+
/**
*
* @see TableOperation
@@ -244,22 +229,22 @@ public class ThriftTableOperationExcepti
this.op = op;
return this;
}
-
+
public void unsetOp() {
this.op = null;
}
-
+
/** Returns true if field op is set (has been asigned a value) and false otherwise */
public boolean isSetOp() {
return this.op != null;
}
-
+
public void setOpIsSet(boolean value) {
if (!value) {
this.op = null;
}
}
-
+
/**
*
* @see TableOperationExceptionType
@@ -267,7 +252,7 @@ public class ThriftTableOperationExcepti
public TableOperationExceptionType getType() {
return this.type;
}
-
+
/**
*
* @see TableOperationExceptionType
@@ -276,154 +261,154 @@ public class ThriftTableOperationExcepti
this.type = type;
return this;
}
-
+
public void unsetType() {
this.type = null;
}
-
+
/** Returns true if field type is set (has been asigned a value) and false otherwise */
public boolean isSetType() {
return this.type != null;
}
-
+
public void setTypeIsSet(boolean value) {
if (!value) {
this.type = null;
}
}
-
+
public String getDescription() {
return this.description;
}
-
+
public ThriftTableOperationException setDescription(String description) {
this.description = description;
return this;
}
-
+
public void unsetDescription() {
this.description = null;
}
-
+
/** Returns true if field description is set (has been asigned a value) and false otherwise */
public boolean isSetDescription() {
return this.description != null;
}
-
+
public void setDescriptionIsSet(boolean value) {
if (!value) {
this.description = null;
}
}
-
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
- case TABLE_ID:
- if (value == null) {
- unsetTableId();
- } else {
- setTableId((String)value);
- }
- break;
-
- case TABLE_NAME:
- if (value == null) {
- unsetTableName();
- } else {
- setTableName((String)value);
- }
- break;
-
- case OP:
- if (value == null) {
- unsetOp();
- } else {
- setOp((TableOperation)value);
- }
- break;
-
- case TYPE:
- if (value == null) {
- unsetType();
- } else {
- setType((TableOperationExceptionType)value);
- }
- break;
-
- case DESCRIPTION:
- if (value == null) {
- unsetDescription();
- } else {
- setDescription((String)value);
- }
- break;
-
+ case TABLE_ID:
+ if (value == null) {
+ unsetTableId();
+ } else {
+ setTableId((String) value);
+ }
+ break;
+
+ case TABLE_NAME:
+ if (value == null) {
+ unsetTableName();
+ } else {
+ setTableName((String) value);
+ }
+ break;
+
+ case OP:
+ if (value == null) {
+ unsetOp();
+ } else {
+ setOp((TableOperation) value);
+ }
+ break;
+
+ case TYPE:
+ if (value == null) {
+ unsetType();
+ } else {
+ setType((TableOperationExceptionType) value);
+ }
+ break;
+
+ case DESCRIPTION:
+ if (value == null) {
+ unsetDescription();
+ } else {
+ setDescription((String) value);
+ }
+ break;
+
}
}
-
+
public void setFieldValue(int fieldID, Object value) {
setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
}
-
+
public Object getFieldValue(_Fields field) {
switch (field) {
- case TABLE_ID:
- return getTableId();
-
- case TABLE_NAME:
- return getTableName();
-
- case OP:
- return getOp();
-
- case TYPE:
- return getType();
-
- case DESCRIPTION:
- return getDescription();
-
+ case TABLE_ID:
+ return getTableId();
+
+ case TABLE_NAME:
+ return getTableName();
+
+ case OP:
+ return getOp();
+
+ case TYPE:
+ return getType();
+
+ case DESCRIPTION:
+ return getDescription();
+
}
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 TABLE_ID:
- return isSetTableId();
- case TABLE_NAME:
- return isSetTableName();
- case OP:
- return isSetOp();
- case TYPE:
- return isSetType();
- case DESCRIPTION:
- return isSetDescription();
+ case TABLE_ID:
+ return isSetTableId();
+ case TABLE_NAME:
+ return isSetTableName();
+ case OP:
+ return isSetOp();
+ case TYPE:
+ return isSetType();
+ case DESCRIPTION:
+ return isSetDescription();
}
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 ThriftTableOperationException)
- return this.equals((ThriftTableOperationException)that);
+ return this.equals((ThriftTableOperationException) that);
return false;
}
-
+
public boolean equals(ThriftTableOperationException that) {
if (that == null)
return false;
-
+
boolean this_present_tableId = true && this.isSetTableId();
boolean that_present_tableId = true && that.isSetTableId();
if (this_present_tableId || that_present_tableId) {
@@ -432,7 +417,7 @@ public class ThriftTableOperationExcepti
if (!this.tableId.equals(that.tableId))
return false;
}
-
+
boolean this_present_tableName = true && this.isSetTableName();
boolean that_present_tableName = true && that.isSetTableName();
if (this_present_tableName || that_present_tableName) {
@@ -441,7 +426,7 @@ public class ThriftTableOperationExcepti
if (!this.tableName.equals(that.tableName))
return false;
}
-
+
boolean this_present_op = true && this.isSetOp();
boolean that_present_op = true && that.isSetOp();
if (this_present_op || that_present_op) {
@@ -450,7 +435,7 @@ public class ThriftTableOperationExcepti
if (!this.op.equals(that.op))
return false;
}
-
+
boolean this_present_type = true && this.isSetType();
boolean that_present_type = true && that.isSetType();
if (this_present_type || that_present_type) {
@@ -459,7 +444,7 @@ public class ThriftTableOperationExcepti
if (!this.type.equals(that.type))
return false;
}
-
+
boolean this_present_description = true && this.isSetDescription();
boolean that_present_description = true && that.isSetDescription();
if (this_present_description || that_present_description) {
@@ -468,28 +453,29 @@ public class ThriftTableOperationExcepti
if (!this.description.equals(that.description))
return false;
}
-
+
return true;
}
-
+
@Override
public int hashCode() {
return 0;
}
-
+
public int compareTo(ThriftTableOperationException other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
-
+
int lastComparison = 0;
- ThriftTableOperationException typedOther = (ThriftTableOperationException)other;
-
+ ThriftTableOperationException typedOther = (ThriftTableOperationException) other;
+
lastComparison = Boolean.valueOf(isSetTableId()).compareTo(typedOther.isSetTableId());
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetTableId()) { lastComparison = TBaseHelper.compareTo(this.tableId, typedOther.tableId);
+ if (isSetTableId()) {
+ lastComparison = TBaseHelper.compareTo(this.tableId, typedOther.tableId);
if (lastComparison != 0) {
return lastComparison;
}
@@ -498,7 +484,8 @@ public class ThriftTableOperationExcepti
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetTableName()) { lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName);
+ if (isSetTableName()) {
+ lastComparison = TBaseHelper.compareTo(this.tableName, typedOther.tableName);
if (lastComparison != 0) {
return lastComparison;
}
@@ -507,7 +494,8 @@ public class ThriftTableOperationExcepti
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetOp()) { lastComparison = TBaseHelper.compareTo(this.op, typedOther.op);
+ if (isSetOp()) {
+ lastComparison = TBaseHelper.compareTo(this.op, typedOther.op);
if (lastComparison != 0) {
return lastComparison;
}
@@ -516,7 +504,8 @@ public class ThriftTableOperationExcepti
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetType()) { lastComparison = TBaseHelper.compareTo(this.type, typedOther.type);
+ if (isSetType()) {
+ lastComparison = TBaseHelper.compareTo(this.type, typedOther.type);
if (lastComparison != 0) {
return lastComparison;
}
@@ -525,56 +514,56 @@ public class ThriftTableOperationExcepti
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetDescription()) { lastComparison = TBaseHelper.compareTo(this.description, typedOther.description);
+ if (isSetDescription()) {
+ lastComparison = TBaseHelper.compareTo(this.description, typedOther.description);
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) {
case 1: // TABLE_ID
if (field.type == TType.STRING) {
this.tableId = iprot.readString();
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // TABLE_NAME
if (field.type == TType.STRING) {
this.tableName = iprot.readString();
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 3: // OP
if (field.type == TType.I32) {
this.op = TableOperation.findByValue(iprot.readI32());
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 4: // TYPE
if (field.type == TType.I32) {
this.type = TableOperationExceptionType.findByValue(iprot.readI32());
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 5: // DESCRIPTION
if (field.type == TType.STRING) {
this.description = iprot.readString();
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
@@ -584,14 +573,14 @@ public class ThriftTableOperationExcepti
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.tableId != null) {
oprot.writeFieldBegin(TABLE_ID_FIELD_DESC);
@@ -621,7 +610,7 @@ public class ThriftTableOperationExcepti
oprot.writeFieldStop();
oprot.writeStructEnd();
}
-
+
@Override
public String toString() {
StringBuilder sb = new StringBuilder("ThriftTableOperationException(");
@@ -662,10 +651,9 @@ public class ThriftTableOperationExcepti
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/client/mapreduce/AccumuloFileOutputFormat.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormat.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormat.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormat.java Thu Oct 27 15:24:51 2011
@@ -57,10 +57,12 @@ public class AccumuloFileOutputFormat ex
Configuration conf = job.getConfiguration();
String extension = conf.get(FILE_TYPE);
- if (extension == null || extension.isEmpty()) extension = RFile.EXTENSION;
+ if (extension == null || extension.isEmpty())
+ extension = RFile.EXTENSION;
AccumuloConfiguration acuConf = AccumuloConfiguration.getDefaultConfiguration();
- if (conf.getBoolean(INSTANCE_HAS_BEEN_SET, false)) acuConf = getInstance(job).getConfiguration();
+ if (conf.getBoolean(INSTANCE_HAS_BEEN_SET, false))
+ acuConf = getInstance(job).getConfiguration();
conf.setInt("io.seqfile.compress.blocksize", (int) acuConf.getMemoryInBytes(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE));
Path file = this.getDefaultWorkFile(job, "." + extension);
@@ -87,7 +89,8 @@ public class AccumuloFileOutputFormat ex
public static void setZooKeeperInstance(JobContext job, String instanceName, String zooKeepers) {
Configuration conf = job.getConfiguration();
- if (conf.getBoolean(INSTANCE_HAS_BEEN_SET, false)) throw new IllegalStateException("Instance info can only be set once per job");
+ if (conf.getBoolean(INSTANCE_HAS_BEEN_SET, false))
+ throw new IllegalStateException("Instance info can only be set once per job");
conf.setBoolean(INSTANCE_HAS_BEEN_SET, true);
ArgumentChecker.notNull(instanceName, zooKeepers);
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java Thu Oct 27 15:24:51 2011
@@ -141,19 +141,22 @@ public class AccumuloInputFormat extends
public static void setInputInfo(JobContext job, String user, byte[] passwd, String table, Authorizations auths) {
Configuration conf = job.getConfiguration();
- if (conf.getBoolean(INPUT_INFO_HAS_BEEN_SET, false)) throw new IllegalStateException("Input info can only be set once per job");
+ if (conf.getBoolean(INPUT_INFO_HAS_BEEN_SET, false))
+ throw new IllegalStateException("Input info can only be set once per job");
conf.setBoolean(INPUT_INFO_HAS_BEEN_SET, true);
ArgumentChecker.notNull(user, passwd, table);
conf.set(USERNAME, user);
conf.set(PASSWORD, new String(Base64.encodeBase64(passwd)));
conf.set(TABLE_NAME, table);
- if (auths != null && !auths.isEmpty()) conf.set(AUTHORIZATIONS, auths.serialize());
+ if (auths != null && !auths.isEmpty())
+ conf.set(AUTHORIZATIONS, auths.serialize());
}
public static void setZooKeeperInstance(JobContext job, String instanceName, String zooKeepers) {
Configuration conf = job.getConfiguration();
- if (conf.getBoolean(INSTANCE_HAS_BEEN_SET, false)) throw new IllegalStateException("Instance info can only be set once per job");
+ if (conf.getBoolean(INSTANCE_HAS_BEEN_SET, false))
+ throw new IllegalStateException("Instance info can only be set once per job");
conf.setBoolean(INSTANCE_HAS_BEEN_SET, true);
ArgumentChecker.notNull(instanceName, zooKeepers);
@@ -229,7 +232,8 @@ public class AccumuloInputFormat extends
* @throws IOException
*/
public static void setMaxVersions(JobContext job, int maxVersions) throws IOException {
- if (maxVersions < 1) throw new IOException("Invalid maxVersions: " + maxVersions + ". Must be >= 1");
+ if (maxVersions < 1)
+ throw new IOException("Invalid maxVersions: " + maxVersions + ". Must be >= 1");
job.getConfiguration().setInt(MAX_VERSIONS, maxVersions);
}
@@ -243,10 +247,12 @@ public class AccumuloInputFormat extends
ArgumentChecker.notNull(columnFamilyColumnQualifierPairs);
ArrayList<String> columnStrings = new ArrayList<String>(columnFamilyColumnQualifierPairs.size());
for (Pair<Text,Text> column : columnFamilyColumnQualifierPairs) {
- if (column.getFirst() == null) throw new IllegalArgumentException("Column family can not be null");
+ if (column.getFirst() == null)
+ throw new IllegalArgumentException("Column family can not be null");
String col = new String(Base64.encodeBase64(TextUtil.getBytes(column.getFirst())));
- if (column.getSecond() != null) col += ":" + new String(Base64.encodeBase64(TextUtil.getBytes(column.getSecond())));
+ if (column.getSecond() != null)
+ col += ":" + new String(Base64.encodeBase64(TextUtil.getBytes(column.getSecond())));
columnStrings.add(col);
}
job.getConfiguration().setStrings(COLUMNS, columnStrings.toArray(new String[0]));
@@ -299,7 +305,8 @@ public class AccumuloInputFormat extends
* the value
*/
public static void setIteratorOption(JobContext job, String iteratorName, String key, String value) {
- if (value == null) return;
+ if (value == null)
+ return;
String iteratorOptions = job.getConfiguration().get(ITERATORS_OPTIONS);
@@ -342,12 +349,14 @@ public class AccumuloInputFormat extends
protected static Instance getInstance(JobContext job) {
Configuration conf = job.getConfiguration();
- if (conf.getBoolean(MOCK, false)) return new MockInstance(conf.get(INSTANCE_NAME));
+ if (conf.getBoolean(MOCK, false))
+ return new MockInstance(conf.get(INSTANCE_NAME));
return new ZooKeeperInstance(conf.get(INSTANCE_NAME), conf.get(ZOOKEEPERS));
}
protected static TabletLocator getTabletLocator(JobContext job) throws TableNotFoundException {
- if (job.getConfiguration().getBoolean(MOCK, false)) return new MockTabletLocator();
+ if (job.getConfiguration().getBoolean(MOCK, false))
+ return new MockTabletLocator();
Instance instance = getInstance(job);
String username = getUsername(job);
byte[] password = getPassword(job);
@@ -386,7 +395,8 @@ public class AccumuloInputFormat extends
}
try {
String s = job.getConfiguration().get(key);
- if (s == null) return null;
+ if (s == null)
+ return null;
return URLDecoder.decode(s, "UTF-8");
} catch (UnsupportedEncodingException e) {
log.error("Failed to decode regular expression", e);
@@ -417,13 +427,17 @@ public class AccumuloInputFormat extends
// checkOutputSpecs(JobContext job)
protected static void validateOptions(JobContext job) throws IOException {
Configuration conf = job.getConfiguration();
- if (!conf.getBoolean(INPUT_INFO_HAS_BEEN_SET, false)) throw new IOException("Input info has not been set.");
- if (!conf.getBoolean(INSTANCE_HAS_BEEN_SET, false)) throw new IOException("Instance info has not been set.");
+ if (!conf.getBoolean(INPUT_INFO_HAS_BEEN_SET, false))
+ throw new IOException("Input info has not been set.");
+ if (!conf.getBoolean(INSTANCE_HAS_BEEN_SET, false))
+ throw new IOException("Instance info has not been set.");
// validate that we can connect as configured
try {
Connector c = getInstance(job).getConnector(getUsername(job), getPassword(job));
- if (!c.securityOperations().authenticateUser(getUsername(job), getPassword(job))) throw new IOException("Unable to authenticate user");
- if (!c.securityOperations().hasTablePermission(getUsername(job), getTablename(job), TablePermission.READ)) throw new IOException("Unable to access table");
+ if (!c.securityOperations().authenticateUser(getUsername(job), getPassword(job)))
+ throw new IOException("Unable to authenticate user");
+ if (!c.securityOperations().hasTablePermission(getUsername(job), getTablename(job), TablePermission.READ))
+ throw new IOException("Unable to access table");
} catch (AccumuloException e) {
throw new IOException(e);
} catch (AccumuloSecurityException e) {
@@ -442,7 +456,8 @@ public class AccumuloInputFormat extends
String iterators = job.getConfiguration().get(ITERATORS);
// If no iterators are present, return an empty list
- if (iterators == null || iterators.isEmpty()) return new ArrayList<AccumuloIterator>();
+ if (iterators == null || iterators.isEmpty())
+ return new ArrayList<AccumuloIterator>();
// Compose the set of iterators encoded in the job configuration
StringTokenizer tokens = new StringTokenizer(job.getConfiguration().get(ITERATORS), ITERATORS_DELIM);
@@ -459,7 +474,8 @@ public class AccumuloInputFormat extends
String iteratorOptions = job.getConfiguration().get(ITERATORS_OPTIONS);
// If no options are present, return an empty list
- if (iteratorOptions == null || iteratorOptions.isEmpty()) return new ArrayList<AccumuloIteratorOption>();
+ if (iteratorOptions == null || iteratorOptions.isEmpty())
+ return new ArrayList<AccumuloIteratorOption>();
// Compose the set of options encoded in the job configuration
StringTokenizer tokens = new StringTokenizer(job.getConfiguration().get(ITERATORS_OPTIONS), ITERATORS_DELIM);
@@ -564,8 +580,10 @@ public class AccumuloInputFormat extends
// setup a scanner within the bounds of this split
for (Pair<Text,Text> c : getFetchedColumns(attempt)) {
- if (c.getSecond() != null) scanner.fetchColumn(c.getFirst(), c.getSecond());
- else scanner.fetchColumnFamily(c.getFirst());
+ if (c.getSecond() != null)
+ scanner.fetchColumn(c.getFirst(), c.getSecond());
+ else
+ scanner.fetchColumnFamily(c.getFirst());
}
scanner.setRange(split.range);
@@ -579,7 +597,8 @@ public class AccumuloInputFormat extends
public void close() {}
public float getProgress() throws IOException {
- if (recordsRead > 0 && currentKey == null) return 1.0f;
+ if (recordsRead > 0 && currentKey == null)
+ return 1.0f;
return split.getProgress(currentKey);
}
@@ -603,7 +622,8 @@ public class AccumuloInputFormat extends
Entry<Key,Value> entry = scannerIterator.next();
currentKey = entry.getKey();
currentValue = entry.getValue();
- if (log.isTraceEnabled()) log.trace("Processing key/value pair: " + DefaultFormatter.formatEntry(entry, true));
+ if (log.isTraceEnabled())
+ log.trace("Processing key/value pair: " + DefaultFormatter.formatEntry(entry, true));
return true;
}
return false;
@@ -649,7 +669,8 @@ public class AccumuloInputFormat extends
ArrayList<InputSplit> splits = new ArrayList<InputSplit>(ranges.size());
HashMap<Range,ArrayList<String>> splitsToAdd = null;
- if (!autoAdjust) splitsToAdd = new HashMap<Range,ArrayList<String>>();
+ if (!autoAdjust)
+ splitsToAdd = new HashMap<Range,ArrayList<String>>();
for (Entry<String,Map<KeyExtent,List<Range>>> tserverBin : binnedRanges.entrySet()) {
String location = tserverBin.getKey().split(":", 2)[0];
@@ -663,7 +684,8 @@ public class AccumuloInputFormat extends
} else {
// don't divide ranges
ArrayList<String> locations = splitsToAdd.get(r);
- if (locations == null) locations = new ArrayList<String>(1);
+ if (locations == null)
+ locations = new ArrayList<String>(1);
locations.add(location);
splitsToAdd.put(r, locations);
}
@@ -671,8 +693,9 @@ public class AccumuloInputFormat extends
}
}
- if (!autoAdjust) for (Entry<Range,ArrayList<String>> entry : splitsToAdd.entrySet())
- splits.add(new RangeInputSplit(tableName, entry.getKey(), entry.getValue().toArray(new String[0])));
+ if (!autoAdjust)
+ for (Entry<Range,ArrayList<String>> entry : splitsToAdd.entrySet())
+ splits.add(new RangeInputSplit(tableName, entry.getKey(), entry.getValue().toArray(new String[0])));
return splits;
}
@@ -692,8 +715,10 @@ public class AccumuloInputFormat extends
byte[] bytes = new byte[numBytes + 1];
bytes[0] = 0;
for (int i = 0; i < numBytes; i++) {
- if (i >= seq.length()) bytes[i + 1] = 0;
- else bytes[i + 1] = seq.byteAt(i);
+ if (i >= seq.length())
+ bytes[i + 1] = 0;
+ else
+ bytes[i + 1] = seq.byteAt(i);
}
return bytes;
}
@@ -707,7 +732,8 @@ public class AccumuloInputFormat extends
}
public float getProgress(Key currentKey) {
- if (currentKey == null) return 0f;
+ if (currentKey == null)
+ return 0f;
if (range.getStartKey() != null && range.getEndKey() != null) {
if (range.getStartKey().compareTo(range.getEndKey(), PartialKey.ROW) != 0) {
// just look at the row progress
@@ -745,7 +771,8 @@ public class AccumuloInputFormat extends
diff <<= Byte.SIZE;
}
- if (startRow.getLength() != stopRow.getLength()) diff |= 0xff;
+ if (startRow.getLength() != stopRow.getLength())
+ diff |= 0xff;
return diff + 1;
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java Thu Oct 27 15:24:51 2011
@@ -90,19 +90,22 @@ public class AccumuloOutputFormat extend
public static void setOutputInfo(JobContext job, String user, byte[] passwd, boolean createTables, String defaultTable) {
Configuration conf = job.getConfiguration();
- if (conf.getBoolean(OUTPUT_INFO_HAS_BEEN_SET, false)) throw new IllegalStateException("Output info can only be set once per job");
+ if (conf.getBoolean(OUTPUT_INFO_HAS_BEEN_SET, false))
+ throw new IllegalStateException("Output info can only be set once per job");
conf.setBoolean(OUTPUT_INFO_HAS_BEEN_SET, true);
ArgumentChecker.notNull(user, passwd);
conf.set(USERNAME, user);
conf.set(PASSWORD, new String(Base64.encodeBase64(passwd)));
conf.setBoolean(CREATETABLES, createTables);
- if (defaultTable != null) conf.set(DEFAULT_TABLE_NAME, defaultTable);
+ if (defaultTable != null)
+ conf.set(DEFAULT_TABLE_NAME, defaultTable);
}
public static void setZooKeeperInstance(JobContext job, String instanceName, String zooKeepers) {
Configuration conf = job.getConfiguration();
- if (conf.getBoolean(INSTANCE_HAS_BEEN_SET, false)) throw new IllegalStateException("Instance info can only be set once per job");
+ if (conf.getBoolean(INSTANCE_HAS_BEEN_SET, false))
+ throw new IllegalStateException("Instance info can only be set once per job");
conf.setBoolean(INSTANCE_HAS_BEEN_SET, true);
ArgumentChecker.notNull(instanceName, zooKeepers);
@@ -169,7 +172,8 @@ public class AccumuloOutputFormat extend
}
protected static Level getLogLevel(JobContext job) {
- if (job.getConfiguration().get(LOGLEVEL) != null) return Level.toLevel(job.getConfiguration().getInt(LOGLEVEL, Level.INFO.toInt()));
+ if (job.getConfiguration().get(LOGLEVEL) != null)
+ return Level.toLevel(job.getConfiguration().getInt(LOGLEVEL, Level.INFO.toInt()));
return null;
}
@@ -192,11 +196,13 @@ public class AccumuloOutputFormat extend
AccumuloRecordWriter(TaskAttemptContext attempt) throws AccumuloException, AccumuloSecurityException {
Level l = getLogLevel(attempt);
- if (l != null) log.setLevel(getLogLevel(attempt));
+ if (l != null)
+ log.setLevel(getLogLevel(attempt));
this.simulate = getSimulationMode(attempt);
this.createTables = canCreateTables(attempt);
- if (simulate) log.info("Simulating output only. No writes to tables will occur");
+ if (simulate)
+ log.info("Simulating output only. No writes to tables will occur");
this.bws = new HashMap<Text,BatchWriter>();
@@ -211,23 +217,27 @@ public class AccumuloOutputFormat extend
@Override
public void write(Text table, Mutation mutation) throws IOException {
- if (table == null || table.toString().isEmpty()) table = this.defaultTableName;
+ if (table == null || table.toString().isEmpty())
+ table = this.defaultTableName;
- if (!simulate && table == null) throw new IOException("No table or default table specified. Try simulation mode next time");
+ if (!simulate && table == null)
+ throw new IOException("No table or default table specified. Try simulation mode next time");
++mutCount;
valCount += mutation.size();
printMutation(table, mutation);
- if (simulate) return;
+ if (simulate)
+ return;
- if (!bws.containsKey(table)) try {
- List<AggregatorConfiguration> l = null;
- addTable(table, l);
- } catch (Exception e) {
- e.printStackTrace();
- throw new IOException(e);
- }
+ if (!bws.containsKey(table))
+ try {
+ List<AggregatorConfiguration> l = null;
+ addTable(table, l);
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new IOException(e);
+ }
try {
bws.get(table).addMutation(mutation);
@@ -249,7 +259,8 @@ public class AccumuloOutputFormat extend
if (createTables && !conn.tableOperations().exists(table)) {
try {
conn.tableOperations().create(table);
- if (aggregators != null) conn.tableOperations().addAggregators(table, aggregators);
+ if (aggregators != null)
+ conn.tableOperations().addAggregators(table, aggregators);
} catch (AccumuloSecurityException e) {
log.error("Accumulo security violation creating " + table, e);
throw e;
@@ -271,7 +282,8 @@ public class AccumuloOutputFormat extend
throw e;
}
- if (bw != null) bws.put(key, bw);
+ if (bw != null)
+ bws.put(key, bw);
}
private int printMutation(Text table, Mutation m) {
@@ -289,8 +301,10 @@ public class AccumuloOutputFormat extend
private String hexDump(byte[] ba) {
StringBuilder sb = new StringBuilder();
for (byte b : ba) {
- if ((b > 0x20) && (b < 0x7e)) sb.append((char) b);
- else sb.append(String.format("x%02x", b));
+ if ((b > 0x20) && (b < 0x7e))
+ sb.append((char) b);
+ else
+ sb.append(String.format("x%02x", b));
}
return sb.toString();
}
@@ -298,7 +312,8 @@ public class AccumuloOutputFormat extend
@Override
public void close(TaskAttemptContext attempt) throws IOException, InterruptedException {
log.debug("mutations written: " + mutCount + ", values written: " + valCount);
- if (simulate) return;
+ if (simulate)
+ return;
try {
mtbw.close();
@@ -322,11 +337,14 @@ public class AccumuloOutputFormat extend
@Override
public void checkOutputSpecs(JobContext job) throws IOException {
Configuration conf = job.getConfiguration();
- if (!conf.getBoolean(OUTPUT_INFO_HAS_BEEN_SET, false)) throw new IOException("Output info has not been set.");
- if (!conf.getBoolean(INSTANCE_HAS_BEEN_SET, false)) throw new IOException("Instance info has not been set.");
+ if (!conf.getBoolean(OUTPUT_INFO_HAS_BEEN_SET, false))
+ throw new IOException("Output info has not been set.");
+ if (!conf.getBoolean(INSTANCE_HAS_BEEN_SET, false))
+ throw new IOException("Instance info has not been set.");
try {
Connector c = getInstance(job).getConnector(getUsername(job), getPassword(job));
- if (!c.securityOperations().authenticateUser(getUsername(job), getPassword(job))) throw new IOException("Unable to authenticate user");
+ if (!c.securityOperations().authenticateUser(getUsername(job), getPassword(job)))
+ throw new IOException("Unable to authenticate user");
} catch (AccumuloException e) {
throw new IOException(e);
} catch (AccumuloSecurityException e) {
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/partition/RangePartitioner.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/partition/RangePartitioner.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/partition/RangePartitioner.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/partition/RangePartitioner.java Thu Oct 27 15:24:51 2011
@@ -60,7 +60,8 @@ public class RangePartitioner extends Pa
// both conditions work with numSubBins == 1, but this check is to avoid
// hashing, when we don't need to, for speed
- if (numSubBins < 2) return index;
+ if (numSubBins < 2)
+ return index;
return (key.toString().hashCode() & Integer.MAX_VALUE) % numSubBins + index * numSubBins;
}
@@ -97,7 +98,8 @@ public class RangePartitioner extends Pa
}
}
}
- if (cutPointArray == null) throw new FileNotFoundException(cutFileName + " not found in distributed cache");
+ if (cutPointArray == null)
+ throw new FileNotFoundException(cutFileName + " not found in distributed cache");
}
return cutPointArray;
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockBatchScanner.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockBatchScanner.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockBatchScanner.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockBatchScanner.java Thu Oct 27 15:24:51 2011
@@ -63,7 +63,8 @@ public class MockBatchScanner extends Mo
@Override
public boolean accept(Key k, Value v) {
for (Range r : ranges) {
- if (r.contains(k)) return true;
+ if (r.contains(k))
+ return true;
}
return false;
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockConnector.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockConnector.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockConnector.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockConnector.java Thu Oct 27 15:24:51 2011
@@ -67,7 +67,8 @@ public class MockConnector extends Conne
@Override
public Scanner createScanner(String tableName, Authorizations authorizations) throws TableNotFoundException {
MockTable table = acu.tables.get(tableName);
- if (table == null) throw new TableNotFoundException(tableName, tableName, "no such table");
+ if (table == null)
+ throw new TableNotFoundException(tableName, tableName, "no such table");
return new MockScanner(table, authorizations);
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java Thu Oct 27 15:24:51 2011
@@ -43,8 +43,10 @@ public class MockInstance implements Ins
public MockInstance(String instanceName) {
synchronized (instances) {
- if (instances.containsKey(instanceName)) acu = instances.get(instanceName);
- else instances.put(instanceName, acu = new MockAccumulo());
+ if (instances.containsKey(instanceName))
+ acu = instances.get(instanceName);
+ else
+ instances.put(instanceName, acu = new MockAccumulo());
}
this.instanceName = instanceName;
}
@@ -93,7 +95,8 @@ public class MockInstance implements Ins
@Override
public AccumuloConfiguration getConfiguration() {
- if (conf == null) conf = AccumuloConfiguration.getDefaultConfiguration();
+ if (conf == null)
+ conf = AccumuloConfiguration.getDefaultConfiguration();
return conf;
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java Thu Oct 27 15:24:51 2011
@@ -63,7 +63,8 @@ public class MockScannerBase implements
public void setScanIteratorOption(String iteratorName, String key, String value) {
Map<String,String> kv = ssio.get(iteratorName);
- if (kv == null) ssio.put(iteratorName, kv = new HashMap<String,String>());
+ if (kv == null)
+ ssio.put(iteratorName, kv = new HashMap<String,String>());
kv.put(key, value);
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockSecurityOperations.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockSecurityOperations.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockSecurityOperations.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockSecurityOperations.java Thu Oct 27 15:24:51 2011
@@ -48,74 +48,90 @@ public class MockSecurityOperations exte
@Override
public boolean authenticateUser(String name, byte[] password) throws AccumuloException, AccumuloSecurityException {
MockUser user = acu.users.get(name);
- if (user == null) return false;
+ if (user == null)
+ return false;
return Arrays.equals(user.password, password);
}
@Override
public void changeUserPassword(String name, byte[] password) throws AccumuloException, AccumuloSecurityException {
MockUser user = acu.users.get(name);
- if (user != null) user.password = Arrays.copyOf(password, password.length);
+ if (user != null)
+ user.password = Arrays.copyOf(password, password.length);
}
@Override
public void changeUserAuthorizations(String name, Authorizations authorizations) throws AccumuloException, AccumuloSecurityException {
MockUser user = acu.users.get(name);
- if (user != null) user.authorizations = authorizations;
+ if (user != null)
+ user.authorizations = authorizations;
}
@Override
public Authorizations getUserAuthorizations(String name) throws AccumuloException, AccumuloSecurityException {
MockUser user = acu.users.get(name);
- if (user != null) return user.authorizations;
+ if (user != null)
+ return user.authorizations;
return new Authorizations();
}
@Override
public boolean hasSystemPermission(String name, SystemPermission perm) throws AccumuloException, AccumuloSecurityException {
MockUser user = acu.users.get(name);
- if (user != null) return user.permissions.contains(perm);
+ if (user != null)
+ return user.permissions.contains(perm);
return false;
}
@Override
public boolean hasTablePermission(String name, String tableName, TablePermission perm) throws AccumuloException, AccumuloSecurityException {
MockTable table = acu.tables.get(tableName);
- if (table == null) return false;
+ if (table == null)
+ return false;
EnumSet<TablePermission> perms = table.userPermissions.get(name);
- if (perms == null) return false;
+ if (perms == null)
+ return false;
return perms.contains(perm);
}
@Override
public void grantSystemPermission(String name, SystemPermission permission) throws AccumuloException, AccumuloSecurityException {
MockUser user = acu.users.get(name);
- if (user != null) user.permissions.add(permission);
+ if (user != null)
+ user.permissions.add(permission);
}
@Override
public void grantTablePermission(String name, String tableName, TablePermission permission) throws AccumuloException, AccumuloSecurityException {
- if (acu.users.get(name) == null) return;
+ if (acu.users.get(name) == null)
+ return;
MockTable table = acu.tables.get(tableName);
- if (table == null) return;
+ if (table == null)
+ return;
EnumSet<TablePermission> perms = table.userPermissions.get(name);
- if (perms == null) table.userPermissions.put(name, EnumSet.of(permission));
- else perms.add(permission);
+ if (perms == null)
+ table.userPermissions.put(name, EnumSet.of(permission));
+ else
+ perms.add(permission);
}
@Override
public void revokeSystemPermission(String name, SystemPermission permission) throws AccumuloException, AccumuloSecurityException {
MockUser user = acu.users.get(name);
- if (user != null) user.permissions.remove(permission);
+ if (user != null)
+ user.permissions.remove(permission);
}
@Override
public void revokeTablePermission(String name, String tableName, TablePermission permission) throws AccumuloException, AccumuloSecurityException {
- if (acu.users.get(name) == null) return;
+ if (acu.users.get(name) == null)
+ return;
MockTable table = acu.tables.get(tableName);
- if (table == null) return;
+ if (table == null)
+ return;
EnumSet<TablePermission> perms = table.userPermissions.get(name);
- if (perms != null) perms.remove(permission);
+ if (perms != null)
+ perms.remove(permission);
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java Thu Oct 27 15:24:51 2011
@@ -63,11 +63,14 @@ public class MockTable {
@Override
public int compareTo(Key o) {
int compare = super.compareTo(o);
- if (compare != 0) return compare;
+ if (compare != 0)
+ return compare;
if (o instanceof MockMemKey) {
MockMemKey other = (MockMemKey) o;
- if (count < other.count) return -1;
- if (count > other.count) return 1;
+ if (count < other.count)
+ return -1;
+ if (count > other.count)
+ return 1;
} else {
return 1;
}
@@ -84,7 +87,8 @@ public class MockTable {
settings = new TreeMap<String,String>();
for (Entry<String,String> entry : AccumuloConfiguration.getDefaultConfiguration()) {
String key = entry.getKey();
- if (key.startsWith(Property.TABLE_PREFIX.getKey())) settings.put(key, entry.getValue());
+ if (key.startsWith(Property.TABLE_PREFIX.getKey()))
+ settings.put(key, entry.getValue());
}
}
@@ -94,8 +98,10 @@ public class MockTable {
for (ColumnUpdate u : m.getUpdates()) {
Key key = new Key(m.getRow(), 0, m.getRow().length, u.getColumnFamily(), 0, u.getColumnFamily().length, u.getColumnQualifier(), 0,
u.getColumnQualifier().length, u.getColumnVisibility(), 0, u.getColumnVisibility().length, u.getTimestamp());
- if (u.isDeleted()) key.setDeleted(true);
- if (!u.hasTimestamp()) key.setTimestamp(now);
+ if (u.isDeleted())
+ key.setDeleted(true);
+ if (!u.hasTimestamp())
+ key.setTimestamp(now);
table.put(new MockMemKey(key, mutationCount), new Value(u.getValue()));
}
@@ -104,7 +110,8 @@ public class MockTable {
public void addAggregators(List<AggregatorConfiguration> aggregators) {
for (Entry<String,String> entry : IteratorUtil.generateInitialTableProperties(aggregators).entrySet()) {
String key = entry.getKey();
- if (key.startsWith(Property.TABLE_PREFIX.getKey())) settings.put(key, entry.getValue());
+ if (key.startsWith(Property.TABLE_PREFIX.getKey()))
+ settings.put(key, entry.getValue());
}
}
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java Thu Oct 27 15:24:51 2011
@@ -75,8 +75,8 @@ public abstract class AccumuloConfigurat
case 's':
multiplier *= 1000;
if (timeString.length() > 1 && timeString.endsWith("ms")) // millis
- // case
- return Long.parseLong(timeString.substring(0, timeString.length() - 2));
+ // case
+ return Long.parseLong(timeString.substring(0, timeString.length() - 2));
return Long.parseLong(timeString.substring(0, timeString.length() - 1)) * multiplier;
default:
return Long.parseLong(timeString) * 1000;
@@ -92,7 +92,8 @@ public abstract class AccumuloConfigurat
checkType(property, PropertyType.FRACTION);
String fractionString = get(property);
- if (fractionString.charAt(fractionString.length() - 1) == '%') return Double.parseDouble(fractionString.substring(0, fractionString.length() - 1)) / 100.0;
+ if (fractionString.charAt(fractionString.length() - 1) == '%')
+ return Double.parseDouble(fractionString.substring(0, fractionString.length() - 1)) / 100.0;
return Double.parseDouble(fractionString);
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/ConfigSanityCheck.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/ConfigSanityCheck.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/ConfigSanityCheck.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/ConfigSanityCheck.java Thu Oct 27 15:24:51 2011
@@ -30,10 +30,14 @@ class ConfigSanityCheck {
String key = entry.getKey();
String value = entry.getValue();
Property prop = Property.getPropertyByKey(entry.getKey());
- if (prop == null && Property.isValidTablePropertyKey(key)) continue; // unknown valid per-table property
- else if (prop == null) log.warn(PREFIX + "unrecognized property key (" + key + ")");
- else if (prop.getType() == PropertyType.PREFIX) fatal(PREFIX + "incomplete property key (" + key + ")");
- else if (!prop.getType().isValidFormat(value)) fatal(PREFIX + "improperly formatted value for key (" + key + ", type=" + prop.getType() + ")");
+ if (prop == null && Property.isValidTablePropertyKey(key))
+ continue; // unknown valid per-table property
+ else if (prop == null)
+ log.warn(PREFIX + "unrecognized property key (" + key + ")");
+ else if (prop.getType() == PropertyType.PREFIX)
+ fatal(PREFIX + "incomplete property key (" + key + ")");
+ else if (!prop.getType().isValidFormat(value))
+ fatal(PREFIX + "improperly formatted value for key (" + key + ", type=" + prop.getType() + ")");
}
compareCounts(acuconf, Property.TSERV_MAJC_MAXOPEN, Property.TSERV_MAJC_MAXCONCURRENT, new FirstGreaterThanEqualToByFactor(2));
@@ -72,7 +76,8 @@ class ConfigSanityCheck {
private static void checkTimeDuration(AccumuloConfiguration acuconf, Property prop, CheckTimeDuration chk) {
verifyPropertyTypes(PropertyType.TIMEDURATION, prop);
- if (!chk.check(acuconf.getTimeInMillis(prop))) fatal(PREFIX + chk.getDescription(prop));
+ if (!chk.check(acuconf.getTimeInMillis(prop)))
+ fatal(PREFIX + chk.getDescription(prop));
}
private static interface CompareTwoCounts {
@@ -121,12 +126,14 @@ class ConfigSanityCheck {
private static void compareCounts(AccumuloConfiguration acuconf, Property prop1, Property prop2, CompareTwoCounts chk) {
verifyPropertyTypes(PropertyType.COUNT, prop1, prop2);
- if (!chk.check(acuconf.getCount(prop1), acuconf.getCount(prop2))) fatal(PREFIX + chk.getDescription(prop1, prop2));
+ if (!chk.check(acuconf.getCount(prop1), acuconf.getCount(prop2)))
+ fatal(PREFIX + chk.getDescription(prop1, prop2));
}
private static void verifyPropertyTypes(PropertyType type, Property... properties) {
for (Property prop : properties)
- if (prop.getType() != type) fatal("Unexpected property type (" + prop.getType() + " != " + type + ")");
+ if (prop.getType() != type)
+ fatal("Unexpected property type (" + prop.getType() + " != " + type + ")");
}
private static void fatal(String msg) {
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java Thu Oct 27 15:24:51 2011
@@ -44,7 +44,8 @@ public class DefaultConfiguration extend
public Iterator<Entry<String,String>> iterator() {
TreeMap<String,String> entries = new TreeMap<String,String>();
for (Property prop : Property.values())
- if (!prop.getType().equals(PropertyType.PREFIX)) entries.put(prop.getKey(), prop.getDefaultValue());
+ if (!prop.getType().equals(PropertyType.PREFIX))
+ entries.put(prop.getKey(), prop.getDefaultValue());
return entries.entrySet().iterator();
}
@@ -68,8 +69,10 @@ public class DefaultConfiguration extend
ArrayList<Property> prefixes = new ArrayList<Property>();
TreeMap<String,Property> sortedProps = new TreeMap<String,Property>();
for (Property prop : Property.values()) {
- if (prop.getType().equals(PropertyType.PREFIX)) prefixes.add(prop);
- else sortedProps.put(prop.getKey(), prop);
+ if (prop.getType().equals(PropertyType.PREFIX))
+ prefixes.add(prop);
+ else
+ sortedProps.put(prop.getKey(), prop);
}
doc.println(" <p>Jump to: ");
@@ -85,8 +88,8 @@ public class DefaultConfiguration extend
doc.println(" <tr><td colspan='5'><a name='" + prefix.name() + "' class='large'>" + prefix.getKey() + "*</a></td></tr>");
doc.println(" <tr><td colspan='5'><i>" + prefix.getDescription() + "</i></td></tr>");
if (!prefix.equals(Property.TABLE_CONSTRAINT_PREFIX) && !prefix.equals(Property.TABLE_ITERATOR_PREFIX)
- && !prefix.equals(Property.TABLE_LOCALITY_GROUP_PREFIX)) doc
- .println(" <tr><th>Property</th><th>Type</th><th>Zookeeper Mutable</th><th>Default Value</th><th>Description</th></tr>");
+ && !prefix.equals(Property.TABLE_LOCALITY_GROUP_PREFIX))
+ doc.println(" <tr><th>Property</th><th>Type</th><th>Zookeeper Mutable</th><th>Default Value</th><th>Description</th></tr>");
boolean highlight = true;
for (Property prop : sortedProps.values()) {
@@ -116,7 +119,8 @@ public class DefaultConfiguration extend
doc.println(" <tr><th>Property Type</th><th>Description</th></tr>");
boolean highlight = true;
for (PropertyType type : PropertyType.values()) {
- if (type.equals(PropertyType.PREFIX)) continue;
+ if (type.equals(PropertyType.PREFIX))
+ continue;
doc.println(" <tr " + (highlight ? "class='highlight'" : "") + ">");
highlight = !highlight;
doc.println(" <td><h3><a name='" + type.name() + "'>" + type + "</a></td>");
@@ -133,6 +137,7 @@ public class DefaultConfiguration extend
* Generate documentation for conf/accumulo-site.xml file usage
*/
public static void main(String[] args) {
- if (args.length == 1 && args[0].equals("--generate-doc")) generateDocumentation(System.out);
+ if (args.length == 1 && args[0].equals("--generate-doc"))
+ generateDocumentation(System.out);
}
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/Property.java Thu Oct 27 15:24:51 2011
@@ -291,7 +291,8 @@ public enum Property {
if (validTableProperties == null) {
HashSet<String> tmp = new HashSet<String>();
for (Property p : Property.values())
- if (!p.getType().equals(PropertyType.PREFIX) && p.getKey().startsWith(Property.TABLE_PREFIX.getKey())) tmp.add(p.getKey());
+ if (!p.getType().equals(PropertyType.PREFIX) && p.getKey().startsWith(Property.TABLE_PREFIX.getKey()))
+ tmp.add(p.getKey());
validTableProperties = tmp;
}
}
@@ -321,7 +322,8 @@ public enum Property {
public static Property getPropertyByKey(String key) {
for (Property prop : Property.values())
- if (prop.getKey().equals(key)) return prop;
+ if (prop.getKey().equals(key))
+ return prop;
return null;
}
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/SiteConfiguration.java Thu Oct 27 15:24:51 2011
@@ -48,8 +48,10 @@ public class SiteConfiguration extends A
if (xmlConfig == null) {
xmlConfig = new Configuration(false);
- if (SiteConfiguration.class.getClassLoader().getResource(configFile) == null) log.warn(configFile + " not found on classpath");
- else xmlConfig.addResource(configFile);
+ if (SiteConfiguration.class.getClassLoader().getResource(configFile) == null)
+ log.warn(configFile + " not found on classpath");
+ else
+ xmlConfig.addResource(configFile);
}
return xmlConfig;
}
@@ -61,7 +63,8 @@ public class SiteConfiguration extends A
String value = getXmlConfig().get(key);
if (value == null || !property.getType().isValidFormat(value)) {
- if (value != null) log.error("Using default value for " + key + " due to improperly formatted " + property.getType() + ": " + value);
+ if (value != null)
+ log.error("Using default value for " + key + " due to improperly formatted " + property.getType() + ": " + value);
value = parent.get(property);
}
return value;
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/TableConfWatcher.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/TableConfWatcher.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/TableConfWatcher.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/TableConfWatcher.java Thu Oct 27 15:24:51 2011
@@ -39,7 +39,8 @@ class TableConfWatcher implements Watche
@Override
public void process(WatchedEvent event) {
String path = event.getPath();
- if (log.isTraceEnabled()) log.trace("WatchEvent : " + path + " " + event.getState() + " " + event.getType());
+ if (log.isTraceEnabled())
+ log.trace("WatchEvent : " + path + " " + event.getState() + " " + event.getType());
String tablesPrefix = ZooUtil.getRoot(instanceId) + Constants.ZTABLES + "/";
@@ -51,8 +52,8 @@ class TableConfWatcher implements Watche
tableId = path.substring(tablesPrefix.length());
if (tableId.contains("/")) {
tableId = tableId.substring(0, tableId.indexOf('/'));
- if (path.startsWith(tablesPrefix + tableId + Constants.ZTABLE_CONF + "/")) key = path
- .substring((tablesPrefix + tableId + Constants.ZTABLE_CONF + "/").length());
+ if (path.startsWith(tablesPrefix + tableId + Constants.ZTABLE_CONF + "/"))
+ key = path.substring((tablesPrefix + tableId + Constants.ZTABLE_CONF + "/").length());
}
}
@@ -64,8 +65,10 @@ class TableConfWatcher implements Watche
switch (event.getType()) {
case NodeDataChanged:
- if (log.isTraceEnabled()) log.trace("EventNodeDataChanged " + event.getPath());
- if (key != null) AccumuloConfiguration.getTableConfiguration(instanceId, tableId).propertyChanged(key);
+ if (log.isTraceEnabled())
+ log.trace("EventNodeDataChanged " + event.getPath());
+ if (key != null)
+ AccumuloConfiguration.getTableConfiguration(instanceId, tableId).propertyChanged(key);
break;
case NodeChildrenChanged:
AccumuloConfiguration.getTableConfiguration(instanceId, tableId).propertiesChanged(key);
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/TableConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/TableConfiguration.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/TableConfiguration.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/TableConfiguration.java Thu Oct 27 15:24:51 2011
@@ -49,10 +49,13 @@ public class TableConfiguration extends
}
private static ZooCache getTablePropCache() {
- if (instanceId == null) throw new IllegalStateException("Attempt to get per-table properties without an instanceId");
- if (tablePropCache == null) synchronized (TableConfiguration.class) {
- if (tablePropCache == null) tablePropCache = new ZooCache(new TableConfWatcher(instanceId));
- }
+ if (instanceId == null)
+ throw new IllegalStateException("Attempt to get per-table properties without an instanceId");
+ if (tablePropCache == null)
+ synchronized (TableConfiguration.class) {
+ if (tablePropCache == null)
+ tablePropCache = new ZooCache(new TableConfWatcher(instanceId));
+ }
return tablePropCache;
}
@@ -98,7 +101,8 @@ public class TableConfiguration extends
String value = get(key);
if (value == null || !property.getType().isValidFormat(value)) {
- if (value != null) log.error("Using default value for " + key + " due to improperly formatted " + property.getType() + ": " + value);
+ if (value != null)
+ log.error("Using default value for " + key + " due to improperly formatted " + property.getType() + ": " + value);
value = parent.get(property);
}
return value;
@@ -108,12 +112,14 @@ public class TableConfiguration extends
String zPath = ZooUtil.getRoot(instanceId) + Constants.ZTABLES + "/" + table + Constants.ZTABLE_CONF + "/" + key;
byte[] v = getTablePropCache().get(zPath);
String value = null;
- if (v != null) value = new String(v);
+ if (v != null)
+ value = new String(v);
return value;
}
public static void invalidateCache() {
- if (tablePropCache != null) tablePropCache.clear();
+ if (tablePropCache != null)
+ tablePropCache.clear();
}
@Override
@@ -127,7 +133,8 @@ public class TableConfiguration extends
if (children != null) {
for (String child : children) {
String value = get(child);
- if (child != null && value != null) entries.put(child, value);
+ if (child != null && value != null)
+ entries.put(child, value);
}
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/ZooConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/ZooConfiguration.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/ZooConfiguration.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/conf/ZooConfiguration.java Thu Oct 27 15:24:51 2011
@@ -61,15 +61,18 @@ public class ZooConfiguration extends Ac
}
private static String getInstanceId() {
- if (instanceId == null) ZooConfiguration.instanceId = HdfsZooInstance.getInstance().getInstanceID();
+ if (instanceId == null)
+ ZooConfiguration.instanceId = HdfsZooInstance.getInstance().getInstanceID();
return instanceId;
}
private static ZooCache getPropCache() {
- if (propCache == null) synchronized (ZooConfiguration.class) {
- if (propCache == null) propCache = new ZooCache();
- }
+ if (propCache == null)
+ synchronized (ZooConfiguration.class) {
+ if (propCache == null)
+ propCache = new ZooCache();
+ }
return propCache;
}
@@ -86,7 +89,8 @@ public class ZooConfiguration extends Ac
}
if (value == null || !property.getType().isValidFormat(value)) {
- if (value != null) log.error("Using parent value for " + key + " due to improperly formatted " + property.getType() + ": " + value);
+ if (value != null)
+ log.error("Using parent value for " + key + " due to improperly formatted " + property.getType() + ": " + value);
value = parent.get(property);
}
return value;
@@ -113,7 +117,8 @@ public class ZooConfiguration extends Ac
String zPath = ZooUtil.getRoot(getInstanceId()) + Constants.ZCONFIG + "/" + key;
byte[] v = getPropCache().get(zPath);
String value = null;
- if (v != null) value = new String(v);
+ if (v != null)
+ value = new String(v);
return value;
}
@@ -128,7 +133,8 @@ public class ZooConfiguration extends Ac
if (children != null) {
for (String child : children) {
String value = get(child);
- if (child != null && value != null) entries.put(child, value);
+ if (child != null && value != null)
+ entries.put(child, value);
}
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/constraints/Violations.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/constraints/Violations.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/constraints/Violations.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/constraints/Violations.java Thu Oct 27 15:24:51 2011
@@ -42,7 +42,8 @@ public class Violations {
@Override
public boolean equals(Object o) {
- if (o instanceof CVSKey) return equals((CVSKey) o);
+ if (o instanceof CVSKey)
+ return equals((CVSKey) o);
return false;
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/ArrayByteSequence.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/ArrayByteSequence.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/ArrayByteSequence.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/ArrayByteSequence.java Thu Oct 27 15:24:51 2011
@@ -90,7 +90,8 @@ public class ArrayByteSequence extends B
@Override
public byte[] toArray() {
- if (offset == 0 && length == data.length) return data;
+ if (offset == 0 && length == data.length)
+ return data;
byte[] copy = new byte[length];
System.arraycopy(data, offset, copy, 0, length);
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/ByteSequence.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/ByteSequence.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/ByteSequence.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/ByteSequence.java Thu Oct 27 15:24:51 2011
@@ -63,9 +63,11 @@ public abstract class ByteSequence imple
if (o instanceof ByteSequence) {
ByteSequence obs = (ByteSequence) o;
- if (this == o) return true;
+ if (this == o)
+ return true;
- if (length() != obs.length()) return false;
+ if (length() != obs.length())
+ return false;
return compareTo(obs) == 0;
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/Column.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/Column.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/Column.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/Column.java Thu Oct 27 15:24:51 2011
@@ -32,18 +32,23 @@ import org.apache.hadoop.io.WritableComp
public class Column implements WritableComparable<Column> {
static private int compareBytes(byte[] a, byte[] b) {
- if (a == null && b == null) return 0;
- if (a == null) return -1;
- if (b == null) return 1;
+ if (a == null && b == null)
+ return 0;
+ if (a == null)
+ return -1;
+ if (b == null)
+ return 1;
return WritableComparator.compareBytes(a, 0, a.length, b, 0, b.length);
}
public int compareTo(Column that) {
int result;
result = compareBytes(this.columnFamily, that.columnFamily);
- if (result != 0) return result;
+ if (result != 0)
+ return result;
result = compareBytes(this.columnQualifier, that.columnQualifier);
- if (result != 0) return result;
+ if (result != 0)
+ return result;
return compareBytes(this.columnVisibility, that.columnVisibility);
}
@@ -119,8 +124,10 @@ public class Column implements WritableC
@Override
public boolean equals(Object that) {
- if (that == null) return false;
- if (that instanceof Column) return this.equals((Column) that);
+ if (that == null)
+ return false;
+ if (that instanceof Column)
+ return this.equals((Column) that);
return false;
}
@@ -129,7 +136,8 @@ public class Column implements WritableC
}
private static int hash(byte[] b) {
- if (b == null) return 0;
+ if (b == null)
+ return 0;
return WritableComparator.hashBytes(b, b.length);
}
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/ColumnUpdate.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/ColumnUpdate.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/ColumnUpdate.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/ColumnUpdate.java Thu Oct 27 15:24:51 2011
@@ -48,7 +48,8 @@ public class ColumnUpdate {
}
public void setSystemTimestamp(long v) {
- if (hasTimestamp) throw new IllegalStateException("Cannot set system timestamp when user set a timestamp");
+ if (hasTimestamp)
+ throw new IllegalStateException("Cannot set system timestamp when user set a timestamp");
int tso = this.tsOffset;
data[tso++] = (byte) (v >>> 56);
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/ConstraintViolationSummary.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/ConstraintViolationSummary.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/ConstraintViolationSummary.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/ConstraintViolationSummary.java Thu Oct 27 15:24:51 2011
@@ -64,11 +64,13 @@ public class ConstraintViolationSummary
sb.append(this.constrainClass);
}
first = false;
- if (!first) sb.append(", ");
+ if (!first)
+ sb.append(", ");
sb.append("violationCode:");
sb.append(this.violationCode);
first = false;
- if (!first) sb.append(", ");
+ if (!first)
+ sb.append(", ");
sb.append("violationDescription:");
if (this.violationDescription == null) {
sb.append("null");
@@ -76,7 +78,8 @@ public class ConstraintViolationSummary
sb.append(this.violationDescription);
}
first = false;
- if (!first) sb.append(", ");
+ if (!first)
+ sb.append(", ");
sb.append("numberOfViolatingMutations:");
sb.append(this.numberOfViolatingMutations);
first = false;