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 [7/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/data/thrift/TConstraintViolationSummary.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TConstraintViolationSummary.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TConstraintViolationSummary.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TConstraintViolationSummary.java Thu Oct 27 15:24:51 2011
@@ -5,46 +5,44 @@
*/
package org.apache.accumulo.core.data.thrift;
-
-
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
@SuppressWarnings("serial")
-public class TConstraintViolationSummary implements TBase<TConstraintViolationSummary, TConstraintViolationSummary._Fields>, java.io.Serializable, Cloneable {
+public class TConstraintViolationSummary implements TBase<TConstraintViolationSummary,TConstraintViolationSummary._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("TConstraintViolationSummary");
-
- private static final TField CONSTRAIN_CLASS_FIELD_DESC = new TField("constrainClass", TType.STRING, (short)1);
- private static final TField VIOLATION_CODE_FIELD_DESC = new TField("violationCode", TType.I16, (short)2);
- private static final TField VIOLATION_DESCRIPTION_FIELD_DESC = new TField("violationDescription", TType.STRING, (short)3);
- private static final TField NUMBER_OF_VIOLATING_MUTATIONS_FIELD_DESC = new TField("numberOfViolatingMutations", TType.I64, (short)4);
-
+
+ private static final TField CONSTRAIN_CLASS_FIELD_DESC = new TField("constrainClass", TType.STRING, (short) 1);
+ private static final TField VIOLATION_CODE_FIELD_DESC = new TField("violationCode", TType.I16, (short) 2);
+ private static final TField VIOLATION_DESCRIPTION_FIELD_DESC = new TField("violationDescription", TType.STRING, (short) 3);
+ private static final TField NUMBER_OF_VIOLATING_MUTATIONS_FIELD_DESC = new TField("numberOfViolatingMutations", TType.I64, (short) 4);
+
public String constrainClass;
public short violationCode;
public String violationDescription;
public long numberOfViolatingMutations;
-
+
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements TFieldIdEnum {
- CONSTRAIN_CLASS((short)1, "constrainClass"),
- VIOLATION_CODE((short)2, "violationCode"),
- VIOLATION_DESCRIPTION((short)3, "violationDescription"),
- NUMBER_OF_VIOLATING_MUTATIONS((short)4, "numberOfViolatingMutations");
-
- private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
-
+ CONSTRAIN_CLASS((short) 1, "constrainClass"),
+ VIOLATION_CODE((short) 2, "violationCode"),
+ VIOLATION_DESCRIPTION((short) 3, "violationDescription"),
+ NUMBER_OF_VIOLATING_MUTATIONS((short) 4, "numberOfViolatingMutations");
+
+ 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: // CONSTRAIN_CLASS
return CONSTRAIN_CLASS;
case 2: // VIOLATION_CODE
@@ -57,70 +55,61 @@ public class TConstraintViolationSummary
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
private static final int __VIOLATIONCODE_ISSET_ID = 0;
private static final int __NUMBEROFVIOLATINGMUTATIONS_ISSET_ID = 1;
private java.util.BitSet __isset_bit_vector = new java.util.BitSet(2);
-
- 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.CONSTRAIN_CLASS, new FieldMetaData("constrainClass", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- tmpMap.put(_Fields.VIOLATION_CODE, new FieldMetaData("violationCode", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.I16)));
- tmpMap.put(_Fields.VIOLATION_DESCRIPTION, new FieldMetaData("violationDescription", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- tmpMap.put(_Fields.NUMBER_OF_VIOLATING_MUTATIONS, new FieldMetaData("numberOfViolatingMutations", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.I64)));
+ java.util.Map<_Fields,FieldMetaData> tmpMap = new java.util.EnumMap<_Fields,FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.CONSTRAIN_CLASS, new FieldMetaData("constrainClass", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING)));
+ tmpMap.put(_Fields.VIOLATION_CODE, new FieldMetaData("violationCode", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I16)));
+ tmpMap.put(_Fields.VIOLATION_DESCRIPTION, new FieldMetaData("violationDescription", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING)));
+ tmpMap.put(_Fields.NUMBER_OF_VIOLATING_MUTATIONS, new FieldMetaData("numberOfViolatingMutations", TFieldRequirementType.DEFAULT, new FieldValueMetaData(
+ TType.I64)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(TConstraintViolationSummary.class, metaDataMap);
}
-
- public TConstraintViolationSummary() {
- }
-
- public TConstraintViolationSummary(
- String constrainClass,
- short violationCode,
- String violationDescription,
- long numberOfViolatingMutations)
- {
+
+ public TConstraintViolationSummary() {}
+
+ public TConstraintViolationSummary(String constrainClass, short violationCode, String violationDescription, long numberOfViolatingMutations) {
this();
this.constrainClass = constrainClass;
this.violationCode = violationCode;
@@ -129,7 +118,7 @@ public class TConstraintViolationSummary
this.numberOfViolatingMutations = numberOfViolatingMutations;
setNumberOfViolatingMutationsIsSet(true);
}
-
+
/**
* Performs a deep copy on <i>other</i>.
*/
@@ -145,205 +134,205 @@ public class TConstraintViolationSummary
}
this.numberOfViolatingMutations = other.numberOfViolatingMutations;
}
-
+
public TConstraintViolationSummary deepCopy() {
return new TConstraintViolationSummary(this);
}
-
+
@Deprecated
public TConstraintViolationSummary clone() {
return new TConstraintViolationSummary(this);
}
-
+
public String getConstrainClass() {
return this.constrainClass;
}
-
+
public TConstraintViolationSummary setConstrainClass(String constrainClass) {
this.constrainClass = constrainClass;
return this;
}
-
+
public void unsetConstrainClass() {
this.constrainClass = null;
}
-
+
/** Returns true if field constrainClass is set (has been asigned a value) and false otherwise */
public boolean isSetConstrainClass() {
return this.constrainClass != null;
}
-
+
public void setConstrainClassIsSet(boolean value) {
if (!value) {
this.constrainClass = null;
}
}
-
+
public short getViolationCode() {
return this.violationCode;
}
-
+
public TConstraintViolationSummary setViolationCode(short violationCode) {
this.violationCode = violationCode;
setViolationCodeIsSet(true);
return this;
}
-
+
public void unsetViolationCode() {
__isset_bit_vector.clear(__VIOLATIONCODE_ISSET_ID);
}
-
+
/** Returns true if field violationCode is set (has been asigned a value) and false otherwise */
public boolean isSetViolationCode() {
return __isset_bit_vector.get(__VIOLATIONCODE_ISSET_ID);
}
-
+
public void setViolationCodeIsSet(boolean value) {
__isset_bit_vector.set(__VIOLATIONCODE_ISSET_ID, value);
}
-
+
public String getViolationDescription() {
return this.violationDescription;
}
-
+
public TConstraintViolationSummary setViolationDescription(String violationDescription) {
this.violationDescription = violationDescription;
return this;
}
-
+
public void unsetViolationDescription() {
this.violationDescription = null;
}
-
+
/** Returns true if field violationDescription is set (has been asigned a value) and false otherwise */
public boolean isSetViolationDescription() {
return this.violationDescription != null;
}
-
+
public void setViolationDescriptionIsSet(boolean value) {
if (!value) {
this.violationDescription = null;
}
}
-
+
public long getNumberOfViolatingMutations() {
return this.numberOfViolatingMutations;
}
-
+
public TConstraintViolationSummary setNumberOfViolatingMutations(long numberOfViolatingMutations) {
this.numberOfViolatingMutations = numberOfViolatingMutations;
setNumberOfViolatingMutationsIsSet(true);
return this;
}
-
+
public void unsetNumberOfViolatingMutations() {
__isset_bit_vector.clear(__NUMBEROFVIOLATINGMUTATIONS_ISSET_ID);
}
-
+
/** Returns true if field numberOfViolatingMutations is set (has been asigned a value) and false otherwise */
public boolean isSetNumberOfViolatingMutations() {
return __isset_bit_vector.get(__NUMBEROFVIOLATINGMUTATIONS_ISSET_ID);
}
-
+
public void setNumberOfViolatingMutationsIsSet(boolean value) {
__isset_bit_vector.set(__NUMBEROFVIOLATINGMUTATIONS_ISSET_ID, value);
}
-
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
- case CONSTRAIN_CLASS:
- if (value == null) {
- unsetConstrainClass();
- } else {
- setConstrainClass((String)value);
- }
- break;
-
- case VIOLATION_CODE:
- if (value == null) {
- unsetViolationCode();
- } else {
- setViolationCode((Short)value);
- }
- break;
-
- case VIOLATION_DESCRIPTION:
- if (value == null) {
- unsetViolationDescription();
- } else {
- setViolationDescription((String)value);
- }
- break;
-
- case NUMBER_OF_VIOLATING_MUTATIONS:
- if (value == null) {
- unsetNumberOfViolatingMutations();
- } else {
- setNumberOfViolatingMutations((Long)value);
- }
- break;
-
+ case CONSTRAIN_CLASS:
+ if (value == null) {
+ unsetConstrainClass();
+ } else {
+ setConstrainClass((String) value);
+ }
+ break;
+
+ case VIOLATION_CODE:
+ if (value == null) {
+ unsetViolationCode();
+ } else {
+ setViolationCode((Short) value);
+ }
+ break;
+
+ case VIOLATION_DESCRIPTION:
+ if (value == null) {
+ unsetViolationDescription();
+ } else {
+ setViolationDescription((String) value);
+ }
+ break;
+
+ case NUMBER_OF_VIOLATING_MUTATIONS:
+ if (value == null) {
+ unsetNumberOfViolatingMutations();
+ } else {
+ setNumberOfViolatingMutations((Long) value);
+ }
+ break;
+
}
}
-
+
public void setFieldValue(int fieldID, Object value) {
setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
}
-
+
public Object getFieldValue(_Fields field) {
switch (field) {
- case CONSTRAIN_CLASS:
- return getConstrainClass();
-
- case VIOLATION_CODE:
- return new Short(getViolationCode());
-
- case VIOLATION_DESCRIPTION:
- return getViolationDescription();
-
- case NUMBER_OF_VIOLATING_MUTATIONS:
- return new Long(getNumberOfViolatingMutations());
-
+ case CONSTRAIN_CLASS:
+ return getConstrainClass();
+
+ case VIOLATION_CODE:
+ return new Short(getViolationCode());
+
+ case VIOLATION_DESCRIPTION:
+ return getViolationDescription();
+
+ case NUMBER_OF_VIOLATING_MUTATIONS:
+ return new Long(getNumberOfViolatingMutations());
+
}
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 CONSTRAIN_CLASS:
- return isSetConstrainClass();
- case VIOLATION_CODE:
- return isSetViolationCode();
- case VIOLATION_DESCRIPTION:
- return isSetViolationDescription();
- case NUMBER_OF_VIOLATING_MUTATIONS:
- return isSetNumberOfViolatingMutations();
+ case CONSTRAIN_CLASS:
+ return isSetConstrainClass();
+ case VIOLATION_CODE:
+ return isSetViolationCode();
+ case VIOLATION_DESCRIPTION:
+ return isSetViolationDescription();
+ case NUMBER_OF_VIOLATING_MUTATIONS:
+ return isSetNumberOfViolatingMutations();
}
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 TConstraintViolationSummary)
- return this.equals((TConstraintViolationSummary)that);
+ return this.equals((TConstraintViolationSummary) that);
return false;
}
-
+
public boolean equals(TConstraintViolationSummary that) {
if (that == null)
return false;
-
+
boolean this_present_constrainClass = true && this.isSetConstrainClass();
boolean that_present_constrainClass = true && that.isSetConstrainClass();
if (this_present_constrainClass || that_present_constrainClass) {
@@ -352,7 +341,7 @@ public class TConstraintViolationSummary
if (!this.constrainClass.equals(that.constrainClass))
return false;
}
-
+
boolean this_present_violationCode = true;
boolean that_present_violationCode = true;
if (this_present_violationCode || that_present_violationCode) {
@@ -361,7 +350,7 @@ public class TConstraintViolationSummary
if (this.violationCode != that.violationCode)
return false;
}
-
+
boolean this_present_violationDescription = true && this.isSetViolationDescription();
boolean that_present_violationDescription = true && that.isSetViolationDescription();
if (this_present_violationDescription || that_present_violationDescription) {
@@ -370,7 +359,7 @@ public class TConstraintViolationSummary
if (!this.violationDescription.equals(that.violationDescription))
return false;
}
-
+
boolean this_present_numberOfViolatingMutations = true;
boolean that_present_numberOfViolatingMutations = true;
if (this_present_numberOfViolatingMutations || that_present_numberOfViolatingMutations) {
@@ -379,28 +368,29 @@ public class TConstraintViolationSummary
if (this.numberOfViolatingMutations != that.numberOfViolatingMutations)
return false;
}
-
+
return true;
}
-
+
@Override
public int hashCode() {
return 0;
}
-
+
public int compareTo(TConstraintViolationSummary other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
-
+
int lastComparison = 0;
- TConstraintViolationSummary typedOther = (TConstraintViolationSummary)other;
-
+ TConstraintViolationSummary typedOther = (TConstraintViolationSummary) other;
+
lastComparison = Boolean.valueOf(isSetConstrainClass()).compareTo(typedOther.isSetConstrainClass());
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetConstrainClass()) { lastComparison = TBaseHelper.compareTo(this.constrainClass, typedOther.constrainClass);
+ if (isSetConstrainClass()) {
+ lastComparison = TBaseHelper.compareTo(this.constrainClass, typedOther.constrainClass);
if (lastComparison != 0) {
return lastComparison;
}
@@ -409,7 +399,8 @@ public class TConstraintViolationSummary
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetViolationCode()) { lastComparison = TBaseHelper.compareTo(this.violationCode, typedOther.violationCode);
+ if (isSetViolationCode()) {
+ lastComparison = TBaseHelper.compareTo(this.violationCode, typedOther.violationCode);
if (lastComparison != 0) {
return lastComparison;
}
@@ -418,7 +409,8 @@ public class TConstraintViolationSummary
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetViolationDescription()) { lastComparison = TBaseHelper.compareTo(this.violationDescription, typedOther.violationDescription);
+ if (isSetViolationDescription()) {
+ lastComparison = TBaseHelper.compareTo(this.violationDescription, typedOther.violationDescription);
if (lastComparison != 0) {
return lastComparison;
}
@@ -427,28 +419,28 @@ public class TConstraintViolationSummary
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetNumberOfViolatingMutations()) { lastComparison = TBaseHelper.compareTo(this.numberOfViolatingMutations, typedOther.numberOfViolatingMutations);
+ if (isSetNumberOfViolatingMutations()) {
+ lastComparison = TBaseHelper.compareTo(this.numberOfViolatingMutations, typedOther.numberOfViolatingMutations);
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: // CONSTRAIN_CLASS
if (field.type == TType.STRING) {
this.constrainClass = iprot.readString();
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
@@ -456,14 +448,14 @@ public class TConstraintViolationSummary
if (field.type == TType.I16) {
this.violationCode = iprot.readI16();
setViolationCodeIsSet(true);
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 3: // VIOLATION_DESCRIPTION
if (field.type == TType.STRING) {
this.violationDescription = iprot.readString();
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
@@ -471,7 +463,7 @@ public class TConstraintViolationSummary
if (field.type == TType.I64) {
this.numberOfViolatingMutations = iprot.readI64();
setNumberOfViolatingMutationsIsSet(true);
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
@@ -481,14 +473,14 @@ public class TConstraintViolationSummary
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.constrainClass != null) {
oprot.writeFieldBegin(CONSTRAIN_CLASS_FIELD_DESC);
@@ -509,7 +501,7 @@ public class TConstraintViolationSummary
oprot.writeFieldStop();
oprot.writeStructEnd();
}
-
+
@Override
public String toString() {
StringBuilder sb = new StringBuilder("TConstraintViolationSummary(");
@@ -535,10 +527,9 @@ public class TConstraintViolationSummary
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/data/thrift/TKey.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TKey.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TKey.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TKey.java Thu Oct 27 15:24:51 2011
@@ -5,49 +5,44 @@
*/
package org.apache.accumulo.core.data.thrift;
-
-
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
@SuppressWarnings("serial")
-public class TKey implements TBase<TKey, TKey._Fields>, java.io.Serializable, Cloneable {
+public class TKey implements TBase<TKey,TKey._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("TKey");
-
- private static final TField ROW_FIELD_DESC = new TField("row", TType.STRING, (short)1);
- private static final TField COL_FAMILY_FIELD_DESC = new TField("colFamily", TType.STRING, (short)2);
- private static final TField COL_QUALIFIER_FIELD_DESC = new TField("colQualifier", TType.STRING, (short)3);
- private static final TField COL_VISIBILITY_FIELD_DESC = new TField("colVisibility", TType.STRING, (short)4);
- private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)5);
-
+
+ private static final TField ROW_FIELD_DESC = new TField("row", TType.STRING, (short) 1);
+ private static final TField COL_FAMILY_FIELD_DESC = new TField("colFamily", TType.STRING, (short) 2);
+ private static final TField COL_QUALIFIER_FIELD_DESC = new TField("colQualifier", TType.STRING, (short) 3);
+ private static final TField COL_VISIBILITY_FIELD_DESC = new TField("colVisibility", TType.STRING, (short) 4);
+ private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short) 5);
+
public byte[] row;
public byte[] colFamily;
public byte[] colQualifier;
public byte[] colVisibility;
public long timestamp;
-
+
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements TFieldIdEnum {
- ROW((short)1, "row"),
- COL_FAMILY((short)2, "colFamily"),
- COL_QUALIFIER((short)3, "colQualifier"),
- COL_VISIBILITY((short)4, "colVisibility"),
- TIMESTAMP((short)5, "timestamp");
-
- private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
-
+ ROW((short) 1, "row"), COL_FAMILY((short) 2, "colFamily"), COL_QUALIFIER((short) 3, "colQualifier"), COL_VISIBILITY((short) 4, "colVisibility"), TIMESTAMP(
+ (short) 5, "timestamp");
+
+ 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: // ROW
return ROW;
case 2: // COL_FAMILY
@@ -62,72 +57,60 @@ public class TKey implements TBase<TKey,
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
private static final int __TIMESTAMP_ISSET_ID = 0;
private java.util.BitSet __isset_bit_vector = new java.util.BitSet(1);
-
- 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.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- tmpMap.put(_Fields.COL_FAMILY, new FieldMetaData("colFamily", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- tmpMap.put(_Fields.COL_QUALIFIER, new FieldMetaData("colQualifier", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- tmpMap.put(_Fields.COL_VISIBILITY, new FieldMetaData("colVisibility", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- tmpMap.put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.I64)));
+ java.util.Map<_Fields,FieldMetaData> tmpMap = new java.util.EnumMap<_Fields,FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING)));
+ tmpMap.put(_Fields.COL_FAMILY, new FieldMetaData("colFamily", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING)));
+ tmpMap.put(_Fields.COL_QUALIFIER, new FieldMetaData("colQualifier", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING)));
+ tmpMap.put(_Fields.COL_VISIBILITY, new FieldMetaData("colVisibility", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING)));
+ tmpMap.put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I64)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(TKey.class, metaDataMap);
}
-
- public TKey() {
- }
-
- public TKey(
- byte[] row,
- byte[] colFamily,
- byte[] colQualifier,
- byte[] colVisibility,
- long timestamp)
- {
+
+ public TKey() {}
+
+ public TKey(byte[] row, byte[] colFamily, byte[] colQualifier, byte[] colVisibility, long timestamp) {
this();
this.row = row;
this.colFamily = colFamily;
@@ -136,7 +119,7 @@ public class TKey implements TBase<TKey,
this.timestamp = timestamp;
setTimestampIsSet(true);
}
-
+
/**
* Performs a deep copy on <i>other</i>.
*/
@@ -161,243 +144,243 @@ public class TKey implements TBase<TKey,
}
this.timestamp = other.timestamp;
}
-
+
public TKey deepCopy() {
return new TKey(this);
}
-
+
@Deprecated
public TKey clone() {
return new TKey(this);
}
-
+
public byte[] getRow() {
return this.row;
}
-
+
public TKey setRow(byte[] row) {
this.row = row;
return this;
}
-
+
public void unsetRow() {
this.row = null;
}
-
+
/** Returns true if field row is set (has been asigned a value) and false otherwise */
public boolean isSetRow() {
return this.row != null;
}
-
+
public void setRowIsSet(boolean value) {
if (!value) {
this.row = null;
}
}
-
+
public byte[] getColFamily() {
return this.colFamily;
}
-
+
public TKey setColFamily(byte[] colFamily) {
this.colFamily = colFamily;
return this;
}
-
+
public void unsetColFamily() {
this.colFamily = null;
}
-
+
/** Returns true if field colFamily is set (has been asigned a value) and false otherwise */
public boolean isSetColFamily() {
return this.colFamily != null;
}
-
+
public void setColFamilyIsSet(boolean value) {
if (!value) {
this.colFamily = null;
}
}
-
+
public byte[] getColQualifier() {
return this.colQualifier;
}
-
+
public TKey setColQualifier(byte[] colQualifier) {
this.colQualifier = colQualifier;
return this;
}
-
+
public void unsetColQualifier() {
this.colQualifier = null;
}
-
+
/** Returns true if field colQualifier is set (has been asigned a value) and false otherwise */
public boolean isSetColQualifier() {
return this.colQualifier != null;
}
-
+
public void setColQualifierIsSet(boolean value) {
if (!value) {
this.colQualifier = null;
}
}
-
+
public byte[] getColVisibility() {
return this.colVisibility;
}
-
+
public TKey setColVisibility(byte[] colVisibility) {
this.colVisibility = colVisibility;
return this;
}
-
+
public void unsetColVisibility() {
this.colVisibility = null;
}
-
+
/** Returns true if field colVisibility is set (has been asigned a value) and false otherwise */
public boolean isSetColVisibility() {
return this.colVisibility != null;
}
-
+
public void setColVisibilityIsSet(boolean value) {
if (!value) {
this.colVisibility = null;
}
}
-
+
public long getTimestamp() {
return this.timestamp;
}
-
+
public TKey setTimestamp(long timestamp) {
this.timestamp = timestamp;
setTimestampIsSet(true);
return this;
}
-
+
public void unsetTimestamp() {
__isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
}
-
+
/** Returns true if field timestamp is set (has been asigned a value) and false otherwise */
public boolean isSetTimestamp() {
return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
}
-
+
public void setTimestampIsSet(boolean value) {
__isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
}
-
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
- case ROW:
- if (value == null) {
- unsetRow();
- } else {
- setRow((byte[])value);
- }
- break;
-
- case COL_FAMILY:
- if (value == null) {
- unsetColFamily();
- } else {
- setColFamily((byte[])value);
- }
- break;
-
- case COL_QUALIFIER:
- if (value == null) {
- unsetColQualifier();
- } else {
- setColQualifier((byte[])value);
- }
- break;
-
- case COL_VISIBILITY:
- if (value == null) {
- unsetColVisibility();
- } else {
- setColVisibility((byte[])value);
- }
- break;
-
- case TIMESTAMP:
- if (value == null) {
- unsetTimestamp();
- } else {
- setTimestamp((Long)value);
- }
- break;
-
+ case ROW:
+ if (value == null) {
+ unsetRow();
+ } else {
+ setRow((byte[]) value);
+ }
+ break;
+
+ case COL_FAMILY:
+ if (value == null) {
+ unsetColFamily();
+ } else {
+ setColFamily((byte[]) value);
+ }
+ break;
+
+ case COL_QUALIFIER:
+ if (value == null) {
+ unsetColQualifier();
+ } else {
+ setColQualifier((byte[]) value);
+ }
+ break;
+
+ case COL_VISIBILITY:
+ if (value == null) {
+ unsetColVisibility();
+ } else {
+ setColVisibility((byte[]) value);
+ }
+ break;
+
+ case TIMESTAMP:
+ if (value == null) {
+ unsetTimestamp();
+ } else {
+ setTimestamp((Long) value);
+ }
+ break;
+
}
}
-
+
public void setFieldValue(int fieldID, Object value) {
setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
}
-
+
public Object getFieldValue(_Fields field) {
switch (field) {
- case ROW:
- return getRow();
-
- case COL_FAMILY:
- return getColFamily();
-
- case COL_QUALIFIER:
- return getColQualifier();
-
- case COL_VISIBILITY:
- return getColVisibility();
-
- case TIMESTAMP:
- return new Long(getTimestamp());
-
+ case ROW:
+ return getRow();
+
+ case COL_FAMILY:
+ return getColFamily();
+
+ case COL_QUALIFIER:
+ return getColQualifier();
+
+ case COL_VISIBILITY:
+ return getColVisibility();
+
+ case TIMESTAMP:
+ return new Long(getTimestamp());
+
}
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 ROW:
- return isSetRow();
- case COL_FAMILY:
- return isSetColFamily();
- case COL_QUALIFIER:
- return isSetColQualifier();
- case COL_VISIBILITY:
- return isSetColVisibility();
- case TIMESTAMP:
- return isSetTimestamp();
+ case ROW:
+ return isSetRow();
+ case COL_FAMILY:
+ return isSetColFamily();
+ case COL_QUALIFIER:
+ return isSetColQualifier();
+ case COL_VISIBILITY:
+ return isSetColVisibility();
+ case TIMESTAMP:
+ return isSetTimestamp();
}
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 TKey)
- return this.equals((TKey)that);
+ return this.equals((TKey) that);
return false;
}
-
+
public boolean equals(TKey that) {
if (that == null)
return false;
-
+
boolean this_present_row = true && this.isSetRow();
boolean that_present_row = true && that.isSetRow();
if (this_present_row || that_present_row) {
@@ -406,7 +389,7 @@ public class TKey implements TBase<TKey,
if (!java.util.Arrays.equals(this.row, that.row))
return false;
}
-
+
boolean this_present_colFamily = true && this.isSetColFamily();
boolean that_present_colFamily = true && that.isSetColFamily();
if (this_present_colFamily || that_present_colFamily) {
@@ -415,7 +398,7 @@ public class TKey implements TBase<TKey,
if (!java.util.Arrays.equals(this.colFamily, that.colFamily))
return false;
}
-
+
boolean this_present_colQualifier = true && this.isSetColQualifier();
boolean that_present_colQualifier = true && that.isSetColQualifier();
if (this_present_colQualifier || that_present_colQualifier) {
@@ -424,7 +407,7 @@ public class TKey implements TBase<TKey,
if (!java.util.Arrays.equals(this.colQualifier, that.colQualifier))
return false;
}
-
+
boolean this_present_colVisibility = true && this.isSetColVisibility();
boolean that_present_colVisibility = true && that.isSetColVisibility();
if (this_present_colVisibility || that_present_colVisibility) {
@@ -433,7 +416,7 @@ public class TKey implements TBase<TKey,
if (!java.util.Arrays.equals(this.colVisibility, that.colVisibility))
return false;
}
-
+
boolean this_present_timestamp = true;
boolean that_present_timestamp = true;
if (this_present_timestamp || that_present_timestamp) {
@@ -442,28 +425,29 @@ public class TKey implements TBase<TKey,
if (this.timestamp != that.timestamp)
return false;
}
-
+
return true;
}
-
+
@Override
public int hashCode() {
return 0;
}
-
+
public int compareTo(TKey other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
-
+
int lastComparison = 0;
- TKey typedOther = (TKey)other;
-
+ TKey typedOther = (TKey) other;
+
lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow());
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetRow()) { lastComparison = TBaseHelper.compareTo(this.row, typedOther.row);
+ if (isSetRow()) {
+ lastComparison = TBaseHelper.compareTo(this.row, typedOther.row);
if (lastComparison != 0) {
return lastComparison;
}
@@ -472,7 +456,8 @@ public class TKey implements TBase<TKey,
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetColFamily()) { lastComparison = TBaseHelper.compareTo(this.colFamily, typedOther.colFamily);
+ if (isSetColFamily()) {
+ lastComparison = TBaseHelper.compareTo(this.colFamily, typedOther.colFamily);
if (lastComparison != 0) {
return lastComparison;
}
@@ -481,7 +466,8 @@ public class TKey implements TBase<TKey,
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetColQualifier()) { lastComparison = TBaseHelper.compareTo(this.colQualifier, typedOther.colQualifier);
+ if (isSetColQualifier()) {
+ lastComparison = TBaseHelper.compareTo(this.colQualifier, typedOther.colQualifier);
if (lastComparison != 0) {
return lastComparison;
}
@@ -490,7 +476,8 @@ public class TKey implements TBase<TKey,
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetColVisibility()) { lastComparison = TBaseHelper.compareTo(this.colVisibility, typedOther.colVisibility);
+ if (isSetColVisibility()) {
+ lastComparison = TBaseHelper.compareTo(this.colVisibility, typedOther.colVisibility);
if (lastComparison != 0) {
return lastComparison;
}
@@ -499,49 +486,49 @@ public class TKey implements TBase<TKey,
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetTimestamp()) { lastComparison = TBaseHelper.compareTo(this.timestamp, typedOther.timestamp);
+ if (isSetTimestamp()) {
+ lastComparison = TBaseHelper.compareTo(this.timestamp, typedOther.timestamp);
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: // ROW
if (field.type == TType.STRING) {
this.row = iprot.readBinary();
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // COL_FAMILY
if (field.type == TType.STRING) {
this.colFamily = iprot.readBinary();
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 3: // COL_QUALIFIER
if (field.type == TType.STRING) {
this.colQualifier = iprot.readBinary();
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 4: // COL_VISIBILITY
if (field.type == TType.STRING) {
this.colVisibility = iprot.readBinary();
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
@@ -549,7 +536,7 @@ public class TKey implements TBase<TKey,
if (field.type == TType.I64) {
this.timestamp = iprot.readI64();
setTimestampIsSet(true);
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
@@ -559,14 +546,14 @@ public class TKey implements TBase<TKey,
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.row != null) {
oprot.writeFieldBegin(ROW_FIELD_DESC);
@@ -594,7 +581,7 @@ public class TKey implements TBase<TKey,
oprot.writeFieldStop();
oprot.writeStructEnd();
}
-
+
@Override
public String toString() {
StringBuilder sb = new StringBuilder("TKey(");
@@ -602,48 +589,60 @@ public class TKey implements TBase<TKey,
if (this.row == null) {
sb.append("null");
} else {
- int __row_size = Math.min(this.row.length, 128);
- for (int i = 0; i < __row_size; i++) {
- if (i != 0) sb.append(" ");
- sb.append(Integer.toHexString(this.row[i]).length() > 1 ? Integer.toHexString(this.row[i]).substring(Integer.toHexString(this.row[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.row[i]).toUpperCase());
- }
- if (this.row.length > 128) sb.append(" ...");
+ int __row_size = Math.min(this.row.length, 128);
+ for (int i = 0; i < __row_size; i++) {
+ if (i != 0)
+ sb.append(" ");
+ sb.append(Integer.toHexString(this.row[i]).length() > 1 ? Integer.toHexString(this.row[i]).substring(Integer.toHexString(this.row[i]).length() - 2)
+ .toUpperCase() : "0" + Integer.toHexString(this.row[i]).toUpperCase());
+ }
+ if (this.row.length > 128)
+ sb.append(" ...");
}
sb.append(", ");
sb.append("colFamily:");
if (this.colFamily == null) {
sb.append("null");
} else {
- int __colFamily_size = Math.min(this.colFamily.length, 128);
- for (int i = 0; i < __colFamily_size; i++) {
- if (i != 0) sb.append(" ");
- sb.append(Integer.toHexString(this.colFamily[i]).length() > 1 ? Integer.toHexString(this.colFamily[i]).substring(Integer.toHexString(this.colFamily[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.colFamily[i]).toUpperCase());
- }
- if (this.colFamily.length > 128) sb.append(" ...");
+ int __colFamily_size = Math.min(this.colFamily.length, 128);
+ for (int i = 0; i < __colFamily_size; i++) {
+ if (i != 0)
+ sb.append(" ");
+ sb.append(Integer.toHexString(this.colFamily[i]).length() > 1 ? Integer.toHexString(this.colFamily[i])
+ .substring(Integer.toHexString(this.colFamily[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.colFamily[i]).toUpperCase());
+ }
+ if (this.colFamily.length > 128)
+ sb.append(" ...");
}
sb.append(", ");
sb.append("colQualifier:");
if (this.colQualifier == null) {
sb.append("null");
} else {
- int __colQualifier_size = Math.min(this.colQualifier.length, 128);
- for (int i = 0; i < __colQualifier_size; i++) {
- if (i != 0) sb.append(" ");
- sb.append(Integer.toHexString(this.colQualifier[i]).length() > 1 ? Integer.toHexString(this.colQualifier[i]).substring(Integer.toHexString(this.colQualifier[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.colQualifier[i]).toUpperCase());
- }
- if (this.colQualifier.length > 128) sb.append(" ...");
+ int __colQualifier_size = Math.min(this.colQualifier.length, 128);
+ for (int i = 0; i < __colQualifier_size; i++) {
+ if (i != 0)
+ sb.append(" ");
+ sb.append(Integer.toHexString(this.colQualifier[i]).length() > 1 ? Integer.toHexString(this.colQualifier[i])
+ .substring(Integer.toHexString(this.colQualifier[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.colQualifier[i]).toUpperCase());
+ }
+ if (this.colQualifier.length > 128)
+ sb.append(" ...");
}
sb.append(", ");
sb.append("colVisibility:");
if (this.colVisibility == null) {
sb.append("null");
} else {
- int __colVisibility_size = Math.min(this.colVisibility.length, 128);
- for (int i = 0; i < __colVisibility_size; i++) {
- if (i != 0) sb.append(" ");
- sb.append(Integer.toHexString(this.colVisibility[i]).length() > 1 ? Integer.toHexString(this.colVisibility[i]).substring(Integer.toHexString(this.colVisibility[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.colVisibility[i]).toUpperCase());
- }
- if (this.colVisibility.length > 128) sb.append(" ...");
+ int __colVisibility_size = Math.min(this.colVisibility.length, 128);
+ for (int i = 0; i < __colVisibility_size; i++) {
+ if (i != 0)
+ sb.append(" ");
+ sb.append(Integer.toHexString(this.colVisibility[i]).length() > 1 ? Integer.toHexString(this.colVisibility[i])
+ .substring(Integer.toHexString(this.colVisibility[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.colVisibility[i]).toUpperCase());
+ }
+ if (this.colVisibility.length > 128)
+ sb.append(" ...");
}
sb.append(", ");
sb.append("timestamp:");
@@ -651,10 +650,9 @@ public class TKey implements TBase<TKey,
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/data/thrift/TKeyExtent.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java Thu Oct 27 15:24:51 2011
@@ -5,43 +5,39 @@
*/
package org.apache.accumulo.core.data.thrift;
-
-
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
@SuppressWarnings("serial")
-public class TKeyExtent implements TBase<TKeyExtent, TKeyExtent._Fields>, java.io.Serializable, Cloneable {
+public class TKeyExtent implements TBase<TKeyExtent,TKeyExtent._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("TKeyExtent");
-
- private static final TField TABLE_FIELD_DESC = new TField("table", TType.STRING, (short)1);
- private static final TField END_ROW_FIELD_DESC = new TField("endRow", TType.STRING, (short)2);
- private static final TField PREV_END_ROW_FIELD_DESC = new TField("prevEndRow", TType.STRING, (short)3);
-
+
+ private static final TField TABLE_FIELD_DESC = new TField("table", TType.STRING, (short) 1);
+ private static final TField END_ROW_FIELD_DESC = new TField("endRow", TType.STRING, (short) 2);
+ private static final TField PREV_END_ROW_FIELD_DESC = new TField("prevEndRow", TType.STRING, (short) 3);
+
public byte[] table;
public byte[] endRow;
public byte[] prevEndRow;
-
+
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements TFieldIdEnum {
- TABLE((short)1, "table"),
- END_ROW((short)2, "endRow"),
- PREV_END_ROW((short)3, "prevEndRow");
-
- private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
-
+ TABLE((short) 1, "table"), END_ROW((short) 2, "endRow"), PREV_END_ROW((short) 3, "prevEndRow");
+
+ 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
return TABLE;
case 2: // END_ROW
@@ -52,70 +48,62 @@ public class TKeyExtent implements TBase
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, new FieldMetaData("table", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- tmpMap.put(_Fields.END_ROW, new FieldMetaData("endRow", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- tmpMap.put(_Fields.PREV_END_ROW, new FieldMetaData("prevEndRow", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
+ java.util.Map<_Fields,FieldMetaData> tmpMap = new java.util.EnumMap<_Fields,FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.TABLE, new FieldMetaData("table", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING)));
+ tmpMap.put(_Fields.END_ROW, new FieldMetaData("endRow", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING)));
+ tmpMap.put(_Fields.PREV_END_ROW, new FieldMetaData("prevEndRow", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(TKeyExtent.class, metaDataMap);
}
-
- public TKeyExtent() {
- }
-
- public TKeyExtent(
- byte[] table,
- byte[] endRow,
- byte[] prevEndRow)
- {
+
+ public TKeyExtent() {}
+
+ public TKeyExtent(byte[] table, byte[] endRow, byte[] prevEndRow) {
this();
this.table = table;
this.endRow = endRow;
this.prevEndRow = prevEndRow;
}
-
+
/**
* Performs a deep copy on <i>other</i>.
*/
@@ -133,170 +121,170 @@ public class TKeyExtent implements TBase
System.arraycopy(other.prevEndRow, 0, prevEndRow, 0, other.prevEndRow.length);
}
}
-
+
public TKeyExtent deepCopy() {
return new TKeyExtent(this);
}
-
+
@Deprecated
public TKeyExtent clone() {
return new TKeyExtent(this);
}
-
+
public byte[] getTable() {
return this.table;
}
-
+
public TKeyExtent setTable(byte[] table) {
this.table = table;
return this;
}
-
+
public void unsetTable() {
this.table = null;
}
-
+
/** Returns true if field table is set (has been asigned a value) and false otherwise */
public boolean isSetTable() {
return this.table != null;
}
-
+
public void setTableIsSet(boolean value) {
if (!value) {
this.table = null;
}
}
-
+
public byte[] getEndRow() {
return this.endRow;
}
-
+
public TKeyExtent setEndRow(byte[] endRow) {
this.endRow = endRow;
return this;
}
-
+
public void unsetEndRow() {
this.endRow = null;
}
-
+
/** Returns true if field endRow is set (has been asigned a value) and false otherwise */
public boolean isSetEndRow() {
return this.endRow != null;
}
-
+
public void setEndRowIsSet(boolean value) {
if (!value) {
this.endRow = null;
}
}
-
+
public byte[] getPrevEndRow() {
return this.prevEndRow;
}
-
+
public TKeyExtent setPrevEndRow(byte[] prevEndRow) {
this.prevEndRow = prevEndRow;
return this;
}
-
+
public void unsetPrevEndRow() {
this.prevEndRow = null;
}
-
+
/** Returns true if field prevEndRow is set (has been asigned a value) and false otherwise */
public boolean isSetPrevEndRow() {
return this.prevEndRow != null;
}
-
+
public void setPrevEndRowIsSet(boolean value) {
if (!value) {
this.prevEndRow = null;
}
}
-
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
- case TABLE:
- if (value == null) {
- unsetTable();
- } else {
- setTable((byte[])value);
- }
- break;
-
- case END_ROW:
- if (value == null) {
- unsetEndRow();
- } else {
- setEndRow((byte[])value);
- }
- break;
-
- case PREV_END_ROW:
- if (value == null) {
- unsetPrevEndRow();
- } else {
- setPrevEndRow((byte[])value);
- }
- break;
-
+ case TABLE:
+ if (value == null) {
+ unsetTable();
+ } else {
+ setTable((byte[]) value);
+ }
+ break;
+
+ case END_ROW:
+ if (value == null) {
+ unsetEndRow();
+ } else {
+ setEndRow((byte[]) value);
+ }
+ break;
+
+ case PREV_END_ROW:
+ if (value == null) {
+ unsetPrevEndRow();
+ } else {
+ setPrevEndRow((byte[]) value);
+ }
+ break;
+
}
}
-
+
public void setFieldValue(int fieldID, Object value) {
setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
}
-
+
public Object getFieldValue(_Fields field) {
switch (field) {
- case TABLE:
- return getTable();
-
- case END_ROW:
- return getEndRow();
-
- case PREV_END_ROW:
- return getPrevEndRow();
-
+ case TABLE:
+ return getTable();
+
+ case END_ROW:
+ return getEndRow();
+
+ case PREV_END_ROW:
+ return getPrevEndRow();
+
}
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:
- return isSetTable();
- case END_ROW:
- return isSetEndRow();
- case PREV_END_ROW:
- return isSetPrevEndRow();
+ case TABLE:
+ return isSetTable();
+ case END_ROW:
+ return isSetEndRow();
+ case PREV_END_ROW:
+ return isSetPrevEndRow();
}
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 TKeyExtent)
- return this.equals((TKeyExtent)that);
+ return this.equals((TKeyExtent) that);
return false;
}
-
+
public boolean equals(TKeyExtent that) {
if (that == null)
return false;
-
+
boolean this_present_table = true && this.isSetTable();
boolean that_present_table = true && that.isSetTable();
if (this_present_table || that_present_table) {
@@ -305,7 +293,7 @@ public class TKeyExtent implements TBase
if (!java.util.Arrays.equals(this.table, that.table))
return false;
}
-
+
boolean this_present_endRow = true && this.isSetEndRow();
boolean that_present_endRow = true && that.isSetEndRow();
if (this_present_endRow || that_present_endRow) {
@@ -314,7 +302,7 @@ public class TKeyExtent implements TBase
if (!java.util.Arrays.equals(this.endRow, that.endRow))
return false;
}
-
+
boolean this_present_prevEndRow = true && this.isSetPrevEndRow();
boolean that_present_prevEndRow = true && that.isSetPrevEndRow();
if (this_present_prevEndRow || that_present_prevEndRow) {
@@ -323,28 +311,29 @@ public class TKeyExtent implements TBase
if (!java.util.Arrays.equals(this.prevEndRow, that.prevEndRow))
return false;
}
-
+
return true;
}
-
+
@Override
public int hashCode() {
return 0;
}
-
+
public int compareTo(TKeyExtent other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
-
+
int lastComparison = 0;
- TKeyExtent typedOther = (TKeyExtent)other;
-
+ TKeyExtent typedOther = (TKeyExtent) other;
+
lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable());
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetTable()) { lastComparison = TBaseHelper.compareTo(this.table, typedOther.table);
+ if (isSetTable()) {
+ lastComparison = TBaseHelper.compareTo(this.table, typedOther.table);
if (lastComparison != 0) {
return lastComparison;
}
@@ -353,7 +342,8 @@ public class TKeyExtent implements TBase
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetEndRow()) { lastComparison = TBaseHelper.compareTo(this.endRow, typedOther.endRow);
+ if (isSetEndRow()) {
+ lastComparison = TBaseHelper.compareTo(this.endRow, typedOther.endRow);
if (lastComparison != 0) {
return lastComparison;
}
@@ -362,42 +352,42 @@ public class TKeyExtent implements TBase
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetPrevEndRow()) { lastComparison = TBaseHelper.compareTo(this.prevEndRow, typedOther.prevEndRow);
+ if (isSetPrevEndRow()) {
+ lastComparison = TBaseHelper.compareTo(this.prevEndRow, typedOther.prevEndRow);
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
if (field.type == TType.STRING) {
this.table = iprot.readBinary();
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // END_ROW
if (field.type == TType.STRING) {
this.endRow = iprot.readBinary();
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 3: // PREV_END_ROW
if (field.type == TType.STRING) {
this.prevEndRow = iprot.readBinary();
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
@@ -407,14 +397,14 @@ public class TKeyExtent implements TBase
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.table != null) {
oprot.writeFieldBegin(TABLE_FIELD_DESC);
@@ -434,7 +424,7 @@ public class TKeyExtent implements TBase
oprot.writeFieldStop();
oprot.writeStructEnd();
}
-
+
@Override
public String toString() {
StringBuilder sb = new StringBuilder("TKeyExtent(");
@@ -442,44 +432,52 @@ public class TKeyExtent implements TBase
if (this.table == null) {
sb.append("null");
} else {
- int __table_size = Math.min(this.table.length, 128);
- for (int i = 0; i < __table_size; i++) {
- if (i != 0) sb.append(" ");
- sb.append(Integer.toHexString(this.table[i]).length() > 1 ? Integer.toHexString(this.table[i]).substring(Integer.toHexString(this.table[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.table[i]).toUpperCase());
- }
- if (this.table.length > 128) sb.append(" ...");
+ int __table_size = Math.min(this.table.length, 128);
+ for (int i = 0; i < __table_size; i++) {
+ if (i != 0)
+ sb.append(" ");
+ sb.append(Integer.toHexString(this.table[i]).length() > 1 ? Integer.toHexString(this.table[i])
+ .substring(Integer.toHexString(this.table[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.table[i]).toUpperCase());
+ }
+ if (this.table.length > 128)
+ sb.append(" ...");
}
sb.append(", ");
sb.append("endRow:");
if (this.endRow == null) {
sb.append("null");
} else {
- int __endRow_size = Math.min(this.endRow.length, 128);
- for (int i = 0; i < __endRow_size; i++) {
- if (i != 0) sb.append(" ");
- sb.append(Integer.toHexString(this.endRow[i]).length() > 1 ? Integer.toHexString(this.endRow[i]).substring(Integer.toHexString(this.endRow[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.endRow[i]).toUpperCase());
- }
- if (this.endRow.length > 128) sb.append(" ...");
+ int __endRow_size = Math.min(this.endRow.length, 128);
+ for (int i = 0; i < __endRow_size; i++) {
+ if (i != 0)
+ sb.append(" ");
+ sb.append(Integer.toHexString(this.endRow[i]).length() > 1 ? Integer.toHexString(this.endRow[i])
+ .substring(Integer.toHexString(this.endRow[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.endRow[i]).toUpperCase());
+ }
+ if (this.endRow.length > 128)
+ sb.append(" ...");
}
sb.append(", ");
sb.append("prevEndRow:");
if (this.prevEndRow == null) {
sb.append("null");
} else {
- int __prevEndRow_size = Math.min(this.prevEndRow.length, 128);
- for (int i = 0; i < __prevEndRow_size; i++) {
- if (i != 0) sb.append(" ");
- sb.append(Integer.toHexString(this.prevEndRow[i]).length() > 1 ? Integer.toHexString(this.prevEndRow[i]).substring(Integer.toHexString(this.prevEndRow[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.prevEndRow[i]).toUpperCase());
- }
- if (this.prevEndRow.length > 128) sb.append(" ...");
+ int __prevEndRow_size = Math.min(this.prevEndRow.length, 128);
+ for (int i = 0; i < __prevEndRow_size; i++) {
+ if (i != 0)
+ sb.append(" ");
+ sb.append(Integer.toHexString(this.prevEndRow[i]).length() > 1 ? Integer.toHexString(this.prevEndRow[i])
+ .substring(Integer.toHexString(this.prevEndRow[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.prevEndRow[i]).toUpperCase());
+ }
+ if (this.prevEndRow.length > 128)
+ sb.append(" ...");
}
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/data/thrift/TKeyValue.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java Thu Oct 27 15:24:51 2011
@@ -5,40 +5,37 @@
*/
package org.apache.accumulo.core.data.thrift;
-
-
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
@SuppressWarnings("serial")
-public class TKeyValue implements TBase<TKeyValue, TKeyValue._Fields>, java.io.Serializable, Cloneable {
+public class TKeyValue implements TBase<TKeyValue,TKeyValue._Fields>, java.io.Serializable, Cloneable {
private static final TStruct STRUCT_DESC = new TStruct("TKeyValue");
-
- private static final TField KEY_FIELD_DESC = new TField("key", TType.STRUCT, (short)1);
- private static final TField VALUE_FIELD_DESC = new TField("value", TType.STRING, (short)2);
-
+
+ private static final TField KEY_FIELD_DESC = new TField("key", TType.STRUCT, (short) 1);
+ private static final TField VALUE_FIELD_DESC = new TField("value", TType.STRING, (short) 2);
+
public TKey key;
public byte[] value;
-
+
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements TFieldIdEnum {
- KEY((short)1, "key"),
- VALUE((short)2, "value");
-
- private static final java.util.Map<String, _Fields> byName = new java.util.HashMap<String, _Fields>();
-
+ KEY((short) 1, "key"), VALUE((short) 2, "value");
+
+ 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: // KEY
return KEY;
case 2: // VALUE
@@ -47,66 +44,60 @@ public class TKeyValue implements TBase<
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.KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT,
- new StructMetaData(TType.STRUCT, TKey.class)));
- tmpMap.put(_Fields.VALUE, new FieldMetaData("value", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
+ java.util.Map<_Fields,FieldMetaData> tmpMap = new java.util.EnumMap<_Fields,FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, new StructMetaData(TType.STRUCT, TKey.class)));
+ tmpMap.put(_Fields.VALUE, new FieldMetaData("value", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(TKeyValue.class, metaDataMap);
}
-
- public TKeyValue() {
- }
-
- public TKeyValue(
- TKey key,
- byte[] value)
- {
+
+ public TKeyValue() {}
+
+ public TKeyValue(TKey key, byte[] value) {
this();
this.key = key;
this.value = value;
}
-
+
/**
* Performs a deep copy on <i>other</i>.
*/
@@ -119,133 +110,133 @@ public class TKeyValue implements TBase<
System.arraycopy(other.value, 0, value, 0, other.value.length);
}
}
-
+
public TKeyValue deepCopy() {
return new TKeyValue(this);
}
-
+
@Deprecated
public TKeyValue clone() {
return new TKeyValue(this);
}
-
+
public TKey getKey() {
return this.key;
}
-
+
public TKeyValue setKey(TKey key) {
this.key = key;
return this;
}
-
+
public void unsetKey() {
this.key = null;
}
-
+
/** Returns true if field key is set (has been asigned a value) and false otherwise */
public boolean isSetKey() {
return this.key != null;
}
-
+
public void setKeyIsSet(boolean value) {
if (!value) {
this.key = null;
}
}
-
+
public byte[] getValue() {
return this.value;
}
-
+
public TKeyValue setValue(byte[] value) {
this.value = value;
return this;
}
-
+
public void unsetValue() {
this.value = null;
}
-
+
/** Returns true if field value is set (has been asigned a value) and false otherwise */
public boolean isSetValue() {
return this.value != null;
}
-
+
public void setValueIsSet(boolean value) {
if (!value) {
this.value = null;
}
}
-
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
- case KEY:
- if (value == null) {
- unsetKey();
- } else {
- setKey((TKey)value);
- }
- break;
-
- case VALUE:
- if (value == null) {
- unsetValue();
- } else {
- setValue((byte[])value);
- }
- break;
-
+ case KEY:
+ if (value == null) {
+ unsetKey();
+ } else {
+ setKey((TKey) value);
+ }
+ break;
+
+ case VALUE:
+ if (value == null) {
+ unsetValue();
+ } else {
+ setValue((byte[]) value);
+ }
+ break;
+
}
}
-
+
public void setFieldValue(int fieldID, Object value) {
setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
}
-
+
public Object getFieldValue(_Fields field) {
switch (field) {
- case KEY:
- return getKey();
-
- case VALUE:
- return getValue();
-
+ case KEY:
+ return getKey();
+
+ case VALUE:
+ return getValue();
+
}
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 KEY:
- return isSetKey();
- case VALUE:
- return isSetValue();
+ case KEY:
+ return isSetKey();
+ case VALUE:
+ return isSetValue();
}
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 TKeyValue)
- return this.equals((TKeyValue)that);
+ return this.equals((TKeyValue) that);
return false;
}
-
+
public boolean equals(TKeyValue that) {
if (that == null)
return false;
-
+
boolean this_present_key = true && this.isSetKey();
boolean that_present_key = true && that.isSetKey();
if (this_present_key || that_present_key) {
@@ -254,7 +245,7 @@ public class TKeyValue implements TBase<
if (!this.key.equals(that.key))
return false;
}
-
+
boolean this_present_value = true && this.isSetValue();
boolean that_present_value = true && that.isSetValue();
if (this_present_value || that_present_value) {
@@ -263,28 +254,29 @@ public class TKeyValue implements TBase<
if (!java.util.Arrays.equals(this.value, that.value))
return false;
}
-
+
return true;
}
-
+
@Override
public int hashCode() {
return 0;
}
-
+
public int compareTo(TKeyValue other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
-
+
int lastComparison = 0;
- TKeyValue typedOther = (TKeyValue)other;
-
+ TKeyValue typedOther = (TKeyValue) other;
+
lastComparison = Boolean.valueOf(isSetKey()).compareTo(typedOther.isSetKey());
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetKey()) { lastComparison = TBaseHelper.compareTo(this.key, typedOther.key);
+ if (isSetKey()) {
+ lastComparison = TBaseHelper.compareTo(this.key, typedOther.key);
if (lastComparison != 0) {
return lastComparison;
}
@@ -293,21 +285,21 @@ public class TKeyValue implements TBase<
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetValue()) { lastComparison = TBaseHelper.compareTo(this.value, typedOther.value);
+ if (isSetValue()) {
+ lastComparison = TBaseHelper.compareTo(this.value, typedOther.value);
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) {
@@ -315,14 +307,14 @@ public class TKeyValue implements TBase<
if (field.type == TType.STRUCT) {
this.key = new TKey();
this.key.read(iprot);
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // VALUE
if (field.type == TType.STRING) {
this.value = iprot.readBinary();
- } else {
+ } else {
TProtocolUtil.skip(iprot, field.type);
}
break;
@@ -332,14 +324,14 @@ public class TKeyValue implements TBase<
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.key != null) {
oprot.writeFieldBegin(KEY_FIELD_DESC);
@@ -354,7 +346,7 @@ public class TKeyValue implements TBase<
oprot.writeFieldStop();
oprot.writeStructEnd();
}
-
+
@Override
public String toString() {
StringBuilder sb = new StringBuilder("TKeyValue(");
@@ -369,20 +361,22 @@ public class TKeyValue implements TBase<
if (this.value == null) {
sb.append("null");
} else {
- int __value_size = Math.min(this.value.length, 128);
- for (int i = 0; i < __value_size; i++) {
- if (i != 0) sb.append(" ");
- sb.append(Integer.toHexString(this.value[i]).length() > 1 ? Integer.toHexString(this.value[i]).substring(Integer.toHexString(this.value[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.value[i]).toUpperCase());
- }
- if (this.value.length > 128) sb.append(" ...");
+ int __value_size = Math.min(this.value.length, 128);
+ for (int i = 0; i < __value_size; i++) {
+ if (i != 0)
+ sb.append(" ");
+ sb.append(Integer.toHexString(this.value[i]).length() > 1 ? Integer.toHexString(this.value[i])
+ .substring(Integer.toHexString(this.value[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.value[i]).toUpperCase());
+ }
+ if (this.value.length > 128)
+ sb.append(" ...");
}
sb.append(")");
return sb.toString();
}
-
+
public void validate() throws TException {
// check for required fields
}
-
+
}
-