Skip to content
Browse files

Updated thrift bindings for Thrift-0.6.1: Compatible with

Flume-0.9.3+, including Flume-0.9.5-SNAPSHOT.
  • Loading branch information...
1 parent 22051a3 commit 3b03d98fe33163eee245ed96b9666638c74fbf29 swillis committed Aug 3, 2011
Showing with 19,963 additions and 11,507 deletions.
  1. +104 −93 src/java/org/apache/cassandra/thrift/AuthenticationException.java
  2. +99 −69 src/java/org/apache/cassandra/thrift/AuthenticationRequest.java
  3. +104 −93 src/java/org/apache/cassandra/thrift/AuthorizationException.java
  4. +15,713 −8,735 src/java/org/apache/cassandra/thrift/Cassandra.java
  5. +940 −361 src/java/org/apache/cassandra/thrift/CfDef.java
  6. +194 −158 src/java/org/apache/cassandra/thrift/Column.java
  7. +148 −125 src/java/org/apache/cassandra/thrift/ColumnDef.java
  8. +276 −71 src/java/org/apache/cassandra/thrift/ColumnOrSuperColumn.java
  9. +106 −85 src/java/org/apache/cassandra/thrift/ColumnParent.java
  10. +143 −112 src/java/org/apache/cassandra/thrift/ColumnPath.java
  11. +58 −25 src/java/org/apache/cassandra/thrift/ConsistencyLevel.java
  12. +2 −1 src/java/org/apache/cassandra/thrift/Constants.java
  13. +145 −121 src/java/org/apache/cassandra/thrift/Deletion.java
  14. +145 −116 src/java/org/apache/cassandra/thrift/IndexClause.java
  15. +147 −124 src/java/org/apache/cassandra/thrift/IndexExpression.java
  16. +20 −12 src/java/org/apache/cassandra/thrift/IndexOperator.java
  17. +8 −8 src/java/org/apache/cassandra/thrift/IndexType.java
  18. +104 −93 src/java/org/apache/cassandra/thrift/InvalidRequestException.java
  19. +112 −88 src/java/org/apache/cassandra/thrift/KeyCount.java
  20. +187 −143 src/java/org/apache/cassandra/thrift/KeyRange.java
  21. +120 −99 src/java/org/apache/cassandra/thrift/KeySlice.java
  22. +327 −146 src/java/org/apache/cassandra/thrift/KsDef.java
  23. +92 −76 src/java/org/apache/cassandra/thrift/Mutation.java
  24. +48 −42 src/java/org/apache/cassandra/thrift/NotFoundException.java
  25. +111 −95 src/java/org/apache/cassandra/thrift/SlicePredicate.java
  26. +174 −134 src/java/org/apache/cassandra/thrift/SliceRange.java
  27. +118 −97 src/java/org/apache/cassandra/thrift/SuperColumn.java
  28. +48 −42 src/java/org/apache/cassandra/thrift/TimedOutException.java
  29. +122 −101 src/java/org/apache/cassandra/thrift/TokenRange.java
  30. +48 −42 src/java/org/apache/cassandra/thrift/UnavailableException.java
