Permalink
Browse files

Old Bindings

  • Loading branch information...
1 parent 95e8bc2 commit 22051a3cc29edd51f6e16d652ce347f8563eb98c swillis committed Aug 3, 2011
Showing with 11,513 additions and 19,969 deletions.
  1. +93 −104 src/java/org/apache/cassandra/thrift/AuthenticationException.java
  2. +69 −99 src/java/org/apache/cassandra/thrift/AuthenticationRequest.java
  3. +93 −104 src/java/org/apache/cassandra/thrift/AuthorizationException.java
  4. +8,741 −15,719 src/java/org/apache/cassandra/thrift/Cassandra.java
  5. +361 −940 src/java/org/apache/cassandra/thrift/CfDef.java
  6. +158 −194 src/java/org/apache/cassandra/thrift/Column.java
  7. +125 −148 src/java/org/apache/cassandra/thrift/ColumnDef.java
  8. +71 −276 src/java/org/apache/cassandra/thrift/ColumnOrSuperColumn.java
  9. +85 −106 src/java/org/apache/cassandra/thrift/ColumnParent.java
  10. +112 −143 src/java/org/apache/cassandra/thrift/ColumnPath.java
  11. +25 −58 src/java/org/apache/cassandra/thrift/ConsistencyLevel.java
  12. +1 −2 src/java/org/apache/cassandra/thrift/Constants.java
  13. +121 −145 src/java/org/apache/cassandra/thrift/Deletion.java
  14. +116 −145 src/java/org/apache/cassandra/thrift/IndexClause.java
  15. +124 −147 src/java/org/apache/cassandra/thrift/IndexExpression.java
  16. +12 −20 src/java/org/apache/cassandra/thrift/IndexOperator.java
  17. +8 −8 src/java/org/apache/cassandra/thrift/IndexType.java
  18. +93 −104 src/java/org/apache/cassandra/thrift/InvalidRequestException.java
  19. +88 −112 src/java/org/apache/cassandra/thrift/KeyCount.java
  20. +143 −187 src/java/org/apache/cassandra/thrift/KeyRange.java
  21. +99 −120 src/java/org/apache/cassandra/thrift/KeySlice.java
  22. +146 −327 src/java/org/apache/cassandra/thrift/KsDef.java
  23. +76 −92 src/java/org/apache/cassandra/thrift/Mutation.java
  24. +42 −48 src/java/org/apache/cassandra/thrift/NotFoundException.java
  25. +95 −111 src/java/org/apache/cassandra/thrift/SlicePredicate.java
  26. +134 −174 src/java/org/apache/cassandra/thrift/SliceRange.java
  27. +97 −118 src/java/org/apache/cassandra/thrift/SuperColumn.java
  28. +42 −48 src/java/org/apache/cassandra/thrift/TimedOutException.java
  29. +101 −122 src/java/org/apache/cassandra/thrift/TokenRange.java
  30. +42 −48 src/java/org/apache/cassandra/thrift/UnavailableException.java
