Permalink
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
@@ -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);
}
}
Oops, something went wrong.

0 comments on commit 3b03d98

Please sign in to comment.