HBASE-8890 Fix Thrift 2 example class location
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1501722 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a2516d3bc0
commit
8bf99de619
|
@ -1,390 +0,0 @@
|
|||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* An AlreadyExists exceptions signals that a table with the specified
|
||||
* name already exists
|
||||
*/
|
||||
public class AlreadyExists extends TException implements org.apache.thrift.TBase<AlreadyExists, AlreadyExists._Fields>, java.io.Serializable, Cloneable {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AlreadyExists");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new AlreadyExistsStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new AlreadyExistsTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public String message; // 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 {
|
||||
MESSAGE((short)1, "message");
|
||||
|
||||
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: // MESSAGE
|
||||
return MESSAGE;
|
||||
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.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AlreadyExists.class, metaDataMap);
|
||||
}
|
||||
|
||||
public AlreadyExists() {
|
||||
}
|
||||
|
||||
public AlreadyExists(
|
||||
String message)
|
||||
{
|
||||
this();
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public AlreadyExists(AlreadyExists other) {
|
||||
if (other.isSetMessage()) {
|
||||
this.message = other.message;
|
||||
}
|
||||
}
|
||||
|
||||
public AlreadyExists deepCopy() {
|
||||
return new AlreadyExists(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.message = null;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return this.message;
|
||||
}
|
||||
|
||||
public AlreadyExists setMessage(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetMessage() {
|
||||
this.message = null;
|
||||
}
|
||||
|
||||
/** Returns true if field message is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetMessage() {
|
||||
return this.message != null;
|
||||
}
|
||||
|
||||
public void setMessageIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.message = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case MESSAGE:
|
||||
if (value == null) {
|
||||
unsetMessage();
|
||||
} else {
|
||||
setMessage((String)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case MESSAGE:
|
||||
return getMessage();
|
||||
|
||||
}
|
||||
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 MESSAGE:
|
||||
return isSetMessage();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof AlreadyExists)
|
||||
return this.equals((AlreadyExists)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(AlreadyExists that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_message = true && this.isSetMessage();
|
||||
boolean that_present_message = true && that.isSetMessage();
|
||||
if (this_present_message || that_present_message) {
|
||||
if (!(this_present_message && that_present_message))
|
||||
return false;
|
||||
if (!this.message.equals(that.message))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int compareTo(AlreadyExists other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
AlreadyExists typedOther = (AlreadyExists)other;
|
||||
|
||||
lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetMessage()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, typedOther.message);
|
||||
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("AlreadyExists(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("message:");
|
||||
if (this.message == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.message);
|
||||
}
|
||||
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 AlreadyExistsStandardSchemeFactory implements SchemeFactory {
|
||||
public AlreadyExistsStandardScheme getScheme() {
|
||||
return new AlreadyExistsStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class AlreadyExistsStandardScheme extends StandardScheme<AlreadyExists> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, AlreadyExists 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: // MESSAGE
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
struct.message = iprot.readString();
|
||||
struct.setMessageIsSet(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, AlreadyExists struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
if (struct.message != null) {
|
||||
oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
|
||||
oprot.writeString(struct.message);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class AlreadyExistsTupleSchemeFactory implements SchemeFactory {
|
||||
public AlreadyExistsTupleScheme getScheme() {
|
||||
return new AlreadyExistsTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class AlreadyExistsTupleScheme extends TupleScheme<AlreadyExists> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, AlreadyExists struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetMessage()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 1);
|
||||
if (struct.isSetMessage()) {
|
||||
oprot.writeString(struct.message);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, AlreadyExists struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
BitSet incoming = iprot.readBitSet(1);
|
||||
if (incoming.get(0)) {
|
||||
struct.message = iprot.readString();
|
||||
struct.setMessageIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,553 +0,0 @@
|
|||
/**
|
||||
* 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 BatchMutation object is used to apply a number of Mutations to a single row.
|
||||
*/
|
||||
public class BatchMutation implements org.apache.thrift.TBase<BatchMutation, BatchMutation._Fields>, java.io.Serializable, Cloneable {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BatchMutation");
|
||||
|
||||
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 MUTATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("mutations", org.apache.thrift.protocol.TType.LIST, (short)2);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new BatchMutationStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new BatchMutationTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public ByteBuffer row; // required
|
||||
public List<Mutation> mutations; // 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"),
|
||||
MUTATIONS((short)2, "mutations");
|
||||
|
||||
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: // MUTATIONS
|
||||
return MUTATIONS;
|
||||
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.MUTATIONS, new org.apache.thrift.meta_data.FieldMetaData("mutations", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
||||
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
|
||||
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Mutation.class))));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BatchMutation.class, metaDataMap);
|
||||
}
|
||||
|
||||
public BatchMutation() {
|
||||
}
|
||||
|
||||
public BatchMutation(
|
||||
ByteBuffer row,
|
||||
List<Mutation> mutations)
|
||||
{
|
||||
this();
|
||||
this.row = row;
|
||||
this.mutations = mutations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public BatchMutation(BatchMutation other) {
|
||||
if (other.isSetRow()) {
|
||||
this.row = other.row;
|
||||
}
|
||||
if (other.isSetMutations()) {
|
||||
List<Mutation> __this__mutations = new ArrayList<Mutation>();
|
||||
for (Mutation other_element : other.mutations) {
|
||||
__this__mutations.add(new Mutation(other_element));
|
||||
}
|
||||
this.mutations = __this__mutations;
|
||||
}
|
||||
}
|
||||
|
||||
public BatchMutation deepCopy() {
|
||||
return new BatchMutation(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.row = null;
|
||||
this.mutations = null;
|
||||
}
|
||||
|
||||
public byte[] getRow() {
|
||||
setRow(org.apache.thrift.TBaseHelper.rightSize(row));
|
||||
return row == null ? null : row.array();
|
||||
}
|
||||
|
||||
public ByteBuffer bufferForRow() {
|
||||
return row;
|
||||
}
|
||||
|
||||
public BatchMutation setRow(byte[] row) {
|
||||
setRow(row == null ? (ByteBuffer)null : ByteBuffer.wrap(row));
|
||||
return this;
|
||||
}
|
||||
|
||||
public BatchMutation 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 getMutationsSize() {
|
||||
return (this.mutations == null) ? 0 : this.mutations.size();
|
||||
}
|
||||
|
||||
public java.util.Iterator<Mutation> getMutationsIterator() {
|
||||
return (this.mutations == null) ? null : this.mutations.iterator();
|
||||
}
|
||||
|
||||
public void addToMutations(Mutation elem) {
|
||||
if (this.mutations == null) {
|
||||
this.mutations = new ArrayList<Mutation>();
|
||||
}
|
||||
this.mutations.add(elem);
|
||||
}
|
||||
|
||||
public List<Mutation> getMutations() {
|
||||
return this.mutations;
|
||||
}
|
||||
|
||||
public BatchMutation setMutations(List<Mutation> mutations) {
|
||||
this.mutations = mutations;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetMutations() {
|
||||
this.mutations = null;
|
||||
}
|
||||
|
||||
/** Returns true if field mutations is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetMutations() {
|
||||
return this.mutations != null;
|
||||
}
|
||||
|
||||
public void setMutationsIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.mutations = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case ROW:
|
||||
if (value == null) {
|
||||
unsetRow();
|
||||
} else {
|
||||
setRow((ByteBuffer)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case MUTATIONS:
|
||||
if (value == null) {
|
||||
unsetMutations();
|
||||
} else {
|
||||
setMutations((List<Mutation>)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case ROW:
|
||||
return getRow();
|
||||
|
||||
case MUTATIONS:
|
||||
return getMutations();
|
||||
|
||||
}
|
||||
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 MUTATIONS:
|
||||
return isSetMutations();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof BatchMutation)
|
||||
return this.equals((BatchMutation)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(BatchMutation 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_mutations = true && this.isSetMutations();
|
||||
boolean that_present_mutations = true && that.isSetMutations();
|
||||
if (this_present_mutations || that_present_mutations) {
|
||||
if (!(this_present_mutations && that_present_mutations))
|
||||
return false;
|
||||
if (!this.mutations.equals(that.mutations))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int compareTo(BatchMutation other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
BatchMutation typedOther = (BatchMutation)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(isSetMutations()).compareTo(typedOther.isSetMutations());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetMutations()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mutations, typedOther.mutations);
|
||||
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("BatchMutation(");
|
||||
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("mutations:");
|
||||
if (this.mutations == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.mutations);
|
||||
}
|
||||
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 BatchMutationStandardSchemeFactory implements SchemeFactory {
|
||||
public BatchMutationStandardScheme getScheme() {
|
||||
return new BatchMutationStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class BatchMutationStandardScheme extends StandardScheme<BatchMutation> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, BatchMutation 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: // MUTATIONS
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
|
||||
struct.mutations = new ArrayList<Mutation>(_list0.size);
|
||||
for (int _i1 = 0; _i1 < _list0.size; ++_i1)
|
||||
{
|
||||
Mutation _elem2; // required
|
||||
_elem2 = new Mutation();
|
||||
_elem2.read(iprot);
|
||||
struct.mutations.add(_elem2);
|
||||
}
|
||||
iprot.readListEnd();
|
||||
}
|
||||
struct.setMutationsIsSet(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, BatchMutation 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.mutations != null) {
|
||||
oprot.writeFieldBegin(MUTATIONS_FIELD_DESC);
|
||||
{
|
||||
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.mutations.size()));
|
||||
for (Mutation _iter3 : struct.mutations)
|
||||
{
|
||||
_iter3.write(oprot);
|
||||
}
|
||||
oprot.writeListEnd();
|
||||
}
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class BatchMutationTupleSchemeFactory implements SchemeFactory {
|
||||
public BatchMutationTupleScheme getScheme() {
|
||||
return new BatchMutationTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class BatchMutationTupleScheme extends TupleScheme<BatchMutation> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, BatchMutation struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetRow()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
if (struct.isSetMutations()) {
|
||||
optionals.set(1);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 2);
|
||||
if (struct.isSetRow()) {
|
||||
oprot.writeBinary(struct.row);
|
||||
}
|
||||
if (struct.isSetMutations()) {
|
||||
{
|
||||
oprot.writeI32(struct.mutations.size());
|
||||
for (Mutation _iter4 : struct.mutations)
|
||||
{
|
||||
_iter4.write(oprot);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, BatchMutation 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.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
|
||||
struct.mutations = new ArrayList<Mutation>(_list5.size);
|
||||
for (int _i6 = 0; _i6 < _list5.size; ++_i6)
|
||||
{
|
||||
Mutation _elem7; // required
|
||||
_elem7 = new Mutation();
|
||||
_elem7.read(iprot);
|
||||
struct.mutations.add(_elem7);
|
||||
}
|
||||
}
|
||||
struct.setMutationsIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,391 +0,0 @@
|
|||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* An IOError exception signals that an error occurred communicating
|
||||
* to the Hbase master or an Hbase region server. Also used to return
|
||||
* more general Hbase error conditions.
|
||||
*/
|
||||
public class IOError extends TException implements org.apache.thrift.TBase<IOError, IOError._Fields>, java.io.Serializable, Cloneable {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("IOError");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new IOErrorStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new IOErrorTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public String message; // 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 {
|
||||
MESSAGE((short)1, "message");
|
||||
|
||||
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: // MESSAGE
|
||||
return MESSAGE;
|
||||
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.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(IOError.class, metaDataMap);
|
||||
}
|
||||
|
||||
public IOError() {
|
||||
}
|
||||
|
||||
public IOError(
|
||||
String message)
|
||||
{
|
||||
this();
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public IOError(IOError other) {
|
||||
if (other.isSetMessage()) {
|
||||
this.message = other.message;
|
||||
}
|
||||
}
|
||||
|
||||
public IOError deepCopy() {
|
||||
return new IOError(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.message = null;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return this.message;
|
||||
}
|
||||
|
||||
public IOError setMessage(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetMessage() {
|
||||
this.message = null;
|
||||
}
|
||||
|
||||
/** Returns true if field message is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetMessage() {
|
||||
return this.message != null;
|
||||
}
|
||||
|
||||
public void setMessageIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.message = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case MESSAGE:
|
||||
if (value == null) {
|
||||
unsetMessage();
|
||||
} else {
|
||||
setMessage((String)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case MESSAGE:
|
||||
return getMessage();
|
||||
|
||||
}
|
||||
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 MESSAGE:
|
||||
return isSetMessage();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof IOError)
|
||||
return this.equals((IOError)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(IOError that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_message = true && this.isSetMessage();
|
||||
boolean that_present_message = true && that.isSetMessage();
|
||||
if (this_present_message || that_present_message) {
|
||||
if (!(this_present_message && that_present_message))
|
||||
return false;
|
||||
if (!this.message.equals(that.message))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int compareTo(IOError other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
IOError typedOther = (IOError)other;
|
||||
|
||||
lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetMessage()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, typedOther.message);
|
||||
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("IOError(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("message:");
|
||||
if (this.message == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.message);
|
||||
}
|
||||
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 IOErrorStandardSchemeFactory implements SchemeFactory {
|
||||
public IOErrorStandardScheme getScheme() {
|
||||
return new IOErrorStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class IOErrorStandardScheme extends StandardScheme<IOError> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, IOError 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: // MESSAGE
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
struct.message = iprot.readString();
|
||||
struct.setMessageIsSet(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, IOError struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
if (struct.message != null) {
|
||||
oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
|
||||
oprot.writeString(struct.message);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class IOErrorTupleSchemeFactory implements SchemeFactory {
|
||||
public IOErrorTupleScheme getScheme() {
|
||||
return new IOErrorTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class IOErrorTupleScheme extends TupleScheme<IOError> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, IOError struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetMessage()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 1);
|
||||
if (struct.isSetMessage()) {
|
||||
oprot.writeString(struct.message);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, IOError struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
BitSet incoming = iprot.readBitSet(1);
|
||||
if (incoming.get(0)) {
|
||||
struct.message = iprot.readString();
|
||||
struct.setMessageIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,390 +0,0 @@
|
|||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* An IllegalArgument exception indicates an illegal or invalid
|
||||
* argument was passed into a procedure.
|
||||
*/
|
||||
public class IllegalArgument extends TException implements org.apache.thrift.TBase<IllegalArgument, IllegalArgument._Fields>, java.io.Serializable, Cloneable {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("IllegalArgument");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new IllegalArgumentStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new IllegalArgumentTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public String message; // 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 {
|
||||
MESSAGE((short)1, "message");
|
||||
|
||||
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: // MESSAGE
|
||||
return MESSAGE;
|
||||
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.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(IllegalArgument.class, metaDataMap);
|
||||
}
|
||||
|
||||
public IllegalArgument() {
|
||||
}
|
||||
|
||||
public IllegalArgument(
|
||||
String message)
|
||||
{
|
||||
this();
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public IllegalArgument(IllegalArgument other) {
|
||||
if (other.isSetMessage()) {
|
||||
this.message = other.message;
|
||||
}
|
||||
}
|
||||
|
||||
public IllegalArgument deepCopy() {
|
||||
return new IllegalArgument(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.message = null;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return this.message;
|
||||
}
|
||||
|
||||
public IllegalArgument setMessage(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetMessage() {
|
||||
this.message = null;
|
||||
}
|
||||
|
||||
/** Returns true if field message is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetMessage() {
|
||||
return this.message != null;
|
||||
}
|
||||
|
||||
public void setMessageIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.message = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case MESSAGE:
|
||||
if (value == null) {
|
||||
unsetMessage();
|
||||
} else {
|
||||
setMessage((String)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case MESSAGE:
|
||||
return getMessage();
|
||||
|
||||
}
|
||||
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 MESSAGE:
|
||||
return isSetMessage();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof IllegalArgument)
|
||||
return this.equals((IllegalArgument)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(IllegalArgument that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_message = true && this.isSetMessage();
|
||||
boolean that_present_message = true && that.isSetMessage();
|
||||
if (this_present_message || that_present_message) {
|
||||
if (!(this_present_message && that_present_message))
|
||||
return false;
|
||||
if (!this.message.equals(that.message))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int compareTo(IllegalArgument other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
IllegalArgument typedOther = (IllegalArgument)other;
|
||||
|
||||
lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetMessage()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, typedOther.message);
|
||||
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("IllegalArgument(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("message:");
|
||||
if (this.message == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.message);
|
||||
}
|
||||
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 IllegalArgumentStandardSchemeFactory implements SchemeFactory {
|
||||
public IllegalArgumentStandardScheme getScheme() {
|
||||
return new IllegalArgumentStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class IllegalArgumentStandardScheme extends StandardScheme<IllegalArgument> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, IllegalArgument 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: // MESSAGE
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
struct.message = iprot.readString();
|
||||
struct.setMessageIsSet(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, IllegalArgument struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
if (struct.message != null) {
|
||||
oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
|
||||
oprot.writeString(struct.message);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class IllegalArgumentTupleSchemeFactory implements SchemeFactory {
|
||||
public IllegalArgumentTupleScheme getScheme() {
|
||||
return new IllegalArgumentTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class IllegalArgumentTupleScheme extends TupleScheme<IllegalArgument> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, IllegalArgument struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetMessage()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 1);
|
||||
if (struct.isSetMessage()) {
|
||||
oprot.writeString(struct.message);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, IllegalArgument struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
BitSet incoming = iprot.readBitSet(1);
|
||||
if (incoming.get(0)) {
|
||||
struct.message = iprot.readString();
|
||||
struct.setMessageIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,705 +0,0 @@
|
|||
/**
|
||||
* 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 Mutation object is used to either update or delete a column-value.
|
||||
*/
|
||||
public class Mutation implements org.apache.thrift.TBase<Mutation, Mutation._Fields>, java.io.Serializable, Cloneable {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Mutation");
|
||||
|
||||
private static final org.apache.thrift.protocol.TField IS_DELETE_FIELD_DESC = new org.apache.thrift.protocol.TField("isDelete", org.apache.thrift.protocol.TType.BOOL, (short)1);
|
||||
private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRING, (short)2);
|
||||
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)3);
|
||||
private static final org.apache.thrift.protocol.TField WRITE_TO_WAL_FIELD_DESC = new org.apache.thrift.protocol.TField("writeToWAL", org.apache.thrift.protocol.TType.BOOL, (short)4);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new MutationStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new MutationTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public boolean isDelete; // required
|
||||
public ByteBuffer column; // required
|
||||
public ByteBuffer value; // required
|
||||
public boolean writeToWAL; // 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 {
|
||||
IS_DELETE((short)1, "isDelete"),
|
||||
COLUMN((short)2, "column"),
|
||||
VALUE((short)3, "value"),
|
||||
WRITE_TO_WAL((short)4, "writeToWAL");
|
||||
|
||||
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: // IS_DELETE
|
||||
return IS_DELETE;
|
||||
case 2: // COLUMN
|
||||
return COLUMN;
|
||||
case 3: // VALUE
|
||||
return VALUE;
|
||||
case 4: // WRITE_TO_WAL
|
||||
return WRITE_TO_WAL;
|
||||
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 __ISDELETE_ISSET_ID = 0;
|
||||
private static final int __WRITETOWAL_ISSET_ID = 1;
|
||||
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.IS_DELETE, new org.apache.thrift.meta_data.FieldMetaData("isDelete", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
|
||||
tmpMap.put(_Fields.COLUMN, new org.apache.thrift.meta_data.FieldMetaData("column", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")));
|
||||
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 , "Text")));
|
||||
tmpMap.put(_Fields.WRITE_TO_WAL, new org.apache.thrift.meta_data.FieldMetaData("writeToWAL", 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(Mutation.class, metaDataMap);
|
||||
}
|
||||
|
||||
public Mutation() {
|
||||
this.isDelete = false;
|
||||
|
||||
this.writeToWAL = true;
|
||||
|
||||
}
|
||||
|
||||
public Mutation(
|
||||
boolean isDelete,
|
||||
ByteBuffer column,
|
||||
ByteBuffer value,
|
||||
boolean writeToWAL)
|
||||
{
|
||||
this();
|
||||
this.isDelete = isDelete;
|
||||
setIsDeleteIsSet(true);
|
||||
this.column = column;
|
||||
this.value = value;
|
||||
this.writeToWAL = writeToWAL;
|
||||
setWriteToWALIsSet(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public Mutation(Mutation other) {
|
||||
__isset_bitfield = other.__isset_bitfield;
|
||||
this.isDelete = other.isDelete;
|
||||
if (other.isSetColumn()) {
|
||||
this.column = other.column;
|
||||
}
|
||||
if (other.isSetValue()) {
|
||||
this.value = other.value;
|
||||
}
|
||||
this.writeToWAL = other.writeToWAL;
|
||||
}
|
||||
|
||||
public Mutation deepCopy() {
|
||||
return new Mutation(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.isDelete = false;
|
||||
|
||||
this.column = null;
|
||||
this.value = null;
|
||||
this.writeToWAL = true;
|
||||
|
||||
}
|
||||
|
||||
public boolean isIsDelete() {
|
||||
return this.isDelete;
|
||||
}
|
||||
|
||||
public Mutation setIsDelete(boolean isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
setIsDeleteIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetIsDelete() {
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISDELETE_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field isDelete is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetIsDelete() {
|
||||
return EncodingUtils.testBit(__isset_bitfield, __ISDELETE_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setIsDeleteIsSet(boolean value) {
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISDELETE_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public byte[] getColumn() {
|
||||
setColumn(org.apache.thrift.TBaseHelper.rightSize(column));
|
||||
return column == null ? null : column.array();
|
||||
}
|
||||
|
||||
public ByteBuffer bufferForColumn() {
|
||||
return column;
|
||||
}
|
||||
|
||||
public Mutation setColumn(byte[] column) {
|
||||
setColumn(column == null ? (ByteBuffer)null : ByteBuffer.wrap(column));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Mutation setColumn(ByteBuffer column) {
|
||||
this.column = column;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetColumn() {
|
||||
this.column = null;
|
||||
}
|
||||
|
||||
/** Returns true if field column is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetColumn() {
|
||||
return this.column != null;
|
||||
}
|
||||
|
||||
public void setColumnIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.column = null;
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] getValue() {
|
||||
setValue(org.apache.thrift.TBaseHelper.rightSize(value));
|
||||
return value == null ? null : value.array();
|
||||
}
|
||||
|
||||
public ByteBuffer bufferForValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Mutation setValue(byte[] value) {
|
||||
setValue(value == null ? (ByteBuffer)null : ByteBuffer.wrap(value));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Mutation 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 boolean isWriteToWAL() {
|
||||
return this.writeToWAL;
|
||||
}
|
||||
|
||||
public Mutation setWriteToWAL(boolean writeToWAL) {
|
||||
this.writeToWAL = writeToWAL;
|
||||
setWriteToWALIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetWriteToWAL() {
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WRITETOWAL_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field writeToWAL is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetWriteToWAL() {
|
||||
return EncodingUtils.testBit(__isset_bitfield, __WRITETOWAL_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setWriteToWALIsSet(boolean value) {
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WRITETOWAL_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case IS_DELETE:
|
||||
if (value == null) {
|
||||
unsetIsDelete();
|
||||
} else {
|
||||
setIsDelete((Boolean)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case COLUMN:
|
||||
if (value == null) {
|
||||
unsetColumn();
|
||||
} else {
|
||||
setColumn((ByteBuffer)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case VALUE:
|
||||
if (value == null) {
|
||||
unsetValue();
|
||||
} else {
|
||||
setValue((ByteBuffer)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case WRITE_TO_WAL:
|
||||
if (value == null) {
|
||||
unsetWriteToWAL();
|
||||
} else {
|
||||
setWriteToWAL((Boolean)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case IS_DELETE:
|
||||
return Boolean.valueOf(isIsDelete());
|
||||
|
||||
case COLUMN:
|
||||
return getColumn();
|
||||
|
||||
case VALUE:
|
||||
return getValue();
|
||||
|
||||
case WRITE_TO_WAL:
|
||||
return Boolean.valueOf(isWriteToWAL());
|
||||
|
||||
}
|
||||
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 IS_DELETE:
|
||||
return isSetIsDelete();
|
||||
case COLUMN:
|
||||
return isSetColumn();
|
||||
case VALUE:
|
||||
return isSetValue();
|
||||
case WRITE_TO_WAL:
|
||||
return isSetWriteToWAL();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof Mutation)
|
||||
return this.equals((Mutation)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(Mutation that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_isDelete = true;
|
||||
boolean that_present_isDelete = true;
|
||||
if (this_present_isDelete || that_present_isDelete) {
|
||||
if (!(this_present_isDelete && that_present_isDelete))
|
||||
return false;
|
||||
if (this.isDelete != that.isDelete)
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_column = true && this.isSetColumn();
|
||||
boolean that_present_column = true && that.isSetColumn();
|
||||
if (this_present_column || that_present_column) {
|
||||
if (!(this_present_column && that_present_column))
|
||||
return false;
|
||||
if (!this.column.equals(that.column))
|
||||
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;
|
||||
}
|
||||
|
||||
boolean this_present_writeToWAL = true;
|
||||
boolean that_present_writeToWAL = true;
|
||||
if (this_present_writeToWAL || that_present_writeToWAL) {
|
||||
if (!(this_present_writeToWAL && that_present_writeToWAL))
|
||||
return false;
|
||||
if (this.writeToWAL != that.writeToWAL)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int compareTo(Mutation other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
Mutation typedOther = (Mutation)other;
|
||||
|
||||
lastComparison = Boolean.valueOf(isSetIsDelete()).compareTo(typedOther.isSetIsDelete());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetIsDelete()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isDelete, typedOther.isDelete);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetColumn()).compareTo(typedOther.isSetColumn());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetColumn()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column, typedOther.column);
|
||||
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;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetWriteToWAL()).compareTo(typedOther.isSetWriteToWAL());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetWriteToWAL()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.writeToWAL, typedOther.writeToWAL);
|
||||
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("Mutation(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("isDelete:");
|
||||
sb.append(this.isDelete);
|
||||
first = false;
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("column:");
|
||||
if (this.column == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.column);
|
||||
}
|
||||
first = false;
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("value:");
|
||||
if (this.value == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.value);
|
||||
}
|
||||
first = false;
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("writeToWAL:");
|
||||
sb.append(this.writeToWAL);
|
||||
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 MutationStandardSchemeFactory implements SchemeFactory {
|
||||
public MutationStandardScheme getScheme() {
|
||||
return new MutationStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class MutationStandardScheme extends StandardScheme<Mutation> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, Mutation 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: // IS_DELETE
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
|
||||
struct.isDelete = iprot.readBool();
|
||||
struct.setIsDeleteIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 2: // COLUMN
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
struct.column = iprot.readBinary();
|
||||
struct.setColumnIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 3: // 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;
|
||||
case 4: // WRITE_TO_WAL
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
|
||||
struct.writeToWAL = iprot.readBool();
|
||||
struct.setWriteToWALIsSet(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, Mutation struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
oprot.writeFieldBegin(IS_DELETE_FIELD_DESC);
|
||||
oprot.writeBool(struct.isDelete);
|
||||
oprot.writeFieldEnd();
|
||||
if (struct.column != null) {
|
||||
oprot.writeFieldBegin(COLUMN_FIELD_DESC);
|
||||
oprot.writeBinary(struct.column);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (struct.value != null) {
|
||||
oprot.writeFieldBegin(VALUE_FIELD_DESC);
|
||||
oprot.writeBinary(struct.value);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldBegin(WRITE_TO_WAL_FIELD_DESC);
|
||||
oprot.writeBool(struct.writeToWAL);
|
||||
oprot.writeFieldEnd();
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class MutationTupleSchemeFactory implements SchemeFactory {
|
||||
public MutationTupleScheme getScheme() {
|
||||
return new MutationTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class MutationTupleScheme extends TupleScheme<Mutation> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, Mutation struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetIsDelete()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
if (struct.isSetColumn()) {
|
||||
optionals.set(1);
|
||||
}
|
||||
if (struct.isSetValue()) {
|
||||
optionals.set(2);
|
||||
}
|
||||
if (struct.isSetWriteToWAL()) {
|
||||
optionals.set(3);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 4);
|
||||
if (struct.isSetIsDelete()) {
|
||||
oprot.writeBool(struct.isDelete);
|
||||
}
|
||||
if (struct.isSetColumn()) {
|
||||
oprot.writeBinary(struct.column);
|
||||
}
|
||||
if (struct.isSetValue()) {
|
||||
oprot.writeBinary(struct.value);
|
||||
}
|
||||
if (struct.isSetWriteToWAL()) {
|
||||
oprot.writeBool(struct.writeToWAL);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, Mutation struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
BitSet incoming = iprot.readBitSet(4);
|
||||
if (incoming.get(0)) {
|
||||
struct.isDelete = iprot.readBool();
|
||||
struct.setIsDeleteIsSet(true);
|
||||
}
|
||||
if (incoming.get(1)) {
|
||||
struct.column = iprot.readBinary();
|
||||
struct.setColumnIsSet(true);
|
||||
}
|
||||
if (incoming.get(2)) {
|
||||
struct.value = iprot.readBinary();
|
||||
struct.setValueIsSet(true);
|
||||
}
|
||||
if (incoming.get(3)) {
|
||||
struct.writeToWAL = iprot.readBool();
|
||||
struct.setWriteToWALIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,500 +0,0 @@
|
|||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* TCell - Used to transport a cell value (byte[]) and the timestamp it was
|
||||
* stored with together as a result for get and getRow methods. This promotes
|
||||
* the timestamp of a cell to a first-class value, making it easy to take
|
||||
* note of temporal data. Cell is used all the way from HStore up to HTable.
|
||||
*/
|
||||
public class TCell implements org.apache.thrift.TBase<TCell, TCell._Fields>, java.io.Serializable, Cloneable {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCell");
|
||||
|
||||
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)1);
|
||||
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)2);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TCellStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TCellTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public ByteBuffer value; // required
|
||||
public long timestamp; // 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 {
|
||||
VALUE((short)1, "value"),
|
||||
TIMESTAMP((short)2, "timestamp");
|
||||
|
||||
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: // VALUE
|
||||
return VALUE;
|
||||
case 2: // TIMESTAMP
|
||||
return TIMESTAMP;
|
||||
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 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.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 , "Bytes")));
|
||||
tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCell.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TCell() {
|
||||
}
|
||||
|
||||
public TCell(
|
||||
ByteBuffer value,
|
||||
long timestamp)
|
||||
{
|
||||
this();
|
||||
this.value = value;
|
||||
this.timestamp = timestamp;
|
||||
setTimestampIsSet(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TCell(TCell other) {
|
||||
__isset_bitfield = other.__isset_bitfield;
|
||||
if (other.isSetValue()) {
|
||||
this.value = other.value;
|
||||
}
|
||||
this.timestamp = other.timestamp;
|
||||
}
|
||||
|
||||
public TCell deepCopy() {
|
||||
return new TCell(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.value = null;
|
||||
setTimestampIsSet(false);
|
||||
this.timestamp = 0;
|
||||
}
|
||||
|
||||
public byte[] getValue() {
|
||||
setValue(org.apache.thrift.TBaseHelper.rightSize(value));
|
||||
return value == null ? null : value.array();
|
||||
}
|
||||
|
||||
public ByteBuffer bufferForValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public TCell setValue(byte[] value) {
|
||||
setValue(value == null ? (ByteBuffer)null : ByteBuffer.wrap(value));
|
||||
return this;
|
||||
}
|
||||
|
||||
public TCell 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 long getTimestamp() {
|
||||
return this.timestamp;
|
||||
}
|
||||
|
||||
public TCell 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 void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case VALUE:
|
||||
if (value == null) {
|
||||
unsetValue();
|
||||
} else {
|
||||
setValue((ByteBuffer)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case TIMESTAMP:
|
||||
if (value == null) {
|
||||
unsetTimestamp();
|
||||
} else {
|
||||
setTimestamp((Long)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case VALUE:
|
||||
return getValue();
|
||||
|
||||
case TIMESTAMP:
|
||||
return Long.valueOf(getTimestamp());
|
||||
|
||||
}
|
||||
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 VALUE:
|
||||
return isSetValue();
|
||||
case TIMESTAMP:
|
||||
return isSetTimestamp();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TCell)
|
||||
return this.equals((TCell)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TCell that) {
|
||||
if (that == null)
|
||||
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;
|
||||
}
|
||||
|
||||
boolean this_present_timestamp = true;
|
||||
boolean that_present_timestamp = true;
|
||||
if (this_present_timestamp || that_present_timestamp) {
|
||||
if (!(this_present_timestamp && that_present_timestamp))
|
||||
return false;
|
||||
if (this.timestamp != that.timestamp)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int compareTo(TCell other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
TCell typedOther = (TCell)other;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
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("TCell(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("value:");
|
||||
if (this.value == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.value);
|
||||
}
|
||||
first = false;
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("timestamp:");
|
||||
sb.append(this.timestamp);
|
||||
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 TCellStandardSchemeFactory implements SchemeFactory {
|
||||
public TCellStandardScheme getScheme() {
|
||||
return new TCellStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TCellStandardScheme extends StandardScheme<TCell> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TCell 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: // 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;
|
||||
case 2: // 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;
|
||||
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, TCell struct) throws org.apache.thrift.TException {
|
||||
struct.validate();
|
||||
|
||||
oprot.writeStructBegin(STRUCT_DESC);
|
||||
if (struct.value != null) {
|
||||
oprot.writeFieldBegin(VALUE_FIELD_DESC);
|
||||
oprot.writeBinary(struct.value);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
|
||||
oprot.writeI64(struct.timestamp);
|
||||
oprot.writeFieldEnd();
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TCellTupleSchemeFactory implements SchemeFactory {
|
||||
public TCellTupleScheme getScheme() {
|
||||
return new TCellTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TCellTupleScheme extends TupleScheme<TCell> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TCell struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetValue()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
if (struct.isSetTimestamp()) {
|
||||
optionals.set(1);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 2);
|
||||
if (struct.isSetValue()) {
|
||||
oprot.writeBinary(struct.value);
|
||||
}
|
||||
if (struct.isSetTimestamp()) {
|
||||
oprot.writeI64(struct.timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TCell struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
BitSet incoming = iprot.readBitSet(2);
|
||||
if (incoming.get(0)) {
|
||||
struct.value = iprot.readBinary();
|
||||
struct.setValueIsSet(true);
|
||||
}
|
||||
if (incoming.get(1)) {
|
||||
struct.timestamp = iprot.readI64();
|
||||
struct.setTimestampIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,718 +0,0 @@
|
|||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* For increments that are not incrementColumnValue
|
||||
* equivalents.
|
||||
*/
|
||||
public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncrement._Fields>, java.io.Serializable, Cloneable {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TIncrement");
|
||||
|
||||
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 ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("row", org.apache.thrift.protocol.TType.STRING, (short)2);
|
||||
private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRING, (short)3);
|
||||
private static final org.apache.thrift.protocol.TField AMMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("ammount", org.apache.thrift.protocol.TType.I64, (short)4);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new TIncrementStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new TIncrementTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public ByteBuffer table; // required
|
||||
public ByteBuffer row; // required
|
||||
public ByteBuffer column; // required
|
||||
public long ammount; // 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"),
|
||||
ROW((short)2, "row"),
|
||||
COLUMN((short)3, "column"),
|
||||
AMMOUNT((short)4, "ammount");
|
||||
|
||||
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: // ROW
|
||||
return ROW;
|
||||
case 3: // COLUMN
|
||||
return COLUMN;
|
||||
case 4: // AMMOUNT
|
||||
return AMMOUNT;
|
||||
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 __AMMOUNT_ISSET_ID = 0;
|
||||
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.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 , "Text")));
|
||||
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.COLUMN, new org.apache.thrift.meta_data.FieldMetaData("column", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")));
|
||||
tmpMap.put(_Fields.AMMOUNT, new org.apache.thrift.meta_data.FieldMetaData("ammount", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TIncrement.class, metaDataMap);
|
||||
}
|
||||
|
||||
public TIncrement() {
|
||||
}
|
||||
|
||||
public TIncrement(
|
||||
ByteBuffer table,
|
||||
ByteBuffer row,
|
||||
ByteBuffer column,
|
||||
long ammount)
|
||||
{
|
||||
this();
|
||||
this.table = table;
|
||||
this.row = row;
|
||||
this.column = column;
|
||||
this.ammount = ammount;
|
||||
setAmmountIsSet(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
public TIncrement(TIncrement other) {
|
||||
__isset_bitfield = other.__isset_bitfield;
|
||||
if (other.isSetTable()) {
|
||||
this.table = other.table;
|
||||
}
|
||||
if (other.isSetRow()) {
|
||||
this.row = other.row;
|
||||
}
|
||||
if (other.isSetColumn()) {
|
||||
this.column = other.column;
|
||||
}
|
||||
this.ammount = other.ammount;
|
||||
}
|
||||
|
||||
public TIncrement deepCopy() {
|
||||
return new TIncrement(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
this.table = null;
|
||||
this.row = null;
|
||||
this.column = null;
|
||||
setAmmountIsSet(false);
|
||||
this.ammount = 0;
|
||||
}
|
||||
|
||||
public byte[] getTable() {
|
||||
setTable(org.apache.thrift.TBaseHelper.rightSize(table));
|
||||
return table == null ? null : table.array();
|
||||
}
|
||||
|
||||
public ByteBuffer bufferForTable() {
|
||||
return table;
|
||||
}
|
||||
|
||||
public TIncrement setTable(byte[] table) {
|
||||
setTable(table == null ? (ByteBuffer)null : ByteBuffer.wrap(table));
|
||||
return this;
|
||||
}
|
||||
|
||||
public TIncrement 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[] getRow() {
|
||||
setRow(org.apache.thrift.TBaseHelper.rightSize(row));
|
||||
return row == null ? null : row.array();
|
||||
}
|
||||
|
||||
public ByteBuffer bufferForRow() {
|
||||
return row;
|
||||
}
|
||||
|
||||
public TIncrement setRow(byte[] row) {
|
||||
setRow(row == null ? (ByteBuffer)null : ByteBuffer.wrap(row));
|
||||
return this;
|
||||
}
|
||||
|
||||
public TIncrement 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[] getColumn() {
|
||||
setColumn(org.apache.thrift.TBaseHelper.rightSize(column));
|
||||
return column == null ? null : column.array();
|
||||
}
|
||||
|
||||
public ByteBuffer bufferForColumn() {
|
||||
return column;
|
||||
}
|
||||
|
||||
public TIncrement setColumn(byte[] column) {
|
||||
setColumn(column == null ? (ByteBuffer)null : ByteBuffer.wrap(column));
|
||||
return this;
|
||||
}
|
||||
|
||||
public TIncrement setColumn(ByteBuffer column) {
|
||||
this.column = column;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetColumn() {
|
||||
this.column = null;
|
||||
}
|
||||
|
||||
/** Returns true if field column is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetColumn() {
|
||||
return this.column != null;
|
||||
}
|
||||
|
||||
public void setColumnIsSet(boolean value) {
|
||||
if (!value) {
|
||||
this.column = null;
|
||||
}
|
||||
}
|
||||
|
||||
public long getAmmount() {
|
||||
return this.ammount;
|
||||
}
|
||||
|
||||
public TIncrement setAmmount(long ammount) {
|
||||
this.ammount = ammount;
|
||||
setAmmountIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetAmmount() {
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __AMMOUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field ammount is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetAmmount() {
|
||||
return EncodingUtils.testBit(__isset_bitfield, __AMMOUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setAmmountIsSet(boolean value) {
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __AMMOUNT_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case TABLE:
|
||||
if (value == null) {
|
||||
unsetTable();
|
||||
} else {
|
||||
setTable((ByteBuffer)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case ROW:
|
||||
if (value == null) {
|
||||
unsetRow();
|
||||
} else {
|
||||
setRow((ByteBuffer)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case COLUMN:
|
||||
if (value == null) {
|
||||
unsetColumn();
|
||||
} else {
|
||||
setColumn((ByteBuffer)value);
|
||||
}
|
||||
break;
|
||||
|
||||
case AMMOUNT:
|
||||
if (value == null) {
|
||||
unsetAmmount();
|
||||
} else {
|
||||
setAmmount((Long)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFieldValue(_Fields field) {
|
||||
switch (field) {
|
||||
case TABLE:
|
||||
return getTable();
|
||||
|
||||
case ROW:
|
||||
return getRow();
|
||||
|
||||
case COLUMN:
|
||||
return getColumn();
|
||||
|
||||
case AMMOUNT:
|
||||
return Long.valueOf(getAmmount());
|
||||
|
||||
}
|
||||
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 ROW:
|
||||
return isSetRow();
|
||||
case COLUMN:
|
||||
return isSetColumn();
|
||||
case AMMOUNT:
|
||||
return isSetAmmount();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TIncrement)
|
||||
return this.equals((TIncrement)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TIncrement 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_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_column = true && this.isSetColumn();
|
||||
boolean that_present_column = true && that.isSetColumn();
|
||||
if (this_present_column || that_present_column) {
|
||||
if (!(this_present_column && that_present_column))
|
||||
return false;
|
||||
if (!this.column.equals(that.column))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_ammount = true;
|
||||
boolean that_present_ammount = true;
|
||||
if (this_present_ammount || that_present_ammount) {
|
||||
if (!(this_present_ammount && that_present_ammount))
|
||||
return false;
|
||||
if (this.ammount != that.ammount)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int compareTo(TIncrement other) {
|
||||
if (!getClass().equals(other.getClass())) {
|
||||
return getClass().getName().compareTo(other.getClass().getName());
|
||||
}
|
||||
|
||||
int lastComparison = 0;
|
||||
TIncrement typedOther = (TIncrement)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(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(isSetColumn()).compareTo(typedOther.isSetColumn());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetColumn()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column, typedOther.column);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetAmmount()).compareTo(typedOther.isSetAmmount());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetAmmount()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ammount, typedOther.ammount);
|
||||
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("TIncrement(");
|
||||
boolean first = true;
|
||||
|
||||
sb.append("table:");
|
||||
if (this.table == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.table);
|
||||
}
|
||||
first = false;
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("row:");
|
||||
if (this.row == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.row);
|
||||
}
|
||||
first = false;
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("column:");
|
||||
if (this.column == null) {
|
||||
sb.append("null");
|
||||
} else {
|
||||
sb.append(this.column);
|
||||
}
|
||||
first = false;
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("ammount:");
|
||||
sb.append(this.ammount);
|
||||
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 TIncrementStandardSchemeFactory implements SchemeFactory {
|
||||
public TIncrementStandardScheme getScheme() {
|
||||
return new TIncrementStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TIncrementStandardScheme extends StandardScheme<TIncrement> {
|
||||
|
||||
public void read(org.apache.thrift.protocol.TProtocol iprot, TIncrement 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: // 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 3: // COLUMN
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
struct.column = iprot.readBinary();
|
||||
struct.setColumnIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 4: // AMMOUNT
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
|
||||
struct.ammount = iprot.readI64();
|
||||
struct.setAmmountIsSet(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, TIncrement 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.row != null) {
|
||||
oprot.writeFieldBegin(ROW_FIELD_DESC);
|
||||
oprot.writeBinary(struct.row);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (struct.column != null) {
|
||||
oprot.writeFieldBegin(COLUMN_FIELD_DESC);
|
||||
oprot.writeBinary(struct.column);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldBegin(AMMOUNT_FIELD_DESC);
|
||||
oprot.writeI64(struct.ammount);
|
||||
oprot.writeFieldEnd();
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class TIncrementTupleSchemeFactory implements SchemeFactory {
|
||||
public TIncrementTupleScheme getScheme() {
|
||||
return new TIncrementTupleScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TIncrementTupleScheme extends TupleScheme<TIncrement> {
|
||||
|
||||
@Override
|
||||
public void write(org.apache.thrift.protocol.TProtocol prot, TIncrement struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol oprot = (TTupleProtocol) prot;
|
||||
BitSet optionals = new BitSet();
|
||||
if (struct.isSetTable()) {
|
||||
optionals.set(0);
|
||||
}
|
||||
if (struct.isSetRow()) {
|
||||
optionals.set(1);
|
||||
}
|
||||
if (struct.isSetColumn()) {
|
||||
optionals.set(2);
|
||||
}
|
||||
if (struct.isSetAmmount()) {
|
||||
optionals.set(3);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 4);
|
||||
if (struct.isSetTable()) {
|
||||
oprot.writeBinary(struct.table);
|
||||
}
|
||||
if (struct.isSetRow()) {
|
||||
oprot.writeBinary(struct.row);
|
||||
}
|
||||
if (struct.isSetColumn()) {
|
||||
oprot.writeBinary(struct.column);
|
||||
}
|
||||
if (struct.isSetAmmount()) {
|
||||
oprot.writeI64(struct.ammount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, TIncrement struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
BitSet incoming = iprot.readBitSet(4);
|
||||
if (incoming.get(0)) {
|
||||
struct.table = iprot.readBinary();
|
||||
struct.setTableIsSet(true);
|
||||
}
|
||||
if (incoming.get(1)) {
|
||||
struct.row = iprot.readBinary();
|
||||
struct.setRowIsSet(true);
|
||||
}
|
||||
if (incoming.get(2)) {
|
||||
struct.column = iprot.readBinary();
|
||||
struct.setColumnIsSet(true);
|
||||
}
|
||||
if (incoming.get(3)) {
|
||||
struct.ammount = iprot.readI64();
|
||||
struct.setAmmountIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,564 +0,0 @@
|
|||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,969 +0,0 @@
|
|||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -18,21 +18,29 @@
|
|||
"""
|
||||
# Instructions:
|
||||
# 1. Run Thrift to generate the python module hbase
|
||||
# thrift --gen py ../../../src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift
|
||||
# thrift --gen py ../../../../../hbase-server/src/main/resources/org/apache/hadoop \
|
||||
# /hbase/thrift2/hbase.thrift
|
||||
# 2. Create a directory of your choosing that contains:
|
||||
# a. This file (DemoClient.py).
|
||||
# b. The directory gen-py/hbase (generated by instruction step 1).
|
||||
# 3. pip install thrift==0.7.0
|
||||
# 3. pip install thrift==0.9.0
|
||||
# 4. Create a table call "example", with a family called "family1" using the hbase shell.
|
||||
# 5. Start the hbase thrift2 server
|
||||
# bin/hbase thrift2 start
|
||||
# 6. Execute {python DemoClient.py}.
|
||||
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
|
||||
from thrift.transport import TTransport
|
||||
from thrift.transport import TSocket
|
||||
from thrift.transport import THttpClient
|
||||
from thrift.protocol import TBinaryProtocol
|
||||
|
||||
# Add path for local "gen-py/hbase" for the pre-generated module
|
||||
gen_py_path = os.path.abspath('gen-py')
|
||||
sys.path.append(gen_py_path)
|
||||
from hbase import THBaseService
|
||||
from hbase.ttypes import *
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Autogenerated by Thrift Compiler (0.9.0)
|
||||
#
|
||||
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
#
|
||||
# options string: py
|
||||
#
|
||||
|
||||
import sys
|
||||
import pprint
|
||||
from urlparse import urlparse
|
||||
from thrift.transport import TTransport
|
||||
from thrift.transport import TSocket
|
||||
from thrift.transport import THttpClient
|
||||
from thrift.protocol import TBinaryProtocol
|
||||
|
||||
import THBaseService
|
||||
from ttypes import *
|
||||
|
||||
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
|
||||
print ''
|
||||
print 'Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
|
||||
print ''
|
||||
print 'Functions:'
|
||||
print ' bool exists(string table, TGet get)'
|
||||
print ' TResult get(string table, TGet get)'
|
||||
print ' getMultiple(string table, gets)'
|
||||
print ' void put(string table, TPut put)'
|
||||
print ' bool checkAndPut(string table, string row, string family, string qualifier, string value, TPut put)'
|
||||
print ' void putMultiple(string table, puts)'
|
||||
print ' void deleteSingle(string table, TDelete deleteSingle)'
|
||||
print ' deleteMultiple(string table, deletes)'
|
||||
print ' bool checkAndDelete(string table, string row, string family, string qualifier, string value, TDelete deleteSingle)'
|
||||
print ' TResult increment(string table, TIncrement increment)'
|
||||
print ' i32 openScanner(string table, TScan scan)'
|
||||
print ' getScannerRows(i32 scannerId, i32 numRows)'
|
||||
print ' void closeScanner(i32 scannerId)'
|
||||
print ''
|
||||
sys.exit(0)
|
||||
|
||||
pp = pprint.PrettyPrinter(indent = 2)
|
||||
host = 'localhost'
|
||||
port = 9090
|
||||
uri = ''
|
||||
framed = False
|
||||
http = False
|
||||
argi = 1
|
||||
|
||||
if sys.argv[argi] == '-h':
|
||||
parts = sys.argv[argi+1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-u':
|
||||
url = urlparse(sys.argv[argi+1])
|
||||
parts = url[1].split(':')
|
||||
host = parts[0]
|
||||
if len(parts) > 1:
|
||||
port = int(parts[1])
|
||||
else:
|
||||
port = 80
|
||||
uri = url[2]
|
||||
if url[4]:
|
||||
uri += '?%s' % url[4]
|
||||
http = True
|
||||
argi += 2
|
||||
|
||||
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
|
||||
framed = True
|
||||
argi += 1
|
||||
|
||||
cmd = sys.argv[argi]
|
||||
args = sys.argv[argi+1:]
|
||||
|
||||
if http:
|
||||
transport = THttpClient.THttpClient(host, port, uri)
|
||||
else:
|
||||
socket = TSocket.TSocket(host, port)
|
||||
if framed:
|
||||
transport = TTransport.TFramedTransport(socket)
|
||||
else:
|
||||
transport = TTransport.TBufferedTransport(socket)
|
||||
protocol = TBinaryProtocol.TBinaryProtocol(transport)
|
||||
client = THBaseService.Client(protocol)
|
||||
transport.open()
|
||||
|
||||
if cmd == 'exists':
|
||||
if len(args) != 2:
|
||||
print 'exists requires 2 args'
|
||||
sys.exit(1)
|
||||
pp.pprint(client.exists(args[0],eval(args[1]),))
|
||||
|
||||
elif cmd == 'get':
|
||||
if len(args) != 2:
|
||||
print 'get requires 2 args'
|
||||
sys.exit(1)
|
||||
pp.pprint(client.get(args[0],eval(args[1]),))
|
||||
|
||||
elif cmd == 'getMultiple':
|
||||
if len(args) != 2:
|
||||
print 'getMultiple requires 2 args'
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getMultiple(args[0],eval(args[1]),))
|
||||
|
||||
elif cmd == 'put':
|
||||
if len(args) != 2:
|
||||
print 'put requires 2 args'
|
||||
sys.exit(1)
|
||||
pp.pprint(client.put(args[0],eval(args[1]),))
|
||||
|
||||
elif cmd == 'checkAndPut':
|
||||
if len(args) != 6:
|
||||
print 'checkAndPut requires 6 args'
|
||||
sys.exit(1)
|
||||
pp.pprint(client.checkAndPut(args[0],args[1],args[2],args[3],args[4],eval(args[5]),))
|
||||
|
||||
elif cmd == 'putMultiple':
|
||||
if len(args) != 2:
|
||||
print 'putMultiple requires 2 args'
|
||||
sys.exit(1)
|
||||
pp.pprint(client.putMultiple(args[0],eval(args[1]),))
|
||||
|
||||
elif cmd == 'deleteSingle':
|
||||
if len(args) != 2:
|
||||
print 'deleteSingle requires 2 args'
|
||||
sys.exit(1)
|
||||
pp.pprint(client.deleteSingle(args[0],eval(args[1]),))
|
||||
|
||||
elif cmd == 'deleteMultiple':
|
||||
if len(args) != 2:
|
||||
print 'deleteMultiple requires 2 args'
|
||||
sys.exit(1)
|
||||
pp.pprint(client.deleteMultiple(args[0],eval(args[1]),))
|
||||
|
||||
elif cmd == 'checkAndDelete':
|
||||
if len(args) != 6:
|
||||
print 'checkAndDelete requires 6 args'
|
||||
sys.exit(1)
|
||||
pp.pprint(client.checkAndDelete(args[0],args[1],args[2],args[3],args[4],eval(args[5]),))
|
||||
|
||||
elif cmd == 'increment':
|
||||
if len(args) != 2:
|
||||
print 'increment requires 2 args'
|
||||
sys.exit(1)
|
||||
pp.pprint(client.increment(args[0],eval(args[1]),))
|
||||
|
||||
elif cmd == 'openScanner':
|
||||
if len(args) != 2:
|
||||
print 'openScanner requires 2 args'
|
||||
sys.exit(1)
|
||||
pp.pprint(client.openScanner(args[0],eval(args[1]),))
|
||||
|
||||
elif cmd == 'getScannerRows':
|
||||
if len(args) != 2:
|
||||
print 'getScannerRows requires 2 args'
|
||||
sys.exit(1)
|
||||
pp.pprint(client.getScannerRows(eval(args[0]),eval(args[1]),))
|
||||
|
||||
elif cmd == 'closeScanner':
|
||||
if len(args) != 1:
|
||||
print 'closeScanner requires 1 args'
|
||||
sys.exit(1)
|
||||
pp.pprint(client.closeScanner(eval(args[0]),))
|
||||
|
||||
else:
|
||||
print 'Unrecognized method %s' % cmd
|
||||
sys.exit(1)
|
||||
|
||||
transport.close()
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
|||
__all__ = ['ttypes', 'constants', 'THBaseService']
|
|
@ -0,0 +1,11 @@
|
|||
#
|
||||
# Autogenerated by Thrift Compiler (0.9.0)
|
||||
#
|
||||
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
#
|
||||
# options string: py
|
||||
#
|
||||
|
||||
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
|
||||
from ttypes import *
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue