You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2010/01/20 23:04:38 UTC
svn commit: r901398 [1/3] - in /hadoop/hbase/trunk: ./ lib/
src/java/org/apache/hadoop/hbase/thrift/
src/java/org/apache/hadoop/hbase/thrift/generated/
Author: stack
Date: Wed Jan 20 22:04:37 2010
New Revision: 901398
URL: http://svn.apache.org/viewvc?rev=901398&view=rev
Log:
HBASE-1360 move up to Thrift 0.2.0
Added:
hadoop/hbase/trunk/lib/libthrift-0.2.0.jar (with props)
Removed:
hadoop/hbase/trunk/lib/libthrift-r771587.jar
Modified:
hadoop/hbase/trunk/CHANGES.txt
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/IOError.java
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/IllegalArgument.java
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/Mutation.java
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/TCell.java
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/package.html
Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=901398&r1=901397&r2=901398&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Wed Jan 20 22:04:37 2010
@@ -179,6 +179,7 @@
(Kay Kay via Stack)
HBASE-2139 findbugs task in build.xml (Kay Kay via Stack)
HBASE-2147 run zookeeper in the same jvm as master during non-distributed mode
+ HBASE-1360 move up to Thrift 0.2.0 (Kay Kay and Lars Francke via Stack)
IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable
Added: hadoop/hbase/trunk/lib/libthrift-0.2.0.jar
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/lib/libthrift-0.2.0.jar?rev=901398&view=auto
==============================================================================
Binary file - no diff available.
Propchange: hadoop/hbase/trunk/lib/libthrift-0.2.0.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java?rev=901398&r1=901397&r2=901398&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/AlreadyExists.java Wed Jan 20 22:04:37 2010
@@ -1,6 +1,4 @@
-/*
- * Copyright 2009 The Apache Software Foundation
- *
+/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -17,31 +15,86 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.hadoop.hbase.thrift.generated;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Collections;
-
+import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.thrift.*;
-import org.apache.thrift.meta_data.*;
+import org.apache.thrift.meta_data.FieldMetaData;
+import org.apache.thrift.meta_data.FieldValueMetaData;
import org.apache.thrift.protocol.*;
+import java.util.*;
+
/**
* An AlreadyExists exceptions signals that a table with the specified
* name already exists
*/
-public class AlreadyExists extends Exception implements TBase, java.io.Serializable, Cloneable {
- private static final long serialVersionUID = 1L;
+public class AlreadyExists extends Exception implements TBase<AlreadyExists._Fields>, java.io.Serializable, Cloneable, Comparable<AlreadyExists> {
private static final TStruct STRUCT_DESC = new TStruct("AlreadyExists");
+
private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)1);
public String message;
- public static final int MESSAGE = 1;
- public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
- put(MESSAGE, new FieldMetaData("message", TFieldRequirementType.DEFAULT,
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements TFieldIdEnum {
+ MESSAGE((short)1, "message");
+
+ 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);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ return byId.get(fieldId);
+ }
+
+ /**
+ * 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
+ put(_Fields.MESSAGE, new FieldMetaData("message", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.STRING)));
}});
@@ -68,7 +121,11 @@
}
}
- @Override
+ public AlreadyExists deepCopy() {
+ return new AlreadyExists(this);
+ }
+
+ @Deprecated
public AlreadyExists clone() {
return new AlreadyExists(this);
}
@@ -77,15 +134,16 @@
return this.message;
}
- public void setMessage(String 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 asigned a value) and false otherwise
+ /** Returns true if field message is set (has been asigned a value) and false otherwise */
public boolean isSetMessage() {
return this.message != null;
}
@@ -96,8 +154,8 @@
}
}
- public void setFieldValue(int fieldID, Object value) {
- switch (fieldID) {
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
case MESSAGE:
if (value == null) {
unsetMessage();
@@ -106,29 +164,37 @@
}
break;
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
}
- public Object getFieldValue(int fieldID) {
- switch (fieldID) {
+ public void setFieldValue(int fieldID, Object value) {
+ setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
case MESSAGE:
return getMessage();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
+ throw new IllegalStateException();
}
- // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise
- public boolean isSet(int fieldID) {
- switch (fieldID) {
+ public Object getFieldValue(int fieldId) {
+ return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ switch (field) {
case MESSAGE:
return isSetMessage();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
+ throw new IllegalStateException();
+ }
+
+ public boolean isSet(int fieldID) {
+ return isSet(_Fields.findByThriftIdOrThrow(fieldID));
}
@Override
@@ -158,6 +224,32 @@
@Override
public int hashCode() {
+ HashCodeBuilder builder = new HashCodeBuilder();
+
+ boolean present_message = true && (isSetMessage());
+ builder.append(present_message);
+ if (present_message)
+ builder.append(message);
+
+ return builder.toHashCode();
+ }
+
+ 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(isSetMessage());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = TBaseHelper.compareTo(message, typedOther.message);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
return 0;
}
@@ -170,24 +262,24 @@
if (field.type == TType.STOP) {
break;
}
- switch (field.id)
- {
- case MESSAGE:
- if (field.type == TType.STRING) {
- this.message = iprot.readString();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- TProtocolUtil.skip(iprot, field.type);
- break;
+ _Fields fieldId = _Fields.findByThriftId(field.id);
+ if (fieldId == null) {
+ TProtocolUtil.skip(iprot, field.type);
+ } else {
+ switch (fieldId) {
+ case MESSAGE:
+ if (field.type == TType.STRING) {
+ this.message = iprot.readString();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ }
+ iprot.readFieldEnd();
}
- iprot.readFieldEnd();
}
iprot.readStructEnd();
-
// check for required fields of primitive type, which can't be checked in the validate method
validate();
}
@@ -208,6 +300,7 @@
@Override
public String toString() {
StringBuilder sb = new StringBuilder("AlreadyExists(");
+ boolean first = true;
sb.append("message:");
if (this.message == null) {
@@ -215,13 +308,13 @@
} else {
sb.append(this.message);
}
+ first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws TException {
// check for required fields
- // check that fields of type enum have valid values
}
}
Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java?rev=901398&r1=901397&r2=901398&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/BatchMutation.java Wed Jan 20 22:04:37 2010
@@ -1,6 +1,4 @@
-/*
- * Copyright 2009 The Apache Software Foundation
- *
+/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -19,13 +17,21 @@
*/
package org.apache.hadoop.hbase.thrift.generated;
+import org.apache.commons.lang.builder.HashCodeBuilder;
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.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-import org.apache.hadoop.hbase.util.Bytes;
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
@@ -33,21 +39,77 @@
/**
* A BatchMutation object is used to apply a number of Mutations to a single row.
*/
-public class BatchMutation implements TBase, java.io.Serializable, Cloneable {
- private static final long serialVersionUID = 1L;
+public class BatchMutation implements TBase<BatchMutation._Fields>, java.io.Serializable, Cloneable, Comparable<BatchMutation> {
private static final TStruct STRUCT_DESC = new 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);
public byte[] row;
- public static final int ROW = 1;
public List<Mutation> mutations;
- public static final int MUTATIONS = 2;
- public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
- put(ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT,
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements TFieldIdEnum {
+ ROW((short)1, "row"),
+ 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);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ return byId.get(fieldId);
+ }
+
+ /**
+ * 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, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
+ put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.STRING)));
- put(MUTATIONS, new FieldMetaData("mutations", TFieldRequirementType.DEFAULT,
+ put(_Fields.MUTATIONS, new FieldMetaData("mutations", TFieldRequirementType.DEFAULT,
new ListMetaData(TType.LIST,
new StructMetaData(TType.STRUCT, Mutation.class))));
}});
@@ -84,7 +146,11 @@
}
}
- @Override
+ public BatchMutation deepCopy() {
+ return new BatchMutation(this);
+ }
+
+ @Deprecated
public BatchMutation clone() {
return new BatchMutation(this);
}
@@ -93,15 +159,16 @@
return this.row;
}
- public void setRow(byte[] row) {
+ public BatchMutation setRow(byte[] row) {
this.row = row;
+ return this;
}
public void unsetRow() {
this.row = null;
}
- // Returns true if field row is set (has been asigned a value) and false otherwise
+ /** Returns true if field row is set (has been asigned a value) and false otherwise */
public boolean isSetRow() {
return this.row != null;
}
@@ -131,15 +198,16 @@
return this.mutations;
}
- public void setMutations(List<Mutation> 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 asigned a value) and false otherwise
+ /** Returns true if field mutations is set (has been asigned a value) and false otherwise */
public boolean isSetMutations() {
return this.mutations != null;
}
@@ -150,8 +218,8 @@
}
}
- public void setFieldValue(int fieldID, Object value) {
- switch (fieldID) {
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
case ROW:
if (value == null) {
unsetRow();
@@ -168,34 +236,42 @@
}
break;
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
}
- public Object getFieldValue(int fieldID) {
- switch (fieldID) {
+ public void setFieldValue(int fieldID, Object value) {
+ setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
case ROW:
return getRow();
case MUTATIONS:
return getMutations();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
+ throw new IllegalStateException();
}
- // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise
- public boolean isSet(int fieldID) {
- switch (fieldID) {
+ public Object getFieldValue(int fieldId) {
+ return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ switch (field) {
case ROW:
return isSetRow();
case MUTATIONS:
return isSetMutations();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
+ throw new IllegalStateException();
+ }
+
+ public boolean isSet(int fieldID) {
+ return isSet(_Fields.findByThriftIdOrThrow(fieldID));
}
@Override
@@ -234,6 +310,45 @@
@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();
+ }
+
+ 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(isSetRow());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = TBaseHelper.compareTo(row, typedOther.row);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = Boolean.valueOf(isSetMutations()).compareTo(isSetMutations());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = TBaseHelper.compareTo(mutations, typedOther.mutations);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
return 0;
}
@@ -246,42 +361,42 @@
if (field.type == TType.STOP) {
break;
}
- switch (field.id)
- {
- 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)
+ _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) {
{
- Mutation _elem2;
- _elem2 = new Mutation();
- _elem2.read(iprot);
- this.mutations.add(_elem2);
+ 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();
}
- iprot.readListEnd();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
}
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- TProtocolUtil.skip(iprot, field.type);
- break;
+ break;
+ }
+ iprot.readFieldEnd();
}
- iprot.readFieldEnd();
}
iprot.readStructEnd();
-
// check for required fields of primitive type, which can't be checked in the validate method
validate();
}
@@ -299,7 +414,8 @@
oprot.writeFieldBegin(MUTATIONS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRUCT, this.mutations.size()));
- for (Mutation _iter3 : this.mutations) {
+ for (Mutation _iter3 : this.mutations)
+ {
_iter3.write(oprot);
}
oprot.writeListEnd();
@@ -319,7 +435,7 @@
if (this.row == null) {
sb.append("null");
} else {
- sb.append(Bytes.toStringBinary(this.row));
+ sb.append(this.row);
}
first = false;
if (!first) sb.append(", ");
@@ -336,7 +452,6 @@
public void validate() throws TException {
// check for required fields
- // check that fields of type enum have valid values
}
}
Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java?rev=901398&r1=901397&r2=901398&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/thrift/generated/ColumnDescriptor.java Wed Jan 20 22:04:37 2010
@@ -1,6 +1,4 @@
-/*
- * Copyright 2009 The Apache Software Foundation
- *
+/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -19,11 +17,21 @@
*/
package org.apache.hadoop.hbase.thrift.generated;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+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.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-import org.apache.hadoop.hbase.util.Bytes;
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
@@ -33,9 +41,9 @@
* 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, java.io.Serializable, Cloneable {
- private static final long serialVersionUID = 1L;
+public class ColumnDescriptor implements TBase<ColumnDescriptor._Fields>, java.io.Serializable, Cloneable, Comparable<ColumnDescriptor> {
private static final TStruct STRUCT_DESC = new 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);
@@ -47,53 +55,105 @@
private static final TField TIME_TO_LIVE_FIELD_DESC = new TField("timeToLive", TType.I32, (short)9);
public byte[] name;
- public static final int NAME = 1;
public int maxVersions;
- public static final int MAXVERSIONS = 2;
public String compression;
- public static final int COMPRESSION = 3;
public boolean inMemory;
- public static final int INMEMORY = 4;
public String bloomFilterType;
- public static final int BLOOMFILTERTYPE = 5;
public int bloomFilterVectorSize;
- public static final int BLOOMFILTERVECTORSIZE = 6;
public int bloomFilterNbHashes;
- public static final int BLOOMFILTERNBHASHES = 7;
public boolean blockCacheEnabled;
- public static final int BLOCKCACHEENABLED = 8;
public int timeToLive;
- public static final int TIMETOLIVE = 9;
- private final Isset __isset = new Isset();
- private static final class Isset implements java.io.Serializable {
- private static final long serialVersionUID = 1L;
- public boolean maxVersions = false;
- public boolean inMemory = false;
- public boolean bloomFilterVectorSize = false;
- public boolean bloomFilterNbHashes = false;
- public boolean blockCacheEnabled = false;
- public boolean timeToLive = false;
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements TFieldIdEnum {
+ NAME((short)1, "name"),
+ MAX_VERSIONS((short)2, "maxVersions"),
+ COMPRESSION((short)3, "compression"),
+ IN_MEMORY((short)4, "inMemory"),
+ BLOOM_FILTER_TYPE((short)5, "bloomFilterType"),
+ BLOOM_FILTER_VECTOR_SIZE((short)6, "bloomFilterVectorSize"),
+ BLOOM_FILTER_NB_HASHES((short)7, "bloomFilterNbHashes"),
+ 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);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ return byId.get(fieldId);
+ }
+
+ /**
+ * 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;
+ }
}
- public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
- put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT,
+ // isset id assignments
+ private static final int __MAXVERSIONS_ISSET_ID = 0;
+ private static final int __INMEMORY_ISSET_ID = 1;
+ private static final int __BLOOMFILTERVECTORSIZE_ISSET_ID = 2;
+ private static final int __BLOOMFILTERNBHASHES_ISSET_ID = 3;
+ 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(MAXVERSIONS, new FieldMetaData("maxVersions", TFieldRequirementType.DEFAULT,
+ put(_Fields.MAX_VERSIONS, new FieldMetaData("maxVersions", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.I32)));
- put(COMPRESSION, new FieldMetaData("compression", TFieldRequirementType.DEFAULT,
+ put(_Fields.COMPRESSION, new FieldMetaData("compression", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.STRING)));
- put(INMEMORY, new FieldMetaData("inMemory", TFieldRequirementType.DEFAULT,
+ put(_Fields.IN_MEMORY, new FieldMetaData("inMemory", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.BOOL)));
- put(BLOOMFILTERTYPE, new FieldMetaData("bloomFilterType", TFieldRequirementType.DEFAULT,
+ put(_Fields.BLOOM_FILTER_TYPE, new FieldMetaData("bloomFilterType", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.STRING)));
- put(BLOOMFILTERVECTORSIZE, new FieldMetaData("bloomFilterVectorSize", TFieldRequirementType.DEFAULT,
+ put(_Fields.BLOOM_FILTER_VECTOR_SIZE, new FieldMetaData("bloomFilterVectorSize", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.I32)));
- put(BLOOMFILTERNBHASHES, new FieldMetaData("bloomFilterNbHashes", TFieldRequirementType.DEFAULT,
+ put(_Fields.BLOOM_FILTER_NB_HASHES, new FieldMetaData("bloomFilterNbHashes", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.I32)));
- put(BLOCKCACHEENABLED, new FieldMetaData("blockCacheEnabled", TFieldRequirementType.DEFAULT,
+ put(_Fields.BLOCK_CACHE_ENABLED, new FieldMetaData("blockCacheEnabled", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.BOOL)));
- put(TIMETOLIVE, new FieldMetaData("timeToLive", TFieldRequirementType.DEFAULT,
+ put(_Fields.TIME_TO_LIVE, new FieldMetaData("timeToLive", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.I32)));
}});
@@ -134,49 +194,49 @@
this();
this.name = name;
this.maxVersions = maxVersions;
- this.__isset.maxVersions = true;
+ setMaxVersionsIsSet(true);
this.compression = compression;
this.inMemory = inMemory;
- this.__isset.inMemory = true;
+ setInMemoryIsSet(true);
this.bloomFilterType = bloomFilterType;
this.bloomFilterVectorSize = bloomFilterVectorSize;
- this.__isset.bloomFilterVectorSize = true;
+ setBloomFilterVectorSizeIsSet(true);
this.bloomFilterNbHashes = bloomFilterNbHashes;
- this.__isset.bloomFilterNbHashes = true;
+ setBloomFilterNbHashesIsSet(true);
this.blockCacheEnabled = blockCacheEnabled;
- this.__isset.blockCacheEnabled = true;
+ setBlockCacheEnabledIsSet(true);
this.timeToLive = timeToLive;
- this.__isset.timeToLive = true;
+ setTimeToLiveIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public ColumnDescriptor(ColumnDescriptor other) {
+ __isset_bit_vector.clear();
+ __isset_bit_vector.or(other.__isset_bit_vector);
if (other.isSetName()) {
this.name = other.name;
}
- __isset.maxVersions = other.__isset.maxVersions;
this.maxVersions = other.maxVersions;
if (other.isSetCompression()) {
this.compression = other.compression;
}
- __isset.inMemory = other.__isset.inMemory;
this.inMemory = other.inMemory;
if (other.isSetBloomFilterType()) {
this.bloomFilterType = other.bloomFilterType;
}
- __isset.bloomFilterVectorSize = other.__isset.bloomFilterVectorSize;
this.bloomFilterVectorSize = other.bloomFilterVectorSize;
- __isset.bloomFilterNbHashes = other.__isset.bloomFilterNbHashes;
this.bloomFilterNbHashes = other.bloomFilterNbHashes;
- __isset.blockCacheEnabled = other.__isset.blockCacheEnabled;
this.blockCacheEnabled = other.blockCacheEnabled;
- __isset.timeToLive = other.__isset.timeToLive;
this.timeToLive = other.timeToLive;
}
- @Override
+ public ColumnDescriptor deepCopy() {
+ return new ColumnDescriptor(this);
+ }
+
+ @Deprecated
public ColumnDescriptor clone() {
return new ColumnDescriptor(this);
}
@@ -185,15 +245,16 @@
return this.name;
}
- public void setName(byte[] name) {
+ public ColumnDescriptor setName(byte[] name) {
this.name = name;
+ return this;
}
public void unsetName() {
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 asigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
@@ -208,37 +269,39 @@
return this.maxVersions;
}
- public void setMaxVersions(int maxVersions) {
+ public ColumnDescriptor setMaxVersions(int maxVersions) {
this.maxVersions = maxVersions;
- this.__isset.maxVersions = true;
+ setMaxVersionsIsSet(true);
+ return this;
}
public void unsetMaxVersions() {
- this.__isset.maxVersions = false;
+ __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 asigned a value) and false otherwise */
public boolean isSetMaxVersions() {
- return this.__isset.maxVersions;
+ return __isset_bit_vector.get(__MAXVERSIONS_ISSET_ID);
}
public void setMaxVersionsIsSet(boolean value) {
- this.__isset.maxVersions = value;
+ __isset_bit_vector.set(__MAXVERSIONS_ISSET_ID, value);
}
public String getCompression() {
return this.compression;
}
- public void setCompression(String compression) {
+ public ColumnDescriptor setCompression(String compression) {
this.compression = compression;
+ return this;
}
public void unsetCompression() {
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 asigned a value) and false otherwise */
public boolean isSetCompression() {
return this.compression != null;
}
@@ -253,37 +316,39 @@
return this.inMemory;
}
- public void setInMemory(boolean inMemory) {
+ public ColumnDescriptor setInMemory(boolean inMemory) {
this.inMemory = inMemory;
- this.__isset.inMemory = true;
+ setInMemoryIsSet(true);
+ return this;
}
public void unsetInMemory() {
- this.__isset.inMemory = false;
+ __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 asigned a value) and false otherwise */
public boolean isSetInMemory() {
- return this.__isset.inMemory;
+ return __isset_bit_vector.get(__INMEMORY_ISSET_ID);
}
public void setInMemoryIsSet(boolean value) {
- this.__isset.inMemory = value;
+ __isset_bit_vector.set(__INMEMORY_ISSET_ID, value);
}
public String getBloomFilterType() {
return this.bloomFilterType;
}
- public void setBloomFilterType(String bloomFilterType) {
+ public ColumnDescriptor setBloomFilterType(String bloomFilterType) {
this.bloomFilterType = bloomFilterType;
+ return this;
}
public void unsetBloomFilterType() {
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 asigned a value) and false otherwise */
public boolean isSetBloomFilterType() {
return this.bloomFilterType != null;
}
@@ -298,92 +363,96 @@
return this.bloomFilterVectorSize;
}
- public void setBloomFilterVectorSize(int bloomFilterVectorSize) {
+ public ColumnDescriptor setBloomFilterVectorSize(int bloomFilterVectorSize) {
this.bloomFilterVectorSize = bloomFilterVectorSize;
- this.__isset.bloomFilterVectorSize = true;
+ setBloomFilterVectorSizeIsSet(true);
+ return this;
}
public void unsetBloomFilterVectorSize() {
- this.__isset.bloomFilterVectorSize = false;
+ __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 asigned a value) and false otherwise */
public boolean isSetBloomFilterVectorSize() {
- return this.__isset.bloomFilterVectorSize;
+ return __isset_bit_vector.get(__BLOOMFILTERVECTORSIZE_ISSET_ID);
}
public void setBloomFilterVectorSizeIsSet(boolean value) {
- this.__isset.bloomFilterVectorSize = value;
+ __isset_bit_vector.set(__BLOOMFILTERVECTORSIZE_ISSET_ID, value);
}
public int getBloomFilterNbHashes() {
return this.bloomFilterNbHashes;
}
- public void setBloomFilterNbHashes(int bloomFilterNbHashes) {
+ public ColumnDescriptor setBloomFilterNbHashes(int bloomFilterNbHashes) {
this.bloomFilterNbHashes = bloomFilterNbHashes;
- this.__isset.bloomFilterNbHashes = true;
+ setBloomFilterNbHashesIsSet(true);
+ return this;
}
public void unsetBloomFilterNbHashes() {
- this.__isset.bloomFilterNbHashes = false;
+ __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 asigned a value) and false otherwise */
public boolean isSetBloomFilterNbHashes() {
- return this.__isset.bloomFilterNbHashes;
+ return __isset_bit_vector.get(__BLOOMFILTERNBHASHES_ISSET_ID);
}
public void setBloomFilterNbHashesIsSet(boolean value) {
- this.__isset.bloomFilterNbHashes = value;
+ __isset_bit_vector.set(__BLOOMFILTERNBHASHES_ISSET_ID, value);
}
public boolean isBlockCacheEnabled() {
return this.blockCacheEnabled;
}
- public void setBlockCacheEnabled(boolean blockCacheEnabled) {
+ public ColumnDescriptor setBlockCacheEnabled(boolean blockCacheEnabled) {
this.blockCacheEnabled = blockCacheEnabled;
- this.__isset.blockCacheEnabled = true;
+ setBlockCacheEnabledIsSet(true);
+ return this;
}
public void unsetBlockCacheEnabled() {
- this.__isset.blockCacheEnabled = false;
+ __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 asigned a value) and false otherwise */
public boolean isSetBlockCacheEnabled() {
- return this.__isset.blockCacheEnabled;
+ return __isset_bit_vector.get(__BLOCKCACHEENABLED_ISSET_ID);
}
public void setBlockCacheEnabledIsSet(boolean value) {
- this.__isset.blockCacheEnabled = value;
+ __isset_bit_vector.set(__BLOCKCACHEENABLED_ISSET_ID, value);
}
public int getTimeToLive() {
return this.timeToLive;
}
- public void setTimeToLive(int timeToLive) {
+ public ColumnDescriptor setTimeToLive(int timeToLive) {
this.timeToLive = timeToLive;
- this.__isset.timeToLive = true;
+ setTimeToLiveIsSet(true);
+ return this;
}
public void unsetTimeToLive() {
- this.__isset.timeToLive = false;
+ __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 asigned a value) and false otherwise */
public boolean isSetTimeToLive() {
- return this.__isset.timeToLive;
+ return __isset_bit_vector.get(__TIMETOLIVE_ISSET_ID);
}
public void setTimeToLiveIsSet(boolean value) {
- this.__isset.timeToLive = value;
+ __isset_bit_vector.set(__TIMETOLIVE_ISSET_ID, value);
}
- public void setFieldValue(int fieldID, Object value) {
- switch (fieldID) {
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
case NAME:
if (value == null) {
unsetName();
@@ -392,7 +461,7 @@
}
break;
- case MAXVERSIONS:
+ case MAX_VERSIONS:
if (value == null) {
unsetMaxVersions();
} else {
@@ -408,7 +477,7 @@
}
break;
- case INMEMORY:
+ case IN_MEMORY:
if (value == null) {
unsetInMemory();
} else {
@@ -416,7 +485,7 @@
}
break;
- case BLOOMFILTERTYPE:
+ case BLOOM_FILTER_TYPE:
if (value == null) {
unsetBloomFilterType();
} else {
@@ -424,7 +493,7 @@
}
break;
- case BLOOMFILTERVECTORSIZE:
+ case BLOOM_FILTER_VECTOR_SIZE:
if (value == null) {
unsetBloomFilterVectorSize();
} else {
@@ -432,7 +501,7 @@
}
break;
- case BLOOMFILTERNBHASHES:
+ case BLOOM_FILTER_NB_HASHES:
if (value == null) {
unsetBloomFilterNbHashes();
} else {
@@ -440,7 +509,7 @@
}
break;
- case BLOCKCACHEENABLED:
+ case BLOCK_CACHE_ENABLED:
if (value == null) {
unsetBlockCacheEnabled();
} else {
@@ -448,7 +517,7 @@
}
break;
- case TIMETOLIVE:
+ case TIME_TO_LIVE:
if (value == null) {
unsetTimeToLive();
} else {
@@ -456,69 +525,77 @@
}
break;
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
}
- public Object getFieldValue(int fieldID) {
- switch (fieldID) {
+ public void setFieldValue(int fieldID, Object value) {
+ setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
case NAME:
return getName();
- case MAXVERSIONS:
- return Integer.valueOf(getMaxVersions());
+ case MAX_VERSIONS:
+ return new Integer(getMaxVersions());
case COMPRESSION:
return getCompression();
- case INMEMORY:
- return Boolean.valueOf(isInMemory());
+ case IN_MEMORY:
+ return new Boolean(isInMemory());
- case BLOOMFILTERTYPE:
+ case BLOOM_FILTER_TYPE:
return getBloomFilterType();
- case BLOOMFILTERVECTORSIZE:
- return Integer.valueOf(getBloomFilterVectorSize());
+ case BLOOM_FILTER_VECTOR_SIZE:
+ return new Integer(getBloomFilterVectorSize());
- case BLOOMFILTERNBHASHES:
- return Integer.valueOf(getBloomFilterNbHashes());
+ case BLOOM_FILTER_NB_HASHES:
+ return new Integer(getBloomFilterNbHashes());
- case BLOCKCACHEENABLED:
- return Boolean.valueOf(isBlockCacheEnabled());
+ case BLOCK_CACHE_ENABLED:
+ return new Boolean(isBlockCacheEnabled());
- case TIMETOLIVE:
- return Integer.valueOf(getTimeToLive());
+ case TIME_TO_LIVE:
+ return new Integer(getTimeToLive());
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
+ throw new IllegalStateException();
}
- // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise
- public boolean isSet(int fieldID) {
- switch (fieldID) {
+ public Object getFieldValue(int fieldId) {
+ return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ switch (field) {
case NAME:
return isSetName();
- case MAXVERSIONS:
+ case MAX_VERSIONS:
return isSetMaxVersions();
case COMPRESSION:
return isSetCompression();
- case INMEMORY:
+ case IN_MEMORY:
return isSetInMemory();
- case BLOOMFILTERTYPE:
+ case BLOOM_FILTER_TYPE:
return isSetBloomFilterType();
- case BLOOMFILTERVECTORSIZE:
+ case BLOOM_FILTER_VECTOR_SIZE:
return isSetBloomFilterVectorSize();
- case BLOOMFILTERNBHASHES:
+ case BLOOM_FILTER_NB_HASHES:
return isSetBloomFilterNbHashes();
- case BLOCKCACHEENABLED:
+ case BLOCK_CACHE_ENABLED:
return isSetBlockCacheEnabled();
- case TIMETOLIVE:
+ case TIME_TO_LIVE:
return isSetTimeToLive();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
+ throw new IllegalStateException();
+ }
+
+ public boolean isSet(int fieldID) {
+ return isSet(_Fields.findByThriftIdOrThrow(fieldID));
}
@Override
@@ -620,6 +697,136 @@
@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();
+ }
+
+ public int compareTo(ColumnDescriptor other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ ColumnDescriptor typedOther = (ColumnDescriptor)other;
+
+ lastComparison = Boolean.valueOf(isSetName()).compareTo(isSetName());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = TBaseHelper.compareTo(name, typedOther.name);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = Boolean.valueOf(isSetMaxVersions()).compareTo(isSetMaxVersions());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = TBaseHelper.compareTo(maxVersions, typedOther.maxVersions);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = Boolean.valueOf(isSetCompression()).compareTo(isSetCompression());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = TBaseHelper.compareTo(compression, typedOther.compression);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = Boolean.valueOf(isSetInMemory()).compareTo(isSetInMemory());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = TBaseHelper.compareTo(inMemory, typedOther.inMemory);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = Boolean.valueOf(isSetBloomFilterType()).compareTo(isSetBloomFilterType());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = TBaseHelper.compareTo(bloomFilterType, typedOther.bloomFilterType);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = Boolean.valueOf(isSetBloomFilterVectorSize()).compareTo(isSetBloomFilterVectorSize());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = TBaseHelper.compareTo(bloomFilterVectorSize, typedOther.bloomFilterVectorSize);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = Boolean.valueOf(isSetBloomFilterNbHashes()).compareTo(isSetBloomFilterNbHashes());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = TBaseHelper.compareTo(bloomFilterNbHashes, typedOther.bloomFilterNbHashes);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = Boolean.valueOf(isSetBlockCacheEnabled()).compareTo(isSetBlockCacheEnabled());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = TBaseHelper.compareTo(blockCacheEnabled, typedOther.blockCacheEnabled);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = Boolean.valueOf(isSetTimeToLive()).compareTo(isSetTimeToLive());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ lastComparison = TBaseHelper.compareTo(timeToLive, typedOther.timeToLive);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
return 0;
}
@@ -632,86 +839,86 @@
if (field.type == TType.STOP) {
break;
}
- switch (field.id)
- {
- case NAME:
- if (field.type == TType.STRING) {
- this.name = iprot.readBinary();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case MAXVERSIONS:
- if (field.type == TType.I32) {
- this.maxVersions = iprot.readI32();
- this.__isset.maxVersions = 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 INMEMORY:
- if (field.type == TType.BOOL) {
- this.inMemory = iprot.readBool();
- this.__isset.inMemory = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case BLOOMFILTERTYPE:
- if (field.type == TType.STRING) {
- this.bloomFilterType = iprot.readString();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case BLOOMFILTERVECTORSIZE:
- if (field.type == TType.I32) {
- this.bloomFilterVectorSize = iprot.readI32();
- this.__isset.bloomFilterVectorSize = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case BLOOMFILTERNBHASHES:
- if (field.type == TType.I32) {
- this.bloomFilterNbHashes = iprot.readI32();
- this.__isset.bloomFilterNbHashes = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case BLOCKCACHEENABLED:
- if (field.type == TType.BOOL) {
- this.blockCacheEnabled = iprot.readBool();
- this.__isset.blockCacheEnabled = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case TIMETOLIVE:
- if (field.type == TType.I32) {
- this.timeToLive = iprot.readI32();
- this.__isset.timeToLive = true;
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- TProtocolUtil.skip(iprot, field.type);
- 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.readFieldEnd();
}
iprot.readStructEnd();
-
// check for required fields of primitive type, which can't be checked in the validate method
validate();
}
@@ -766,7 +973,7 @@
if (this.name == null) {
sb.append("null");
} else {
- sb.append(Bytes.toString(this.name));
+ sb.append(this.name);
}
first = false;
if (!first) sb.append(", ");
@@ -815,7 +1022,6 @@
public void validate() throws TException {
// check for required fields
- // check that fields of type enum have valid values
}
}