You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2016/03/03 22:59:54 UTC
[29/61] [abbrv] [partial] accumulo git commit: ACCUMULO-722 put trunk
in my sandbox
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7bdbfccb/1.5/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java
----------------------------------------------------------------------
diff --git a/1.5/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java b/1.5/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java
new file mode 100644
index 0000000..8ac1eda
--- /dev/null
+++ b/1.5/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyExtent.java
@@ -0,0 +1,615 @@
+/**
+ * Autogenerated by Thrift Compiler (0.8.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.accumulo.core.data.thrift;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class TKeyExtent implements org.apache.thrift.TBase<TKeyExtent, TKeyExtent._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TKeyExtent");
+
+ private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField END_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("endRow", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField PREV_END_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("prevEndRow", org.apache.thrift.protocol.TType.STRING, (short)3);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TKeyExtentStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TKeyExtentTupleSchemeFactory());
+ }
+
+ public ByteBuffer table; // required
+ public ByteBuffer endRow; // required
+ public ByteBuffer prevEndRow; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ TABLE((short)1, "table"),
+ END_ROW((short)2, "endRow"),
+ PREV_END_ROW((short)3, "prevEndRow");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : 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) {
+ case 1: // TABLE
+ return TABLE;
+ case 2: // END_ROW
+ return END_ROW;
+ case 3: // PREV_END_ROW
+ return PREV_END_ROW;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * 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!");
+ 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 Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
+ tmpMap.put(_Fields.END_ROW, new org.apache.thrift.meta_data.FieldMetaData("endRow", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
+ tmpMap.put(_Fields.PREV_END_ROW, new org.apache.thrift.meta_data.FieldMetaData("prevEndRow", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TKeyExtent.class, metaDataMap);
+ }
+
+ public TKeyExtent() {
+ }
+
+ public TKeyExtent(
+ ByteBuffer table,
+ ByteBuffer endRow,
+ ByteBuffer prevEndRow)
+ {
+ this();
+ this.table = table;
+ this.endRow = endRow;
+ this.prevEndRow = prevEndRow;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public TKeyExtent(TKeyExtent other) {
+ if (other.isSetTable()) {
+ this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table);
+;
+ }
+ if (other.isSetEndRow()) {
+ this.endRow = org.apache.thrift.TBaseHelper.copyBinary(other.endRow);
+;
+ }
+ if (other.isSetPrevEndRow()) {
+ this.prevEndRow = org.apache.thrift.TBaseHelper.copyBinary(other.prevEndRow);
+;
+ }
+ }
+
+ public TKeyExtent deepCopy() {
+ return new TKeyExtent(this);
+ }
+
+ @Override
+ public void clear() {
+ this.table = null;
+ this.endRow = null;
+ this.prevEndRow = null;
+ }
+
+ public byte[] getTable() {
+ setTable(org.apache.thrift.TBaseHelper.rightSize(table));
+ return table == null ? null : table.array();
+ }
+
+ public ByteBuffer bufferForTable() {
+ return table;
+ }
+
+ public TKeyExtent setTable(byte[] table) {
+ setTable(table == null ? (ByteBuffer)null : ByteBuffer.wrap(table));
+ return this;
+ }
+
+ public TKeyExtent setTable(ByteBuffer table) {
+ this.table = table;
+ return this;
+ }
+
+ public void unsetTable() {
+ this.table = null;
+ }
+
+ /** Returns true if field table is set (has been assigned 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() {
+ setEndRow(org.apache.thrift.TBaseHelper.rightSize(endRow));
+ return endRow == null ? null : endRow.array();
+ }
+
+ public ByteBuffer bufferForEndRow() {
+ return endRow;
+ }
+
+ public TKeyExtent setEndRow(byte[] endRow) {
+ setEndRow(endRow == null ? (ByteBuffer)null : ByteBuffer.wrap(endRow));
+ return this;
+ }
+
+ public TKeyExtent setEndRow(ByteBuffer endRow) {
+ this.endRow = endRow;
+ return this;
+ }
+
+ public void unsetEndRow() {
+ this.endRow = null;
+ }
+
+ /** Returns true if field endRow is set (has been assigned 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() {
+ setPrevEndRow(org.apache.thrift.TBaseHelper.rightSize(prevEndRow));
+ return prevEndRow == null ? null : prevEndRow.array();
+ }
+
+ public ByteBuffer bufferForPrevEndRow() {
+ return prevEndRow;
+ }
+
+ public TKeyExtent setPrevEndRow(byte[] prevEndRow) {
+ setPrevEndRow(prevEndRow == null ? (ByteBuffer)null : ByteBuffer.wrap(prevEndRow));
+ return this;
+ }
+
+ public TKeyExtent setPrevEndRow(ByteBuffer prevEndRow) {
+ this.prevEndRow = prevEndRow;
+ return this;
+ }
+
+ public void unsetPrevEndRow() {
+ this.prevEndRow = null;
+ }
+
+ /** Returns true if field prevEndRow is set (has been assigned 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((ByteBuffer)value);
+ }
+ break;
+
+ case END_ROW:
+ if (value == null) {
+ unsetEndRow();
+ } else {
+ setEndRow((ByteBuffer)value);
+ }
+ break;
+
+ case PREV_END_ROW:
+ if (value == null) {
+ unsetPrevEndRow();
+ } else {
+ setPrevEndRow((ByteBuffer)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case TABLE:
+ return getTable();
+
+ case END_ROW:
+ return getEndRow();
+
+ case PREV_END_ROW:
+ return getPrevEndRow();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case TABLE:
+ return isSetTable();
+ case END_ROW:
+ return isSetEndRow();
+ case PREV_END_ROW:
+ return isSetPrevEndRow();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof TKeyExtent)
+ 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) {
+ if (!(this_present_table && that_present_table))
+ return false;
+ if (!this.table.equals(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) {
+ if (!(this_present_endRow && that_present_endRow))
+ return false;
+ if (!this.endRow.equals(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) {
+ if (!(this_present_prevEndRow && that_present_prevEndRow))
+ return false;
+ if (!this.prevEndRow.equals(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;
+
+ lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetTable()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, typedOther.table);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetEndRow()).compareTo(typedOther.isSetEndRow());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetEndRow()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endRow, typedOther.endRow);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetPrevEndRow()).compareTo(typedOther.isSetPrevEndRow());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetPrevEndRow()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prevEndRow, typedOther.prevEndRow);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("TKeyExtent(");
+ boolean first = true;
+
+ sb.append("table:");
+ if (this.table == null) {
+ sb.append("null");
+ } else {
+ org.apache.thrift.TBaseHelper.toString(this.table, sb);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("endRow:");
+ if (this.endRow == null) {
+ sb.append("null");
+ } else {
+ org.apache.thrift.TBaseHelper.toString(this.endRow, sb);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("prevEndRow:");
+ if (this.prevEndRow == null) {
+ sb.append("null");
+ } else {
+ org.apache.thrift.TBaseHelper.toString(this.prevEndRow, sb);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class TKeyExtentStandardSchemeFactory implements SchemeFactory {
+ public TKeyExtentStandardScheme getScheme() {
+ return new TKeyExtentStandardScheme();
+ }
+ }
+
+ private static class TKeyExtentStandardScheme extends StandardScheme<TKeyExtent> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TKeyExtent struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // TABLE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.table = iprot.readBinary();
+ struct.setTableIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // END_ROW
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.endRow = iprot.readBinary();
+ struct.setEndRowIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // PREV_END_ROW
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.prevEndRow = iprot.readBinary();
+ struct.setPrevEndRowIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, TKeyExtent struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.table != null) {
+ oprot.writeFieldBegin(TABLE_FIELD_DESC);
+ oprot.writeBinary(struct.table);
+ oprot.writeFieldEnd();
+ }
+ if (struct.endRow != null) {
+ oprot.writeFieldBegin(END_ROW_FIELD_DESC);
+ oprot.writeBinary(struct.endRow);
+ oprot.writeFieldEnd();
+ }
+ if (struct.prevEndRow != null) {
+ oprot.writeFieldBegin(PREV_END_ROW_FIELD_DESC);
+ oprot.writeBinary(struct.prevEndRow);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TKeyExtentTupleSchemeFactory implements SchemeFactory {
+ public TKeyExtentTupleScheme getScheme() {
+ return new TKeyExtentTupleScheme();
+ }
+ }
+
+ private static class TKeyExtentTupleScheme extends TupleScheme<TKeyExtent> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TKeyExtent struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetTable()) {
+ optionals.set(0);
+ }
+ if (struct.isSetEndRow()) {
+ optionals.set(1);
+ }
+ if (struct.isSetPrevEndRow()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
+ if (struct.isSetTable()) {
+ oprot.writeBinary(struct.table);
+ }
+ if (struct.isSetEndRow()) {
+ oprot.writeBinary(struct.endRow);
+ }
+ if (struct.isSetPrevEndRow()) {
+ oprot.writeBinary(struct.prevEndRow);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TKeyExtent struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(3);
+ if (incoming.get(0)) {
+ struct.table = iprot.readBinary();
+ struct.setTableIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.endRow = iprot.readBinary();
+ struct.setEndRowIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.prevEndRow = iprot.readBinary();
+ struct.setPrevEndRowIsSet(true);
+ }
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7bdbfccb/1.5/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java
----------------------------------------------------------------------
diff --git a/1.5/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java b/1.5/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java
new file mode 100644
index 0000000..5471a5e
--- /dev/null
+++ b/1.5/core/src/main/java/org/apache/accumulo/core/data/thrift/TKeyValue.java
@@ -0,0 +1,495 @@
+/**
+ * Autogenerated by Thrift Compiler (0.8.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.accumulo.core.data.thrift;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class TKeyValue implements org.apache.thrift.TBase<TKeyValue, TKeyValue._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TKeyValue");
+
+ private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+ private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)2);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TKeyValueStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TKeyValueTupleSchemeFactory());
+ }
+
+ public TKey key; // required
+ public ByteBuffer value; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ KEY((short)1, "key"),
+ VALUE((short)2, "value");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : 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) {
+ case 1: // KEY
+ return KEY;
+ case 2: // VALUE
+ return VALUE;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * 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!");
+ 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 Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TKey.class)));
+ tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TKeyValue.class, metaDataMap);
+ }
+
+ public TKeyValue() {
+ }
+
+ public TKeyValue(
+ TKey key,
+ ByteBuffer value)
+ {
+ this();
+ this.key = key;
+ this.value = value;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public TKeyValue(TKeyValue other) {
+ if (other.isSetKey()) {
+ this.key = new TKey(other.key);
+ }
+ if (other.isSetValue()) {
+ this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value);
+;
+ }
+ }
+
+ public TKeyValue deepCopy() {
+ return new TKeyValue(this);
+ }
+
+ @Override
+ public void clear() {
+ this.key = null;
+ this.value = null;
+ }
+
+ 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 assigned 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() {
+ setValue(org.apache.thrift.TBaseHelper.rightSize(value));
+ return value == null ? null : value.array();
+ }
+
+ public ByteBuffer bufferForValue() {
+ return value;
+ }
+
+ public TKeyValue setValue(byte[] value) {
+ setValue(value == null ? (ByteBuffer)null : ByteBuffer.wrap(value));
+ return this;
+ }
+
+ public TKeyValue setValue(ByteBuffer value) {
+ this.value = value;
+ return this;
+ }
+
+ public void unsetValue() {
+ this.value = null;
+ }
+
+ /** Returns true if field value is set (has been assigned 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((ByteBuffer)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case KEY:
+ return getKey();
+
+ case VALUE:
+ return getValue();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case KEY:
+ return isSetKey();
+ case VALUE:
+ return isSetValue();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof TKeyValue)
+ 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) {
+ if (!(this_present_key && that_present_key))
+ return false;
+ 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) {
+ if (!(this_present_value && that_present_value))
+ return false;
+ if (!this.value.equals(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;
+
+ lastComparison = Boolean.valueOf(isSetKey()).compareTo(typedOther.isSetKey());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetKey()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, typedOther.key);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetValue()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("TKeyValue(");
+ boolean first = true;
+
+ sb.append("key:");
+ if (this.key == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.key);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("value:");
+ if (this.value == null) {
+ sb.append("null");
+ } else {
+ org.apache.thrift.TBaseHelper.toString(this.value, sb);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class TKeyValueStandardSchemeFactory implements SchemeFactory {
+ public TKeyValueStandardScheme getScheme() {
+ return new TKeyValueStandardScheme();
+ }
+ }
+
+ private static class TKeyValueStandardScheme extends StandardScheme<TKeyValue> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TKeyValue struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // KEY
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.key = new TKey();
+ struct.key.read(iprot);
+ struct.setKeyIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // VALUE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.value = iprot.readBinary();
+ struct.setValueIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, TKeyValue struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.key != null) {
+ oprot.writeFieldBegin(KEY_FIELD_DESC);
+ struct.key.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.value != null) {
+ oprot.writeFieldBegin(VALUE_FIELD_DESC);
+ oprot.writeBinary(struct.value);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TKeyValueTupleSchemeFactory implements SchemeFactory {
+ public TKeyValueTupleScheme getScheme() {
+ return new TKeyValueTupleScheme();
+ }
+ }
+
+ private static class TKeyValueTupleScheme extends TupleScheme<TKeyValue> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TKeyValue struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetKey()) {
+ optionals.set(0);
+ }
+ if (struct.isSetValue()) {
+ optionals.set(1);
+ }
+ oprot.writeBitSet(optionals, 2);
+ if (struct.isSetKey()) {
+ struct.key.write(oprot);
+ }
+ if (struct.isSetValue()) {
+ oprot.writeBinary(struct.value);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TKeyValue struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(2);
+ if (incoming.get(0)) {
+ struct.key = new TKey();
+ struct.key.read(iprot);
+ struct.setKeyIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.value = iprot.readBinary();
+ struct.setValueIsSet(true);
+ }
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7bdbfccb/1.5/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java
----------------------------------------------------------------------
diff --git a/1.5/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java b/1.5/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java
new file mode 100644
index 0000000..9f5ff6e
--- /dev/null
+++ b/1.5/core/src/main/java/org/apache/accumulo/core/data/thrift/TMutation.java
@@ -0,0 +1,757 @@
+/**
+ * Autogenerated by Thrift Compiler (0.8.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.accumulo.core.data.thrift;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class TMutation implements org.apache.thrift.TBase<TMutation, TMutation._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TMutation");
+
+ private static final org.apache.thrift.protocol.TField ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("row", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)3);
+ private static final org.apache.thrift.protocol.TField ENTRIES_FIELD_DESC = new org.apache.thrift.protocol.TField("entries", org.apache.thrift.protocol.TType.I32, (short)4);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TMutationStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TMutationTupleSchemeFactory());
+ }
+
+ public ByteBuffer row; // required
+ public ByteBuffer data; // required
+ public List<ByteBuffer> values; // required
+ public int entries; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ ROW((short)1, "row"),
+ DATA((short)2, "data"),
+ VALUES((short)3, "values"),
+ ENTRIES((short)4, "entries");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : 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) {
+ case 1: // ROW
+ return ROW;
+ case 2: // DATA
+ return DATA;
+ case 3: // VALUES
+ return VALUES;
+ case 4: // ENTRIES
+ return ENTRIES;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * 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!");
+ 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 __ENTRIES_ISSET_ID = 0;
+ private BitSet __isset_bit_vector = new BitSet(1);
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
+ tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
+ tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))));
+ tmpMap.put(_Fields.ENTRIES, new org.apache.thrift.meta_data.FieldMetaData("entries", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TMutation.class, metaDataMap);
+ }
+
+ public TMutation() {
+ }
+
+ public TMutation(
+ ByteBuffer row,
+ ByteBuffer data,
+ List<ByteBuffer> values,
+ int entries)
+ {
+ this();
+ this.row = row;
+ this.data = data;
+ this.values = values;
+ this.entries = entries;
+ setEntriesIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public TMutation(TMutation other) {
+ __isset_bit_vector.clear();
+ __isset_bit_vector.or(other.__isset_bit_vector);
+ if (other.isSetRow()) {
+ this.row = org.apache.thrift.TBaseHelper.copyBinary(other.row);
+;
+ }
+ if (other.isSetData()) {
+ this.data = org.apache.thrift.TBaseHelper.copyBinary(other.data);
+;
+ }
+ if (other.isSetValues()) {
+ List<ByteBuffer> __this__values = new ArrayList<ByteBuffer>();
+ for (ByteBuffer other_element : other.values) {
+ ByteBuffer temp_binary_element = org.apache.thrift.TBaseHelper.copyBinary(other_element);
+;
+ __this__values.add(temp_binary_element);
+ }
+ this.values = __this__values;
+ }
+ this.entries = other.entries;
+ }
+
+ public TMutation deepCopy() {
+ return new TMutation(this);
+ }
+
+ @Override
+ public void clear() {
+ this.row = null;
+ this.data = null;
+ this.values = null;
+ setEntriesIsSet(false);
+ this.entries = 0;
+ }
+
+ public byte[] getRow() {
+ setRow(org.apache.thrift.TBaseHelper.rightSize(row));
+ return row == null ? null : row.array();
+ }
+
+ public ByteBuffer bufferForRow() {
+ return row;
+ }
+
+ public TMutation setRow(byte[] row) {
+ setRow(row == null ? (ByteBuffer)null : ByteBuffer.wrap(row));
+ return this;
+ }
+
+ public TMutation setRow(ByteBuffer row) {
+ this.row = row;
+ return this;
+ }
+
+ public void unsetRow() {
+ this.row = null;
+ }
+
+ /** Returns true if field row is set (has been assigned a value) and false otherwise */
+ public boolean isSetRow() {
+ return this.row != null;
+ }
+
+ public void setRowIsSet(boolean value) {
+ if (!value) {
+ this.row = null;
+ }
+ }
+
+ public byte[] getData() {
+ setData(org.apache.thrift.TBaseHelper.rightSize(data));
+ return data == null ? null : data.array();
+ }
+
+ public ByteBuffer bufferForData() {
+ return data;
+ }
+
+ public TMutation setData(byte[] data) {
+ setData(data == null ? (ByteBuffer)null : ByteBuffer.wrap(data));
+ return this;
+ }
+
+ public TMutation setData(ByteBuffer data) {
+ this.data = data;
+ return this;
+ }
+
+ public void unsetData() {
+ this.data = null;
+ }
+
+ /** Returns true if field data is set (has been assigned a value) and false otherwise */
+ public boolean isSetData() {
+ return this.data != null;
+ }
+
+ public void setDataIsSet(boolean value) {
+ if (!value) {
+ this.data = null;
+ }
+ }
+
+ public int getValuesSize() {
+ return (this.values == null) ? 0 : this.values.size();
+ }
+
+ public java.util.Iterator<ByteBuffer> getValuesIterator() {
+ return (this.values == null) ? null : this.values.iterator();
+ }
+
+ public void addToValues(ByteBuffer elem) {
+ if (this.values == null) {
+ this.values = new ArrayList<ByteBuffer>();
+ }
+ this.values.add(elem);
+ }
+
+ public List<ByteBuffer> getValues() {
+ return this.values;
+ }
+
+ public TMutation setValues(List<ByteBuffer> values) {
+ this.values = values;
+ return this;
+ }
+
+ public void unsetValues() {
+ this.values = null;
+ }
+
+ /** Returns true if field values is set (has been assigned a value) and false otherwise */
+ public boolean isSetValues() {
+ return this.values != null;
+ }
+
+ public void setValuesIsSet(boolean value) {
+ if (!value) {
+ this.values = null;
+ }
+ }
+
+ public int getEntries() {
+ return this.entries;
+ }
+
+ public TMutation setEntries(int entries) {
+ this.entries = entries;
+ setEntriesIsSet(true);
+ return this;
+ }
+
+ public void unsetEntries() {
+ __isset_bit_vector.clear(__ENTRIES_ISSET_ID);
+ }
+
+ /** Returns true if field entries is set (has been assigned a value) and false otherwise */
+ public boolean isSetEntries() {
+ return __isset_bit_vector.get(__ENTRIES_ISSET_ID);
+ }
+
+ public void setEntriesIsSet(boolean value) {
+ __isset_bit_vector.set(__ENTRIES_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case ROW:
+ if (value == null) {
+ unsetRow();
+ } else {
+ setRow((ByteBuffer)value);
+ }
+ break;
+
+ case DATA:
+ if (value == null) {
+ unsetData();
+ } else {
+ setData((ByteBuffer)value);
+ }
+ break;
+
+ case VALUES:
+ if (value == null) {
+ unsetValues();
+ } else {
+ setValues((List<ByteBuffer>)value);
+ }
+ break;
+
+ case ENTRIES:
+ if (value == null) {
+ unsetEntries();
+ } else {
+ setEntries((Integer)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case ROW:
+ return getRow();
+
+ case DATA:
+ return getData();
+
+ case VALUES:
+ return getValues();
+
+ case ENTRIES:
+ return Integer.valueOf(getEntries());
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case ROW:
+ return isSetRow();
+ case DATA:
+ return isSetData();
+ case VALUES:
+ return isSetValues();
+ case ENTRIES:
+ return isSetEntries();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof TMutation)
+ return this.equals((TMutation)that);
+ return false;
+ }
+
+ public boolean equals(TMutation 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) {
+ if (!(this_present_row && that_present_row))
+ return false;
+ if (!this.row.equals(that.row))
+ return false;
+ }
+
+ boolean this_present_data = true && this.isSetData();
+ boolean that_present_data = true && that.isSetData();
+ if (this_present_data || that_present_data) {
+ if (!(this_present_data && that_present_data))
+ return false;
+ if (!this.data.equals(that.data))
+ return false;
+ }
+
+ boolean this_present_values = true && this.isSetValues();
+ boolean that_present_values = true && that.isSetValues();
+ if (this_present_values || that_present_values) {
+ if (!(this_present_values && that_present_values))
+ return false;
+ if (!this.values.equals(that.values))
+ return false;
+ }
+
+ boolean this_present_entries = true;
+ boolean that_present_entries = true;
+ if (this_present_entries || that_present_entries) {
+ if (!(this_present_entries && that_present_entries))
+ return false;
+ if (this.entries != that.entries)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(TMutation other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ TMutation typedOther = (TMutation)other;
+
+ lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetRow()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, typedOther.row);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetData()).compareTo(typedOther.isSetData());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetData()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, typedOther.data);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetValues()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetEntries()).compareTo(typedOther.isSetEntries());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetEntries()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entries, typedOther.entries);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("TMutation(");
+ boolean first = true;
+
+ sb.append("row:");
+ if (this.row == null) {
+ sb.append("null");
+ } else {
+ org.apache.thrift.TBaseHelper.toString(this.row, sb);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("data:");
+ if (this.data == null) {
+ sb.append("null");
+ } else {
+ org.apache.thrift.TBaseHelper.toString(this.data, sb);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("values:");
+ if (this.values == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.values);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("entries:");
+ sb.append(this.entries);
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+ __isset_bit_vector = new BitSet(1);
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class TMutationStandardSchemeFactory implements SchemeFactory {
+ public TMutationStandardScheme getScheme() {
+ return new TMutationStandardScheme();
+ }
+ }
+
+ private static class TMutationStandardScheme extends StandardScheme<TMutation> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TMutation struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // ROW
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.row = iprot.readBinary();
+ struct.setRowIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // DATA
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.data = iprot.readBinary();
+ struct.setDataIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // VALUES
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
+ struct.values = new ArrayList<ByteBuffer>(_list0.size);
+ for (int _i1 = 0; _i1 < _list0.size; ++_i1)
+ {
+ ByteBuffer _elem2; // required
+ _elem2 = iprot.readBinary();
+ struct.values.add(_elem2);
+ }
+ iprot.readListEnd();
+ }
+ struct.setValuesIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // ENTRIES
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.entries = iprot.readI32();
+ struct.setEntriesIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, TMutation struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.row != null) {
+ oprot.writeFieldBegin(ROW_FIELD_DESC);
+ oprot.writeBinary(struct.row);
+ oprot.writeFieldEnd();
+ }
+ if (struct.data != null) {
+ oprot.writeFieldBegin(DATA_FIELD_DESC);
+ oprot.writeBinary(struct.data);
+ oprot.writeFieldEnd();
+ }
+ if (struct.values != null) {
+ oprot.writeFieldBegin(VALUES_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size()));
+ for (ByteBuffer _iter3 : struct.values)
+ {
+ oprot.writeBinary(_iter3);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(ENTRIES_FIELD_DESC);
+ oprot.writeI32(struct.entries);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TMutationTupleSchemeFactory implements SchemeFactory {
+ public TMutationTupleScheme getScheme() {
+ return new TMutationTupleScheme();
+ }
+ }
+
+ private static class TMutationTupleScheme extends TupleScheme<TMutation> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TMutation struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetRow()) {
+ optionals.set(0);
+ }
+ if (struct.isSetData()) {
+ optionals.set(1);
+ }
+ if (struct.isSetValues()) {
+ optionals.set(2);
+ }
+ if (struct.isSetEntries()) {
+ optionals.set(3);
+ }
+ oprot.writeBitSet(optionals, 4);
+ if (struct.isSetRow()) {
+ oprot.writeBinary(struct.row);
+ }
+ if (struct.isSetData()) {
+ oprot.writeBinary(struct.data);
+ }
+ if (struct.isSetValues()) {
+ {
+ oprot.writeI32(struct.values.size());
+ for (ByteBuffer _iter4 : struct.values)
+ {
+ oprot.writeBinary(_iter4);
+ }
+ }
+ }
+ if (struct.isSetEntries()) {
+ oprot.writeI32(struct.entries);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TMutation struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(4);
+ if (incoming.get(0)) {
+ struct.row = iprot.readBinary();
+ struct.setRowIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.data = iprot.readBinary();
+ struct.setDataIsSet(true);
+ }
+ if (incoming.get(2)) {
+ {
+ org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.values = new ArrayList<ByteBuffer>(_list5.size);
+ for (int _i6 = 0; _i6 < _list5.size; ++_i6)
+ {
+ ByteBuffer _elem7; // required
+ _elem7 = iprot.readBinary();
+ struct.values.add(_elem7);
+ }
+ }
+ struct.setValuesIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.entries = iprot.readI32();
+ struct.setEntriesIsSet(true);
+ }
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/accumulo/blob/7bdbfccb/1.5/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java
----------------------------------------------------------------------
diff --git a/1.5/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java b/1.5/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java
new file mode 100644
index 0000000..43954fb
--- /dev/null
+++ b/1.5/core/src/main/java/org/apache/accumulo/core/data/thrift/TRange.java
@@ -0,0 +1,867 @@
+/**
+ * Autogenerated by Thrift Compiler (0.8.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.accumulo.core.data.thrift;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class TRange implements org.apache.thrift.TBase<TRange, TRange._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRange");
+
+ private static final org.apache.thrift.protocol.TField START_FIELD_DESC = new org.apache.thrift.protocol.TField("start", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+ private static final org.apache.thrift.protocol.TField STOP_FIELD_DESC = new org.apache.thrift.protocol.TField("stop", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+ private static final org.apache.thrift.protocol.TField START_KEY_INCLUSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("startKeyInclusive", org.apache.thrift.protocol.TType.BOOL, (short)3);
+ private static final org.apache.thrift.protocol.TField STOP_KEY_INCLUSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("stopKeyInclusive", org.apache.thrift.protocol.TType.BOOL, (short)4);
+ private static final org.apache.thrift.protocol.TField INFINITE_START_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("infiniteStartKey", org.apache.thrift.protocol.TType.BOOL, (short)5);
+ private static final org.apache.thrift.protocol.TField INFINITE_STOP_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("infiniteStopKey", org.apache.thrift.protocol.TType.BOOL, (short)6);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TRangeStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TRangeTupleSchemeFactory());
+ }
+
+ public TKey start; // required
+ public TKey stop; // required
+ public boolean startKeyInclusive; // required
+ public boolean stopKeyInclusive; // required
+ public boolean infiniteStartKey; // required
+ public boolean infiniteStopKey; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ START((short)1, "start"),
+ STOP((short)2, "stop"),
+ START_KEY_INCLUSIVE((short)3, "startKeyInclusive"),
+ STOP_KEY_INCLUSIVE((short)4, "stopKeyInclusive"),
+ INFINITE_START_KEY((short)5, "infiniteStartKey"),
+ INFINITE_STOP_KEY((short)6, "infiniteStopKey");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : 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) {
+ case 1: // START
+ return START;
+ case 2: // STOP
+ return STOP;
+ case 3: // START_KEY_INCLUSIVE
+ return START_KEY_INCLUSIVE;
+ case 4: // STOP_KEY_INCLUSIVE
+ return STOP_KEY_INCLUSIVE;
+ case 5: // INFINITE_START_KEY
+ return INFINITE_START_KEY;
+ case 6: // INFINITE_STOP_KEY
+ return INFINITE_STOP_KEY;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * 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!");
+ 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 __STARTKEYINCLUSIVE_ISSET_ID = 0;
+ private static final int __STOPKEYINCLUSIVE_ISSET_ID = 1;
+ private static final int __INFINITESTARTKEY_ISSET_ID = 2;
+ private static final int __INFINITESTOPKEY_ISSET_ID = 3;
+ private BitSet __isset_bit_vector = new BitSet(4);
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.START, new org.apache.thrift.meta_data.FieldMetaData("start", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TKey.class)));
+ tmpMap.put(_Fields.STOP, new org.apache.thrift.meta_data.FieldMetaData("stop", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TKey.class)));
+ tmpMap.put(_Fields.START_KEY_INCLUSIVE, new org.apache.thrift.meta_data.FieldMetaData("startKeyInclusive", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.STOP_KEY_INCLUSIVE, new org.apache.thrift.meta_data.FieldMetaData("stopKeyInclusive", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.INFINITE_START_KEY, new org.apache.thrift.meta_data.FieldMetaData("infiniteStartKey", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.INFINITE_STOP_KEY, new org.apache.thrift.meta_data.FieldMetaData("infiniteStopKey", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRange.class, metaDataMap);
+ }
+
+ public TRange() {
+ }
+
+ public TRange(
+ TKey start,
+ TKey stop,
+ boolean startKeyInclusive,
+ boolean stopKeyInclusive,
+ boolean infiniteStartKey,
+ boolean infiniteStopKey)
+ {
+ this();
+ this.start = start;
+ this.stop = stop;
+ this.startKeyInclusive = startKeyInclusive;
+ setStartKeyInclusiveIsSet(true);
+ this.stopKeyInclusive = stopKeyInclusive;
+ setStopKeyInclusiveIsSet(true);
+ this.infiniteStartKey = infiniteStartKey;
+ setInfiniteStartKeyIsSet(true);
+ this.infiniteStopKey = infiniteStopKey;
+ setInfiniteStopKeyIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public TRange(TRange other) {
+ __isset_bit_vector.clear();
+ __isset_bit_vector.or(other.__isset_bit_vector);
+ if (other.isSetStart()) {
+ this.start = new TKey(other.start);
+ }
+ if (other.isSetStop()) {
+ this.stop = new TKey(other.stop);
+ }
+ this.startKeyInclusive = other.startKeyInclusive;
+ this.stopKeyInclusive = other.stopKeyInclusive;
+ this.infiniteStartKey = other.infiniteStartKey;
+ this.infiniteStopKey = other.infiniteStopKey;
+ }
+
+ public TRange deepCopy() {
+ return new TRange(this);
+ }
+
+ @Override
+ public void clear() {
+ this.start = null;
+ this.stop = null;
+ setStartKeyInclusiveIsSet(false);
+ this.startKeyInclusive = false;
+ setStopKeyInclusiveIsSet(false);
+ this.stopKeyInclusive = false;
+ setInfiniteStartKeyIsSet(false);
+ this.infiniteStartKey = false;
+ setInfiniteStopKeyIsSet(false);
+ this.infiniteStopKey = false;
+ }
+
+ public TKey getStart() {
+ return this.start;
+ }
+
+ public TRange setStart(TKey start) {
+ this.start = start;
+ return this;
+ }
+
+ public void unsetStart() {
+ this.start = null;
+ }
+
+ /** Returns true if field start is set (has been assigned a value) and false otherwise */
+ public boolean isSetStart() {
+ return this.start != null;
+ }
+
+ public void setStartIsSet(boolean value) {
+ if (!value) {
+ this.start = null;
+ }
+ }
+
+ public TKey getStop() {
+ return this.stop;
+ }
+
+ public TRange setStop(TKey stop) {
+ this.stop = stop;
+ return this;
+ }
+
+ public void unsetStop() {
+ this.stop = null;
+ }
+
+ /** Returns true if field stop is set (has been assigned a value) and false otherwise */
+ public boolean isSetStop() {
+ return this.stop != null;
+ }
+
+ public void setStopIsSet(boolean value) {
+ if (!value) {
+ this.stop = null;
+ }
+ }
+
+ public boolean isStartKeyInclusive() {
+ return this.startKeyInclusive;
+ }
+
+ public TRange setStartKeyInclusive(boolean startKeyInclusive) {
+ this.startKeyInclusive = startKeyInclusive;
+ setStartKeyInclusiveIsSet(true);
+ return this;
+ }
+
+ public void unsetStartKeyInclusive() {
+ __isset_bit_vector.clear(__STARTKEYINCLUSIVE_ISSET_ID);
+ }
+
+ /** Returns true if field startKeyInclusive is set (has been assigned a value) and false otherwise */
+ public boolean isSetStartKeyInclusive() {
+ return __isset_bit_vector.get(__STARTKEYINCLUSIVE_ISSET_ID);
+ }
+
+ public void setStartKeyInclusiveIsSet(boolean value) {
+ __isset_bit_vector.set(__STARTKEYINCLUSIVE_ISSET_ID, value);
+ }
+
+ public boolean isStopKeyInclusive() {
+ return this.stopKeyInclusive;
+ }
+
+ public TRange setStopKeyInclusive(boolean stopKeyInclusive) {
+ this.stopKeyInclusive = stopKeyInclusive;
+ setStopKeyInclusiveIsSet(true);
+ return this;
+ }
+
+ public void unsetStopKeyInclusive() {
+ __isset_bit_vector.clear(__STOPKEYINCLUSIVE_ISSET_ID);
+ }
+
+ /** Returns true if field stopKeyInclusive is set (has been assigned a value) and false otherwise */
+ public boolean isSetStopKeyInclusive() {
+ return __isset_bit_vector.get(__STOPKEYINCLUSIVE_ISSET_ID);
+ }
+
+ public void setStopKeyInclusiveIsSet(boolean value) {
+ __isset_bit_vector.set(__STOPKEYINCLUSIVE_ISSET_ID, value);
+ }
+
+ public boolean isInfiniteStartKey() {
+ return this.infiniteStartKey;
+ }
+
+ public TRange setInfiniteStartKey(boolean infiniteStartKey) {
+ this.infiniteStartKey = infiniteStartKey;
+ setInfiniteStartKeyIsSet(true);
+ return this;
+ }
+
+ public void unsetInfiniteStartKey() {
+ __isset_bit_vector.clear(__INFINITESTARTKEY_ISSET_ID);
+ }
+
+ /** Returns true if field infiniteStartKey is set (has been assigned a value) and false otherwise */
+ public boolean isSetInfiniteStartKey() {
+ return __isset_bit_vector.get(__INFINITESTARTKEY_ISSET_ID);
+ }
+
+ public void setInfiniteStartKeyIsSet(boolean value) {
+ __isset_bit_vector.set(__INFINITESTARTKEY_ISSET_ID, value);
+ }
+
+ public boolean isInfiniteStopKey() {
+ return this.infiniteStopKey;
+ }
+
+ public TRange setInfiniteStopKey(boolean infiniteStopKey) {
+ this.infiniteStopKey = infiniteStopKey;
+ setInfiniteStopKeyIsSet(true);
+ return this;
+ }
+
+ public void unsetInfiniteStopKey() {
+ __isset_bit_vector.clear(__INFINITESTOPKEY_ISSET_ID);
+ }
+
+ /** Returns true if field infiniteStopKey is set (has been assigned a value) and false otherwise */
+ public boolean isSetInfiniteStopKey() {
+ return __isset_bit_vector.get(__INFINITESTOPKEY_ISSET_ID);
+ }
+
+ public void setInfiniteStopKeyIsSet(boolean value) {
+ __isset_bit_vector.set(__INFINITESTOPKEY_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case START:
+ if (value == null) {
+ unsetStart();
+ } else {
+ setStart((TKey)value);
+ }
+ break;
+
+ case STOP:
+ if (value == null) {
+ unsetStop();
+ } else {
+ setStop((TKey)value);
+ }
+ break;
+
+ case START_KEY_INCLUSIVE:
+ if (value == null) {
+ unsetStartKeyInclusive();
+ } else {
+ setStartKeyInclusive((Boolean)value);
+ }
+ break;
+
+ case STOP_KEY_INCLUSIVE:
+ if (value == null) {
+ unsetStopKeyInclusive();
+ } else {
+ setStopKeyInclusive((Boolean)value);
+ }
+ break;
+
+ case INFINITE_START_KEY:
+ if (value == null) {
+ unsetInfiniteStartKey();
+ } else {
+ setInfiniteStartKey((Boolean)value);
+ }
+ break;
+
+ case INFINITE_STOP_KEY:
+ if (value == null) {
+ unsetInfiniteStopKey();
+ } else {
+ setInfiniteStopKey((Boolean)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case START:
+ return getStart();
+
+ case STOP:
+ return getStop();
+
+ case START_KEY_INCLUSIVE:
+ return Boolean.valueOf(isStartKeyInclusive());
+
+ case STOP_KEY_INCLUSIVE:
+ return Boolean.valueOf(isStopKeyInclusive());
+
+ case INFINITE_START_KEY:
+ return Boolean.valueOf(isInfiniteStartKey());
+
+ case INFINITE_STOP_KEY:
+ return Boolean.valueOf(isInfiniteStopKey());
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case START:
+ return isSetStart();
+ case STOP:
+ return isSetStop();
+ case START_KEY_INCLUSIVE:
+ return isSetStartKeyInclusive();
+ case STOP_KEY_INCLUSIVE:
+ return isSetStopKeyInclusive();
+ case INFINITE_START_KEY:
+ return isSetInfiniteStartKey();
+ case INFINITE_STOP_KEY:
+ return isSetInfiniteStopKey();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof TRange)
+ return this.equals((TRange)that);
+ return false;
+ }
+
+ public boolean equals(TRange that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_start = true && this.isSetStart();
+ boolean that_present_start = true && that.isSetStart();
+ if (this_present_start || that_present_start) {
+ if (!(this_present_start && that_present_start))
+ return false;
+ if (!this.start.equals(that.start))
+ return false;
+ }
+
+ boolean this_present_stop = true && this.isSetStop();
+ boolean that_present_stop = true && that.isSetStop();
+ if (this_present_stop || that_present_stop) {
+ if (!(this_present_stop && that_present_stop))
+ return false;
+ if (!this.stop.equals(that.stop))
+ return false;
+ }
+
+ boolean this_present_startKeyInclusive = true;
+ boolean that_present_startKeyInclusive = true;
+ if (this_present_startKeyInclusive || that_present_startKeyInclusive) {
+ if (!(this_present_startKeyInclusive && that_present_startKeyInclusive))
+ return false;
+ if (this.startKeyInclusive != that.startKeyInclusive)
+ return false;
+ }
+
+ boolean this_present_stopKeyInclusive = true;
+ boolean that_present_stopKeyInclusive = true;
+ if (this_present_stopKeyInclusive || that_present_stopKeyInclusive) {
+ if (!(this_present_stopKeyInclusive && that_present_stopKeyInclusive))
+ return false;
+ if (this.stopKeyInclusive != that.stopKeyInclusive)
+ return false;
+ }
+
+ boolean this_present_infiniteStartKey = true;
+ boolean that_present_infiniteStartKey = true;
+ if (this_present_infiniteStartKey || that_present_infiniteStartKey) {
+ if (!(this_present_infiniteStartKey && that_present_infiniteStartKey))
+ return false;
+ if (this.infiniteStartKey != that.infiniteStartKey)
+ return false;
+ }
+
+ boolean this_present_infiniteStopKey = true;
+ boolean that_present_infiniteStopKey = true;
+ if (this_present_infiniteStopKey || that_present_infiniteStopKey) {
+ if (!(this_present_infiniteStopKey && that_present_infiniteStopKey))
+ return false;
+ if (this.infiniteStopKey != that.infiniteStopKey)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(TRange other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ TRange typedOther = (TRange)other;
+
+ lastComparison = Boolean.valueOf(isSetStart()).compareTo(typedOther.isSetStart());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetStart()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.start, typedOther.start);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetStop()).compareTo(typedOther.isSetStop());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetStop()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stop, typedOther.stop);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetStartKeyInclusive()).compareTo(typedOther.isSetStartKeyInclusive());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetStartKeyInclusive()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startKeyInclusive, typedOther.startKeyInclusive);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetStopKeyInclusive()).compareTo(typedOther.isSetStopKeyInclusive());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetStopKeyInclusive()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stopKeyInclusive, typedOther.stopKeyInclusive);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetInfiniteStartKey()).compareTo(typedOther.isSetInfiniteStartKey());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetInfiniteStartKey()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infiniteStartKey, typedOther.infiniteStartKey);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetInfiniteStopKey()).compareTo(typedOther.isSetInfiniteStopKey());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetInfiniteStopKey()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infiniteStopKey, typedOther.infiniteStopKey);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("TRange(");
+ boolean first = true;
+
+ sb.append("start:");
+ if (this.start == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.start);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("stop:");
+ if (this.stop == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.stop);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("startKeyInclusive:");
+ sb.append(this.startKeyInclusive);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("stopKeyInclusive:");
+ sb.append(this.stopKeyInclusive);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("infiniteStartKey:");
+ sb.append(this.infiniteStartKey);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("infiniteStopKey:");
+ sb.append(this.infiniteStopKey);
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+ __isset_bit_vector = new BitSet(1);
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class TRangeStandardSchemeFactory implements SchemeFactory {
+ public TRangeStandardScheme getScheme() {
+ return new TRangeStandardScheme();
+ }
+ }
+
+ private static class TRangeStandardScheme extends StandardScheme<TRange> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TRange struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // START
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.start = new TKey();
+ struct.start.read(iprot);
+ struct.setStartIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // STOP
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.stop = new TKey();
+ struct.stop.read(iprot);
+ struct.setStopIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // START_KEY_INCLUSIVE
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.startKeyInclusive = iprot.readBool();
+ struct.setStartKeyInclusiveIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // STOP_KEY_INCLUSIVE
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.stopKeyInclusive = iprot.readBool();
+ struct.setStopKeyInclusiveIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // INFINITE_START_KEY
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.infiniteStartKey = iprot.readBool();
+ struct.setInfiniteStartKeyIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // INFINITE_STOP_KEY
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.infiniteStopKey = iprot.readBool();
+ struct.setInfiniteStopKeyIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, TRange struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.start != null) {
+ oprot.writeFieldBegin(START_FIELD_DESC);
+ struct.start.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.stop != null) {
+ oprot.writeFieldBegin(STOP_FIELD_DESC);
+ struct.stop.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(START_KEY_INCLUSIVE_FIELD_DESC);
+ oprot.writeBool(struct.startKeyInclusive);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(STOP_KEY_INCLUSIVE_FIELD_DESC);
+ oprot.writeBool(struct.stopKeyInclusive);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(INFINITE_START_KEY_FIELD_DESC);
+ oprot.writeBool(struct.infiniteStartKey);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(INFINITE_STOP_KEY_FIELD_DESC);
+ oprot.writeBool(struct.infiniteStopKey);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TRangeTupleSchemeFactory implements SchemeFactory {
+ public TRangeTupleScheme getScheme() {
+ return new TRangeTupleScheme();
+ }
+ }
+
+ private static class TRangeTupleScheme extends TupleScheme<TRange> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TRange struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetStart()) {
+ optionals.set(0);
+ }
+ if (struct.isSetStop()) {
+ optionals.set(1);
+ }
+ if (struct.isSetStartKeyInclusive()) {
+ optionals.set(2);
+ }
+ if (struct.isSetStopKeyInclusive()) {
+ optionals.set(3);
+ }
+ if (struct.isSetInfiniteStartKey()) {
+ optionals.set(4);
+ }
+ if (struct.isSetInfiniteStopKey()) {
+ optionals.set(5);
+ }
+ oprot.writeBitSet(optionals, 6);
+ if (struct.isSetStart()) {
+ struct.start.write(oprot);
+ }
+ if (struct.isSetStop()) {
+ struct.stop.write(oprot);
+ }
+ if (struct.isSetStartKeyInclusive()) {
+ oprot.writeBool(struct.startKeyInclusive);
+ }
+ if (struct.isSetStopKeyInclusive()) {
+ oprot.writeBool(struct.stopKeyInclusive);
+ }
+ if (struct.isSetInfiniteStartKey()) {
+ oprot.writeBool(struct.infiniteStartKey);
+ }
+ if (struct.isSetInfiniteStopKey()) {
+ oprot.writeBool(struct.infiniteStopKey);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TRange struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(6);
+ if (incoming.get(0)) {
+ struct.start = new TKey();
+ struct.start.read(iprot);
+ struct.setStartIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.stop = new TKey();
+ struct.stop.read(iprot);
+ struct.setStopIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.startKeyInclusive = iprot.readBool();
+ struct.setStartKeyInclusiveIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.stopKeyInclusive = iprot.readBool();
+ struct.setStopKeyInclusiveIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.infiniteStartKey = iprot.readBool();
+ struct.setInfiniteStartKeyIsSet(true);
+ }
+ if (incoming.get(5)) {
+ struct.infiniteStopKey = iprot.readBool();
+ struct.setInfiniteStopKeyIsSet(true);
+ }
+ }
+ }
+
+}
+