@@ -15,29 +15,34 @@
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 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");
+public class AuthenticationException extends Exception implements TBase<AuthenticationException._Fields>, java.io.Serializable, Cloneable, Comparable<AuthenticationException> {
+ private static final TStruct STRUCT_DESC = new TStruct("AuthenticationException");
- 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);
+ private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)1);
- public String why;
+ public String message;
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- WHY((short)1, "why");
+ 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);
}
}
@@ -46,12 +51,7 @@
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // WHY
- return WHY;
- default:
- return null;
- }
+ return byId.get(fieldId);
}
/**
@@ -90,102 +90,110 @@ public String getFieldName() {
// isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ 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)));
+ }});
+
static {
- 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);
+ FieldMetaData.addStructMetaDataMap(AuthenticationException.class, metaDataMap);
}
public AuthenticationException() {
}
public AuthenticationException(
- String why)
+ String message)
{
this();
- this.why = why;
+ this.message = message;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public AuthenticationException(AuthenticationException other) {
- if (other.isSetWhy()) {
- this.why = other.why;
+ if (other.isSetMessage()) {
+ this.message = other.message;
}
}
public AuthenticationException deepCopy() {
return new AuthenticationException(this);
}
- @Override
- public void clear() {
- this.why = null;
+ @Deprecated
+ public AuthenticationException clone() {
+ return new AuthenticationException(this);
}
- public String getWhy() {
- return this.why;
+ public String getMessage() {
+ return this.message;
}
- public AuthenticationException setWhy(String why) {
- this.why = why;
+ public AuthenticationException setMessage(String message) {
+ this.message = message;
return this;
}
- public void unsetWhy() {
- this.why = null;
+ public void unsetMessage() {
+ 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;
+ /** Returns true if field message is set (has been asigned a value) and false otherwise */
+ public boolean isSetMessage() {
+ return this.message != null;
}
- public void setWhyIsSet(boolean value) {
+ public void setMessageIsSet(boolean value) {
if (!value) {
- this.why = null;
+ this.message = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
- case WHY:
+ case MESSAGE:
if (value == null) {
- unsetWhy();
+ unsetMessage();
} else {
- setWhy((String)value);
+ setMessage((String)value);
}
break;
}
}
+ public void setFieldValue(int fieldID, Object value) {
+ setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
+ }
+
public Object getFieldValue(_Fields field) {
switch (field) {
- case WHY:
- return getWhy();
+ case MESSAGE:
+ return getMessage();
}
throw new IllegalStateException();
}
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
+ 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 WHY:
- return isSetWhy();
+ case MESSAGE:
+ return isSetMessage();
}
throw new IllegalStateException();
}
+ public boolean isSet(int fieldID) {
+ return isSet(_Fields.findByThriftIdOrThrow(fieldID));
+ }
+
@Override
public boolean equals(Object that) {
if (that == null)
@@ -199,12 +207,12 @@ public boolean equals(AuthenticationException that) {
if (that == null)
return false;
- 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))
+ boolean this_present_message = true && this.isSetMessage();
+ boolean that_present_message = true && that.isSetMessage();
+ if (this_present_message || that_present_message) {
+ if (!(this_present_message && that_present_message))
return false;
- if (!this.why.equals(that.why))
+ if (!this.message.equals(that.message))
return false;
}
@@ -224,58 +232,55 @@ public int compareTo(AuthenticationException other) {
int lastComparison = 0;
AuthenticationException typedOther = (AuthenticationException)other;
- lastComparison = Boolean.valueOf(isSetWhy()).compareTo(typedOther.isSetWhy());
+ lastComparison = Boolean.valueOf(isSetMessage()).compareTo(isSetMessage());
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetWhy()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.why, typedOther.why);
- if (lastComparison != 0) {
- return lastComparison;
- }
+ lastComparison = TBaseHelper.compareTo(message, typedOther.message);
+ if (lastComparison != 0) {
+ return lastComparison;
}
return 0;
}
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField field;
+ public void read(TProtocol iprot) throws TException {
+ TField field;
iprot.readStructBegin();
while (true)
{
field = iprot.readFieldBegin();
- if (field.type == org.apache.thrift.protocol.TType.STOP) {
+ if (field.type == TType.STOP) {
break;
}
- 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);
+ _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();
}
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ public void write(TProtocol oprot) throws TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
- if (this.why != null) {
- oprot.writeFieldBegin(WHY_FIELD_DESC);
- oprot.writeString(this.why);
+ if (this.message != null) {
+ oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
+ oprot.writeString(this.message);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
@@ -287,37 +292,21 @@ public String toString() {
StringBuilder sb = new StringBuilder("AuthenticationException(");
boolean first = true;
- sb.append("why:");
- if (this.why == null) {
+ sb.append("message:");
+ if (this.message == null) {
sb.append("null");
} else {
- sb.append(this.why);
+ sb.append(this.message);
}
first = false;
sb.append(")");
return sb.toString();
}
- public void validate() throws org.apache.thrift.TException {
+ public void validate() throws TException {
// check for required fields
- 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);
+ if (message == null) {
+ throw new TProtocolException("Required field 'message' was not present! Struct: " + toString());
}
}
Oops, something went wrong.

0 comments on commit 22051a3

Please sign in to comment.