View
197 src/java/org/apache/cassandra/thrift/AuthenticationException.java
@@ -15,34 +15,29 @@
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.*;
-
/**
* invalid authentication request (invalid keyspace, user does not exist, or credentials invalid)
*/
-public class AuthenticationException extends Exception implements TBase<AuthenticationException._Fields>, java.io.Serializable, Cloneable, Comparable<AuthenticationException> {
- private static final TStruct STRUCT_DESC = new TStruct("AuthenticationException");
+public class AuthenticationException extends Exception implements org.apache.thrift.TBase<AuthenticationException, AuthenticationException._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AuthenticationException");
- private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField WHY_FIELD_DESC = new org.apache.thrift.protocol.TField("why", org.apache.thrift.protocol.TType.STRING, (short)1);
- public String message;
+ public String why;
/** 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");
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ WHY((short)1, "why");
- 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);
}
}
@@ -51,7 +46,12 @@
* 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: // WHY
+ return WHY;
+ default:
+ return null;
+ }
}
/**
@@ -90,110 +90,102 @@ public String getFieldName() {
// 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.REQUIRED,
- new FieldValueMetaData(TType.STRING)));
- }});
-
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
- FieldMetaData.addStructMetaDataMap(AuthenticationException.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.WHY, new org.apache.thrift.meta_data.FieldMetaData("why", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AuthenticationException.class, metaDataMap);
}
public AuthenticationException() {
}
public AuthenticationException(
- String message)
+ String why)
{
this();
- this.message = message;
+ this.why = why;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public AuthenticationException(AuthenticationException other) {
- if (other.isSetMessage()) {
- this.message = other.message;
+ if (other.isSetWhy()) {
+ this.why = other.why;
}
}
public AuthenticationException deepCopy() {
return new AuthenticationException(this);
}
- @Deprecated
- public AuthenticationException clone() {
- return new AuthenticationException(this);
+ @Override
+ public void clear() {
+ this.why = null;
}
- public String getMessage() {
- return this.message;
+ public String getWhy() {
+ return this.why;
}
- public AuthenticationException setMessage(String message) {
- this.message = message;
+ public AuthenticationException setWhy(String why) {
+ this.why = why;
return this;
}
- public void unsetMessage() {
- this.message = null;
+ public void unsetWhy() {
+ this.why = null;
}
- /** Returns true if field message is set (has been asigned a value) and false otherwise */
- public boolean isSetMessage() {
- return this.message != null;
+ /** Returns true if field why is set (has been assigned a value) and false otherwise */
+ public boolean isSetWhy() {
+ return this.why != null;
}
- public void setMessageIsSet(boolean value) {
+ public void setWhyIsSet(boolean value) {
if (!value) {
- this.message = null;
+ this.why = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
- case MESSAGE:
+ case WHY:
if (value == null) {
- unsetMessage();
+ unsetWhy();
} else {
- setMessage((String)value);
+ setWhy((String)value);
}
break;
}
}
- public void setFieldValue(int fieldID, Object value) {
- setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
- }
-
public Object getFieldValue(_Fields field) {
switch (field) {
- case MESSAGE:
- return getMessage();
+ case WHY:
+ return getWhy();
}
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 MESSAGE:
- return isSetMessage();
+ case WHY:
+ return isSetWhy();
}
throw new IllegalStateException();
}
- public boolean isSet(int fieldID) {
- return isSet(_Fields.findByThriftIdOrThrow(fieldID));
- }
-
@Override
public boolean equals(Object that) {
if (that == null)
@@ -207,12 +199,12 @@ public boolean equals(AuthenticationException that) {
if (that == null)
return false;
- boolean this_present_message = true && this.isSetMessage();
- boolean that_present_message = true && that.isSetMessage();
- if (this_present_message || that_present_message) {
- if (!(this_present_message && that_present_message))
+ boolean this_present_why = true && this.isSetWhy();
+ boolean that_present_why = true && that.isSetWhy();
+ if (this_present_why || that_present_why) {
+ if (!(this_present_why && that_present_why))
return false;
- if (!this.message.equals(that.message))
+ if (!this.why.equals(that.why))
return false;
}
@@ -232,55 +224,58 @@ public int compareTo(AuthenticationException other) {
int lastComparison = 0;
AuthenticationException typedOther = (AuthenticationException)other;
- lastComparison = Boolean.valueOf(isSetMessage()).compareTo(isSetMessage());
+ lastComparison = Boolean.valueOf(isSetWhy()).compareTo(typedOther.isSetWhy());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(message, typedOther.message);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetWhy()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.why, typedOther.why);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
return 0;
}
- public void read(TProtocol iprot) throws TException {
- TField field;
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
- if (field.type == TType.STOP) {
+ if (field.type == org.apache.thrift.protocol.TType.STOP) {
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();
+ switch (field.id) {
+ case 1: // WHY
+ if (field.type == org.apache.thrift.protocol.TType.STRING) {
+ this.why = iprot.readString();
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
+ iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
validate();
}
- public void write(TProtocol oprot) throws TException {
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
- if (this.message != null) {
- oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
- oprot.writeString(this.message);
+ if (this.why != null) {
+ oprot.writeFieldBegin(WHY_FIELD_DESC);
+ oprot.writeString(this.why);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
@@ -292,21 +287,37 @@ public String toString() {
StringBuilder sb = new StringBuilder("AuthenticationException(");
boolean first = true;
- sb.append("message:");
- if (this.message == null) {
+ sb.append("why:");
+ if (this.why == null) {
sb.append("null");
} else {
- sb.append(this.message);
+ sb.append(this.why);
}
first = false;
sb.append(")");
return sb.toString();
}
- public void validate() throws TException {
+ public void validate() throws org.apache.thrift.TException {
// check for required fields
- if (message == null) {
- throw new TProtocolException("Required field 'message' was not present! Struct: " + toString());
+ if (why == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'why' was not present! Struct: " + toString());
+ }
+ }
+
+ 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);
}
}
View
168 src/java/org/apache/cassandra/thrift/AuthenticationRequest.java
@@ -15,34 +15,29 @@
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.*;
-
/**
* Authentication requests can contain any data, dependent on the IAuthenticator used
*/
-public class AuthenticationRequest implements TBase<AuthenticationRequest._Fields>, java.io.Serializable, Cloneable {
- private static final TStruct STRUCT_DESC = new TStruct("AuthenticationRequest");
+public class AuthenticationRequest implements org.apache.thrift.TBase<AuthenticationRequest, AuthenticationRequest._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AuthenticationRequest");
- private static final TField CREDENTIALS_FIELD_DESC = new TField("credentials", TType.MAP, (short)1);
+ private static final org.apache.thrift.protocol.TField CREDENTIALS_FIELD_DESC = new org.apache.thrift.protocol.TField("credentials", org.apache.thrift.protocol.TType.MAP, (short)1);
public Map<String,String> credentials;
/** 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 {
CREDENTIALS((short)1, "credentials");
- 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);
}
}
@@ -51,7 +46,12 @@
* 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: // CREDENTIALS
+ return CREDENTIALS;
+ default:
+ return null;
+ }
}
/**
@@ -90,15 +90,15 @@ public String getFieldName() {
// isset id assignments
- public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
- put(_Fields.CREDENTIALS, new FieldMetaData("credentials", TFieldRequirementType.REQUIRED,
- new MapMetaData(TType.MAP,
- new FieldValueMetaData(TType.STRING),
- new FieldValueMetaData(TType.STRING))));
- }});
-
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
- FieldMetaData.addStructMetaDataMap(AuthenticationRequest.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.CREDENTIALS, new org.apache.thrift.meta_data.FieldMetaData("credentials", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AuthenticationRequest.class, metaDataMap);
}
public AuthenticationRequest() {
@@ -136,9 +136,9 @@ public AuthenticationRequest deepCopy() {
return new AuthenticationRequest(this);
}
- @Deprecated
- public AuthenticationRequest clone() {
- return new AuthenticationRequest(this);
+ @Override
+ public void clear() {
+ this.credentials = null;
}
public int getCredentialsSize() {
@@ -165,7 +165,7 @@ public void unsetCredentials() {
this.credentials = null;
}
- /** Returns true if field credentials is set (has been asigned a value) and false otherwise */
+ /** Returns true if field credentials is set (has been assigned a value) and false otherwise */
public boolean isSetCredentials() {
return this.credentials != null;
}
@@ -189,10 +189,6 @@ public void setFieldValue(_Fields field, Object value) {
}
}
- public void setFieldValue(int fieldID, Object value) {
- setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
- }
-
public Object getFieldValue(_Fields field) {
switch (field) {
case CREDENTIALS:
@@ -202,23 +198,19 @@ public Object getFieldValue(_Fields field) {
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 CREDENTIALS:
return isSetCredentials();
}
throw new IllegalStateException();
}
- public boolean isSet(int fieldID) {
- return isSet(_Fields.findByThriftIdOrThrow(fieldID));
- }
-
@Override
public boolean equals(Object that) {
if (that == null)
@@ -249,61 +241,83 @@ public int hashCode() {
return 0;
}
- public void read(TProtocol iprot) throws TException {
- TField field;
+ public int compareTo(AuthenticationRequest other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ AuthenticationRequest typedOther = (AuthenticationRequest)other;
+
+ lastComparison = Boolean.valueOf(isSetCredentials()).compareTo(typedOther.isSetCredentials());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetCredentials()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.credentials, typedOther.credentials);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
- if (field.type == TType.STOP) {
+ if (field.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
- _Fields fieldId = _Fields.findByThriftId(field.id);
- if (fieldId == null) {
- TProtocolUtil.skip(iprot, field.type);
- } else {
- switch (fieldId) {
- case CREDENTIALS:
- if (field.type == TType.MAP) {
+ switch (field.id) {
+ case 1: // CREDENTIALS
+ if (field.type == org.apache.thrift.protocol.TType.MAP) {
+ {
+ org.apache.thrift.protocol.TMap _map24 = iprot.readMapBegin();
+ this.credentials = new HashMap<String,String>(2*_map24.size);
+ for (int _i25 = 0; _i25 < _map24.size; ++_i25)
{
- TMap _map20 = iprot.readMapBegin();
- this.credentials = new HashMap<String,String>(2*_map20.size);
- for (int _i21 = 0; _i21 < _map20.size; ++_i21)
- {
- String _key22;
- String _val23;
- _key22 = iprot.readString();
- _val23 = iprot.readString();
- this.credentials.put(_key22, _val23);
- }
- iprot.readMapEnd();
+ String _key26;
+ String _val27;
+ _key26 = iprot.readString();
+ _val27 = iprot.readString();
+ this.credentials.put(_key26, _val27);
}
- } else {
- TProtocolUtil.skip(iprot, field.type);
+ iprot.readMapEnd();
}
- break;
- }
- iprot.readFieldEnd();
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
+ iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
validate();
}
- public void write(TProtocol oprot) throws TException {
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
if (this.credentials != null) {
oprot.writeFieldBegin(CREDENTIALS_FIELD_DESC);
{
- oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.credentials.size()));
- for (Map.Entry<String, String> _iter24 : this.credentials.entrySet())
+ oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, this.credentials.size()));
+ for (Map.Entry<String, String> _iter28 : this.credentials.entrySet())
{
- oprot.writeString(_iter24.getKey());
- oprot.writeString(_iter24.getValue());
+ oprot.writeString(_iter28.getKey());
+ oprot.writeString(_iter28.getValue());
}
oprot.writeMapEnd();
}
@@ -329,10 +343,26 @@ public String toString() {
return sb.toString();
}
- public void validate() throws TException {
+ public void validate() throws org.apache.thrift.TException {
// check for required fields
if (credentials == null) {
- throw new TProtocolException("Required field 'credentials' was not present! Struct: " + toString());
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'credentials' was not present! Struct: " + toString());
+ }
+ }
+
+ 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);
}
}
View
197 src/java/org/apache/cassandra/thrift/AuthorizationException.java
@@ -15,34 +15,29 @@
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.*;
-
/**
* invalid authorization request (user does not have access to keyspace)
*/
-public class AuthorizationException extends Exception implements TBase<AuthorizationException._Fields>, java.io.Serializable, Cloneable, Comparable<AuthorizationException> {
- private static final TStruct STRUCT_DESC = new TStruct("AuthorizationException");
+public class AuthorizationException extends Exception implements org.apache.thrift.TBase<AuthorizationException, AuthorizationException._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AuthorizationException");
- private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField WHY_FIELD_DESC = new org.apache.thrift.protocol.TField("why", org.apache.thrift.protocol.TType.STRING, (short)1);
- public String message;
+ public String why;
/** 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");
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ WHY((short)1, "why");
- 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);
}
}
@@ -51,7 +46,12 @@
* 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: // WHY
+ return WHY;
+ default:
+ return null;
+ }
}
/**
@@ -90,110 +90,102 @@ public String getFieldName() {
// 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.REQUIRED,
- new FieldValueMetaData(TType.STRING)));
- }});
-
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
- FieldMetaData.addStructMetaDataMap(AuthorizationException.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.WHY, new org.apache.thrift.meta_data.FieldMetaData("why", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AuthorizationException.class, metaDataMap);
}
public AuthorizationException() {
}
public AuthorizationException(
- String message)
+ String why)
{
this();
- this.message = message;
+ this.why = why;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public AuthorizationException(AuthorizationException other) {
- if (other.isSetMessage()) {
- this.message = other.message;
+ if (other.isSetWhy()) {
+ this.why = other.why;
}
}
public AuthorizationException deepCopy() {
return new AuthorizationException(this);
}
- @Deprecated
- public AuthorizationException clone() {
- return new AuthorizationException(this);
+ @Override
+ public void clear() {
+ this.why = null;
}
- public String getMessage() {
- return this.message;
+ public String getWhy() {
+ return this.why;
}
- public AuthorizationException setMessage(String message) {
- this.message = message;
+ public AuthorizationException setWhy(String why) {
+ this.why = why;
return this;
}
- public void unsetMessage() {
- this.message = null;
+ public void unsetWhy() {
+ this.why = null;
}
- /** Returns true if field message is set (has been asigned a value) and false otherwise */
- public boolean isSetMessage() {
- return this.message != null;
+ /** Returns true if field why is set (has been assigned a value) and false otherwise */
+ public boolean isSetWhy() {
+ return this.why != null;
}
- public void setMessageIsSet(boolean value) {
+ public void setWhyIsSet(boolean value) {
if (!value) {
- this.message = null;
+ this.why = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
- case MESSAGE:
+ case WHY:
if (value == null) {
- unsetMessage();
+ unsetWhy();
} else {
- setMessage((String)value);
+ setWhy((String)value);
}
break;
}
}
- public void setFieldValue(int fieldID, Object value) {
- setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
- }
-
public Object getFieldValue(_Fields field) {
switch (field) {
- case MESSAGE:
- return getMessage();
+ case WHY:
+ return getWhy();
}
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 MESSAGE:
- return isSetMessage();
+ case WHY:
+ return isSetWhy();
}
throw new IllegalStateException();
}
- public boolean isSet(int fieldID) {
- return isSet(_Fields.findByThriftIdOrThrow(fieldID));
- }
-
@Override
public boolean equals(Object that) {
if (that == null)
@@ -207,12 +199,12 @@ public boolean equals(AuthorizationException that) {
if (that == null)
return false;
- boolean this_present_message = true && this.isSetMessage();
- boolean that_present_message = true && that.isSetMessage();
- if (this_present_message || that_present_message) {
- if (!(this_present_message && that_present_message))
+ boolean this_present_why = true && this.isSetWhy();
+ boolean that_present_why = true && that.isSetWhy();
+ if (this_present_why || that_present_why) {
+ if (!(this_present_why && that_present_why))
return false;
- if (!this.message.equals(that.message))
+ if (!this.why.equals(that.why))
return false;
}
@@ -232,55 +224,58 @@ public int compareTo(AuthorizationException other) {
int lastComparison = 0;
AuthorizationException typedOther = (AuthorizationException)other;
- lastComparison = Boolean.valueOf(isSetMessage()).compareTo(isSetMessage());
+ lastComparison = Boolean.valueOf(isSetWhy()).compareTo(typedOther.isSetWhy());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(message, typedOther.message);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetWhy()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.why, typedOther.why);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
return 0;
}
- public void read(TProtocol iprot) throws TException {
- TField field;
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
- if (field.type == TType.STOP) {
+ if (field.type == org.apache.thrift.protocol.TType.STOP) {
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();
+ switch (field.id) {
+ case 1: // WHY
+ if (field.type == org.apache.thrift.protocol.TType.STRING) {
+ this.why = iprot.readString();
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
+ iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
validate();
}
- public void write(TProtocol oprot) throws TException {
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
- if (this.message != null) {
- oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
- oprot.writeString(this.message);
+ if (this.why != null) {
+ oprot.writeFieldBegin(WHY_FIELD_DESC);
+ oprot.writeString(this.why);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
@@ -292,21 +287,37 @@ public String toString() {
StringBuilder sb = new StringBuilder("AuthorizationException(");
boolean first = true;
- sb.append("message:");
- if (this.message == null) {
+ sb.append("why:");
+ if (this.why == null) {
sb.append("null");
} else {
- sb.append(this.message);
+ sb.append(this.why);
}
first = false;
sb.append(")");
return sb.toString();
}
- public void validate() throws TException {
+ public void validate() throws org.apache.thrift.TException {
// check for required fields
- if (message == null) {
- throw new TProtocolException("Required field 'message' was not present! Struct: " + toString());
+ if (why == null) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'why' was not present! Struct: " + toString());
+ }
+ }
+
+ 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);
}
}
View
24,448 src/java/org/apache/cassandra/thrift/Cassandra.java
15,713 additions, 8,735 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
1,301 src/java/org/apache/cassandra/thrift/CfDef.java
940 additions, 361 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
352 src/java/org/apache/cassandra/thrift/Column.java
@@ -15,47 +15,42 @@
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.*;
-
/**
* Basic unit of data within a ColumnFamily.
* @param name, the name by which this column is set and retrieved. Maximum 64KB long.
* @param value. The data associated with the name. Maximum 2GB long, but in practice you should limit it to small numbers of MB (since Thrift must read the full value into memory to operate on it).
* @param timestamp. The timestamp is used for conflict detection/resolution when two columns with same name need to be compared.
* @param ttl. An optional, positive delay (in seconds) after which the column will be automatically deleted.
*/
-public class Column implements TBase<Column._Fields>, java.io.Serializable, Cloneable, Comparable<Column> {
- private static final TStruct STRUCT_DESC = new TStruct("Column");
+public class Column implements org.apache.thrift.TBase<Column, Column._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Column");
- private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1);
- private static final TField VALUE_FIELD_DESC = new TField("value", TType.STRING, (short)2);
- private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)3);
- private static final TField TTL_FIELD_DESC = new TField("ttl", TType.I32, (short)4);
+ 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 VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)3);
+ private static final org.apache.thrift.protocol.TField TTL_FIELD_DESC = new org.apache.thrift.protocol.TField("ttl", org.apache.thrift.protocol.TType.I32, (short)4);
- public byte[] name;
- public byte[] value;
+ public ByteBuffer name;
+ public ByteBuffer value;
public long timestamp;
public int ttl;
/** 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"),
VALUE((short)2, "value"),
TIMESTAMP((short)3, "timestamp"),
TTL((short)4, "ttl");
- 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);
}
}
@@ -64,7 +59,18 @@
* 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: // VALUE
+ return VALUE;
+ case 3: // TIMESTAMP
+ return TIMESTAMP;
+ case 4: // TTL
+ return TTL;
+ default:
+ return null;
+ }
}
/**
@@ -106,34 +112,29 @@ public String getFieldName() {
private static final int __TTL_ISSET_ID = 1;
private BitSet __isset_bit_vector = new BitSet(2);
- public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
- put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.REQUIRED,
- new FieldValueMetaData(TType.STRING)));
- put(_Fields.VALUE, new FieldMetaData("value", TFieldRequirementType.REQUIRED,
- new FieldValueMetaData(TType.STRING)));
- put(_Fields.TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.REQUIRED,
- new FieldValueMetaData(TType.I64)));
- put(_Fields.TTL, new FieldMetaData("ttl", TFieldRequirementType.OPTIONAL,
- new FieldValueMetaData(TType.I32)));
- }});
-
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
- FieldMetaData.addStructMetaDataMap(Column.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.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
+ tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
+ tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+ tmpMap.put(_Fields.TTL, new org.apache.thrift.meta_data.FieldMetaData("ttl", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Column.class, metaDataMap);
}
public Column() {
}
public Column(
- byte[] name,
- byte[] value,
- long timestamp)
+ ByteBuffer name)
{
this();
this.name = name;
- this.value = value;
- this.timestamp = timestamp;
- setTimestampIsSet(true);
}
/**
@@ -143,12 +144,12 @@ public Column(Column other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
if (other.isSetName()) {
- this.name = new byte[other.name.length];
- System.arraycopy(other.name, 0, name, 0, other.name.length);
+ this.name = org.apache.thrift.TBaseHelper.copyBinary(other.name);
+;
}
if (other.isSetValue()) {
- this.value = new byte[other.value.length];
- System.arraycopy(other.value, 0, value, 0, other.value.length);
+ this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value);
+;
}
this.timestamp = other.timestamp;
this.ttl = other.ttl;
@@ -158,16 +159,31 @@ public Column deepCopy() {
return new Column(this);
}
- @Deprecated
- public Column clone() {
- return new Column(this);
+ @Override
+ public void clear() {
+ this.name = null;
+ this.value = null;
+ setTimestampIsSet(false);
+ this.timestamp = 0;
+ setTtlIsSet(false);
+ this.ttl = 0;
}
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 Column setName(byte[] name) {
+ setName(name == null ? (ByteBuffer)null : ByteBuffer.wrap(name));
+ return this;
+ }
+
+ public Column setName(ByteBuffer name) {
this.name = name;
return this;
}
@@ -176,7 +192,7 @@ 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 assigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
@@ -188,10 +204,20 @@ public void setNameIsSet(boolean value) {
}
public byte[] getValue() {
- return this.value;
+ setValue(org.apache.thrift.TBaseHelper.rightSize(value));
+ return value == null ? null : value.array();
+ }
+
+ public ByteBuffer bufferForValue() {
+ return value;
}
public Column setValue(byte[] value) {
+ setValue(value == null ? (ByteBuffer)null : ByteBuffer.wrap(value));
+ return this;
+ }
+
+ public Column setValue(ByteBuffer value) {
this.value = value;
return this;
}
@@ -200,7 +226,7 @@ public void unsetValue() {
this.value = null;
}
- /** Returns true if field value is set (has been asigned a value) and false otherwise */
+ /** Returns true if field value is set (has been assigned a value) and false otherwise */
public boolean isSetValue() {
return this.value != null;
}
@@ -225,7 +251,7 @@ public void unsetTimestamp() {
__isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
}
- /** Returns true if field timestamp is set (has been asigned a value) and false otherwise */
+ /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */
public boolean isSetTimestamp() {
return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
}
@@ -248,7 +274,7 @@ public void unsetTtl() {
__isset_bit_vector.clear(__TTL_ISSET_ID);
}
- /** Returns true if field ttl is set (has been asigned a value) and false otherwise */
+ /** Returns true if field ttl is set (has been assigned a value) and false otherwise */
public boolean isSetTtl() {
return __isset_bit_vector.get(__TTL_ISSET_ID);
}
@@ -263,15 +289,15 @@ public void setFieldValue(_Fields field, Object value) {
if (value == null) {
unsetName();
} else {
- setName((byte[])value);
+ setName((ByteBuffer)value);
}
break;
case VALUE:
if (value == null) {
unsetValue();
} else {
- setValue((byte[])value);
+ setValue((ByteBuffer)value);
}
break;
@@ -294,10 +320,6 @@ public void setFieldValue(_Fields field, Object value) {
}
}
- public void setFieldValue(int fieldID, Object value) {
- setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
- }
-
public Object getFieldValue(_Fields field) {
switch (field) {
case NAME:
@@ -316,12 +338,12 @@ public Object getFieldValue(_Fields field) {
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();
@@ -335,10 +357,6 @@ public boolean isSet(_Fields field) {
throw new IllegalStateException();
}
- public boolean isSet(int fieldID) {
- return isSet(_Fields.findByThriftIdOrThrow(fieldID));
- }
-
@Override
public boolean equals(Object that) {
if (that == null)
@@ -357,7 +375,7 @@ public boolean equals(Column that) {
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;
}
@@ -366,12 +384,12 @@ public boolean equals(Column that) {
if (this_present_value || that_present_value) {
if (!(this_present_value && that_present_value))
return false;
- if (!java.util.Arrays.equals(this.value, that.value))
+ if (!this.value.equals(that.value))
return false;
}
- boolean this_present_timestamp = true;
- boolean that_present_timestamp = true;
+ boolean this_present_timestamp = true && this.isSetTimestamp();
+ boolean that_present_timestamp = true && that.isSetTimestamp();
if (this_present_timestamp || that_present_timestamp) {
if (!(this_present_timestamp && that_present_timestamp))
return false;
@@ -404,99 +422,105 @@ public int compareTo(Column other) {
int lastComparison = 0;
Column typedOther = (Column)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(isSetValue()).compareTo(isSetValue());
+ lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(value, typedOther.value);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetValue()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp());
+ lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetTimestamp()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetTtl()).compareTo(isSetTtl());
+ lastComparison = Boolean.valueOf(isSetTtl()).compareTo(typedOther.isSetTtl());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(ttl, typedOther.ttl);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetTtl()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ttl, typedOther.ttl);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
return 0;
}
- public void read(TProtocol iprot) throws TException {
- TField field;
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
- if (field.type == TType.STOP) {
+ if (field.type == org.apache.thrift.protocol.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 VALUE:
- if (field.type == TType.STRING) {
- this.value = iprot.readBinary();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case TIMESTAMP:
- if (field.type == TType.I64) {
- this.timestamp = iprot.readI64();
- setTimestampIsSet(true);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case TTL:
- if (field.type == TType.I32) {
- this.ttl = iprot.readI32();
- setTtlIsSet(true);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- }
- iprot.readFieldEnd();
+ switch (field.id) {
+ case 1: // NAME
+ if (field.type == org.apache.thrift.protocol.TType.STRING) {
+ this.name = iprot.readBinary();
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 2: // VALUE
+ if (field.type == org.apache.thrift.protocol.TType.STRING) {
+ this.value = iprot.readBinary();
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 3: // TIMESTAMP
+ if (field.type == org.apache.thrift.protocol.TType.I64) {
+ this.timestamp = iprot.readI64();
+ setTimestampIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 4: // TTL
+ if (field.type == org.apache.thrift.protocol.TType.I32) {
+ this.ttl = iprot.readI32();
+ setTtlIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
}
+ iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
- if (!isSetTimestamp()) {
- throw new TProtocolException("Required field 'timestamp' was not found in serialized data! Struct: " + toString());
- }
validate();
}
- public void write(TProtocol oprot) throws TException {
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
@@ -506,13 +530,17 @@ public void write(TProtocol oprot) throws TException {
oprot.writeFieldEnd();
}
if (this.value != null) {
- oprot.writeFieldBegin(VALUE_FIELD_DESC);
- oprot.writeBinary(this.value);
+ if (isSetValue()) {
+ oprot.writeFieldBegin(VALUE_FIELD_DESC);
+ oprot.writeBinary(this.value);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (isSetTimestamp()) {
+ oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
+ oprot.writeI64(this.timestamp);
oprot.writeFieldEnd();
}
- oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
- oprot.writeI64(this.timestamp);
- oprot.writeFieldEnd();
if (isSetTtl()) {
oprot.writeFieldBegin(TTL_FIELD_DESC);
oprot.writeI32(this.ttl);
@@ -531,31 +559,25 @@ public String toString() {
if (this.name == null) {
sb.append("null");
} else {
- int __name_size = Math.min(this.name.length, 128);
- for (int i = 0; i < __name_size; i++) {
- if (i != 0) sb.append(" ");
- sb.append(Integer.toHexString(this.name[i]).length() > 1 ? Integer.toHexString(this.name[i]).substring(Integer.toHexString(this.name[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.name[i]).toUpperCase());
- }
- if (this.name.length > 128) sb.append(" ...");
+ org.apache.thrift.TBaseHelper.toString(this.name, sb);
}
first = false;
- if (!first) sb.append(", ");
- sb.append("value:");
- if (this.value == null) {
- sb.append("null");
- } else {
- int __value_size = Math.min(this.value.length, 128);
- for (int i = 0; i < __value_size; i++) {
- if (i != 0) sb.append(" ");
- sb.append(Integer.toHexString(this.value[i]).length() > 1 ? Integer.toHexString(this.value[i]).substring(Integer.toHexString(this.value[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.value[i]).toUpperCase());
- }
- if (this.value.length > 128) sb.append(" ...");
+ if (isSetValue()) {
+ if (!first) sb.append(", ");
+ sb.append("value:");
+ if (this.value == null) {
+ sb.append("null");
+ } else {
+ org.apache.thrift.TBaseHelper.toString(this.value, sb);
+ }
+ first = false;
+ }
+ if (isSetTimestamp()) {
+ if (!first) sb.append(", ");
+ sb.append("timestamp:");
+ sb.append(this.timestamp);
+ first = false;
}
- first = false;
- if (!first) sb.append(", ");
- sb.append("timestamp:");
- sb.append(this.timestamp);
- first = false;
if (isSetTtl()) {
if (!first) sb.append(", ");
sb.append("ttl:");
@@ -566,15 +588,29 @@ public String toString() {
return sb.toString();
}
- public void validate() throws TException {
+ public void validate() throws org.apache.thrift.TException {
// check for required fields
if (name == null) {
- throw new TProtocolException("Required field 'name' was not present! Struct: " + toString());
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' was not present! Struct: " + toString());
}
- if (value == null) {
- throw new TProtocolException("Required field 'value' was not present! Struct: " + toString());
+ }
+
+ 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);
}
- // alas, we cannot check 'timestamp' because it's a primitive and you chose the non-beans generator.
}
}
View
273 src/java/org/apache/cassandra/thrift/ColumnDef.java
</
@@ -15,23 +15,20 @@
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.*;
+public class ColumnDef implements org.apache.thrift.TBase<ColumnDef, ColumnDef._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ColumnDef");
-public class ColumnDef implements TBase<ColumnDef._Fields>, java.io.Serializable, Cloneable, Comparable<ColumnDef> {
- private static final TStruct STRUCT_DESC = new TStruct("ColumnDef");
+ 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 VALIDATION_CLASS_FIELD_DESC = new org.apache.thrift.protocol.TField("validation_class", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField INDEX_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("index_type", org.apache.thrift.protocol.TType.I32, (short)3);
+ private static final org.apache.thrift.protocol.TField INDEX_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("index_name", org.apache.thrift.protocol.TType.STRING, (short)4);
- private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1);
- private static final TField VALIDATION_CLASS_FIELD_DESC = new TField("validation_class", TType.STRING, (short)2);
- private static final TField INDEX_TYPE_FIELD_DESC = new TField("index_type", TType.I32, (short)3);
- private static final TField INDEX_NAME_FIELD_DESC = new TField("index_name", TType.STRING, (short)4);
-
- public byte[] name;
+ public ByteBuffer name;
public String validation_class;
/**
*
@@ -41,7 +38,7 @@
public String index_name;
/** 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"),
VALIDATION_CLASS((short)2, "validation_class"),
/**
@@ -51,12 +48,10 @@
INDEX_TYPE((short)3, "index_type"),
INDEX_NAME((short)4, "index_name");
- 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);
}
}
@@ -65,7 +60,18 @@
* 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: // VALIDATION_CLASS
+ return VALIDATION_CLASS;
+ case 3: // INDEX_TYPE
+ return INDEX_TYPE;
+ case 4: // INDEX_NAME
+ return INDEX_NAME;
+ default:
+ return null;
+ }
}
/**
@@ -104,26 +110,26 @@ public String getFieldName() {
// isset id assignments
- public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
- put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.REQUIRED,
- new FieldValueMetaData(TType.STRING)));
- put(_Fields.VALIDATION_CLASS, new FieldMetaData("validation_class", TFieldRequirementType.REQUIRED,
- new FieldValueMetaData(TType.STRING)));
- put(_Fields.INDEX_TYPE, new FieldMetaData("index_type", TFieldRequirementType.OPTIONAL,
- new EnumMetaData(TType.ENUM, IndexType.class)));
- put(_Fields.INDEX_NAME, new FieldMetaData("index_name", TFieldRequirementType.OPTIONAL,
- new FieldValueMetaData(TType.STRING)));
- }});
-
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
- FieldMetaData.addStructMetaDataMap(ColumnDef.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.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
+ tmpMap.put(_Fields.VALIDATION_CLASS, new org.apache.thrift.meta_data.FieldMetaData("validation_class", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.INDEX_TYPE, new org.apache.thrift.meta_data.FieldMetaData("index_type", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, IndexType.class)));
+ tmpMap.put(_Fields.INDEX_NAME, new org.apache.thrift.meta_data.FieldMetaData("index_name", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ColumnDef.class, metaDataMap);
}
public ColumnDef() {
}
public ColumnDef(
- byte[] name,
+ ByteBuffer name,
String validation_class)
{
this();
@@ -136,8 +142,8 @@ public ColumnDef(
*/
public ColumnDef(ColumnDef other) {
if (other.isSetName()) {
- this.name = new byte[other.name.length];
- System.arraycopy(other.name, 0, name, 0, other.name.length);
+ this.name = org.apache.thrift.TBaseHelper.copyBinary(other.name);
+;
}
if (other.isSetValidation_class()) {
this.validation_class = other.validation_class;
@@ -154,16 +160,29 @@ public ColumnDef deepCopy() {
return new ColumnDef(this);
}
- @Deprecated
- public ColumnDef clone() {
- return new ColumnDef(this);
+ @Override
+ public void clear() {
+ this.name = null;
+ this.validation_class = null;
+ this.index_type = null;
+ this.index_name = null;
}
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 ColumnDef setName(byte[] name) {
+ setName(name == null ? (ByteBuffer)null : ByteBuffer.wrap(name));
+ return this;
+ }
+
+ public ColumnDef setName(ByteBuffer name) {
this.name = name;
return this;
}
@@ -172,7 +191,7 @@ 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 assigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
@@ -196,7 +215,7 @@ public void unsetValidation_class() {
this.validation_class = null;
}
- /** Returns true if field validation_class is set (has been asigned a value) and false otherwise */
+ /** Returns true if field validation_class is set (has been assigned a value) and false otherwise */
public boolean isSetValidation_class() {
return this.validation_class != null;
}
@@ -228,7 +247,7 @@ public void unsetIndex_type() {
this.index_type = null;
}
- /** Returns true if field index_type is set (has been asigned a value) and false otherwise */
+ /** Returns true if field index_type is set (has been assigned a value) and false otherwise */
public boolean isSetIndex_type() {
return this.index_type != null;
}
@@ -252,7 +271,7 @@ public void unsetIndex_name() {
this.index_name = null;
}
- /** Returns true if field index_name is set (has been asigned a value) and false otherwise */
+ /** Returns true if field index_name is set (has been assigned a value) and false otherwise */
public boolean isSetIndex_name() {
return this.index_name != null;
}
@@ -269,7 +288,7 @@ public void setFieldValue(_Fields field, Object value) {
if (value == null) {
unsetName();
} else {
- setName((byte[])value);
+ setName((ByteBuffer)value);
}
break;
@@ -300,10 +319,6 @@ public void setFieldValue(_Fields field, Object value) {
}
}
- public void setFieldValue(int fieldID, Object value) {
- setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
- }
-
public Object getFieldValue(_Fields field) {
switch (field) {
case NAME:
@@ -322,12 +337,12 @@ public Object getFieldValue(_Fields field) {
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();
@@ -341,10 +356,6 @@ public boolean isSet(_Fields field) {
throw new IllegalStateException();
}
- public boolean isSet(int fieldID) {
- return isSet(_Fields.findByThriftIdOrThrow(fieldID));
- }
-
@Override
public boolean equals(Object that) {
if (that == null)
@@ -363,7 +374,7 @@ public boolean equals(ColumnDef that) {
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;
}
@@ -410,94 +421,103 @@ public int compareTo(ColumnDef other) {
int lastComparison = 0;
ColumnDef typedOther = (ColumnDef)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(isSetValidation_class()).compareTo(isSetValidation_class());
+ lastComparison = Boolean.valueOf(isSetValidation_class()).compareTo(typedOther.isSetValidation_class());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(validation_class, typedOther.validation_class);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetValidation_class()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.validation_class, typedOther.validation_class);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetIndex_type()).compareTo(isSetIndex_type());
+ lastComparison = Boolean.valueOf(isSetIndex_type()).compareTo(typedOther.isSetIndex_type());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(index_type, typedOther.index_type);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetIndex_type()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.index_type, typedOther.index_type);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
- lastComparison = Boolean.valueOf(isSetIndex_name()).compareTo(isSetIndex_name());
+ lastComparison = Boolean.valueOf(isSetIndex_name()).compareTo(typedOther.isSetIndex_name());
if (lastComparison != 0) {
return lastComparison;
}
- lastComparison = TBaseHelper.compareTo(index_name, typedOther.index_name);
- if (lastComparison != 0) {
- return lastComparison;
+ if (isSetIndex_name()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.index_name, typedOther.index_name);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
}
return 0;
}
- public void read(TProtocol iprot) throws TException {
- TField field;
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
- if (field.type == TType.STOP) {
+ if (field.type == org.apache.thrift.protocol.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 VALIDATION_CLASS:
- if (field.type == TType.STRING) {
- this.validation_class = iprot.readString();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case INDEX_TYPE:
- if (field.type == TType.I32) {
- this.index_type = IndexType.findByValue(iprot.readI32());
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case INDEX_NAME:
- if (field.type == TType.STRING) {
- this.index_name = iprot.readString();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- }
- iprot.readFieldEnd();
+ switch (field.id) {
+ case 1: // NAME
+ if (field.type == org.apache.thrift.protocol.TType.STRING) {
+ this.name = iprot.readBinary();
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 2: // VALIDATION_CLASS
+ if (field.type == org.apache.thrift.protocol.TType.STRING) {
+ this.validation_class = iprot.readString();
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+ }