You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2012/11/06 22:22:30 UTC
svn commit: r1406339 [8/17] - in /hbase/trunk: ./ examples/ hbase-examples/
hbase-examples/src/ hbase-examples/src/main/ hbase-examples/src/main/cpp/
hbase-examples/src/main/cpp/gen-cpp/ hbase-examples/src/main/java/
hbase-examples/src/main/java/org/ h...
Added: hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java?rev=1406339&view=auto
==============================================================================
--- hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java (added)
+++ hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java Tue Nov 6 21:22:27 2012
@@ -0,0 +1,1015 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.hadoop.hbase.thrift.generated;
+
+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 org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+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;
+
+/**
+ * A TRegionInfo contains information about an HTable region.
+ */
+public class TRegionInfo implements org.apache.thrift.TBase<TRegionInfo, TRegionInfo._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRegionInfo");
+
+ private static final org.apache.thrift.protocol.TField START_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("startKey", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField END_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("endKey", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)3);
+ private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)4);
+ private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.BYTE, (short)5);
+ private static final org.apache.thrift.protocol.TField SERVER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("serverName", org.apache.thrift.protocol.TType.STRING, (short)6);
+ private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)7);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TRegionInfoStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TRegionInfoTupleSchemeFactory());
+ }
+
+ public ByteBuffer startKey; // required
+ public ByteBuffer endKey; // required
+ public long id; // required
+ public ByteBuffer name; // required
+ public byte version; // required
+ public ByteBuffer serverName; // required
+ public int port; // 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_KEY((short)1, "startKey"),
+ END_KEY((short)2, "endKey"),
+ ID((short)3, "id"),
+ NAME((short)4, "name"),
+ VERSION((short)5, "version"),
+ SERVER_NAME((short)6, "serverName"),
+ PORT((short)7, "port");
+
+ 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_KEY
+ return START_KEY;
+ case 2: // END_KEY
+ return END_KEY;
+ case 3: // ID
+ return ID;
+ case 4: // NAME
+ return NAME;
+ case 5: // VERSION
+ return VERSION;
+ case 6: // SERVER_NAME
+ return SERVER_NAME;
+ case 7: // PORT
+ return PORT;
+ 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 __ID_ISSET_ID = 0;
+ private static final int __VERSION_ISSET_ID = 1;
+ private static final int __PORT_ISSET_ID = 2;
+ private byte __isset_bitfield = 0;
+ 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_KEY, new org.apache.thrift.meta_data.FieldMetaData("startKey", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")));
+ tmpMap.put(_Fields.END_KEY, new org.apache.thrift.meta_data.FieldMetaData("endKey", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")));
+ tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+ tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")));
+ tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
+ tmpMap.put(_Fields.SERVER_NAME, new org.apache.thrift.meta_data.FieldMetaData("serverName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")));
+ tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", 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(TRegionInfo.class, metaDataMap);
+ }
+
+ public TRegionInfo() {
+ }
+
+ public TRegionInfo(
+ ByteBuffer startKey,
+ ByteBuffer endKey,
+ long id,
+ ByteBuffer name,
+ byte version,
+ ByteBuffer serverName,
+ int port)
+ {
+ this();
+ this.startKey = startKey;
+ this.endKey = endKey;
+ this.id = id;
+ setIdIsSet(true);
+ this.name = name;
+ this.version = version;
+ setVersionIsSet(true);
+ this.serverName = serverName;
+ this.port = port;
+ setPortIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public TRegionInfo(TRegionInfo other) {
+ __isset_bitfield = other.__isset_bitfield;
+ if (other.isSetStartKey()) {
+ this.startKey = other.startKey;
+ }
+ if (other.isSetEndKey()) {
+ this.endKey = other.endKey;
+ }
+ this.id = other.id;
+ if (other.isSetName()) {
+ this.name = other.name;
+ }
+ this.version = other.version;
+ if (other.isSetServerName()) {
+ this.serverName = other.serverName;
+ }
+ this.port = other.port;
+ }
+
+ public TRegionInfo deepCopy() {
+ return new TRegionInfo(this);
+ }
+
+ @Override
+ public void clear() {
+ this.startKey = null;
+ this.endKey = null;
+ setIdIsSet(false);
+ this.id = 0;
+ this.name = null;
+ setVersionIsSet(false);
+ this.version = 0;
+ this.serverName = null;
+ setPortIsSet(false);
+ this.port = 0;
+ }
+
+ public byte[] getStartKey() {
+ setStartKey(org.apache.thrift.TBaseHelper.rightSize(startKey));
+ return startKey == null ? null : startKey.array();
+ }
+
+ public ByteBuffer bufferForStartKey() {
+ return startKey;
+ }
+
+ public TRegionInfo setStartKey(byte[] startKey) {
+ setStartKey(startKey == null ? (ByteBuffer)null : ByteBuffer.wrap(startKey));
+ return this;
+ }
+
+ public TRegionInfo setStartKey(ByteBuffer startKey) {
+ this.startKey = startKey;
+ return this;
+ }
+
+ public void unsetStartKey() {
+ this.startKey = null;
+ }
+
+ /** Returns true if field startKey is set (has been assigned a value) and false otherwise */
+ public boolean isSetStartKey() {
+ return this.startKey != null;
+ }
+
+ public void setStartKeyIsSet(boolean value) {
+ if (!value) {
+ this.startKey = null;
+ }
+ }
+
+ public byte[] getEndKey() {
+ setEndKey(org.apache.thrift.TBaseHelper.rightSize(endKey));
+ return endKey == null ? null : endKey.array();
+ }
+
+ public ByteBuffer bufferForEndKey() {
+ return endKey;
+ }
+
+ public TRegionInfo setEndKey(byte[] endKey) {
+ setEndKey(endKey == null ? (ByteBuffer)null : ByteBuffer.wrap(endKey));
+ return this;
+ }
+
+ public TRegionInfo setEndKey(ByteBuffer endKey) {
+ this.endKey = endKey;
+ return this;
+ }
+
+ public void unsetEndKey() {
+ this.endKey = null;
+ }
+
+ /** Returns true if field endKey is set (has been assigned a value) and false otherwise */
+ public boolean isSetEndKey() {
+ return this.endKey != null;
+ }
+
+ public void setEndKeyIsSet(boolean value) {
+ if (!value) {
+ this.endKey = null;
+ }
+ }
+
+ public long getId() {
+ return this.id;
+ }
+
+ public TRegionInfo setId(long id) {
+ this.id = id;
+ setIdIsSet(true);
+ return this;
+ }
+
+ public void unsetId() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID);
+ }
+
+ /** Returns true if field id is set (has been assigned a value) and false otherwise */
+ public boolean isSetId() {
+ return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID);
+ }
+
+ public void setIdIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value);
+ }
+
+ public byte[] getName() {
+ setName(org.apache.thrift.TBaseHelper.rightSize(name));
+ return name == null ? null : name.array();
+ }
+
+ public ByteBuffer bufferForName() {
+ return name;
+ }
+
+ public TRegionInfo setName(byte[] name) {
+ setName(name == null ? (ByteBuffer)null : ByteBuffer.wrap(name));
+ return this;
+ }
+
+ public TRegionInfo setName(ByteBuffer name) {
+ this.name = name;
+ return this;
+ }
+
+ public void unsetName() {
+ this.name = null;
+ }
+
+ /** Returns true if field name is set (has been assigned a value) and false otherwise */
+ public boolean isSetName() {
+ return this.name != null;
+ }
+
+ public void setNameIsSet(boolean value) {
+ if (!value) {
+ this.name = null;
+ }
+ }
+
+ public byte getVersion() {
+ return this.version;
+ }
+
+ public TRegionInfo setVersion(byte version) {
+ this.version = version;
+ setVersionIsSet(true);
+ return this;
+ }
+
+ public void unsetVersion() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VERSION_ISSET_ID);
+ }
+
+ /** Returns true if field version is set (has been assigned a value) and false otherwise */
+ public boolean isSetVersion() {
+ return EncodingUtils.testBit(__isset_bitfield, __VERSION_ISSET_ID);
+ }
+
+ public void setVersionIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VERSION_ISSET_ID, value);
+ }
+
+ public byte[] getServerName() {
+ setServerName(org.apache.thrift.TBaseHelper.rightSize(serverName));
+ return serverName == null ? null : serverName.array();
+ }
+
+ public ByteBuffer bufferForServerName() {
+ return serverName;
+ }
+
+ public TRegionInfo setServerName(byte[] serverName) {
+ setServerName(serverName == null ? (ByteBuffer)null : ByteBuffer.wrap(serverName));
+ return this;
+ }
+
+ public TRegionInfo setServerName(ByteBuffer serverName) {
+ this.serverName = serverName;
+ return this;
+ }
+
+ public void unsetServerName() {
+ this.serverName = null;
+ }
+
+ /** Returns true if field serverName is set (has been assigned a value) and false otherwise */
+ public boolean isSetServerName() {
+ return this.serverName != null;
+ }
+
+ public void setServerNameIsSet(boolean value) {
+ if (!value) {
+ this.serverName = null;
+ }
+ }
+
+ public int getPort() {
+ return this.port;
+ }
+
+ public TRegionInfo setPort(int port) {
+ this.port = port;
+ setPortIsSet(true);
+ return this;
+ }
+
+ public void unsetPort() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PORT_ISSET_ID);
+ }
+
+ /** Returns true if field port is set (has been assigned a value) and false otherwise */
+ public boolean isSetPort() {
+ return EncodingUtils.testBit(__isset_bitfield, __PORT_ISSET_ID);
+ }
+
+ public void setPortIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PORT_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case START_KEY:
+ if (value == null) {
+ unsetStartKey();
+ } else {
+ setStartKey((ByteBuffer)value);
+ }
+ break;
+
+ case END_KEY:
+ if (value == null) {
+ unsetEndKey();
+ } else {
+ setEndKey((ByteBuffer)value);
+ }
+ break;
+
+ case ID:
+ if (value == null) {
+ unsetId();
+ } else {
+ setId((Long)value);
+ }
+ break;
+
+ case NAME:
+ if (value == null) {
+ unsetName();
+ } else {
+ setName((ByteBuffer)value);
+ }
+ break;
+
+ case VERSION:
+ if (value == null) {
+ unsetVersion();
+ } else {
+ setVersion((Byte)value);
+ }
+ break;
+
+ case SERVER_NAME:
+ if (value == null) {
+ unsetServerName();
+ } else {
+ setServerName((ByteBuffer)value);
+ }
+ break;
+
+ case PORT:
+ if (value == null) {
+ unsetPort();
+ } else {
+ setPort((Integer)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case START_KEY:
+ return getStartKey();
+
+ case END_KEY:
+ return getEndKey();
+
+ case ID:
+ return Long.valueOf(getId());
+
+ case NAME:
+ return getName();
+
+ case VERSION:
+ return Byte.valueOf(getVersion());
+
+ case SERVER_NAME:
+ return getServerName();
+
+ case PORT:
+ return Integer.valueOf(getPort());
+
+ }
+ 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_KEY:
+ return isSetStartKey();
+ case END_KEY:
+ return isSetEndKey();
+ case ID:
+ return isSetId();
+ case NAME:
+ return isSetName();
+ case VERSION:
+ return isSetVersion();
+ case SERVER_NAME:
+ return isSetServerName();
+ case PORT:
+ return isSetPort();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof TRegionInfo)
+ return this.equals((TRegionInfo)that);
+ return false;
+ }
+
+ public boolean equals(TRegionInfo that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_startKey = true && this.isSetStartKey();
+ boolean that_present_startKey = true && that.isSetStartKey();
+ if (this_present_startKey || that_present_startKey) {
+ if (!(this_present_startKey && that_present_startKey))
+ return false;
+ if (!this.startKey.equals(that.startKey))
+ return false;
+ }
+
+ boolean this_present_endKey = true && this.isSetEndKey();
+ boolean that_present_endKey = true && that.isSetEndKey();
+ if (this_present_endKey || that_present_endKey) {
+ if (!(this_present_endKey && that_present_endKey))
+ return false;
+ if (!this.endKey.equals(that.endKey))
+ return false;
+ }
+
+ boolean this_present_id = true;
+ boolean that_present_id = true;
+ if (this_present_id || that_present_id) {
+ if (!(this_present_id && that_present_id))
+ return false;
+ if (this.id != that.id)
+ return false;
+ }
+
+ boolean this_present_name = true && this.isSetName();
+ boolean that_present_name = true && that.isSetName();
+ if (this_present_name || that_present_name) {
+ if (!(this_present_name && that_present_name))
+ return false;
+ if (!this.name.equals(that.name))
+ return false;
+ }
+
+ boolean this_present_version = true;
+ boolean that_present_version = true;
+ if (this_present_version || that_present_version) {
+ if (!(this_present_version && that_present_version))
+ return false;
+ if (this.version != that.version)
+ return false;
+ }
+
+ boolean this_present_serverName = true && this.isSetServerName();
+ boolean that_present_serverName = true && that.isSetServerName();
+ if (this_present_serverName || that_present_serverName) {
+ if (!(this_present_serverName && that_present_serverName))
+ return false;
+ if (!this.serverName.equals(that.serverName))
+ return false;
+ }
+
+ boolean this_present_port = true;
+ boolean that_present_port = true;
+ if (this_present_port || that_present_port) {
+ if (!(this_present_port && that_present_port))
+ return false;
+ if (this.port != that.port)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(TRegionInfo other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ TRegionInfo typedOther = (TRegionInfo)other;
+
+ lastComparison = Boolean.valueOf(isSetStartKey()).compareTo(typedOther.isSetStartKey());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetStartKey()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startKey, typedOther.startKey);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetEndKey()).compareTo(typedOther.isSetEndKey());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetEndKey()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endKey, typedOther.endKey);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetVersion()).compareTo(typedOther.isSetVersion());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetVersion()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, typedOther.version);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetServerName()).compareTo(typedOther.isSetServerName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetServerName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverName, typedOther.serverName);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetPort()).compareTo(typedOther.isSetPort());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetPort()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, typedOther.port);
+ 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("TRegionInfo(");
+ boolean first = true;
+
+ sb.append("startKey:");
+ if (this.startKey == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.startKey);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("endKey:");
+ if (this.endKey == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.endKey);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("id:");
+ sb.append(this.id);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("name:");
+ if (this.name == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.name);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("version:");
+ sb.append(this.version);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("serverName:");
+ if (this.serverName == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.serverName);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("port:");
+ sb.append(this.port);
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ 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_bitfield = 0;
+ 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 TRegionInfoStandardSchemeFactory implements SchemeFactory {
+ public TRegionInfoStandardScheme getScheme() {
+ return new TRegionInfoStandardScheme();
+ }
+ }
+
+ private static class TRegionInfoStandardScheme extends StandardScheme<TRegionInfo> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TRegionInfo 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_KEY
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.startKey = iprot.readBinary();
+ struct.setStartKeyIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // END_KEY
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.endKey = iprot.readBinary();
+ struct.setEndKeyIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.id = iprot.readI64();
+ struct.setIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.name = iprot.readBinary();
+ struct.setNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // VERSION
+ if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) {
+ struct.version = iprot.readByte();
+ struct.setVersionIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // SERVER_NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.serverName = iprot.readBinary();
+ struct.setServerNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 7: // PORT
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.port = iprot.readI32();
+ struct.setPortIsSet(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, TRegionInfo struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.startKey != null) {
+ oprot.writeFieldBegin(START_KEY_FIELD_DESC);
+ oprot.writeBinary(struct.startKey);
+ oprot.writeFieldEnd();
+ }
+ if (struct.endKey != null) {
+ oprot.writeFieldBegin(END_KEY_FIELD_DESC);
+ oprot.writeBinary(struct.endKey);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(ID_FIELD_DESC);
+ oprot.writeI64(struct.id);
+ oprot.writeFieldEnd();
+ if (struct.name != null) {
+ oprot.writeFieldBegin(NAME_FIELD_DESC);
+ oprot.writeBinary(struct.name);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(VERSION_FIELD_DESC);
+ oprot.writeByte(struct.version);
+ oprot.writeFieldEnd();
+ if (struct.serverName != null) {
+ oprot.writeFieldBegin(SERVER_NAME_FIELD_DESC);
+ oprot.writeBinary(struct.serverName);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(PORT_FIELD_DESC);
+ oprot.writeI32(struct.port);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TRegionInfoTupleSchemeFactory implements SchemeFactory {
+ public TRegionInfoTupleScheme getScheme() {
+ return new TRegionInfoTupleScheme();
+ }
+ }
+
+ private static class TRegionInfoTupleScheme extends TupleScheme<TRegionInfo> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TRegionInfo struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetStartKey()) {
+ optionals.set(0);
+ }
+ if (struct.isSetEndKey()) {
+ optionals.set(1);
+ }
+ if (struct.isSetId()) {
+ optionals.set(2);
+ }
+ if (struct.isSetName()) {
+ optionals.set(3);
+ }
+ if (struct.isSetVersion()) {
+ optionals.set(4);
+ }
+ if (struct.isSetServerName()) {
+ optionals.set(5);
+ }
+ if (struct.isSetPort()) {
+ optionals.set(6);
+ }
+ oprot.writeBitSet(optionals, 7);
+ if (struct.isSetStartKey()) {
+ oprot.writeBinary(struct.startKey);
+ }
+ if (struct.isSetEndKey()) {
+ oprot.writeBinary(struct.endKey);
+ }
+ if (struct.isSetId()) {
+ oprot.writeI64(struct.id);
+ }
+ if (struct.isSetName()) {
+ oprot.writeBinary(struct.name);
+ }
+ if (struct.isSetVersion()) {
+ oprot.writeByte(struct.version);
+ }
+ if (struct.isSetServerName()) {
+ oprot.writeBinary(struct.serverName);
+ }
+ if (struct.isSetPort()) {
+ oprot.writeI32(struct.port);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TRegionInfo struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(7);
+ if (incoming.get(0)) {
+ struct.startKey = iprot.readBinary();
+ struct.setStartKeyIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.endKey = iprot.readBinary();
+ struct.setEndKeyIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.id = iprot.readI64();
+ struct.setIdIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.name = iprot.readBinary();
+ struct.setNameIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.version = iprot.readByte();
+ struct.setVersionIsSet(true);
+ }
+ if (incoming.get(5)) {
+ struct.serverName = iprot.readBinary();
+ struct.setServerNameIsSet(true);
+ }
+ if (incoming.get(6)) {
+ struct.port = iprot.readI32();
+ struct.setPortIsSet(true);
+ }
+ }
+ }
+
+}
+
Added: hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java?rev=1406339&view=auto
==============================================================================
--- hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java (added)
+++ hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java Tue Nov 6 21:22:27 2012
@@ -0,0 +1,564 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.hadoop.hbase.thrift.generated;
+
+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 org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+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;
+
+/**
+ * Holds row name and then a map of columns to cells.
+ */
+public class TRowResult implements org.apache.thrift.TBase<TRowResult, TRowResult._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowResult");
+
+ 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 COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.MAP, (short)2);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TRowResultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TRowResultTupleSchemeFactory());
+ }
+
+ public ByteBuffer row; // required
+ public Map<ByteBuffer,TCell> columns; // 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"),
+ COLUMNS((short)2, "columns");
+
+ 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: // COLUMNS
+ return COLUMNS;
+ 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.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 , "Text")));
+ tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text"),
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCell.class))));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRowResult.class, metaDataMap);
+ }
+
+ public TRowResult() {
+ }
+
+ public TRowResult(
+ ByteBuffer row,
+ Map<ByteBuffer,TCell> columns)
+ {
+ this();
+ this.row = row;
+ this.columns = columns;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public TRowResult(TRowResult other) {
+ if (other.isSetRow()) {
+ this.row = other.row;
+ }
+ if (other.isSetColumns()) {
+ Map<ByteBuffer,TCell> __this__columns = new HashMap<ByteBuffer,TCell>();
+ for (Map.Entry<ByteBuffer, TCell> other_element : other.columns.entrySet()) {
+
+ ByteBuffer other_element_key = other_element.getKey();
+ TCell other_element_value = other_element.getValue();
+
+ ByteBuffer __this__columns_copy_key = other_element_key;
+
+ TCell __this__columns_copy_value = new TCell(other_element_value);
+
+ __this__columns.put(__this__columns_copy_key, __this__columns_copy_value);
+ }
+ this.columns = __this__columns;
+ }
+ }
+
+ public TRowResult deepCopy() {
+ return new TRowResult(this);
+ }
+
+ @Override
+ public void clear() {
+ this.row = null;
+ this.columns = null;
+ }
+
+ public byte[] getRow() {
+ setRow(org.apache.thrift.TBaseHelper.rightSize(row));
+ return row == null ? null : row.array();
+ }
+
+ public ByteBuffer bufferForRow() {
+ return row;
+ }
+
+ public TRowResult setRow(byte[] row) {
+ setRow(row == null ? (ByteBuffer)null : ByteBuffer.wrap(row));
+ return this;
+ }
+
+ public TRowResult 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 int getColumnsSize() {
+ return (this.columns == null) ? 0 : this.columns.size();
+ }
+
+ public void putToColumns(ByteBuffer key, TCell val) {
+ if (this.columns == null) {
+ this.columns = new HashMap<ByteBuffer,TCell>();
+ }
+ this.columns.put(key, val);
+ }
+
+ public Map<ByteBuffer,TCell> getColumns() {
+ return this.columns;
+ }
+
+ public TRowResult setColumns(Map<ByteBuffer,TCell> columns) {
+ this.columns = columns;
+ return this;
+ }
+
+ public void unsetColumns() {
+ this.columns = null;
+ }
+
+ /** Returns true if field columns is set (has been assigned a value) and false otherwise */
+ public boolean isSetColumns() {
+ return this.columns != null;
+ }
+
+ public void setColumnsIsSet(boolean value) {
+ if (!value) {
+ this.columns = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case ROW:
+ if (value == null) {
+ unsetRow();
+ } else {
+ setRow((ByteBuffer)value);
+ }
+ break;
+
+ case COLUMNS:
+ if (value == null) {
+ unsetColumns();
+ } else {
+ setColumns((Map<ByteBuffer,TCell>)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case ROW:
+ return getRow();
+
+ case COLUMNS:
+ return getColumns();
+
+ }
+ 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 COLUMNS:
+ return isSetColumns();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof TRowResult)
+ return this.equals((TRowResult)that);
+ return false;
+ }
+
+ public boolean equals(TRowResult 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_columns = true && this.isSetColumns();
+ boolean that_present_columns = true && that.isSetColumns();
+ if (this_present_columns || that_present_columns) {
+ if (!(this_present_columns && that_present_columns))
+ return false;
+ if (!this.columns.equals(that.columns))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(TRowResult other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ TRowResult typedOther = (TRowResult)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(isSetColumns()).compareTo(typedOther.isSetColumns());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetColumns()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns);
+ 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("TRowResult(");
+ boolean first = true;
+
+ sb.append("row:");
+ if (this.row == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.row);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("columns:");
+ if (this.columns == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.columns);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ 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 TRowResultStandardSchemeFactory implements SchemeFactory {
+ public TRowResultStandardScheme getScheme() {
+ return new TRowResultStandardScheme();
+ }
+ }
+
+ private static class TRowResultStandardScheme extends StandardScheme<TRowResult> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TRowResult 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: // COLUMNS
+ if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+ {
+ org.apache.thrift.protocol.TMap _map8 = iprot.readMapBegin();
+ struct.columns = new HashMap<ByteBuffer,TCell>(2*_map8.size);
+ for (int _i9 = 0; _i9 < _map8.size; ++_i9)
+ {
+ ByteBuffer _key10; // required
+ TCell _val11; // required
+ _key10 = iprot.readBinary();
+ _val11 = new TCell();
+ _val11.read(iprot);
+ struct.columns.put(_key10, _val11);
+ }
+ iprot.readMapEnd();
+ }
+ struct.setColumnsIsSet(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, TRowResult 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.columns != null) {
+ oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
+ {
+ oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.columns.size()));
+ for (Map.Entry<ByteBuffer, TCell> _iter12 : struct.columns.entrySet())
+ {
+ oprot.writeBinary(_iter12.getKey());
+ _iter12.getValue().write(oprot);
+ }
+ oprot.writeMapEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TRowResultTupleSchemeFactory implements SchemeFactory {
+ public TRowResultTupleScheme getScheme() {
+ return new TRowResultTupleScheme();
+ }
+ }
+
+ private static class TRowResultTupleScheme extends TupleScheme<TRowResult> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TRowResult struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetRow()) {
+ optionals.set(0);
+ }
+ if (struct.isSetColumns()) {
+ optionals.set(1);
+ }
+ oprot.writeBitSet(optionals, 2);
+ if (struct.isSetRow()) {
+ oprot.writeBinary(struct.row);
+ }
+ if (struct.isSetColumns()) {
+ {
+ oprot.writeI32(struct.columns.size());
+ for (Map.Entry<ByteBuffer, TCell> _iter13 : struct.columns.entrySet())
+ {
+ oprot.writeBinary(_iter13.getKey());
+ _iter13.getValue().write(oprot);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TRowResult struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(2);
+ if (incoming.get(0)) {
+ struct.row = iprot.readBinary();
+ struct.setRowIsSet(true);
+ }
+ if (incoming.get(1)) {
+ {
+ org.apache.thrift.protocol.TMap _map14 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.columns = new HashMap<ByteBuffer,TCell>(2*_map14.size);
+ for (int _i15 = 0; _i15 < _map14.size; ++_i15)
+ {
+ ByteBuffer _key16; // required
+ TCell _val17; // required
+ _key16 = iprot.readBinary();
+ _val17 = new TCell();
+ _val17.read(iprot);
+ struct.columns.put(_key16, _val17);
+ }
+ }
+ struct.setColumnsIsSet(true);
+ }
+ }
+ }
+
+}
+
Added: hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java?rev=1406339&view=auto
==============================================================================
--- hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java (added)
+++ hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift/generated/TScan.java Tue Nov 6 21:22:27 2012
@@ -0,0 +1,969 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.hadoop.hbase.thrift.generated;
+
+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 org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+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;
+
+/**
+ * A Scan object is used to specify scanner parameters when opening a scanner.
+ */
+public class TScan implements org.apache.thrift.TBase<TScan, TScan._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TScan");
+
+ private static final org.apache.thrift.protocol.TField START_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("startRow", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField STOP_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("stopRow", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)3);
+ private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)4);
+ private static final org.apache.thrift.protocol.TField CACHING_FIELD_DESC = new org.apache.thrift.protocol.TField("caching", org.apache.thrift.protocol.TType.I32, (short)5);
+ private static final org.apache.thrift.protocol.TField FILTER_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("filterString", org.apache.thrift.protocol.TType.STRING, (short)6);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TScanStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TScanTupleSchemeFactory());
+ }
+
+ public ByteBuffer startRow; // optional
+ public ByteBuffer stopRow; // optional
+ public long timestamp; // optional
+ public List<ByteBuffer> columns; // optional
+ public int caching; // optional
+ public ByteBuffer filterString; // optional
+
+ /** 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_ROW((short)1, "startRow"),
+ STOP_ROW((short)2, "stopRow"),
+ TIMESTAMP((short)3, "timestamp"),
+ COLUMNS((short)4, "columns"),
+ CACHING((short)5, "caching"),
+ FILTER_STRING((short)6, "filterString");
+
+ 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_ROW
+ return START_ROW;
+ case 2: // STOP_ROW
+ return STOP_ROW;
+ case 3: // TIMESTAMP
+ return TIMESTAMP;
+ case 4: // COLUMNS
+ return COLUMNS;
+ case 5: // CACHING
+ return CACHING;
+ case 6: // FILTER_STRING
+ return FILTER_STRING;
+ 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 __TIMESTAMP_ISSET_ID = 0;
+ private static final int __CACHING_ISSET_ID = 1;
+ private byte __isset_bitfield = 0;
+ private _Fields optionals[] = {_Fields.START_ROW,_Fields.STOP_ROW,_Fields.TIMESTAMP,_Fields.COLUMNS,_Fields.CACHING,_Fields.FILTER_STRING};
+ 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_ROW, new org.apache.thrift.meta_data.FieldMetaData("startRow", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")));
+ tmpMap.put(_Fields.STOP_ROW, new org.apache.thrift.meta_data.FieldMetaData("stopRow", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")));
+ tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+ tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ 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 , "Text"))));
+ tmpMap.put(_Fields.CACHING, new org.apache.thrift.meta_data.FieldMetaData("caching", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+ tmpMap.put(_Fields.FILTER_STRING, new org.apache.thrift.meta_data.FieldMetaData("filterString", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TScan.class, metaDataMap);
+ }
+
+ public TScan() {
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public TScan(TScan other) {
+ __isset_bitfield = other.__isset_bitfield;
+ if (other.isSetStartRow()) {
+ this.startRow = other.startRow;
+ }
+ if (other.isSetStopRow()) {
+ this.stopRow = other.stopRow;
+ }
+ this.timestamp = other.timestamp;
+ if (other.isSetColumns()) {
+ List<ByteBuffer> __this__columns = new ArrayList<ByteBuffer>();
+ for (ByteBuffer other_element : other.columns) {
+ __this__columns.add(other_element);
+ }
+ this.columns = __this__columns;
+ }
+ this.caching = other.caching;
+ if (other.isSetFilterString()) {
+ this.filterString = other.filterString;
+ }
+ }
+
+ public TScan deepCopy() {
+ return new TScan(this);
+ }
+
+ @Override
+ public void clear() {
+ this.startRow = null;
+ this.stopRow = null;
+ setTimestampIsSet(false);
+ this.timestamp = 0;
+ this.columns = null;
+ setCachingIsSet(false);
+ this.caching = 0;
+ this.filterString = null;
+ }
+
+ public byte[] getStartRow() {
+ setStartRow(org.apache.thrift.TBaseHelper.rightSize(startRow));
+ return startRow == null ? null : startRow.array();
+ }
+
+ public ByteBuffer bufferForStartRow() {
+ return startRow;
+ }
+
+ public TScan setStartRow(byte[] startRow) {
+ setStartRow(startRow == null ? (ByteBuffer)null : ByteBuffer.wrap(startRow));
+ return this;
+ }
+
+ public TScan setStartRow(ByteBuffer startRow) {
+ this.startRow = startRow;
+ return this;
+ }
+
+ public void unsetStartRow() {
+ this.startRow = null;
+ }
+
+ /** Returns true if field startRow is set (has been assigned a value) and false otherwise */
+ public boolean isSetStartRow() {
+ return this.startRow != null;
+ }
+
+ public void setStartRowIsSet(boolean value) {
+ if (!value) {
+ this.startRow = null;
+ }
+ }
+
+ public byte[] getStopRow() {
+ setStopRow(org.apache.thrift.TBaseHelper.rightSize(stopRow));
+ return stopRow == null ? null : stopRow.array();
+ }
+
+ public ByteBuffer bufferForStopRow() {
+ return stopRow;
+ }
+
+ public TScan setStopRow(byte[] stopRow) {
+ setStopRow(stopRow == null ? (ByteBuffer)null : ByteBuffer.wrap(stopRow));
+ return this;
+ }
+
+ public TScan setStopRow(ByteBuffer stopRow) {
+ this.stopRow = stopRow;
+ return this;
+ }
+
+ public void unsetStopRow() {
+ this.stopRow = null;
+ }
+
+ /** Returns true if field stopRow is set (has been assigned a value) and false otherwise */
+ public boolean isSetStopRow() {
+ return this.stopRow != null;
+ }
+
+ public void setStopRowIsSet(boolean value) {
+ if (!value) {
+ this.stopRow = null;
+ }
+ }
+
+ public long getTimestamp() {
+ return this.timestamp;
+ }
+
+ public TScan setTimestamp(long timestamp) {
+ this.timestamp = timestamp;
+ setTimestampIsSet(true);
+ return this;
+ }
+
+ public void unsetTimestamp() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID);
+ }
+
+ /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */
+ public boolean isSetTimestamp() {
+ return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID);
+ }
+
+ public void setTimestampIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value);
+ }
+
+ public int getColumnsSize() {
+ return (this.columns == null) ? 0 : this.columns.size();
+ }
+
+ public java.util.Iterator<ByteBuffer> getColumnsIterator() {
+ return (this.columns == null) ? null : this.columns.iterator();
+ }
+
+ public void addToColumns(ByteBuffer elem) {
+ if (this.columns == null) {
+ this.columns = new ArrayList<ByteBuffer>();
+ }
+ this.columns.add(elem);
+ }
+
+ public List<ByteBuffer> getColumns() {
+ return this.columns;
+ }
+
+ public TScan setColumns(List<ByteBuffer> columns) {
+ this.columns = columns;
+ return this;
+ }
+
+ public void unsetColumns() {
+ this.columns = null;
+ }
+
+ /** Returns true if field columns is set (has been assigned a value) and false otherwise */
+ public boolean isSetColumns() {
+ return this.columns != null;
+ }
+
+ public void setColumnsIsSet(boolean value) {
+ if (!value) {
+ this.columns = null;
+ }
+ }
+
+ public int getCaching() {
+ return this.caching;
+ }
+
+ public TScan setCaching(int caching) {
+ this.caching = caching;
+ setCachingIsSet(true);
+ return this;
+ }
+
+ public void unsetCaching() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CACHING_ISSET_ID);
+ }
+
+ /** Returns true if field caching is set (has been assigned a value) and false otherwise */
+ public boolean isSetCaching() {
+ return EncodingUtils.testBit(__isset_bitfield, __CACHING_ISSET_ID);
+ }
+
+ public void setCachingIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CACHING_ISSET_ID, value);
+ }
+
+ public byte[] getFilterString() {
+ setFilterString(org.apache.thrift.TBaseHelper.rightSize(filterString));
+ return filterString == null ? null : filterString.array();
+ }
+
+ public ByteBuffer bufferForFilterString() {
+ return filterString;
+ }
+
+ public TScan setFilterString(byte[] filterString) {
+ setFilterString(filterString == null ? (ByteBuffer)null : ByteBuffer.wrap(filterString));
+ return this;
+ }
+
+ public TScan setFilterString(ByteBuffer filterString) {
+ this.filterString = filterString;
+ return this;
+ }
+
+ public void unsetFilterString() {
+ this.filterString = null;
+ }
+
+ /** Returns true if field filterString is set (has been assigned a value) and false otherwise */
+ public boolean isSetFilterString() {
+ return this.filterString != null;
+ }
+
+ public void setFilterStringIsSet(boolean value) {
+ if (!value) {
+ this.filterString = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case START_ROW:
+ if (value == null) {
+ unsetStartRow();
+ } else {
+ setStartRow((ByteBuffer)value);
+ }
+ break;
+
+ case STOP_ROW:
+ if (value == null) {
+ unsetStopRow();
+ } else {
+ setStopRow((ByteBuffer)value);
+ }
+ break;
+
+ case TIMESTAMP:
+ if (value == null) {
+ unsetTimestamp();
+ } else {
+ setTimestamp((Long)value);
+ }
+ break;
+
+ case COLUMNS:
+ if (value == null) {
+ unsetColumns();
+ } else {
+ setColumns((List<ByteBuffer>)value);
+ }
+ break;
+
+ case CACHING:
+ if (value == null) {
+ unsetCaching();
+ } else {
+ setCaching((Integer)value);
+ }
+ break;
+
+ case FILTER_STRING:
+ if (value == null) {
+ unsetFilterString();
+ } else {
+ setFilterString((ByteBuffer)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case START_ROW:
+ return getStartRow();
+
+ case STOP_ROW:
+ return getStopRow();
+
+ case TIMESTAMP:
+ return Long.valueOf(getTimestamp());
+
+ case COLUMNS:
+ return getColumns();
+
+ case CACHING:
+ return Integer.valueOf(getCaching());
+
+ case FILTER_STRING:
+ return getFilterString();
+
+ }
+ 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_ROW:
+ return isSetStartRow();
+ case STOP_ROW:
+ return isSetStopRow();
+ case TIMESTAMP:
+ return isSetTimestamp();
+ case COLUMNS:
+ return isSetColumns();
+ case CACHING:
+ return isSetCaching();
+ case FILTER_STRING:
+ return isSetFilterString();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof TScan)
+ return this.equals((TScan)that);
+ return false;
+ }
+
+ public boolean equals(TScan that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_startRow = true && this.isSetStartRow();
+ boolean that_present_startRow = true && that.isSetStartRow();
+ if (this_present_startRow || that_present_startRow) {
+ if (!(this_present_startRow && that_present_startRow))
+ return false;
+ if (!this.startRow.equals(that.startRow))
+ return false;
+ }
+
+ boolean this_present_stopRow = true && this.isSetStopRow();
+ boolean that_present_stopRow = true && that.isSetStopRow();
+ if (this_present_stopRow || that_present_stopRow) {
+ if (!(this_present_stopRow && that_present_stopRow))
+ return false;
+ if (!this.stopRow.equals(that.stopRow))
+ return false;
+ }
+
+ boolean this_present_timestamp = true && this.isSetTimestamp();
+ boolean that_present_timestamp = true && that.isSetTimestamp();
+ if (this_present_timestamp || that_present_timestamp) {
+ if (!(this_present_timestamp && that_present_timestamp))
+ return false;
+ if (this.timestamp != that.timestamp)
+ return false;
+ }
+
+ boolean this_present_columns = true && this.isSetColumns();
+ boolean that_present_columns = true && that.isSetColumns();
+ if (this_present_columns || that_present_columns) {
+ if (!(this_present_columns && that_present_columns))
+ return false;
+ if (!this.columns.equals(that.columns))
+ return false;
+ }
+
+ boolean this_present_caching = true && this.isSetCaching();
+ boolean that_present_caching = true && that.isSetCaching();
+ if (this_present_caching || that_present_caching) {
+ if (!(this_present_caching && that_present_caching))
+ return false;
+ if (this.caching != that.caching)
+ return false;
+ }
+
+ boolean this_present_filterString = true && this.isSetFilterString();
+ boolean that_present_filterString = true && that.isSetFilterString();
+ if (this_present_filterString || that_present_filterString) {
+ if (!(this_present_filterString && that_present_filterString))
+ return false;
+ if (!this.filterString.equals(that.filterString))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(TScan other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ TScan typedOther = (TScan)other;
+
+ lastComparison = Boolean.valueOf(isSetStartRow()).compareTo(typedOther.isSetStartRow());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetStartRow()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRow, typedOther.startRow);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetStopRow()).compareTo(typedOther.isSetStopRow());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetStopRow()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stopRow, typedOther.stopRow);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetTimestamp()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetColumns()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetCaching()).compareTo(typedOther.isSetCaching());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetCaching()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.caching, typedOther.caching);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetFilterString()).compareTo(typedOther.isSetFilterString());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetFilterString()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.filterString, typedOther.filterString);
+ 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("TScan(");
+ boolean first = true;
+
+ if (isSetStartRow()) {
+ sb.append("startRow:");
+ if (this.startRow == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.startRow);
+ }
+ first = false;
+ }
+ if (isSetStopRow()) {
+ if (!first) sb.append(", ");
+ sb.append("stopRow:");
+ if (this.stopRow == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.stopRow);
+ }
+ first = false;
+ }
+ if (isSetTimestamp()) {
+ if (!first) sb.append(", ");
+ sb.append("timestamp:");
+ sb.append(this.timestamp);
+ first = false;
+ }
+ if (isSetColumns()) {
+ if (!first) sb.append(", ");
+ sb.append("columns:");
+ if (this.columns == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.columns);
+ }
+ first = false;
+ }
+ if (isSetCaching()) {
+ if (!first) sb.append(", ");
+ sb.append("caching:");
+ sb.append(this.caching);
+ first = false;
+ }
+ if (isSetFilterString()) {
+ if (!first) sb.append(", ");
+ sb.append("filterString:");
+ if (this.filterString == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.filterString);
+ }
+ first = false;
+ }
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ 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_bitfield = 0;
+ 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 TScanStandardSchemeFactory implements SchemeFactory {
+ public TScanStandardScheme getScheme() {
+ return new TScanStandardScheme();
+ }
+ }
+
+ private static class TScanStandardScheme extends StandardScheme<TScan> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TScan 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_ROW
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.startRow = iprot.readBinary();
+ struct.setStartRowIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // STOP_ROW
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.stopRow = iprot.readBinary();
+ struct.setStopRowIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // TIMESTAMP
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.timestamp = iprot.readI64();
+ struct.setTimestampIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // COLUMNS
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list18 = iprot.readListBegin();
+ struct.columns = new ArrayList<ByteBuffer>(_list18.size);
+ for (int _i19 = 0; _i19 < _list18.size; ++_i19)
+ {
+ ByteBuffer _elem20; // required
+ _elem20 = iprot.readBinary();
+ struct.columns.add(_elem20);
+ }
+ iprot.readListEnd();
+ }
+ struct.setColumnsIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // CACHING
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.caching = iprot.readI32();
+ struct.setCachingIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // FILTER_STRING
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.filterString = iprot.readBinary();
+ struct.setFilterStringIsSet(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, TScan struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.startRow != null) {
+ if (struct.isSetStartRow()) {
+ oprot.writeFieldBegin(START_ROW_FIELD_DESC);
+ oprot.writeBinary(struct.startRow);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.stopRow != null) {
+ if (struct.isSetStopRow()) {
+ oprot.writeFieldBegin(STOP_ROW_FIELD_DESC);
+ oprot.writeBinary(struct.stopRow);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.isSetTimestamp()) {
+ oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
+ oprot.writeI64(struct.timestamp);
+ oprot.writeFieldEnd();
+ }
+ if (struct.columns != null) {
+ if (struct.isSetColumns()) {
+ oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.columns.size()));
+ for (ByteBuffer _iter21 : struct.columns)
+ {
+ oprot.writeBinary(_iter21);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.isSetCaching()) {
+ oprot.writeFieldBegin(CACHING_FIELD_DESC);
+ oprot.writeI32(struct.caching);
+ oprot.writeFieldEnd();
+ }
+ if (struct.filterString != null) {
+ if (struct.isSetFilterString()) {
+ oprot.writeFieldBegin(FILTER_STRING_FIELD_DESC);
+ oprot.writeBinary(struct.filterString);
+ oprot.writeFieldEnd();
+ }
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TScanTupleSchemeFactory implements SchemeFactory {
+ public TScanTupleScheme getScheme() {
+ return new TScanTupleScheme();
+ }
+ }
+
+ private static class TScanTupleScheme extends TupleScheme<TScan> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TScan struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetStartRow()) {
+ optionals.set(0);
+ }
+ if (struct.isSetStopRow()) {
+ optionals.set(1);
+ }
+ if (struct.isSetTimestamp()) {
+ optionals.set(2);
+ }
+ if (struct.isSetColumns()) {
+ optionals.set(3);
+ }
+ if (struct.isSetCaching()) {
+ optionals.set(4);
+ }
+ if (struct.isSetFilterString()) {
+ optionals.set(5);
+ }
+ oprot.writeBitSet(optionals, 6);
+ if (struct.isSetStartRow()) {
+ oprot.writeBinary(struct.startRow);
+ }
+ if (struct.isSetStopRow()) {
+ oprot.writeBinary(struct.stopRow);
+ }
+ if (struct.isSetTimestamp()) {
+ oprot.writeI64(struct.timestamp);
+ }
+ if (struct.isSetColumns()) {
+ {
+ oprot.writeI32(struct.columns.size());
+ for (ByteBuffer _iter22 : struct.columns)
+ {
+ oprot.writeBinary(_iter22);
+ }
+ }
+ }
+ if (struct.isSetCaching()) {
+ oprot.writeI32(struct.caching);
+ }
+ if (struct.isSetFilterString()) {
+ oprot.writeBinary(struct.filterString);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TScan struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(6);
+ if (incoming.get(0)) {
+ struct.startRow = iprot.readBinary();
+ struct.setStartRowIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.stopRow = iprot.readBinary();
+ struct.setStopRowIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.timestamp = iprot.readI64();
+ struct.setTimestampIsSet(true);
+ }
+ if (incoming.get(3)) {
+ {
+ org.apache.thrift.protocol.TList _list23 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.columns = new ArrayList<ByteBuffer>(_list23.size);
+ for (int _i24 = 0; _i24 < _list23.size; ++_i24)
+ {
+ ByteBuffer _elem25; // required
+ _elem25 = iprot.readBinary();
+ struct.columns.add(_elem25);
+ }
+ }
+ struct.setColumnsIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.caching = iprot.readI32();
+ struct.setCachingIsSet(true);
+ }
+ if (incoming.get(5)) {
+ struct.filterString = iprot.readBinary();
+ struct.setFilterStringIsSet(true);
+ }
+ }
+ }
+
+}
+