You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by mb...@apache.org on 2012/04/21 03:37:16 UTC
svn commit: r1328562 [4/9] - in /hbase/branches/0.89-fb: ./
src/main/java/org/apache/hadoop/hbase/
src/main/java/org/apache/hadoop/hbase/filter/
src/main/java/org/apache/hadoop/hbase/regionserver/
src/main/java/org/apache/hadoop/hbase/thrift/ src/main/...
Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java?rev=1328562&r1=1328561&r2=1328562&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java Sat Apr 21 01:37:15 2012
@@ -1,11 +1,17 @@
/**
- * Autogenerated by Thrift
+ * Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
*/
package org.apache.hadoop.hbase.thrift.generated;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
@@ -16,37 +22,38 @@ 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;
-import org.apache.thrift.*;
-import org.apache.thrift.meta_data.*;
-import org.apache.thrift.protocol.*;
-
/**
* A BatchMutation object is used to apply a number of Mutations to a single row.
*/
-public class BatchMutation implements TBase<BatchMutation._Fields>, java.io.Serializable, Cloneable, Comparable<BatchMutation> {
- private static final TStruct STRUCT_DESC = new TStruct("BatchMutation");
+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 TField ROW_FIELD_DESC = new TField("row", TType.STRING, (short)1);
- private static final TField MUTATIONS_FIELD_DESC = new TField("mutations", TType.LIST, (short)2);
+ 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 byte[] row;
- public List<Mutation> mutations;
+ 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 TFieldIdEnum {
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ROW((short)1, "row"),
MUTATIONS((short)2, "mutations");
- private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byId.put((int)field._thriftId, field);
byName.put(field.getFieldName(), field);
}
}
@@ -55,7 +62,14 @@ public class BatchMutation implements TB
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
- return byId.get(fieldId);
+ switch(fieldId) {
+ case 1: // ROW
+ return ROW;
+ case 2: // MUTATIONS
+ return MUTATIONS;
+ default:
+ return null;
+ }
}
/**
@@ -93,24 +107,23 @@ public class BatchMutation implements TB
}
// isset id assignments
-
- public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
- put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- put(_Fields.MUTATIONS, new FieldMetaData("mutations", TFieldRequirementType.DEFAULT,
- new ListMetaData(TType.LIST,
- new StructMetaData(TType.STRUCT, Mutation.class))));
- }});
-
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
- FieldMetaData.addStructMetaDataMap(BatchMutation.class, metaDataMap);
+ 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(
- byte[] row,
+ ByteBuffer row,
List<Mutation> mutations)
{
this();
@@ -138,16 +151,27 @@ public class BatchMutation implements TB
return new BatchMutation(this);
}
- @Deprecated
- public BatchMutation clone() {
- return new BatchMutation(this);
+ @Override
+ public void clear() {
+ this.row = null;
+ this.mutations = null;
}
public byte[] getRow() {
- return this.row;
+ 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;
}
@@ -156,7 +180,7 @@ public class BatchMutation implements TB
this.row = null;
}
- /** Returns true if field row is set (has been asigned a value) and false otherwise */
+ /** Returns true if field row is set (has been assigned a value) and false otherwise */
public boolean isSetRow() {
return this.row != null;
}
@@ -195,7 +219,7 @@ public class BatchMutation implements TB
this.mutations = null;
}
- /** Returns true if field mutations is set (has been asigned a value) and false otherwise */
+ /** Returns true if field mutations is set (has been assigned a value) and false otherwise */
public boolean isSetMutations() {
return this.mutations != null;
}
@@ -212,7 +236,7 @@ public class BatchMutation implements TB
if (value == null) {
unsetRow();
} else {
- setRow((byte[])value);
+ setRow((ByteBuffer)value);
}
break;
@@ -227,10 +251,6 @@ public class BatchMutation implements TB
}
}
- public void setFieldValue(int fieldID, Object value) {
- setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
- }
-
public Object getFieldValue(_Fields field) {
switch (field) {
case ROW:
@@ -243,12 +263,12 @@ public class BatchMutation implements TB
throw new IllegalStateException();
}
- public Object getFieldValue(int fieldId) {
- return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
- }
-
- /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
+ /** 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();
@@ -258,10 +278,6 @@ public class BatchMutation implements TB
throw new IllegalStateException();
}
- public boolean isSet(int fieldID) {
- return isSet(_Fields.findByThriftIdOrThrow(fieldID));
- }
-
@Override
public boolean equals(Object that) {
if (that == null)
@@ -280,7 +296,7 @@ public class BatchMutation implements TB
if (this_present_row || that_present_row) {
if (!(this_present_row && that_present_row))
return false;
- if (!java.util.Arrays.equals(this.row, that.row))
+ if (!this.row.equals(that.row))
return false;
}
@@ -298,19 +314,7 @@ public class BatchMutation implements TB
@Override
public int hashCode() {
- HashCodeBuilder builder = new HashCodeBuilder();
-
- boolean present_row = true && (isSetRow());
- builder.append(present_row);
- if (present_row)
- builder.append(row);
-
- boolean present_mutations = true && (isSetMutations());
- builder.append(present_mutations);
- if (present_mutations)
- builder.append(mutations);
-
- return builder.toHashCode();
+ return 0;
}
public int compareTo(BatchMutation other) {
@@ -321,97 +325,39 @@ public class BatchMutation implements TB
int lastComparison = 0;
BatchMutation typedOther = (BatchMutation)other;
- lastComparison = Boolean.valueOf(isSetRow()).compareTo(isSetRow());
+ lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(row, typedOther.row);
- 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(isSetMutations());
+ lastComparison = Boolean.valueOf(isSetMutations()).compareTo(typedOther.isSetMutations());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(mutations, typedOther.mutations);
- 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 void read(TProtocol iprot) throws TException {
- TField field;
- iprot.readStructBegin();
- while (true)
- {
- field = iprot.readFieldBegin();
- if (field.type == TType.STOP) {
- break;
- }
- _Fields fieldId = _Fields.findByThriftId(field.id);
- if (fieldId == null) {
- TProtocolUtil.skip(iprot, field.type);
- } else {
- switch (fieldId) {
- case ROW:
- if (field.type == TType.STRING) {
- this.row = iprot.readBinary();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case MUTATIONS:
- if (field.type == TType.LIST) {
- {
- TList _list0 = iprot.readListBegin();
- this.mutations = new ArrayList<Mutation>(_list0.size);
- for (int _i1 = 0; _i1 < _list0.size; ++_i1)
- {
- Mutation _elem2;
- _elem2 = new Mutation();
- _elem2.read(iprot);
- this.mutations.add(_elem2);
- }
- iprot.readListEnd();
- }
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- }
- iprot.readFieldEnd();
- }
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- validate();
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
}
- public void write(TProtocol oprot) throws TException {
- validate();
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
- oprot.writeStructBegin(STRUCT_DESC);
- if (this.row != null) {
- oprot.writeFieldBegin(ROW_FIELD_DESC);
- oprot.writeBinary(this.row);
- oprot.writeFieldEnd();
- }
- if (this.mutations != null) {
- oprot.writeFieldBegin(MUTATIONS_FIELD_DESC);
- {
- oprot.writeListBegin(new TList(TType.STRUCT, this.mutations.size()));
- for (Mutation _iter3 : this.mutations)
- {
- _iter3.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -438,9 +384,166 @@ public class BatchMutation implements TB
return sb.toString();
}
- public void validate() throws TException {
+ public void validate() throws org.apache.thrift.TException {
// check for required fields
}
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class 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);
+ }
+ }
+ }
+
}
Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java?rev=1328562&r1=1328561&r2=1328562&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java Sat Apr 21 01:37:15 2012
@@ -1,11 +1,17 @@
/**
- * Autogenerated by Thrift
+ * Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
*/
package org.apache.hadoop.hbase.thrift.generated;
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
@@ -16,44 +22,47 @@ 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;
-import org.apache.thrift.*;
-import org.apache.thrift.meta_data.*;
-import org.apache.thrift.protocol.*;
-
/**
* An HColumnDescriptor contains information about a column family
* such as the number of versions, compression settings, etc. It is
* used as input when creating a table or adding a column.
*/
-public class ColumnDescriptor implements TBase<ColumnDescriptor._Fields>, java.io.Serializable, Cloneable, Comparable<ColumnDescriptor> {
- private static final TStruct STRUCT_DESC = new TStruct("ColumnDescriptor");
+public class ColumnDescriptor implements org.apache.thrift.TBase<ColumnDescriptor, ColumnDescriptor._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ColumnDescriptor");
- private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1);
- private static final TField MAX_VERSIONS_FIELD_DESC = new TField("maxVersions", TType.I32, (short)2);
- private static final TField COMPRESSION_FIELD_DESC = new TField("compression", TType.STRING, (short)3);
- private static final TField IN_MEMORY_FIELD_DESC = new TField("inMemory", TType.BOOL, (short)4);
- private static final TField BLOOM_FILTER_TYPE_FIELD_DESC = new TField("bloomFilterType", TType.STRING, (short)5);
- private static final TField BLOOM_FILTER_VECTOR_SIZE_FIELD_DESC = new TField("bloomFilterVectorSize", TType.I32, (short)6);
- private static final TField BLOOM_FILTER_NB_HASHES_FIELD_DESC = new TField("bloomFilterNbHashes", TType.I32, (short)7);
- private static final TField BLOCK_CACHE_ENABLED_FIELD_DESC = new TField("blockCacheEnabled", TType.BOOL, (short)8);
- private static final TField TIME_TO_LIVE_FIELD_DESC = new TField("timeToLive", TType.I32, (short)9);
-
- public byte[] name;
- public int maxVersions;
- public String compression;
- public boolean inMemory;
- public String bloomFilterType;
- public int bloomFilterVectorSize;
- public int bloomFilterNbHashes;
- public boolean blockCacheEnabled;
- public int timeToLive;
+ private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField MAX_VERSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxVersions", org.apache.thrift.protocol.TType.I32, (short)2);
+ private static final org.apache.thrift.protocol.TField COMPRESSION_FIELD_DESC = new org.apache.thrift.protocol.TField("compression", org.apache.thrift.protocol.TType.STRING, (short)3);
+ private static final org.apache.thrift.protocol.TField IN_MEMORY_FIELD_DESC = new org.apache.thrift.protocol.TField("inMemory", org.apache.thrift.protocol.TType.BOOL, (short)4);
+ private static final org.apache.thrift.protocol.TField BLOOM_FILTER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("bloomFilterType", org.apache.thrift.protocol.TType.STRING, (short)5);
+ private static final org.apache.thrift.protocol.TField BLOOM_FILTER_VECTOR_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("bloomFilterVectorSize", org.apache.thrift.protocol.TType.I32, (short)6);
+ private static final org.apache.thrift.protocol.TField BLOOM_FILTER_NB_HASHES_FIELD_DESC = new org.apache.thrift.protocol.TField("bloomFilterNbHashes", org.apache.thrift.protocol.TType.I32, (short)7);
+ private static final org.apache.thrift.protocol.TField BLOCK_CACHE_ENABLED_FIELD_DESC = new org.apache.thrift.protocol.TField("blockCacheEnabled", org.apache.thrift.protocol.TType.BOOL, (short)8);
+ private static final org.apache.thrift.protocol.TField TIME_TO_LIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("timeToLive", org.apache.thrift.protocol.TType.I32, (short)9);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new ColumnDescriptorStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new ColumnDescriptorTupleSchemeFactory());
+ }
+
+ public ByteBuffer name; // required
+ public int maxVersions; // required
+ public String compression; // required
+ public boolean inMemory; // required
+ public String bloomFilterType; // required
+ public int bloomFilterVectorSize; // required
+ public int bloomFilterNbHashes; // required
+ public boolean blockCacheEnabled; // required
+ public int timeToLive; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements TFieldIdEnum {
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
NAME((short)1, "name"),
MAX_VERSIONS((short)2, "maxVersions"),
COMPRESSION((short)3, "compression"),
@@ -64,12 +73,10 @@ public class ColumnDescriptor implements
BLOCK_CACHE_ENABLED((short)8, "blockCacheEnabled"),
TIME_TO_LIVE((short)9, "timeToLive");
- private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byId.put((int)field._thriftId, field);
byName.put(field.getFieldName(), field);
}
}
@@ -78,7 +85,28 @@ public class ColumnDescriptor implements
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
- return byId.get(fieldId);
+ switch(fieldId) {
+ case 1: // NAME
+ return NAME;
+ case 2: // MAX_VERSIONS
+ return MAX_VERSIONS;
+ case 3: // COMPRESSION
+ return COMPRESSION;
+ case 4: // IN_MEMORY
+ return IN_MEMORY;
+ case 5: // BLOOM_FILTER_TYPE
+ return BLOOM_FILTER_TYPE;
+ case 6: // BLOOM_FILTER_VECTOR_SIZE
+ return BLOOM_FILTER_VECTOR_SIZE;
+ case 7: // BLOOM_FILTER_NB_HASHES
+ return BLOOM_FILTER_NB_HASHES;
+ case 8: // BLOCK_CACHE_ENABLED
+ return BLOCK_CACHE_ENABLED;
+ case 9: // TIME_TO_LIVE
+ return TIME_TO_LIVE;
+ default:
+ return null;
+ }
}
/**
@@ -123,30 +151,29 @@ public class ColumnDescriptor implements
private static final int __BLOCKCACHEENABLED_ISSET_ID = 4;
private static final int __TIMETOLIVE_ISSET_ID = 5;
private BitSet __isset_bit_vector = new BitSet(6);
-
- public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
- put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- put(_Fields.MAX_VERSIONS, new FieldMetaData("maxVersions", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.I32)));
- put(_Fields.COMPRESSION, new FieldMetaData("compression", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- put(_Fields.IN_MEMORY, new FieldMetaData("inMemory", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.BOOL)));
- put(_Fields.BLOOM_FILTER_TYPE, new FieldMetaData("bloomFilterType", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- put(_Fields.BLOOM_FILTER_VECTOR_SIZE, new FieldMetaData("bloomFilterVectorSize", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.I32)));
- put(_Fields.BLOOM_FILTER_NB_HASHES, new FieldMetaData("bloomFilterNbHashes", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.I32)));
- put(_Fields.BLOCK_CACHE_ENABLED, new FieldMetaData("blockCacheEnabled", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.BOOL)));
- put(_Fields.TIME_TO_LIVE, new FieldMetaData("timeToLive", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.I32)));
- }});
-
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
- FieldMetaData.addStructMetaDataMap(ColumnDescriptor.class, metaDataMap);
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Text")));
+ tmpMap.put(_Fields.MAX_VERSIONS, new org.apache.thrift.meta_data.FieldMetaData("maxVersions", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+ tmpMap.put(_Fields.COMPRESSION, new org.apache.thrift.meta_data.FieldMetaData("compression", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.IN_MEMORY, new org.apache.thrift.meta_data.FieldMetaData("inMemory", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.BLOOM_FILTER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("bloomFilterType", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.BLOOM_FILTER_VECTOR_SIZE, new org.apache.thrift.meta_data.FieldMetaData("bloomFilterVectorSize", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+ tmpMap.put(_Fields.BLOOM_FILTER_NB_HASHES, new org.apache.thrift.meta_data.FieldMetaData("bloomFilterNbHashes", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+ tmpMap.put(_Fields.BLOCK_CACHE_ENABLED, new org.apache.thrift.meta_data.FieldMetaData("blockCacheEnabled", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.TIME_TO_LIVE, new org.apache.thrift.meta_data.FieldMetaData("timeToLive", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ColumnDescriptor.class, metaDataMap);
}
public ColumnDescriptor() {
@@ -169,7 +196,7 @@ public class ColumnDescriptor implements
}
public ColumnDescriptor(
- byte[] name,
+ ByteBuffer name,
int maxVersions,
String compression,
boolean inMemory,
@@ -224,16 +251,42 @@ public class ColumnDescriptor implements
return new ColumnDescriptor(this);
}
- @Deprecated
- public ColumnDescriptor clone() {
- return new ColumnDescriptor(this);
+ @Override
+ public void clear() {
+ this.name = null;
+ this.maxVersions = 3;
+
+ this.compression = "NONE";
+
+ this.inMemory = false;
+
+ this.bloomFilterType = "NONE";
+
+ this.bloomFilterVectorSize = 0;
+
+ this.bloomFilterNbHashes = 0;
+
+ this.blockCacheEnabled = false;
+
+ this.timeToLive = -1;
+
}
public byte[] getName() {
- return this.name;
+ setName(org.apache.thrift.TBaseHelper.rightSize(name));
+ return name == null ? null : name.array();
+ }
+
+ public ByteBuffer bufferForName() {
+ return name;
}
public ColumnDescriptor setName(byte[] name) {
+ setName(name == null ? (ByteBuffer)null : ByteBuffer.wrap(name));
+ return this;
+ }
+
+ public ColumnDescriptor setName(ByteBuffer name) {
this.name = name;
return this;
}
@@ -242,7 +295,7 @@ public class ColumnDescriptor implements
this.name = null;
}
- /** Returns true if field name is set (has been asigned a value) and false otherwise */
+ /** Returns true if field name is set (has been assigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
@@ -267,7 +320,7 @@ public class ColumnDescriptor implements
__isset_bit_vector.clear(__MAXVERSIONS_ISSET_ID);
}
- /** Returns true if field maxVersions is set (has been asigned a value) and false otherwise */
+ /** Returns true if field maxVersions is set (has been assigned a value) and false otherwise */
public boolean isSetMaxVersions() {
return __isset_bit_vector.get(__MAXVERSIONS_ISSET_ID);
}
@@ -289,7 +342,7 @@ public class ColumnDescriptor implements
this.compression = null;
}
- /** Returns true if field compression is set (has been asigned a value) and false otherwise */
+ /** Returns true if field compression is set (has been assigned a value) and false otherwise */
public boolean isSetCompression() {
return this.compression != null;
}
@@ -314,7 +367,7 @@ public class ColumnDescriptor implements
__isset_bit_vector.clear(__INMEMORY_ISSET_ID);
}
- /** Returns true if field inMemory is set (has been asigned a value) and false otherwise */
+ /** Returns true if field inMemory is set (has been assigned a value) and false otherwise */
public boolean isSetInMemory() {
return __isset_bit_vector.get(__INMEMORY_ISSET_ID);
}
@@ -336,7 +389,7 @@ public class ColumnDescriptor implements
this.bloomFilterType = null;
}
- /** Returns true if field bloomFilterType is set (has been asigned a value) and false otherwise */
+ /** Returns true if field bloomFilterType is set (has been assigned a value) and false otherwise */
public boolean isSetBloomFilterType() {
return this.bloomFilterType != null;
}
@@ -361,7 +414,7 @@ public class ColumnDescriptor implements
__isset_bit_vector.clear(__BLOOMFILTERVECTORSIZE_ISSET_ID);
}
- /** Returns true if field bloomFilterVectorSize is set (has been asigned a value) and false otherwise */
+ /** Returns true if field bloomFilterVectorSize is set (has been assigned a value) and false otherwise */
public boolean isSetBloomFilterVectorSize() {
return __isset_bit_vector.get(__BLOOMFILTERVECTORSIZE_ISSET_ID);
}
@@ -384,7 +437,7 @@ public class ColumnDescriptor implements
__isset_bit_vector.clear(__BLOOMFILTERNBHASHES_ISSET_ID);
}
- /** Returns true if field bloomFilterNbHashes is set (has been asigned a value) and false otherwise */
+ /** Returns true if field bloomFilterNbHashes is set (has been assigned a value) and false otherwise */
public boolean isSetBloomFilterNbHashes() {
return __isset_bit_vector.get(__BLOOMFILTERNBHASHES_ISSET_ID);
}
@@ -407,7 +460,7 @@ public class ColumnDescriptor implements
__isset_bit_vector.clear(__BLOCKCACHEENABLED_ISSET_ID);
}
- /** Returns true if field blockCacheEnabled is set (has been asigned a value) and false otherwise */
+ /** Returns true if field blockCacheEnabled is set (has been assigned a value) and false otherwise */
public boolean isSetBlockCacheEnabled() {
return __isset_bit_vector.get(__BLOCKCACHEENABLED_ISSET_ID);
}
@@ -430,7 +483,7 @@ public class ColumnDescriptor implements
__isset_bit_vector.clear(__TIMETOLIVE_ISSET_ID);
}
- /** Returns true if field timeToLive is set (has been asigned a value) and false otherwise */
+ /** Returns true if field timeToLive is set (has been assigned a value) and false otherwise */
public boolean isSetTimeToLive() {
return __isset_bit_vector.get(__TIMETOLIVE_ISSET_ID);
}
@@ -445,7 +498,7 @@ public class ColumnDescriptor implements
if (value == null) {
unsetName();
} else {
- setName((byte[])value);
+ setName((ByteBuffer)value);
}
break;
@@ -516,49 +569,45 @@ public class ColumnDescriptor implements
}
}
- public void setFieldValue(int fieldID, Object value) {
- setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
- }
-
public Object getFieldValue(_Fields field) {
switch (field) {
case NAME:
return getName();
case MAX_VERSIONS:
- return new Integer(getMaxVersions());
+ return Integer.valueOf(getMaxVersions());
case COMPRESSION:
return getCompression();
case IN_MEMORY:
- return new Boolean(isInMemory());
+ return Boolean.valueOf(isInMemory());
case BLOOM_FILTER_TYPE:
return getBloomFilterType();
case BLOOM_FILTER_VECTOR_SIZE:
- return new Integer(getBloomFilterVectorSize());
+ return Integer.valueOf(getBloomFilterVectorSize());
case BLOOM_FILTER_NB_HASHES:
- return new Integer(getBloomFilterNbHashes());
+ return Integer.valueOf(getBloomFilterNbHashes());
case BLOCK_CACHE_ENABLED:
- return new Boolean(isBlockCacheEnabled());
+ return Boolean.valueOf(isBlockCacheEnabled());
case TIME_TO_LIVE:
- return new Integer(getTimeToLive());
+ return Integer.valueOf(getTimeToLive());
}
throw new IllegalStateException();
}
- public Object getFieldValue(int fieldId) {
- return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
- }
-
- /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
+ /** 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 NAME:
return isSetName();
@@ -582,10 +631,6 @@ public class ColumnDescriptor implements
throw new IllegalStateException();
}
- public boolean isSet(int fieldID) {
- return isSet(_Fields.findByThriftIdOrThrow(fieldID));
- }
-
@Override
public boolean equals(Object that) {
if (that == null)
@@ -604,7 +649,7 @@ public class ColumnDescriptor implements
if (this_present_name || that_present_name) {
if (!(this_present_name && that_present_name))
return false;
- if (!java.util.Arrays.equals(this.name, that.name))
+ if (!this.name.equals(that.name))
return false;
}
@@ -685,54 +730,7 @@ public class ColumnDescriptor implements
@Override
public int hashCode() {
- HashCodeBuilder builder = new HashCodeBuilder();
-
- boolean present_name = true && (isSetName());
- builder.append(present_name);
- if (present_name)
- builder.append(name);
-
- boolean present_maxVersions = true;
- builder.append(present_maxVersions);
- if (present_maxVersions)
- builder.append(maxVersions);
-
- boolean present_compression = true && (isSetCompression());
- builder.append(present_compression);
- if (present_compression)
- builder.append(compression);
-
- boolean present_inMemory = true;
- builder.append(present_inMemory);
- if (present_inMemory)
- builder.append(inMemory);
-
- boolean present_bloomFilterType = true && (isSetBloomFilterType());
- builder.append(present_bloomFilterType);
- if (present_bloomFilterType)
- builder.append(bloomFilterType);
-
- boolean present_bloomFilterVectorSize = true;
- builder.append(present_bloomFilterVectorSize);
- if (present_bloomFilterVectorSize)
- builder.append(bloomFilterVectorSize);
-
- boolean present_bloomFilterNbHashes = true;
- builder.append(present_bloomFilterNbHashes);
- if (present_bloomFilterNbHashes)
- builder.append(bloomFilterNbHashes);
-
- boolean present_blockCacheEnabled = true;
- builder.append(present_blockCacheEnabled);
- if (present_blockCacheEnabled)
- builder.append(blockCacheEnabled);
-
- boolean present_timeToLive = true;
- builder.append(present_timeToLive);
- if (present_timeToLive)
- builder.append(timeToLive);
-
- return builder.toHashCode();
+ return 0;
}
public int compareTo(ColumnDescriptor other) {
@@ -743,213 +741,109 @@ public class ColumnDescriptor implements
int lastComparison = 0;
ColumnDescriptor typedOther = (ColumnDescriptor)other;
- lastComparison = Boolean.valueOf(isSetName()).compareTo(isSetName());
+ lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(name, typedOther.name);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetName()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetMaxVersions()).compareTo(isSetMaxVersions());
+ lastComparison = Boolean.valueOf(isSetMaxVersions()).compareTo(typedOther.isSetMaxVersions());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(maxVersions, typedOther.maxVersions);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetMaxVersions()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxVersions, typedOther.maxVersions);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetCompression()).compareTo(isSetCompression());
+ lastComparison = Boolean.valueOf(isSetCompression()).compareTo(typedOther.isSetCompression());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(compression, typedOther.compression);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetCompression()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.compression, typedOther.compression);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetInMemory()).compareTo(isSetInMemory());
+ lastComparison = Boolean.valueOf(isSetInMemory()).compareTo(typedOther.isSetInMemory());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(inMemory, typedOther.inMemory);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetInMemory()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inMemory, typedOther.inMemory);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetBloomFilterType()).compareTo(isSetBloomFilterType());
+ lastComparison = Boolean.valueOf(isSetBloomFilterType()).compareTo(typedOther.isSetBloomFilterType());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(bloomFilterType, typedOther.bloomFilterType);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetBloomFilterType()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bloomFilterType, typedOther.bloomFilterType);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetBloomFilterVectorSize()).compareTo(isSetBloomFilterVectorSize());
+ lastComparison = Boolean.valueOf(isSetBloomFilterVectorSize()).compareTo(typedOther.isSetBloomFilterVectorSize());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(bloomFilterVectorSize, typedOther.bloomFilterVectorSize);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetBloomFilterVectorSize()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bloomFilterVectorSize, typedOther.bloomFilterVectorSize);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetBloomFilterNbHashes()).compareTo(isSetBloomFilterNbHashes());
+ lastComparison = Boolean.valueOf(isSetBloomFilterNbHashes()).compareTo(typedOther.isSetBloomFilterNbHashes());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(bloomFilterNbHashes, typedOther.bloomFilterNbHashes);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetBloomFilterNbHashes()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bloomFilterNbHashes, typedOther.bloomFilterNbHashes);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetBlockCacheEnabled()).compareTo(isSetBlockCacheEnabled());
+ lastComparison = Boolean.valueOf(isSetBlockCacheEnabled()).compareTo(typedOther.isSetBlockCacheEnabled());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(blockCacheEnabled, typedOther.blockCacheEnabled);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetBlockCacheEnabled()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockCacheEnabled, typedOther.blockCacheEnabled);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetTimeToLive()).compareTo(isSetTimeToLive());
+ lastComparison = Boolean.valueOf(isSetTimeToLive()).compareTo(typedOther.isSetTimeToLive());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(timeToLive, typedOther.timeToLive);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetTimeToLive()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeToLive, typedOther.timeToLive);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
return 0;
}
- public void read(TProtocol iprot) throws TException {
- TField field;
- iprot.readStructBegin();
- while (true)
- {
- field = iprot.readFieldBegin();
- if (field.type == TType.STOP) {
- break;
- }
- _Fields fieldId = _Fields.findByThriftId(field.id);
- if (fieldId == null) {
- TProtocolUtil.skip(iprot, field.type);
- } else {
- switch (fieldId) {
- case NAME:
- if (field.type == TType.STRING) {
- this.name = iprot.readBinary();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case MAX_VERSIONS:
- if (field.type == TType.I32) {
- this.maxVersions = iprot.readI32();
- setMaxVersionsIsSet(true);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case COMPRESSION:
- if (field.type == TType.STRING) {
- this.compression = iprot.readString();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case IN_MEMORY:
- if (field.type == TType.BOOL) {
- this.inMemory = iprot.readBool();
- setInMemoryIsSet(true);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case BLOOM_FILTER_TYPE:
- if (field.type == TType.STRING) {
- this.bloomFilterType = iprot.readString();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case BLOOM_FILTER_VECTOR_SIZE:
- if (field.type == TType.I32) {
- this.bloomFilterVectorSize = iprot.readI32();
- setBloomFilterVectorSizeIsSet(true);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case BLOOM_FILTER_NB_HASHES:
- if (field.type == TType.I32) {
- this.bloomFilterNbHashes = iprot.readI32();
- setBloomFilterNbHashesIsSet(true);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case BLOCK_CACHE_ENABLED:
- if (field.type == TType.BOOL) {
- this.blockCacheEnabled = iprot.readBool();
- setBlockCacheEnabledIsSet(true);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case TIME_TO_LIVE:
- if (field.type == TType.I32) {
- this.timeToLive = iprot.readI32();
- setTimeToLiveIsSet(true);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- }
- iprot.readFieldEnd();
- }
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- validate();
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
}
- public void write(TProtocol oprot) throws TException {
- validate();
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
- oprot.writeStructBegin(STRUCT_DESC);
- if (this.name != null) {
- oprot.writeFieldBegin(NAME_FIELD_DESC);
- oprot.writeBinary(this.name);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(MAX_VERSIONS_FIELD_DESC);
- oprot.writeI32(this.maxVersions);
- oprot.writeFieldEnd();
- if (this.compression != null) {
- oprot.writeFieldBegin(COMPRESSION_FIELD_DESC);
- oprot.writeString(this.compression);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(IN_MEMORY_FIELD_DESC);
- oprot.writeBool(this.inMemory);
- oprot.writeFieldEnd();
- if (this.bloomFilterType != null) {
- oprot.writeFieldBegin(BLOOM_FILTER_TYPE_FIELD_DESC);
- oprot.writeString(this.bloomFilterType);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(BLOOM_FILTER_VECTOR_SIZE_FIELD_DESC);
- oprot.writeI32(this.bloomFilterVectorSize);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(BLOOM_FILTER_NB_HASHES_FIELD_DESC);
- oprot.writeI32(this.bloomFilterNbHashes);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(BLOCK_CACHE_ENABLED_FIELD_DESC);
- oprot.writeBool(this.blockCacheEnabled);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(TIME_TO_LIVE_FIELD_DESC);
- oprot.writeI32(this.timeToLive);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -1008,9 +902,283 @@ public class ColumnDescriptor implements
return sb.toString();
}
- public void validate() throws TException {
+ public void validate() throws org.apache.thrift.TException {
// check for required fields
}
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+ __isset_bit_vector = new BitSet(1);
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class ColumnDescriptorStandardSchemeFactory implements SchemeFactory {
+ public ColumnDescriptorStandardScheme getScheme() {
+ return new ColumnDescriptorStandardScheme();
+ }
+ }
+
+ private static class ColumnDescriptorStandardScheme extends StandardScheme<ColumnDescriptor> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, ColumnDescriptor 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: // NAME
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.name = iprot.readBinary();
+ struct.setNameIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // MAX_VERSIONS
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.maxVersions = iprot.readI32();
+ struct.setMaxVersionsIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // COMPRESSION
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.compression = iprot.readString();
+ struct.setCompressionIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // IN_MEMORY
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.inMemory = iprot.readBool();
+ struct.setInMemoryIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // BLOOM_FILTER_TYPE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.bloomFilterType = iprot.readString();
+ struct.setBloomFilterTypeIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // BLOOM_FILTER_VECTOR_SIZE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.bloomFilterVectorSize = iprot.readI32();
+ struct.setBloomFilterVectorSizeIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 7: // BLOOM_FILTER_NB_HASHES
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.bloomFilterNbHashes = iprot.readI32();
+ struct.setBloomFilterNbHashesIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 8: // BLOCK_CACHE_ENABLED
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.blockCacheEnabled = iprot.readBool();
+ struct.setBlockCacheEnabledIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 9: // TIME_TO_LIVE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.timeToLive = iprot.readI32();
+ struct.setTimeToLiveIsSet(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, ColumnDescriptor struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.name != null) {
+ oprot.writeFieldBegin(NAME_FIELD_DESC);
+ oprot.writeBinary(struct.name);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(MAX_VERSIONS_FIELD_DESC);
+ oprot.writeI32(struct.maxVersions);
+ oprot.writeFieldEnd();
+ if (struct.compression != null) {
+ oprot.writeFieldBegin(COMPRESSION_FIELD_DESC);
+ oprot.writeString(struct.compression);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(IN_MEMORY_FIELD_DESC);
+ oprot.writeBool(struct.inMemory);
+ oprot.writeFieldEnd();
+ if (struct.bloomFilterType != null) {
+ oprot.writeFieldBegin(BLOOM_FILTER_TYPE_FIELD_DESC);
+ oprot.writeString(struct.bloomFilterType);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(BLOOM_FILTER_VECTOR_SIZE_FIELD_DESC);
+ oprot.writeI32(struct.bloomFilterVectorSize);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(BLOOM_FILTER_NB_HASHES_FIELD_DESC);
+ oprot.writeI32(struct.bloomFilterNbHashes);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(BLOCK_CACHE_ENABLED_FIELD_DESC);
+ oprot.writeBool(struct.blockCacheEnabled);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(TIME_TO_LIVE_FIELD_DESC);
+ oprot.writeI32(struct.timeToLive);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class ColumnDescriptorTupleSchemeFactory implements SchemeFactory {
+ public ColumnDescriptorTupleScheme getScheme() {
+ return new ColumnDescriptorTupleScheme();
+ }
+ }
+
+ private static class ColumnDescriptorTupleScheme extends TupleScheme<ColumnDescriptor> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, ColumnDescriptor struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetName()) {
+ optionals.set(0);
+ }
+ if (struct.isSetMaxVersions()) {
+ optionals.set(1);
+ }
+ if (struct.isSetCompression()) {
+ optionals.set(2);
+ }
+ if (struct.isSetInMemory()) {
+ optionals.set(3);
+ }
+ if (struct.isSetBloomFilterType()) {
+ optionals.set(4);
+ }
+ if (struct.isSetBloomFilterVectorSize()) {
+ optionals.set(5);
+ }
+ if (struct.isSetBloomFilterNbHashes()) {
+ optionals.set(6);
+ }
+ if (struct.isSetBlockCacheEnabled()) {
+ optionals.set(7);
+ }
+ if (struct.isSetTimeToLive()) {
+ optionals.set(8);
+ }
+ oprot.writeBitSet(optionals, 9);
+ if (struct.isSetName()) {
+ oprot.writeBinary(struct.name);
+ }
+ if (struct.isSetMaxVersions()) {
+ oprot.writeI32(struct.maxVersions);
+ }
+ if (struct.isSetCompression()) {
+ oprot.writeString(struct.compression);
+ }
+ if (struct.isSetInMemory()) {
+ oprot.writeBool(struct.inMemory);
+ }
+ if (struct.isSetBloomFilterType()) {
+ oprot.writeString(struct.bloomFilterType);
+ }
+ if (struct.isSetBloomFilterVectorSize()) {
+ oprot.writeI32(struct.bloomFilterVectorSize);
+ }
+ if (struct.isSetBloomFilterNbHashes()) {
+ oprot.writeI32(struct.bloomFilterNbHashes);
+ }
+ if (struct.isSetBlockCacheEnabled()) {
+ oprot.writeBool(struct.blockCacheEnabled);
+ }
+ if (struct.isSetTimeToLive()) {
+ oprot.writeI32(struct.timeToLive);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, ColumnDescriptor struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(9);
+ if (incoming.get(0)) {
+ struct.name = iprot.readBinary();
+ struct.setNameIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.maxVersions = iprot.readI32();
+ struct.setMaxVersionsIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.compression = iprot.readString();
+ struct.setCompressionIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.inMemory = iprot.readBool();
+ struct.setInMemoryIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.bloomFilterType = iprot.readString();
+ struct.setBloomFilterTypeIsSet(true);
+ }
+ if (incoming.get(5)) {
+ struct.bloomFilterVectorSize = iprot.readI32();
+ struct.setBloomFilterVectorSizeIsSet(true);
+ }
+ if (incoming.get(6)) {
+ struct.bloomFilterNbHashes = iprot.readI32();
+ struct.setBloomFilterNbHashesIsSet(true);
+ }
+ if (incoming.get(7)) {
+ struct.blockCacheEnabled = iprot.readBool();
+ struct.setBlockCacheEnabledIsSet(true);
+ }
+ if (incoming.get(8)) {
+ struct.timeToLive = iprot.readI32();
+ struct.setTimeToLiveIsSet(true);
+ }
+ }
+ }
+
}