diff --git a/CHANGES.txt b/CHANGES.txt index d71b77c8c9..93d7ecde5e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,7 +3,7 @@ * add default_tim_to_live (CASSANDRA-3974) * add memtable_flush_period_in_ms (CASSANDRA-4237) * replace supercolumns internally by composites (CASSANDRA-3237) - + * upgrade thrift to 0.9.0 (CASSANDRA-3719) 1.2.1 * add inter_dc_tcp_nodelay setting (CASSANDRA-5148) diff --git a/build.xml b/build.xml index eb681eb7fa..d73abc7750 100644 --- a/build.xml +++ b/build.xml @@ -356,7 +356,7 @@ - + diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationException.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationException.java index 5d88cd98e8..8127883e31 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationException.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationException.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -45,11 +55,17 @@ import org.slf4j.LoggerFactory; /** * invalid authentication request (invalid keyspace, user does not exist, or credentials invalid) */ -public class AuthenticationException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class AuthenticationException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new AuthenticationExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new AuthenticationExceptionTupleSchemeFactory()); + } + public String why; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -111,7 +127,6 @@ public class AuthenticationException extends Exception implements org.apache.thr } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -271,44 +286,11 @@ public class AuthenticationException extends Exception implements org.apache.thr } 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 == org.apache.thrift.protocol.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); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.why != null) { - oprot.writeFieldBegin(WHY_FIELD_DESC); - oprot.writeString(this.why); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -332,6 +314,7 @@ public class AuthenticationException extends Exception implements org.apache.thr if (why == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'why' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -350,5 +333,79 @@ public class AuthenticationException extends Exception implements org.apache.thr } } + private static class AuthenticationExceptionStandardSchemeFactory implements SchemeFactory { + public AuthenticationExceptionStandardScheme getScheme() { + return new AuthenticationExceptionStandardScheme(); + } + } + + private static class AuthenticationExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, AuthenticationException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // WHY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.why = iprot.readString(); + struct.setWhyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, AuthenticationException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.why != null) { + oprot.writeFieldBegin(WHY_FIELD_DESC); + oprot.writeString(struct.why); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class AuthenticationExceptionTupleSchemeFactory implements SchemeFactory { + public AuthenticationExceptionTupleScheme getScheme() { + return new AuthenticationExceptionTupleScheme(); + } + } + + private static class AuthenticationExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, AuthenticationException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.why); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, AuthenticationException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.why = iprot.readString(); + struct.setWhyIsSet(true); + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationRequest.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationRequest.java index 0f68426841..707c6b93f3 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationRequest.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationRequest.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -50,6 +60,12 @@ public class AuthenticationRequest implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new AuthenticationRequestStandardSchemeFactory()); + schemes.put(TupleScheme.class, new AuthenticationRequestTupleSchemeFactory()); + } + public Map credentials; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -111,7 +127,6 @@ public class AuthenticationRequest implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -296,64 +311,11 @@ public class AuthenticationRequest implements org.apache.thrift.TBase(2*_map36.size); - for (int _i37 = 0; _i37 < _map36.size; ++_i37) - { - String _key38; // required - String _val39; // required - _key38 = iprot.readString(); - _val39 = iprot.readString(); - this.credentials.put(_key38, _val39); - } - iprot.readMapEnd(); - } - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } 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 org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, this.credentials.size())); - for (Map.Entry _iter40 : this.credentials.entrySet()) - { - oprot.writeString(_iter40.getKey()); - oprot.writeString(_iter40.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -377,6 +339,7 @@ public class AuthenticationRequest implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, AuthenticationRequest struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // CREDENTIALS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map72 = iprot.readMapBegin(); + struct.credentials = new HashMap(2*_map72.size); + for (int _i73 = 0; _i73 < _map72.size; ++_i73) + { + String _key74; // required + String _val75; // required + _key74 = iprot.readString(); + _val75 = iprot.readString(); + struct.credentials.put(_key74, _val75); + } + iprot.readMapEnd(); + } + struct.setCredentialsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, AuthenticationRequest struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.credentials != null) { + oprot.writeFieldBegin(CREDENTIALS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.credentials.size())); + for (Map.Entry _iter76 : struct.credentials.entrySet()) + { + oprot.writeString(_iter76.getKey()); + oprot.writeString(_iter76.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class AuthenticationRequestTupleSchemeFactory implements SchemeFactory { + public AuthenticationRequestTupleScheme getScheme() { + return new AuthenticationRequestTupleScheme(); + } + } + + private static class AuthenticationRequestTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, AuthenticationRequest struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.credentials.size()); + for (Map.Entry _iter77 : struct.credentials.entrySet()) + { + oprot.writeString(_iter77.getKey()); + oprot.writeString(_iter77.getValue()); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, AuthenticationRequest struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TMap _map78 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.credentials = new HashMap(2*_map78.size); + for (int _i79 = 0; _i79 < _map78.size; ++_i79) + { + String _key80; // required + String _val81; // required + _key80 = iprot.readString(); + _val81 = iprot.readString(); + struct.credentials.put(_key80, _val81); + } + } + struct.setCredentialsIsSet(true); + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthorizationException.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthorizationException.java index 76bc0614e4..f3a8506112 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthorizationException.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthorizationException.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -45,11 +55,17 @@ import org.slf4j.LoggerFactory; /** * invalid authorization request (user does not have access to keyspace) */ -public class AuthorizationException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class AuthorizationException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AuthorizationException"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new AuthorizationExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new AuthorizationExceptionTupleSchemeFactory()); + } + public String why; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -111,7 +127,6 @@ public class AuthorizationException extends Exception implements org.apache.thri } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -271,44 +286,11 @@ public class AuthorizationException extends Exception implements org.apache.thri } 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 == org.apache.thrift.protocol.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); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.why != null) { - oprot.writeFieldBegin(WHY_FIELD_DESC); - oprot.writeString(this.why); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -332,6 +314,7 @@ public class AuthorizationException extends Exception implements org.apache.thri if (why == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'why' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -350,5 +333,79 @@ public class AuthorizationException extends Exception implements org.apache.thri } } + private static class AuthorizationExceptionStandardSchemeFactory implements SchemeFactory { + public AuthorizationExceptionStandardScheme getScheme() { + return new AuthorizationExceptionStandardScheme(); + } + } + + private static class AuthorizationExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, AuthorizationException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // WHY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.why = iprot.readString(); + struct.setWhyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, AuthorizationException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.why != null) { + oprot.writeFieldBegin(WHY_FIELD_DESC); + oprot.writeString(struct.why); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class AuthorizationExceptionTupleSchemeFactory implements SchemeFactory { + public AuthorizationExceptionTupleScheme getScheme() { + return new AuthorizationExceptionTupleScheme(); + } + } + + private static class AuthorizationExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, AuthorizationException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.why); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, AuthorizationException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.why = iprot.readString(); + struct.setWhyIsSet(true); + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java index 8a2e66edc3..300068cd69 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -3218,7 +3228,7 @@ public class Cassandra { } - public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); public Processor(I iface) { super(iface, getProcessMap(new HashMap>())); @@ -3274,16 +3284,20 @@ public class Cassandra { return processMap; } - private static class login extends org.apache.thrift.ProcessFunction { + public static class login extends org.apache.thrift.ProcessFunction { public login() { super("login"); } - protected login_args getEmptyArgsInstance() { + public login_args getEmptyArgsInstance() { return new login_args(); } - protected login_result getResult(I iface, login_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public login_result getResult(I iface, login_args args) throws org.apache.thrift.TException { login_result result = new login_result(); try { iface.login(args.auth_request); @@ -3296,16 +3310,20 @@ public class Cassandra { } } - private static class set_keyspace extends org.apache.thrift.ProcessFunction { + public static class set_keyspace extends org.apache.thrift.ProcessFunction { public set_keyspace() { super("set_keyspace"); } - protected set_keyspace_args getEmptyArgsInstance() { + public set_keyspace_args getEmptyArgsInstance() { return new set_keyspace_args(); } - protected set_keyspace_result getResult(I iface, set_keyspace_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public set_keyspace_result getResult(I iface, set_keyspace_args args) throws org.apache.thrift.TException { set_keyspace_result result = new set_keyspace_result(); try { iface.set_keyspace(args.keyspace); @@ -3316,16 +3334,20 @@ public class Cassandra { } } - private static class get extends org.apache.thrift.ProcessFunction { + public static class get extends org.apache.thrift.ProcessFunction { public get() { super("get"); } - protected get_args getEmptyArgsInstance() { + public get_args getEmptyArgsInstance() { return new get_args(); } - protected get_result getResult(I iface, get_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public get_result getResult(I iface, get_args args) throws org.apache.thrift.TException { get_result result = new get_result(); try { result.success = iface.get(args.key, args.column_path, args.consistency_level); @@ -3342,16 +3364,20 @@ public class Cassandra { } } - private static class get_slice extends org.apache.thrift.ProcessFunction { + public static class get_slice extends org.apache.thrift.ProcessFunction { public get_slice() { super("get_slice"); } - protected get_slice_args getEmptyArgsInstance() { + public get_slice_args getEmptyArgsInstance() { return new get_slice_args(); } - protected get_slice_result getResult(I iface, get_slice_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public get_slice_result getResult(I iface, get_slice_args args) throws org.apache.thrift.TException { get_slice_result result = new get_slice_result(); try { result.success = iface.get_slice(args.key, args.column_parent, args.predicate, args.consistency_level); @@ -3366,16 +3392,20 @@ public class Cassandra { } } - private static class get_count extends org.apache.thrift.ProcessFunction { + public static class get_count extends org.apache.thrift.ProcessFunction { public get_count() { super("get_count"); } - protected get_count_args getEmptyArgsInstance() { + public get_count_args getEmptyArgsInstance() { return new get_count_args(); } - protected get_count_result getResult(I iface, get_count_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public get_count_result getResult(I iface, get_count_args args) throws org.apache.thrift.TException { get_count_result result = new get_count_result(); try { result.success = iface.get_count(args.key, args.column_parent, args.predicate, args.consistency_level); @@ -3391,16 +3421,20 @@ public class Cassandra { } } - private static class multiget_slice extends org.apache.thrift.ProcessFunction { + public static class multiget_slice extends org.apache.thrift.ProcessFunction { public multiget_slice() { super("multiget_slice"); } - protected multiget_slice_args getEmptyArgsInstance() { + public multiget_slice_args getEmptyArgsInstance() { return new multiget_slice_args(); } - protected multiget_slice_result getResult(I iface, multiget_slice_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public multiget_slice_result getResult(I iface, multiget_slice_args args) throws org.apache.thrift.TException { multiget_slice_result result = new multiget_slice_result(); try { result.success = iface.multiget_slice(args.keys, args.column_parent, args.predicate, args.consistency_level); @@ -3415,16 +3449,20 @@ public class Cassandra { } } - private static class multiget_count extends org.apache.thrift.ProcessFunction { + public static class multiget_count extends org.apache.thrift.ProcessFunction { public multiget_count() { super("multiget_count"); } - protected multiget_count_args getEmptyArgsInstance() { + public multiget_count_args getEmptyArgsInstance() { return new multiget_count_args(); } - protected multiget_count_result getResult(I iface, multiget_count_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public multiget_count_result getResult(I iface, multiget_count_args args) throws org.apache.thrift.TException { multiget_count_result result = new multiget_count_result(); try { result.success = iface.multiget_count(args.keys, args.column_parent, args.predicate, args.consistency_level); @@ -3439,16 +3477,20 @@ public class Cassandra { } } - private static class get_range_slices extends org.apache.thrift.ProcessFunction { + public static class get_range_slices extends org.apache.thrift.ProcessFunction { public get_range_slices() { super("get_range_slices"); } - protected get_range_slices_args getEmptyArgsInstance() { + public get_range_slices_args getEmptyArgsInstance() { return new get_range_slices_args(); } - protected get_range_slices_result getResult(I iface, get_range_slices_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public get_range_slices_result getResult(I iface, get_range_slices_args args) throws org.apache.thrift.TException { get_range_slices_result result = new get_range_slices_result(); try { result.success = iface.get_range_slices(args.column_parent, args.predicate, args.range, args.consistency_level); @@ -3463,16 +3505,20 @@ public class Cassandra { } } - private static class get_paged_slice extends org.apache.thrift.ProcessFunction { + public static class get_paged_slice extends org.apache.thrift.ProcessFunction { public get_paged_slice() { super("get_paged_slice"); } - protected get_paged_slice_args getEmptyArgsInstance() { + public get_paged_slice_args getEmptyArgsInstance() { return new get_paged_slice_args(); } - protected get_paged_slice_result getResult(I iface, get_paged_slice_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public get_paged_slice_result getResult(I iface, get_paged_slice_args args) throws org.apache.thrift.TException { get_paged_slice_result result = new get_paged_slice_result(); try { result.success = iface.get_paged_slice(args.column_family, args.range, args.start_column, args.consistency_level); @@ -3487,16 +3533,20 @@ public class Cassandra { } } - private static class get_indexed_slices extends org.apache.thrift.ProcessFunction { + public static class get_indexed_slices extends org.apache.thrift.ProcessFunction { public get_indexed_slices() { super("get_indexed_slices"); } - protected get_indexed_slices_args getEmptyArgsInstance() { + public get_indexed_slices_args getEmptyArgsInstance() { return new get_indexed_slices_args(); } - protected get_indexed_slices_result getResult(I iface, get_indexed_slices_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public get_indexed_slices_result getResult(I iface, get_indexed_slices_args args) throws org.apache.thrift.TException { get_indexed_slices_result result = new get_indexed_slices_result(); try { result.success = iface.get_indexed_slices(args.column_parent, args.index_clause, args.column_predicate, args.consistency_level); @@ -3511,16 +3561,20 @@ public class Cassandra { } } - private static class insert extends org.apache.thrift.ProcessFunction { + public static class insert extends org.apache.thrift.ProcessFunction { public insert() { super("insert"); } - protected insert_args getEmptyArgsInstance() { + public insert_args getEmptyArgsInstance() { return new insert_args(); } - protected insert_result getResult(I iface, insert_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public insert_result getResult(I iface, insert_args args) throws org.apache.thrift.TException { insert_result result = new insert_result(); try { iface.insert(args.key, args.column_parent, args.column, args.consistency_level); @@ -3535,16 +3589,20 @@ public class Cassandra { } } - private static class add extends org.apache.thrift.ProcessFunction { + public static class add extends org.apache.thrift.ProcessFunction { public add() { super("add"); } - protected add_args getEmptyArgsInstance() { + public add_args getEmptyArgsInstance() { return new add_args(); } - protected add_result getResult(I iface, add_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public add_result getResult(I iface, add_args args) throws org.apache.thrift.TException { add_result result = new add_result(); try { iface.add(args.key, args.column_parent, args.column, args.consistency_level); @@ -3559,16 +3617,20 @@ public class Cassandra { } } - private static class remove extends org.apache.thrift.ProcessFunction { + public static class remove extends org.apache.thrift.ProcessFunction { public remove() { super("remove"); } - protected remove_args getEmptyArgsInstance() { + public remove_args getEmptyArgsInstance() { return new remove_args(); } - protected remove_result getResult(I iface, remove_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public remove_result getResult(I iface, remove_args args) throws org.apache.thrift.TException { remove_result result = new remove_result(); try { iface.remove(args.key, args.column_path, args.timestamp, args.consistency_level); @@ -3583,16 +3645,20 @@ public class Cassandra { } } - private static class remove_counter extends org.apache.thrift.ProcessFunction { + public static class remove_counter extends org.apache.thrift.ProcessFunction { public remove_counter() { super("remove_counter"); } - protected remove_counter_args getEmptyArgsInstance() { + public remove_counter_args getEmptyArgsInstance() { return new remove_counter_args(); } - protected remove_counter_result getResult(I iface, remove_counter_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public remove_counter_result getResult(I iface, remove_counter_args args) throws org.apache.thrift.TException { remove_counter_result result = new remove_counter_result(); try { iface.remove_counter(args.key, args.path, args.consistency_level); @@ -3607,16 +3673,20 @@ public class Cassandra { } } - private static class batch_mutate extends org.apache.thrift.ProcessFunction { + public static class batch_mutate extends org.apache.thrift.ProcessFunction { public batch_mutate() { super("batch_mutate"); } - protected batch_mutate_args getEmptyArgsInstance() { + public batch_mutate_args getEmptyArgsInstance() { return new batch_mutate_args(); } - protected batch_mutate_result getResult(I iface, batch_mutate_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public batch_mutate_result getResult(I iface, batch_mutate_args args) throws org.apache.thrift.TException { batch_mutate_result result = new batch_mutate_result(); try { iface.batch_mutate(args.mutation_map, args.consistency_level); @@ -3631,16 +3701,20 @@ public class Cassandra { } } - private static class atomic_batch_mutate extends org.apache.thrift.ProcessFunction { + public static class atomic_batch_mutate extends org.apache.thrift.ProcessFunction { public atomic_batch_mutate() { super("atomic_batch_mutate"); } - protected atomic_batch_mutate_args getEmptyArgsInstance() { + public atomic_batch_mutate_args getEmptyArgsInstance() { return new atomic_batch_mutate_args(); } - protected atomic_batch_mutate_result getResult(I iface, atomic_batch_mutate_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public atomic_batch_mutate_result getResult(I iface, atomic_batch_mutate_args args) throws org.apache.thrift.TException { atomic_batch_mutate_result result = new atomic_batch_mutate_result(); try { iface.atomic_batch_mutate(args.mutation_map, args.consistency_level); @@ -3655,16 +3729,20 @@ public class Cassandra { } } - private static class truncate extends org.apache.thrift.ProcessFunction { + public static class truncate extends org.apache.thrift.ProcessFunction { public truncate() { super("truncate"); } - protected truncate_args getEmptyArgsInstance() { + public truncate_args getEmptyArgsInstance() { return new truncate_args(); } - protected truncate_result getResult(I iface, truncate_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public truncate_result getResult(I iface, truncate_args args) throws org.apache.thrift.TException { truncate_result result = new truncate_result(); try { iface.truncate(args.cfname); @@ -3679,16 +3757,20 @@ public class Cassandra { } } - private static class describe_schema_versions extends org.apache.thrift.ProcessFunction { + public static class describe_schema_versions extends org.apache.thrift.ProcessFunction { public describe_schema_versions() { super("describe_schema_versions"); } - protected describe_schema_versions_args getEmptyArgsInstance() { + public describe_schema_versions_args getEmptyArgsInstance() { return new describe_schema_versions_args(); } - protected describe_schema_versions_result getResult(I iface, describe_schema_versions_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public describe_schema_versions_result getResult(I iface, describe_schema_versions_args args) throws org.apache.thrift.TException { describe_schema_versions_result result = new describe_schema_versions_result(); try { result.success = iface.describe_schema_versions(); @@ -3699,16 +3781,20 @@ public class Cassandra { } } - private static class describe_keyspaces extends org.apache.thrift.ProcessFunction { + public static class describe_keyspaces extends org.apache.thrift.ProcessFunction { public describe_keyspaces() { super("describe_keyspaces"); } - protected describe_keyspaces_args getEmptyArgsInstance() { + public describe_keyspaces_args getEmptyArgsInstance() { return new describe_keyspaces_args(); } - protected describe_keyspaces_result getResult(I iface, describe_keyspaces_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public describe_keyspaces_result getResult(I iface, describe_keyspaces_args args) throws org.apache.thrift.TException { describe_keyspaces_result result = new describe_keyspaces_result(); try { result.success = iface.describe_keyspaces(); @@ -3719,48 +3805,60 @@ public class Cassandra { } } - private static class describe_cluster_name extends org.apache.thrift.ProcessFunction { + public static class describe_cluster_name extends org.apache.thrift.ProcessFunction { public describe_cluster_name() { super("describe_cluster_name"); } - protected describe_cluster_name_args getEmptyArgsInstance() { + public describe_cluster_name_args getEmptyArgsInstance() { return new describe_cluster_name_args(); } - protected describe_cluster_name_result getResult(I iface, describe_cluster_name_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public describe_cluster_name_result getResult(I iface, describe_cluster_name_args args) throws org.apache.thrift.TException { describe_cluster_name_result result = new describe_cluster_name_result(); result.success = iface.describe_cluster_name(); return result; } } - private static class describe_version extends org.apache.thrift.ProcessFunction { + public static class describe_version extends org.apache.thrift.ProcessFunction { public describe_version() { super("describe_version"); } - protected describe_version_args getEmptyArgsInstance() { + public describe_version_args getEmptyArgsInstance() { return new describe_version_args(); } - protected describe_version_result getResult(I iface, describe_version_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public describe_version_result getResult(I iface, describe_version_args args) throws org.apache.thrift.TException { describe_version_result result = new describe_version_result(); result.success = iface.describe_version(); return result; } } - private static class describe_ring extends org.apache.thrift.ProcessFunction { + public static class describe_ring extends org.apache.thrift.ProcessFunction { public describe_ring() { super("describe_ring"); } - protected describe_ring_args getEmptyArgsInstance() { + public describe_ring_args getEmptyArgsInstance() { return new describe_ring_args(); } - protected describe_ring_result getResult(I iface, describe_ring_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public describe_ring_result getResult(I iface, describe_ring_args args) throws org.apache.thrift.TException { describe_ring_result result = new describe_ring_result(); try { result.success = iface.describe_ring(args.keyspace); @@ -3771,16 +3869,20 @@ public class Cassandra { } } - private static class describe_token_map extends org.apache.thrift.ProcessFunction { + public static class describe_token_map extends org.apache.thrift.ProcessFunction { public describe_token_map() { super("describe_token_map"); } - protected describe_token_map_args getEmptyArgsInstance() { + public describe_token_map_args getEmptyArgsInstance() { return new describe_token_map_args(); } - protected describe_token_map_result getResult(I iface, describe_token_map_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public describe_token_map_result getResult(I iface, describe_token_map_args args) throws org.apache.thrift.TException { describe_token_map_result result = new describe_token_map_result(); try { result.success = iface.describe_token_map(); @@ -3791,48 +3893,60 @@ public class Cassandra { } } - private static class describe_partitioner extends org.apache.thrift.ProcessFunction { + public static class describe_partitioner extends org.apache.thrift.ProcessFunction { public describe_partitioner() { super("describe_partitioner"); } - protected describe_partitioner_args getEmptyArgsInstance() { + public describe_partitioner_args getEmptyArgsInstance() { return new describe_partitioner_args(); } - protected describe_partitioner_result getResult(I iface, describe_partitioner_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public describe_partitioner_result getResult(I iface, describe_partitioner_args args) throws org.apache.thrift.TException { describe_partitioner_result result = new describe_partitioner_result(); result.success = iface.describe_partitioner(); return result; } } - private static class describe_snitch extends org.apache.thrift.ProcessFunction { + public static class describe_snitch extends org.apache.thrift.ProcessFunction { public describe_snitch() { super("describe_snitch"); } - protected describe_snitch_args getEmptyArgsInstance() { + public describe_snitch_args getEmptyArgsInstance() { return new describe_snitch_args(); } - protected describe_snitch_result getResult(I iface, describe_snitch_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public describe_snitch_result getResult(I iface, describe_snitch_args args) throws org.apache.thrift.TException { describe_snitch_result result = new describe_snitch_result(); result.success = iface.describe_snitch(); return result; } } - private static class describe_keyspace extends org.apache.thrift.ProcessFunction { + public static class describe_keyspace extends org.apache.thrift.ProcessFunction { public describe_keyspace() { super("describe_keyspace"); } - protected describe_keyspace_args getEmptyArgsInstance() { + public describe_keyspace_args getEmptyArgsInstance() { return new describe_keyspace_args(); } - protected describe_keyspace_result getResult(I iface, describe_keyspace_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public describe_keyspace_result getResult(I iface, describe_keyspace_args args) throws org.apache.thrift.TException { describe_keyspace_result result = new describe_keyspace_result(); try { result.success = iface.describe_keyspace(args.keyspace); @@ -3845,16 +3959,20 @@ public class Cassandra { } } - private static class describe_splits extends org.apache.thrift.ProcessFunction { + public static class describe_splits extends org.apache.thrift.ProcessFunction { public describe_splits() { super("describe_splits"); } - protected describe_splits_args getEmptyArgsInstance() { + public describe_splits_args getEmptyArgsInstance() { return new describe_splits_args(); } - protected describe_splits_result getResult(I iface, describe_splits_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public describe_splits_result getResult(I iface, describe_splits_args args) throws org.apache.thrift.TException { describe_splits_result result = new describe_splits_result(); try { result.success = iface.describe_splits(args.cfName, args.start_token, args.end_token, args.keys_per_split); @@ -3865,32 +3983,40 @@ public class Cassandra { } } - private static class trace_next_query extends org.apache.thrift.ProcessFunction { + public static class trace_next_query extends org.apache.thrift.ProcessFunction { public trace_next_query() { super("trace_next_query"); } - protected trace_next_query_args getEmptyArgsInstance() { + public trace_next_query_args getEmptyArgsInstance() { return new trace_next_query_args(); } - protected trace_next_query_result getResult(I iface, trace_next_query_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public trace_next_query_result getResult(I iface, trace_next_query_args args) throws org.apache.thrift.TException { trace_next_query_result result = new trace_next_query_result(); result.success = iface.trace_next_query(); return result; } } - private static class describe_splits_ex extends org.apache.thrift.ProcessFunction { + public static class describe_splits_ex extends org.apache.thrift.ProcessFunction { public describe_splits_ex() { super("describe_splits_ex"); } - protected describe_splits_ex_args getEmptyArgsInstance() { + public describe_splits_ex_args getEmptyArgsInstance() { return new describe_splits_ex_args(); } - protected describe_splits_ex_result getResult(I iface, describe_splits_ex_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public describe_splits_ex_result getResult(I iface, describe_splits_ex_args args) throws org.apache.thrift.TException { describe_splits_ex_result result = new describe_splits_ex_result(); try { result.success = iface.describe_splits_ex(args.cfName, args.start_token, args.end_token, args.keys_per_split); @@ -3901,16 +4027,20 @@ public class Cassandra { } } - private static class system_add_column_family extends org.apache.thrift.ProcessFunction { + public static class system_add_column_family extends org.apache.thrift.ProcessFunction { public system_add_column_family() { super("system_add_column_family"); } - protected system_add_column_family_args getEmptyArgsInstance() { + public system_add_column_family_args getEmptyArgsInstance() { return new system_add_column_family_args(); } - protected system_add_column_family_result getResult(I iface, system_add_column_family_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public system_add_column_family_result getResult(I iface, system_add_column_family_args args) throws org.apache.thrift.TException { system_add_column_family_result result = new system_add_column_family_result(); try { result.success = iface.system_add_column_family(args.cf_def); @@ -3923,16 +4053,20 @@ public class Cassandra { } } - private static class system_drop_column_family extends org.apache.thrift.ProcessFunction { + public static class system_drop_column_family extends org.apache.thrift.ProcessFunction { public system_drop_column_family() { super("system_drop_column_family"); } - protected system_drop_column_family_args getEmptyArgsInstance() { + public system_drop_column_family_args getEmptyArgsInstance() { return new system_drop_column_family_args(); } - protected system_drop_column_family_result getResult(I iface, system_drop_column_family_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public system_drop_column_family_result getResult(I iface, system_drop_column_family_args args) throws org.apache.thrift.TException { system_drop_column_family_result result = new system_drop_column_family_result(); try { result.success = iface.system_drop_column_family(args.column_family); @@ -3945,16 +4079,20 @@ public class Cassandra { } } - private static class system_add_keyspace extends org.apache.thrift.ProcessFunction { + public static class system_add_keyspace extends org.apache.thrift.ProcessFunction { public system_add_keyspace() { super("system_add_keyspace"); } - protected system_add_keyspace_args getEmptyArgsInstance() { + public system_add_keyspace_args getEmptyArgsInstance() { return new system_add_keyspace_args(); } - protected system_add_keyspace_result getResult(I iface, system_add_keyspace_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public system_add_keyspace_result getResult(I iface, system_add_keyspace_args args) throws org.apache.thrift.TException { system_add_keyspace_result result = new system_add_keyspace_result(); try { result.success = iface.system_add_keyspace(args.ks_def); @@ -3967,16 +4105,20 @@ public class Cassandra { } } - private static class system_drop_keyspace extends org.apache.thrift.ProcessFunction { + public static class system_drop_keyspace extends org.apache.thrift.ProcessFunction { public system_drop_keyspace() { super("system_drop_keyspace"); } - protected system_drop_keyspace_args getEmptyArgsInstance() { + public system_drop_keyspace_args getEmptyArgsInstance() { return new system_drop_keyspace_args(); } - protected system_drop_keyspace_result getResult(I iface, system_drop_keyspace_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public system_drop_keyspace_result getResult(I iface, system_drop_keyspace_args args) throws org.apache.thrift.TException { system_drop_keyspace_result result = new system_drop_keyspace_result(); try { result.success = iface.system_drop_keyspace(args.keyspace); @@ -3989,16 +4131,20 @@ public class Cassandra { } } - private static class system_update_keyspace extends org.apache.thrift.ProcessFunction { + public static class system_update_keyspace extends org.apache.thrift.ProcessFunction { public system_update_keyspace() { super("system_update_keyspace"); } - protected system_update_keyspace_args getEmptyArgsInstance() { + public system_update_keyspace_args getEmptyArgsInstance() { return new system_update_keyspace_args(); } - protected system_update_keyspace_result getResult(I iface, system_update_keyspace_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public system_update_keyspace_result getResult(I iface, system_update_keyspace_args args) throws org.apache.thrift.TException { system_update_keyspace_result result = new system_update_keyspace_result(); try { result.success = iface.system_update_keyspace(args.ks_def); @@ -4011,16 +4157,20 @@ public class Cassandra { } } - private static class system_update_column_family extends org.apache.thrift.ProcessFunction { + public static class system_update_column_family extends org.apache.thrift.ProcessFunction { public system_update_column_family() { super("system_update_column_family"); } - protected system_update_column_family_args getEmptyArgsInstance() { + public system_update_column_family_args getEmptyArgsInstance() { return new system_update_column_family_args(); } - protected system_update_column_family_result getResult(I iface, system_update_column_family_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public system_update_column_family_result getResult(I iface, system_update_column_family_args args) throws org.apache.thrift.TException { system_update_column_family_result result = new system_update_column_family_result(); try { result.success = iface.system_update_column_family(args.cf_def); @@ -4033,16 +4183,20 @@ public class Cassandra { } } - private static class execute_cql_query extends org.apache.thrift.ProcessFunction { + public static class execute_cql_query extends org.apache.thrift.ProcessFunction { public execute_cql_query() { super("execute_cql_query"); } - protected execute_cql_query_args getEmptyArgsInstance() { + public execute_cql_query_args getEmptyArgsInstance() { return new execute_cql_query_args(); } - protected execute_cql_query_result getResult(I iface, execute_cql_query_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public execute_cql_query_result getResult(I iface, execute_cql_query_args args) throws org.apache.thrift.TException { execute_cql_query_result result = new execute_cql_query_result(); try { result.success = iface.execute_cql_query(args.query, args.compression); @@ -4059,16 +4213,20 @@ public class Cassandra { } } - private static class execute_cql3_query extends org.apache.thrift.ProcessFunction { + public static class execute_cql3_query extends org.apache.thrift.ProcessFunction { public execute_cql3_query() { super("execute_cql3_query"); } - protected execute_cql3_query_args getEmptyArgsInstance() { + public execute_cql3_query_args getEmptyArgsInstance() { return new execute_cql3_query_args(); } - protected execute_cql3_query_result getResult(I iface, execute_cql3_query_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public execute_cql3_query_result getResult(I iface, execute_cql3_query_args args) throws org.apache.thrift.TException { execute_cql3_query_result result = new execute_cql3_query_result(); try { result.success = iface.execute_cql3_query(args.query, args.compression, args.consistency); @@ -4085,16 +4243,20 @@ public class Cassandra { } } - private static class prepare_cql_query extends org.apache.thrift.ProcessFunction { + public static class prepare_cql_query extends org.apache.thrift.ProcessFunction { public prepare_cql_query() { super("prepare_cql_query"); } - protected prepare_cql_query_args getEmptyArgsInstance() { + public prepare_cql_query_args getEmptyArgsInstance() { return new prepare_cql_query_args(); } - protected prepare_cql_query_result getResult(I iface, prepare_cql_query_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public prepare_cql_query_result getResult(I iface, prepare_cql_query_args args) throws org.apache.thrift.TException { prepare_cql_query_result result = new prepare_cql_query_result(); try { result.success = iface.prepare_cql_query(args.query, args.compression); @@ -4105,16 +4267,20 @@ public class Cassandra { } } - private static class prepare_cql3_query extends org.apache.thrift.ProcessFunction { + public static class prepare_cql3_query extends org.apache.thrift.ProcessFunction { public prepare_cql3_query() { super("prepare_cql3_query"); } - protected prepare_cql3_query_args getEmptyArgsInstance() { + public prepare_cql3_query_args getEmptyArgsInstance() { return new prepare_cql3_query_args(); } - protected prepare_cql3_query_result getResult(I iface, prepare_cql3_query_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public prepare_cql3_query_result getResult(I iface, prepare_cql3_query_args args) throws org.apache.thrift.TException { prepare_cql3_query_result result = new prepare_cql3_query_result(); try { result.success = iface.prepare_cql3_query(args.query, args.compression); @@ -4125,16 +4291,20 @@ public class Cassandra { } } - private static class execute_prepared_cql_query extends org.apache.thrift.ProcessFunction { + public static class execute_prepared_cql_query extends org.apache.thrift.ProcessFunction { public execute_prepared_cql_query() { super("execute_prepared_cql_query"); } - protected execute_prepared_cql_query_args getEmptyArgsInstance() { + public execute_prepared_cql_query_args getEmptyArgsInstance() { return new execute_prepared_cql_query_args(); } - protected execute_prepared_cql_query_result getResult(I iface, execute_prepared_cql_query_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public execute_prepared_cql_query_result getResult(I iface, execute_prepared_cql_query_args args) throws org.apache.thrift.TException { execute_prepared_cql_query_result result = new execute_prepared_cql_query_result(); try { result.success = iface.execute_prepared_cql_query(args.itemId, args.values); @@ -4151,16 +4321,20 @@ public class Cassandra { } } - private static class execute_prepared_cql3_query extends org.apache.thrift.ProcessFunction { + public static class execute_prepared_cql3_query extends org.apache.thrift.ProcessFunction { public execute_prepared_cql3_query() { super("execute_prepared_cql3_query"); } - protected execute_prepared_cql3_query_args getEmptyArgsInstance() { + public execute_prepared_cql3_query_args getEmptyArgsInstance() { return new execute_prepared_cql3_query_args(); } - protected execute_prepared_cql3_query_result getResult(I iface, execute_prepared_cql3_query_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public execute_prepared_cql3_query_result getResult(I iface, execute_prepared_cql3_query_args args) throws org.apache.thrift.TException { execute_prepared_cql3_query_result result = new execute_prepared_cql3_query_result(); try { result.success = iface.execute_prepared_cql3_query(args.itemId, args.values, args.consistency); @@ -4177,16 +4351,20 @@ public class Cassandra { } } - private static class set_cql_version extends org.apache.thrift.ProcessFunction { + public static class set_cql_version extends org.apache.thrift.ProcessFunction { public set_cql_version() { super("set_cql_version"); } - protected set_cql_version_args getEmptyArgsInstance() { + public set_cql_version_args getEmptyArgsInstance() { return new set_cql_version_args(); } - protected set_cql_version_result getResult(I iface, set_cql_version_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public set_cql_version_result getResult(I iface, set_cql_version_args args) throws org.apache.thrift.TException { set_cql_version_result result = new set_cql_version_result(); try { iface.set_cql_version(args.version); @@ -4204,6 +4382,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField AUTH_REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("auth_request", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new login_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new login_argsTupleSchemeFactory()); + } + public AuthenticationRequest auth_request; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -4265,7 +4449,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -4425,45 +4608,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // AUTH_REQUEST - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.auth_request = new AuthenticationRequest(); - this.auth_request.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.auth_request != null) { - oprot.writeFieldBegin(AUTH_REQUEST_FIELD_DESC); - this.auth_request.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -4487,6 +4636,10 @@ public class Cassandra { if (auth_request == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'auth_request' was not present! Struct: " + toString()); } + // check for sub-struct validity + if (auth_request != null) { + auth_request.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -4505,6 +4658,82 @@ public class Cassandra { } } + private static class login_argsStandardSchemeFactory implements SchemeFactory { + public login_argsStandardScheme getScheme() { + return new login_argsStandardScheme(); + } + } + + private static class login_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, login_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // AUTH_REQUEST + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.auth_request = new AuthenticationRequest(); + struct.auth_request.read(iprot); + struct.setAuth_requestIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, login_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.auth_request != null) { + oprot.writeFieldBegin(AUTH_REQUEST_FIELD_DESC); + struct.auth_request.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class login_argsTupleSchemeFactory implements SchemeFactory { + public login_argsTupleScheme getScheme() { + return new login_argsTupleScheme(); + } + } + + private static class login_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, login_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.auth_request.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, login_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.auth_request = new AuthenticationRequest(); + struct.auth_request.read(iprot); + struct.setAuth_requestIsSet(true); + } + } + } public static class login_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -4513,6 +4742,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField AUTHNX_FIELD_DESC = new org.apache.thrift.protocol.TField("authnx", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField AUTHZX_FIELD_DESC = new org.apache.thrift.protocol.TField("authzx", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new login_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new login_resultTupleSchemeFactory()); + } + public AuthenticationException authnx; // required public AuthorizationException authzx; // required @@ -4578,7 +4813,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -4807,57 +5041,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // AUTHNX - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.authnx = new AuthenticationException(); - this.authnx.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // AUTHZX - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.authzx = new AuthorizationException(); - this.authzx.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetAuthnx()) { - oprot.writeFieldBegin(AUTHNX_FIELD_DESC); - this.authnx.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetAuthzx()) { - oprot.writeFieldBegin(AUTHZX_FIELD_DESC); - this.authzx.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -4885,6 +5074,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -4903,6 +5093,117 @@ public class Cassandra { } } + private static class login_resultStandardSchemeFactory implements SchemeFactory { + public login_resultStandardScheme getScheme() { + return new login_resultStandardScheme(); + } + } + + private static class login_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, login_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // AUTHNX + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.authnx = new AuthenticationException(); + struct.authnx.read(iprot); + struct.setAuthnxIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // AUTHZX + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.authzx = new AuthorizationException(); + struct.authzx.read(iprot); + struct.setAuthzxIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, login_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.authnx != null) { + oprot.writeFieldBegin(AUTHNX_FIELD_DESC); + struct.authnx.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.authzx != null) { + oprot.writeFieldBegin(AUTHZX_FIELD_DESC); + struct.authzx.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class login_resultTupleSchemeFactory implements SchemeFactory { + public login_resultTupleScheme getScheme() { + return new login_resultTupleScheme(); + } + } + + private static class login_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, login_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAuthnx()) { + optionals.set(0); + } + if (struct.isSetAuthzx()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetAuthnx()) { + struct.authnx.write(oprot); + } + if (struct.isSetAuthzx()) { + struct.authzx.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, login_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.authnx = new AuthenticationException(); + struct.authnx.read(iprot); + struct.setAuthnxIsSet(true); + } + if (incoming.get(1)) { + struct.authzx = new AuthorizationException(); + struct.authzx.read(iprot); + struct.setAuthzxIsSet(true); + } + } + } + } public static class set_keyspace_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -4910,6 +5211,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField KEYSPACE_FIELD_DESC = new org.apache.thrift.protocol.TField("keyspace", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new set_keyspace_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new set_keyspace_argsTupleSchemeFactory()); + } + public String keyspace; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -4971,7 +5278,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -5131,44 +5437,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEYSPACE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.keyspace = 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.keyspace != null) { - oprot.writeFieldBegin(KEYSPACE_FIELD_DESC); - oprot.writeString(this.keyspace); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -5192,6 +5465,7 @@ public class Cassandra { if (keyspace == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'keyspace' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -5210,6 +5484,80 @@ public class Cassandra { } } + private static class set_keyspace_argsStandardSchemeFactory implements SchemeFactory { + public set_keyspace_argsStandardScheme getScheme() { + return new set_keyspace_argsStandardScheme(); + } + } + + private static class set_keyspace_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, set_keyspace_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEYSPACE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.keyspace = iprot.readString(); + struct.setKeyspaceIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, set_keyspace_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.keyspace != null) { + oprot.writeFieldBegin(KEYSPACE_FIELD_DESC); + oprot.writeString(struct.keyspace); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class set_keyspace_argsTupleSchemeFactory implements SchemeFactory { + public set_keyspace_argsTupleScheme getScheme() { + return new set_keyspace_argsTupleScheme(); + } + } + + private static class set_keyspace_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, set_keyspace_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.keyspace); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, set_keyspace_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.keyspace = iprot.readString(); + struct.setKeyspaceIsSet(true); + } + } + } public static class set_keyspace_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -5217,6 +5565,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new set_keyspace_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new set_keyspace_resultTupleSchemeFactory()); + } + public InvalidRequestException ire; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -5278,7 +5632,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -5438,45 +5791,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -5496,6 +5816,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -5514,6 +5835,92 @@ public class Cassandra { } } + private static class set_keyspace_resultStandardSchemeFactory implements SchemeFactory { + public set_keyspace_resultStandardScheme getScheme() { + return new set_keyspace_resultStandardScheme(); + } + } + + private static class set_keyspace_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, set_keyspace_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, set_keyspace_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class set_keyspace_resultTupleSchemeFactory implements SchemeFactory { + public set_keyspace_resultTupleScheme getScheme() { + return new set_keyspace_resultTupleScheme(); + } + } + + private static class set_keyspace_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, set_keyspace_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIre()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, set_keyspace_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + } + } + } public static class get_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -5523,6 +5930,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField COLUMN_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("column_path", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new get_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_argsTupleSchemeFactory()); + } + public ByteBuffer key; // required public ColumnPath column_path; // required /** @@ -5600,7 +6013,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -5920,69 +6332,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.key = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COLUMN_PATH - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column_path = new ColumnPath(); - this.column_path.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeBinary(this.key); - oprot.writeFieldEnd(); - } - if (this.column_path != null) { - oprot.writeFieldBegin(COLUMN_PATH_FIELD_DESC); - this.column_path.write(oprot); - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -6028,6 +6382,10 @@ public class Cassandra { if (consistency_level == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); } + // check for sub-struct validity + if (column_path != null) { + column_path.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -6046,6 +6404,114 @@ public class Cassandra { } } + private static class get_argsStandardSchemeFactory implements SchemeFactory { + public get_argsStandardScheme getScheme() { + return new get_argsStandardScheme(); + } + } + + private static class get_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, get_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.column_path = new ColumnPath(); + struct.column_path.read(iprot); + struct.setColumn_pathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // CONSISTENCY_LEVEL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, get_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.key != null) { + oprot.writeFieldBegin(KEY_FIELD_DESC); + oprot.writeBinary(struct.key); + oprot.writeFieldEnd(); + } + if (struct.column_path != null) { + oprot.writeFieldBegin(COLUMN_PATH_FIELD_DESC); + struct.column_path.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.consistency_level != null) { + oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); + oprot.writeI32(struct.consistency_level.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_argsTupleSchemeFactory implements SchemeFactory { + public get_argsTupleScheme getScheme() { + return new get_argsTupleScheme(); + } + } + + private static class get_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.key); + struct.column_path.write(oprot); + oprot.writeI32(struct.consistency_level.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + struct.column_path = new ColumnPath(); + struct.column_path.read(iprot); + struct.setColumn_pathIsSet(true); + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } + } + } public static class get_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -6057,6 +6523,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new get_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_resultTupleSchemeFactory()); + } + public ColumnOrSuperColumn success; // required public InvalidRequestException ire; // required public NotFoundException nfe; // required @@ -6134,7 +6606,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -6570,93 +7041,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new ColumnOrSuperColumn(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // NFE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.nfe = new NotFoundException(); - this.nfe.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetNfe()) { - oprot.writeFieldBegin(NFE_FIELD_DESC); - this.nfe.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -6708,6 +7098,10 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -6726,6 +7120,192 @@ public class Cassandra { } } + private static class get_resultStandardSchemeFactory implements SchemeFactory { + public get_resultStandardScheme getScheme() { + return new get_resultStandardScheme(); + } + } + + private static class get_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, get_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new ColumnOrSuperColumn(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NFE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.nfe = new NotFoundException(); + struct.nfe.read(iprot); + struct.setNfeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, get_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.nfe != null) { + oprot.writeFieldBegin(NFE_FIELD_DESC); + struct.nfe.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_resultTupleSchemeFactory implements SchemeFactory { + public get_resultTupleScheme getScheme() { + return new get_resultTupleScheme(); + } + } + + private static class get_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetNfe()) { + optionals.set(2); + } + if (struct.isSetUe()) { + optionals.set(3); + } + if (struct.isSetTe()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetNfe()) { + struct.nfe.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.success = new ColumnOrSuperColumn(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.nfe = new NotFoundException(); + struct.nfe.read(iprot); + struct.setNfeIsSet(true); + } + if (incoming.get(3)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(4)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + } + } + } public static class get_slice_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -6736,6 +7316,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField PREDICATE_FIELD_DESC = new org.apache.thrift.protocol.TField("predicate", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new get_slice_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_slice_argsTupleSchemeFactory()); + } + public ByteBuffer key; // required public ColumnParent column_parent; // required public SlicePredicate predicate; // required @@ -6817,7 +7403,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -7206,82 +7791,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.key = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COLUMN_PARENT - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column_parent = new ColumnParent(); - this.column_parent.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // PREDICATE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.predicate = new SlicePredicate(); - this.predicate.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeBinary(this.key); - oprot.writeFieldEnd(); - } - if (this.column_parent != null) { - oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); - this.column_parent.write(oprot); - oprot.writeFieldEnd(); - } - if (this.predicate != null) { - oprot.writeFieldBegin(PREDICATE_FIELD_DESC); - this.predicate.write(oprot); - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -7338,6 +7852,13 @@ public class Cassandra { if (consistency_level == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); } + // check for sub-struct validity + if (column_parent != null) { + column_parent.validate(); + } + if (predicate != null) { + predicate.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -7356,6 +7877,132 @@ public class Cassandra { } } + private static class get_slice_argsStandardSchemeFactory implements SchemeFactory { + public get_slice_argsStandardScheme getScheme() { + return new get_slice_argsStandardScheme(); + } + } + + private static class get_slice_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, get_slice_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_PARENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.column_parent = new ColumnParent(); + struct.column_parent.read(iprot); + struct.setColumn_parentIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PREDICATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.predicate = new SlicePredicate(); + struct.predicate.read(iprot); + struct.setPredicateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CONSISTENCY_LEVEL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, get_slice_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.key != null) { + oprot.writeFieldBegin(KEY_FIELD_DESC); + oprot.writeBinary(struct.key); + oprot.writeFieldEnd(); + } + if (struct.column_parent != null) { + oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); + struct.column_parent.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.predicate != null) { + oprot.writeFieldBegin(PREDICATE_FIELD_DESC); + struct.predicate.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.consistency_level != null) { + oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); + oprot.writeI32(struct.consistency_level.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_slice_argsTupleSchemeFactory implements SchemeFactory { + public get_slice_argsTupleScheme getScheme() { + return new get_slice_argsTupleScheme(); + } + } + + private static class get_slice_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_slice_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.key); + struct.column_parent.write(oprot); + struct.predicate.write(oprot); + oprot.writeI32(struct.consistency_level.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_slice_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + struct.column_parent = new ColumnParent(); + struct.column_parent.read(iprot); + struct.setColumn_parentIsSet(true); + struct.predicate = new SlicePredicate(); + struct.predicate.read(iprot); + struct.setPredicateIsSet(true); + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } + } + } public static class get_slice_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -7366,6 +8013,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new get_slice_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_slice_resultTupleSchemeFactory()); + } + public List success; // required public InvalidRequestException ire; // required public UnavailableException ue; // required @@ -7439,7 +8092,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -7826,98 +8478,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list95 = iprot.readListBegin(); - this.success = new ArrayList(_list95.size); - for (int _i96 = 0; _i96 < _list95.size; ++_i96) - { - ColumnOrSuperColumn _elem97; // required - _elem97 = new ColumnOrSuperColumn(); - _elem97.read(iprot); - this.success.add(_elem97); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (ColumnOrSuperColumn _iter98 : this.success) - { - _iter98.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -7961,6 +8527,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -7979,6 +8546,199 @@ public class Cassandra { } } + private static class get_slice_resultStandardSchemeFactory implements SchemeFactory { + public get_slice_resultStandardScheme getScheme() { + return new get_slice_resultStandardScheme(); + } + } + + private static class get_slice_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, get_slice_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list190 = iprot.readListBegin(); + struct.success = new ArrayList(_list190.size); + for (int _i191 = 0; _i191 < _list190.size; ++_i191) + { + ColumnOrSuperColumn _elem192; // required + _elem192 = new ColumnOrSuperColumn(); + _elem192.read(iprot); + struct.success.add(_elem192); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, get_slice_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (ColumnOrSuperColumn _iter193 : struct.success) + { + _iter193.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_slice_resultTupleSchemeFactory implements SchemeFactory { + public get_slice_resultTupleScheme getScheme() { + return new get_slice_resultTupleScheme(); + } + } + + private static class get_slice_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_slice_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetUe()) { + optionals.set(2); + } + if (struct.isSetTe()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (ColumnOrSuperColumn _iter194 : struct.success) + { + _iter194.write(oprot); + } + } + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_slice_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list195 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list195.size); + for (int _i196 = 0; _i196 < _list195.size; ++_i196) + { + ColumnOrSuperColumn _elem197; // required + _elem197 = new ColumnOrSuperColumn(); + _elem197.read(iprot); + struct.success.add(_elem197); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(3)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + } + } + } public static class get_count_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -7989,6 +8749,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField PREDICATE_FIELD_DESC = new org.apache.thrift.protocol.TField("predicate", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new get_count_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_count_argsTupleSchemeFactory()); + } + public ByteBuffer key; // required public ColumnParent column_parent; // required public SlicePredicate predicate; // required @@ -8070,7 +8836,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -8459,82 +9224,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.key = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COLUMN_PARENT - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column_parent = new ColumnParent(); - this.column_parent.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // PREDICATE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.predicate = new SlicePredicate(); - this.predicate.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeBinary(this.key); - oprot.writeFieldEnd(); - } - if (this.column_parent != null) { - oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); - this.column_parent.write(oprot); - oprot.writeFieldEnd(); - } - if (this.predicate != null) { - oprot.writeFieldBegin(PREDICATE_FIELD_DESC); - this.predicate.write(oprot); - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -8591,6 +9285,13 @@ public class Cassandra { if (consistency_level == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); } + // check for sub-struct validity + if (column_parent != null) { + column_parent.validate(); + } + if (predicate != null) { + predicate.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -8609,6 +9310,132 @@ public class Cassandra { } } + private static class get_count_argsStandardSchemeFactory implements SchemeFactory { + public get_count_argsStandardScheme getScheme() { + return new get_count_argsStandardScheme(); + } + } + + private static class get_count_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, get_count_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_PARENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.column_parent = new ColumnParent(); + struct.column_parent.read(iprot); + struct.setColumn_parentIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PREDICATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.predicate = new SlicePredicate(); + struct.predicate.read(iprot); + struct.setPredicateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CONSISTENCY_LEVEL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, get_count_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.key != null) { + oprot.writeFieldBegin(KEY_FIELD_DESC); + oprot.writeBinary(struct.key); + oprot.writeFieldEnd(); + } + if (struct.column_parent != null) { + oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); + struct.column_parent.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.predicate != null) { + oprot.writeFieldBegin(PREDICATE_FIELD_DESC); + struct.predicate.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.consistency_level != null) { + oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); + oprot.writeI32(struct.consistency_level.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_count_argsTupleSchemeFactory implements SchemeFactory { + public get_count_argsTupleScheme getScheme() { + return new get_count_argsTupleScheme(); + } + } + + private static class get_count_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_count_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.key); + struct.column_parent.write(oprot); + struct.predicate.write(oprot); + oprot.writeI32(struct.consistency_level.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_count_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + struct.column_parent = new ColumnParent(); + struct.column_parent.read(iprot); + struct.setColumn_parentIsSet(true); + struct.predicate = new SlicePredicate(); + struct.predicate.read(iprot); + struct.setPredicateIsSet(true); + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } + } + } public static class get_count_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -8619,6 +9446,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new get_count_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_count_resultTupleSchemeFactory()); + } + public int success; // required public InvalidRequestException ire; // required public UnavailableException ue; // required @@ -8693,8 +9526,7 @@ public class Cassandra { // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -8731,8 +9563,7 @@ public class Cassandra { * Performs a deep copy on other. */ public get_count_result(get_count_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetIre()) { this.ire = new InvalidRequestException(other.ire); @@ -8769,16 +9600,16 @@ public class Cassandra { } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public InvalidRequestException getIre() { @@ -9062,81 +9893,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.success = iprot.readI32(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI32(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -9176,6 +9938,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -9189,13 +9952,172 @@ public class Cassandra { 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); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class get_count_resultStandardSchemeFactory implements SchemeFactory { + public get_count_resultStandardScheme getScheme() { + return new get_count_resultStandardScheme(); + } + } + + private static class get_count_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, get_count_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, get_count_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success); + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_count_resultTupleSchemeFactory implements SchemeFactory { + public get_count_resultTupleScheme getScheme() { + return new get_count_resultTupleScheme(); + } + } + + private static class get_count_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_count_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetUe()) { + optionals.set(2); + } + if (struct.isSetTe()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success); + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_count_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(3)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + } + } + } public static class multiget_slice_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -9206,6 +10128,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField PREDICATE_FIELD_DESC = new org.apache.thrift.protocol.TField("predicate", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new multiget_slice_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new multiget_slice_argsTupleSchemeFactory()); + } + public List keys; // required public ColumnParent column_parent; // required public SlicePredicate predicate; // required @@ -9287,7 +10215,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -9687,99 +10614,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEYS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list99 = iprot.readListBegin(); - this.keys = new ArrayList(_list99.size); - for (int _i100 = 0; _i100 < _list99.size; ++_i100) - { - ByteBuffer _elem101; // required - _elem101 = iprot.readBinary(); - this.keys.add(_elem101); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COLUMN_PARENT - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column_parent = new ColumnParent(); - this.column_parent.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // PREDICATE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.predicate = new SlicePredicate(); - this.predicate.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.keys != null) { - oprot.writeFieldBegin(KEYS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.keys.size())); - for (ByteBuffer _iter102 : this.keys) - { - oprot.writeBinary(_iter102); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (this.column_parent != null) { - oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); - this.column_parent.write(oprot); - oprot.writeFieldEnd(); - } - if (this.predicate != null) { - oprot.writeFieldBegin(PREDICATE_FIELD_DESC); - this.predicate.write(oprot); - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -9836,6 +10675,13 @@ public class Cassandra { if (consistency_level == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); } + // check for sub-struct validity + if (column_parent != null) { + column_parent.validate(); + } + if (predicate != null) { + predicate.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -9854,6 +10700,164 @@ public class Cassandra { } } + private static class multiget_slice_argsStandardSchemeFactory implements SchemeFactory { + public multiget_slice_argsStandardScheme getScheme() { + return new multiget_slice_argsStandardScheme(); + } + } + + private static class multiget_slice_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, multiget_slice_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEYS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list198 = iprot.readListBegin(); + struct.keys = new ArrayList(_list198.size); + for (int _i199 = 0; _i199 < _list198.size; ++_i199) + { + ByteBuffer _elem200; // required + _elem200 = iprot.readBinary(); + struct.keys.add(_elem200); + } + iprot.readListEnd(); + } + struct.setKeysIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_PARENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.column_parent = new ColumnParent(); + struct.column_parent.read(iprot); + struct.setColumn_parentIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PREDICATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.predicate = new SlicePredicate(); + struct.predicate.read(iprot); + struct.setPredicateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CONSISTENCY_LEVEL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, multiget_slice_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.keys != null) { + oprot.writeFieldBegin(KEYS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.keys.size())); + for (ByteBuffer _iter201 : struct.keys) + { + oprot.writeBinary(_iter201); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.column_parent != null) { + oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); + struct.column_parent.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.predicate != null) { + oprot.writeFieldBegin(PREDICATE_FIELD_DESC); + struct.predicate.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.consistency_level != null) { + oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); + oprot.writeI32(struct.consistency_level.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class multiget_slice_argsTupleSchemeFactory implements SchemeFactory { + public multiget_slice_argsTupleScheme getScheme() { + return new multiget_slice_argsTupleScheme(); + } + } + + private static class multiget_slice_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, multiget_slice_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.keys.size()); + for (ByteBuffer _iter202 : struct.keys) + { + oprot.writeBinary(_iter202); + } + } + struct.column_parent.write(oprot); + struct.predicate.write(oprot); + oprot.writeI32(struct.consistency_level.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, multiget_slice_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list203 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.keys = new ArrayList(_list203.size); + for (int _i204 = 0; _i204 < _list203.size; ++_i204) + { + ByteBuffer _elem205; // required + _elem205 = iprot.readBinary(); + struct.keys.add(_elem205); + } + } + struct.setKeysIsSet(true); + struct.column_parent = new ColumnParent(); + struct.column_parent.read(iprot); + struct.setColumn_parentIsSet(true); + struct.predicate = new SlicePredicate(); + struct.predicate.read(iprot); + struct.setPredicateIsSet(true); + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } + } + } public static class multiget_slice_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -9864,6 +10868,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new multiget_slice_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new multiget_slice_resultTupleSchemeFactory()); + } + public Map> success; // required public InvalidRequestException ire; // required public UnavailableException ue; // required @@ -9937,7 +10947,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -10334,118 +11343,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map103 = iprot.readMapBegin(); - this.success = new HashMap>(2*_map103.size); - for (int _i104 = 0; _i104 < _map103.size; ++_i104) - { - ByteBuffer _key105; // required - List _val106; // required - _key105 = iprot.readBinary(); - { - org.apache.thrift.protocol.TList _list107 = iprot.readListBegin(); - _val106 = new ArrayList(_list107.size); - for (int _i108 = 0; _i108 < _list107.size; ++_i108) - { - ColumnOrSuperColumn _elem109; // required - _elem109 = new ColumnOrSuperColumn(); - _elem109.read(iprot); - _val106.add(_elem109); - } - iprot.readListEnd(); - } - this.success.put(_key105, _val106); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, this.success.size())); - for (Map.Entry> _iter110 : this.success.entrySet()) - { - oprot.writeBinary(_iter110.getKey()); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter110.getValue().size())); - for (ColumnOrSuperColumn _iter111 : _iter110.getValue()) - { - _iter111.write(oprot); - } - oprot.writeListEnd(); - } - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -10489,6 +11392,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -10507,6 +11411,237 @@ public class Cassandra { } } + private static class multiget_slice_resultStandardSchemeFactory implements SchemeFactory { + public multiget_slice_resultStandardScheme getScheme() { + return new multiget_slice_resultStandardScheme(); + } + } + + private static class multiget_slice_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, multiget_slice_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map206 = iprot.readMapBegin(); + struct.success = new HashMap>(2*_map206.size); + for (int _i207 = 0; _i207 < _map206.size; ++_i207) + { + ByteBuffer _key208; // required + List _val209; // required + _key208 = iprot.readBinary(); + { + org.apache.thrift.protocol.TList _list210 = iprot.readListBegin(); + _val209 = new ArrayList(_list210.size); + for (int _i211 = 0; _i211 < _list210.size; ++_i211) + { + ColumnOrSuperColumn _elem212; // required + _elem212 = new ColumnOrSuperColumn(); + _elem212.read(iprot); + _val209.add(_elem212); + } + iprot.readListEnd(); + } + struct.success.put(_key208, _val209); + } + iprot.readMapEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, multiget_slice_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, struct.success.size())); + for (Map.Entry> _iter213 : struct.success.entrySet()) + { + oprot.writeBinary(_iter213.getKey()); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter213.getValue().size())); + for (ColumnOrSuperColumn _iter214 : _iter213.getValue()) + { + _iter214.write(oprot); + } + oprot.writeListEnd(); + } + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class multiget_slice_resultTupleSchemeFactory implements SchemeFactory { + public multiget_slice_resultTupleScheme getScheme() { + return new multiget_slice_resultTupleScheme(); + } + } + + private static class multiget_slice_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, multiget_slice_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetUe()) { + optionals.set(2); + } + if (struct.isSetTe()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (Map.Entry> _iter215 : struct.success.entrySet()) + { + oprot.writeBinary(_iter215.getKey()); + { + oprot.writeI32(_iter215.getValue().size()); + for (ColumnOrSuperColumn _iter216 : _iter215.getValue()) + { + _iter216.write(oprot); + } + } + } + } + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, multiget_slice_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map217 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, iprot.readI32()); + struct.success = new HashMap>(2*_map217.size); + for (int _i218 = 0; _i218 < _map217.size; ++_i218) + { + ByteBuffer _key219; // required + List _val220; // required + _key219 = iprot.readBinary(); + { + org.apache.thrift.protocol.TList _list221 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + _val220 = new ArrayList(_list221.size); + for (int _i222 = 0; _i222 < _list221.size; ++_i222) + { + ColumnOrSuperColumn _elem223; // required + _elem223 = new ColumnOrSuperColumn(); + _elem223.read(iprot); + _val220.add(_elem223); + } + } + struct.success.put(_key219, _val220); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(3)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + } + } + } public static class multiget_count_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -10517,6 +11652,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField PREDICATE_FIELD_DESC = new org.apache.thrift.protocol.TField("predicate", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new multiget_count_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new multiget_count_argsTupleSchemeFactory()); + } + public List keys; // required public ColumnParent column_parent; // required public SlicePredicate predicate; // required @@ -10598,7 +11739,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -10998,99 +12138,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEYS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list112 = iprot.readListBegin(); - this.keys = new ArrayList(_list112.size); - for (int _i113 = 0; _i113 < _list112.size; ++_i113) - { - ByteBuffer _elem114; // required - _elem114 = iprot.readBinary(); - this.keys.add(_elem114); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COLUMN_PARENT - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column_parent = new ColumnParent(); - this.column_parent.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // PREDICATE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.predicate = new SlicePredicate(); - this.predicate.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.keys != null) { - oprot.writeFieldBegin(KEYS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.keys.size())); - for (ByteBuffer _iter115 : this.keys) - { - oprot.writeBinary(_iter115); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (this.column_parent != null) { - oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); - this.column_parent.write(oprot); - oprot.writeFieldEnd(); - } - if (this.predicate != null) { - oprot.writeFieldBegin(PREDICATE_FIELD_DESC); - this.predicate.write(oprot); - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -11147,6 +12199,13 @@ public class Cassandra { if (consistency_level == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); } + // check for sub-struct validity + if (column_parent != null) { + column_parent.validate(); + } + if (predicate != null) { + predicate.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -11165,6 +12224,164 @@ public class Cassandra { } } + private static class multiget_count_argsStandardSchemeFactory implements SchemeFactory { + public multiget_count_argsStandardScheme getScheme() { + return new multiget_count_argsStandardScheme(); + } + } + + private static class multiget_count_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, multiget_count_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEYS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list224 = iprot.readListBegin(); + struct.keys = new ArrayList(_list224.size); + for (int _i225 = 0; _i225 < _list224.size; ++_i225) + { + ByteBuffer _elem226; // required + _elem226 = iprot.readBinary(); + struct.keys.add(_elem226); + } + iprot.readListEnd(); + } + struct.setKeysIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_PARENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.column_parent = new ColumnParent(); + struct.column_parent.read(iprot); + struct.setColumn_parentIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PREDICATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.predicate = new SlicePredicate(); + struct.predicate.read(iprot); + struct.setPredicateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CONSISTENCY_LEVEL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, multiget_count_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.keys != null) { + oprot.writeFieldBegin(KEYS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.keys.size())); + for (ByteBuffer _iter227 : struct.keys) + { + oprot.writeBinary(_iter227); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.column_parent != null) { + oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); + struct.column_parent.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.predicate != null) { + oprot.writeFieldBegin(PREDICATE_FIELD_DESC); + struct.predicate.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.consistency_level != null) { + oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); + oprot.writeI32(struct.consistency_level.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class multiget_count_argsTupleSchemeFactory implements SchemeFactory { + public multiget_count_argsTupleScheme getScheme() { + return new multiget_count_argsTupleScheme(); + } + } + + private static class multiget_count_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, multiget_count_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.keys.size()); + for (ByteBuffer _iter228 : struct.keys) + { + oprot.writeBinary(_iter228); + } + } + struct.column_parent.write(oprot); + struct.predicate.write(oprot); + oprot.writeI32(struct.consistency_level.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, multiget_count_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list229 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.keys = new ArrayList(_list229.size); + for (int _i230 = 0; _i230 < _list229.size; ++_i230) + { + ByteBuffer _elem231; // required + _elem231 = iprot.readBinary(); + struct.keys.add(_elem231); + } + } + struct.setKeysIsSet(true); + struct.column_parent = new ColumnParent(); + struct.column_parent.read(iprot); + struct.setColumn_parentIsSet(true); + struct.predicate = new SlicePredicate(); + struct.predicate.read(iprot); + struct.setPredicateIsSet(true); + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } + } + } public static class multiget_count_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -11175,6 +12392,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new multiget_count_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new multiget_count_resultTupleSchemeFactory()); + } + public Map success; // required public InvalidRequestException ire; // required public UnavailableException ue; // required @@ -11248,7 +12471,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -11641,100 +12863,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map116 = iprot.readMapBegin(); - this.success = new HashMap(2*_map116.size); - for (int _i117 = 0; _i117 < _map116.size; ++_i117) - { - ByteBuffer _key118; // required - int _val119; // required - _key118 = iprot.readBinary(); - _val119 = iprot.readI32(); - this.success.put(_key118, _val119); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, this.success.size())); - for (Map.Entry _iter120 : this.success.entrySet()) - { - oprot.writeBinary(_iter120.getKey()); - oprot.writeI32(_iter120.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -11778,6 +12912,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -11796,6 +12931,203 @@ public class Cassandra { } } + private static class multiget_count_resultStandardSchemeFactory implements SchemeFactory { + public multiget_count_resultStandardScheme getScheme() { + return new multiget_count_resultStandardScheme(); + } + } + + private static class multiget_count_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, multiget_count_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map232 = iprot.readMapBegin(); + struct.success = new HashMap(2*_map232.size); + for (int _i233 = 0; _i233 < _map232.size; ++_i233) + { + ByteBuffer _key234; // required + int _val235; // required + _key234 = iprot.readBinary(); + _val235 = iprot.readI32(); + struct.success.put(_key234, _val235); + } + iprot.readMapEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, multiget_count_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.success.size())); + for (Map.Entry _iter236 : struct.success.entrySet()) + { + oprot.writeBinary(_iter236.getKey()); + oprot.writeI32(_iter236.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class multiget_count_resultTupleSchemeFactory implements SchemeFactory { + public multiget_count_resultTupleScheme getScheme() { + return new multiget_count_resultTupleScheme(); + } + } + + private static class multiget_count_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, multiget_count_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetUe()) { + optionals.set(2); + } + if (struct.isSetTe()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (Map.Entry _iter237 : struct.success.entrySet()) + { + oprot.writeBinary(_iter237.getKey()); + oprot.writeI32(_iter237.getValue()); + } + } + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, multiget_count_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map238 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.success = new HashMap(2*_map238.size); + for (int _i239 = 0; _i239 < _map238.size; ++_i239) + { + ByteBuffer _key240; // required + int _val241; // required + _key240 = iprot.readBinary(); + _val241 = iprot.readI32(); + struct.success.put(_key240, _val241); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(3)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + } + } + } public static class get_range_slices_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -11806,6 +13138,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField RANGE_FIELD_DESC = new org.apache.thrift.protocol.TField("range", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new get_range_slices_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_range_slices_argsTupleSchemeFactory()); + } + public ColumnParent column_parent; // required public SlicePredicate predicate; // required public KeyRange range; // required @@ -11887,7 +13225,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -12265,83 +13602,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // COLUMN_PARENT - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column_parent = new ColumnParent(); - this.column_parent.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // PREDICATE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.predicate = new SlicePredicate(); - this.predicate.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // RANGE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.range = new KeyRange(); - this.range.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.column_parent != null) { - oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); - this.column_parent.write(oprot); - oprot.writeFieldEnd(); - } - if (this.predicate != null) { - oprot.writeFieldBegin(PREDICATE_FIELD_DESC); - this.predicate.write(oprot); - oprot.writeFieldEnd(); - } - if (this.range != null) { - oprot.writeFieldBegin(RANGE_FIELD_DESC); - this.range.write(oprot); - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -12398,6 +13663,16 @@ public class Cassandra { if (consistency_level == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); } + // check for sub-struct validity + if (column_parent != null) { + column_parent.validate(); + } + if (predicate != null) { + predicate.validate(); + } + if (range != null) { + range.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -12416,6 +13691,134 @@ public class Cassandra { } } + private static class get_range_slices_argsStandardSchemeFactory implements SchemeFactory { + public get_range_slices_argsStandardScheme getScheme() { + return new get_range_slices_argsStandardScheme(); + } + } + + private static class get_range_slices_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, get_range_slices_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // COLUMN_PARENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.column_parent = new ColumnParent(); + struct.column_parent.read(iprot); + struct.setColumn_parentIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // PREDICATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.predicate = new SlicePredicate(); + struct.predicate.read(iprot); + struct.setPredicateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // RANGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.range = new KeyRange(); + struct.range.read(iprot); + struct.setRangeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CONSISTENCY_LEVEL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, get_range_slices_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.column_parent != null) { + oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); + struct.column_parent.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.predicate != null) { + oprot.writeFieldBegin(PREDICATE_FIELD_DESC); + struct.predicate.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.range != null) { + oprot.writeFieldBegin(RANGE_FIELD_DESC); + struct.range.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.consistency_level != null) { + oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); + oprot.writeI32(struct.consistency_level.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_range_slices_argsTupleSchemeFactory implements SchemeFactory { + public get_range_slices_argsTupleScheme getScheme() { + return new get_range_slices_argsTupleScheme(); + } + } + + private static class get_range_slices_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_range_slices_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.column_parent.write(oprot); + struct.predicate.write(oprot); + struct.range.write(oprot); + oprot.writeI32(struct.consistency_level.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_range_slices_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.column_parent = new ColumnParent(); + struct.column_parent.read(iprot); + struct.setColumn_parentIsSet(true); + struct.predicate = new SlicePredicate(); + struct.predicate.read(iprot); + struct.setPredicateIsSet(true); + struct.range = new KeyRange(); + struct.range.read(iprot); + struct.setRangeIsSet(true); + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } + } + } public static class get_range_slices_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -12426,6 +13829,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new get_range_slices_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_range_slices_resultTupleSchemeFactory()); + } + public List success; // required public InvalidRequestException ire; // required public UnavailableException ue; // required @@ -12499,7 +13908,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -12886,98 +14294,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list121 = iprot.readListBegin(); - this.success = new ArrayList(_list121.size); - for (int _i122 = 0; _i122 < _list121.size; ++_i122) - { - KeySlice _elem123; // required - _elem123 = new KeySlice(); - _elem123.read(iprot); - this.success.add(_elem123); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (KeySlice _iter124 : this.success) - { - _iter124.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -13021,6 +14343,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -13039,6 +14362,199 @@ public class Cassandra { } } + private static class get_range_slices_resultStandardSchemeFactory implements SchemeFactory { + public get_range_slices_resultStandardScheme getScheme() { + return new get_range_slices_resultStandardScheme(); + } + } + + private static class get_range_slices_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, get_range_slices_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list242 = iprot.readListBegin(); + struct.success = new ArrayList(_list242.size); + for (int _i243 = 0; _i243 < _list242.size; ++_i243) + { + KeySlice _elem244; // required + _elem244 = new KeySlice(); + _elem244.read(iprot); + struct.success.add(_elem244); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, get_range_slices_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (KeySlice _iter245 : struct.success) + { + _iter245.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_range_slices_resultTupleSchemeFactory implements SchemeFactory { + public get_range_slices_resultTupleScheme getScheme() { + return new get_range_slices_resultTupleScheme(); + } + } + + private static class get_range_slices_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_range_slices_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetUe()) { + optionals.set(2); + } + if (struct.isSetTe()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (KeySlice _iter246 : struct.success) + { + _iter246.write(oprot); + } + } + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_range_slices_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list247 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list247.size); + for (int _i248 = 0; _i248 < _list247.size; ++_i248) + { + KeySlice _elem249; // required + _elem249 = new KeySlice(); + _elem249.read(iprot); + struct.success.add(_elem249); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(3)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + } + } + } public static class get_paged_slice_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -13049,6 +14565,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField START_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("start_column", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new get_paged_slice_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_paged_slice_argsTupleSchemeFactory()); + } + public String column_family; // required public KeyRange range; // required public ByteBuffer start_column; // required @@ -13130,7 +14652,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -13519,81 +15040,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // COLUMN_FAMILY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.column_family = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // RANGE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.range = new KeyRange(); - this.range.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // START_COLUMN - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.start_column = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.column_family != null) { - oprot.writeFieldBegin(COLUMN_FAMILY_FIELD_DESC); - oprot.writeString(this.column_family); - oprot.writeFieldEnd(); - } - if (this.range != null) { - oprot.writeFieldBegin(RANGE_FIELD_DESC); - this.range.write(oprot); - oprot.writeFieldEnd(); - } - if (this.start_column != null) { - oprot.writeFieldBegin(START_COLUMN_FIELD_DESC); - oprot.writeBinary(this.start_column); - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -13650,6 +15101,10 @@ public class Cassandra { if (consistency_level == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); } + // check for sub-struct validity + if (range != null) { + range.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -13668,6 +15123,130 @@ public class Cassandra { } } + private static class get_paged_slice_argsStandardSchemeFactory implements SchemeFactory { + public get_paged_slice_argsStandardScheme getScheme() { + return new get_paged_slice_argsStandardScheme(); + } + } + + private static class get_paged_slice_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, get_paged_slice_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // COLUMN_FAMILY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.column_family = iprot.readString(); + struct.setColumn_familyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // RANGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.range = new KeyRange(); + struct.range.read(iprot); + struct.setRangeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // START_COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.start_column = iprot.readBinary(); + struct.setStart_columnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CONSISTENCY_LEVEL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, get_paged_slice_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.column_family != null) { + oprot.writeFieldBegin(COLUMN_FAMILY_FIELD_DESC); + oprot.writeString(struct.column_family); + oprot.writeFieldEnd(); + } + if (struct.range != null) { + oprot.writeFieldBegin(RANGE_FIELD_DESC); + struct.range.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.start_column != null) { + oprot.writeFieldBegin(START_COLUMN_FIELD_DESC); + oprot.writeBinary(struct.start_column); + oprot.writeFieldEnd(); + } + if (struct.consistency_level != null) { + oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); + oprot.writeI32(struct.consistency_level.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_paged_slice_argsTupleSchemeFactory implements SchemeFactory { + public get_paged_slice_argsTupleScheme getScheme() { + return new get_paged_slice_argsTupleScheme(); + } + } + + private static class get_paged_slice_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_paged_slice_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.column_family); + struct.range.write(oprot); + oprot.writeBinary(struct.start_column); + oprot.writeI32(struct.consistency_level.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_paged_slice_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.column_family = iprot.readString(); + struct.setColumn_familyIsSet(true); + struct.range = new KeyRange(); + struct.range.read(iprot); + struct.setRangeIsSet(true); + struct.start_column = iprot.readBinary(); + struct.setStart_columnIsSet(true); + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } + } + } public static class get_paged_slice_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -13678,6 +15257,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new get_paged_slice_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_paged_slice_resultTupleSchemeFactory()); + } + public List success; // required public InvalidRequestException ire; // required public UnavailableException ue; // required @@ -13751,7 +15336,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -14138,98 +15722,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list125 = iprot.readListBegin(); - this.success = new ArrayList(_list125.size); - for (int _i126 = 0; _i126 < _list125.size; ++_i126) - { - KeySlice _elem127; // required - _elem127 = new KeySlice(); - _elem127.read(iprot); - this.success.add(_elem127); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (KeySlice _iter128 : this.success) - { - _iter128.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -14273,6 +15771,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -14291,6 +15790,199 @@ public class Cassandra { } } + private static class get_paged_slice_resultStandardSchemeFactory implements SchemeFactory { + public get_paged_slice_resultStandardScheme getScheme() { + return new get_paged_slice_resultStandardScheme(); + } + } + + private static class get_paged_slice_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, get_paged_slice_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list250 = iprot.readListBegin(); + struct.success = new ArrayList(_list250.size); + for (int _i251 = 0; _i251 < _list250.size; ++_i251) + { + KeySlice _elem252; // required + _elem252 = new KeySlice(); + _elem252.read(iprot); + struct.success.add(_elem252); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, get_paged_slice_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (KeySlice _iter253 : struct.success) + { + _iter253.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_paged_slice_resultTupleSchemeFactory implements SchemeFactory { + public get_paged_slice_resultTupleScheme getScheme() { + return new get_paged_slice_resultTupleScheme(); + } + } + + private static class get_paged_slice_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_paged_slice_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetUe()) { + optionals.set(2); + } + if (struct.isSetTe()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (KeySlice _iter254 : struct.success) + { + _iter254.write(oprot); + } + } + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_paged_slice_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list255 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list255.size); + for (int _i256 = 0; _i256 < _list255.size; ++_i256) + { + KeySlice _elem257; // required + _elem257 = new KeySlice(); + _elem257.read(iprot); + struct.success.add(_elem257); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(3)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + } + } + } public static class get_indexed_slices_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -14301,6 +15993,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField COLUMN_PREDICATE_FIELD_DESC = new org.apache.thrift.protocol.TField("column_predicate", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new get_indexed_slices_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_indexed_slices_argsTupleSchemeFactory()); + } + public ColumnParent column_parent; // required public IndexClause index_clause; // required public SlicePredicate column_predicate; // required @@ -14382,7 +16080,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -14760,83 +16457,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // COLUMN_PARENT - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column_parent = new ColumnParent(); - this.column_parent.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // INDEX_CLAUSE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.index_clause = new IndexClause(); - this.index_clause.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // COLUMN_PREDICATE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column_predicate = new SlicePredicate(); - this.column_predicate.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.column_parent != null) { - oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); - this.column_parent.write(oprot); - oprot.writeFieldEnd(); - } - if (this.index_clause != null) { - oprot.writeFieldBegin(INDEX_CLAUSE_FIELD_DESC); - this.index_clause.write(oprot); - oprot.writeFieldEnd(); - } - if (this.column_predicate != null) { - oprot.writeFieldBegin(COLUMN_PREDICATE_FIELD_DESC); - this.column_predicate.write(oprot); - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -14893,6 +16518,16 @@ public class Cassandra { if (consistency_level == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); } + // check for sub-struct validity + if (column_parent != null) { + column_parent.validate(); + } + if (index_clause != null) { + index_clause.validate(); + } + if (column_predicate != null) { + column_predicate.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -14911,6 +16546,134 @@ public class Cassandra { } } + private static class get_indexed_slices_argsStandardSchemeFactory implements SchemeFactory { + public get_indexed_slices_argsStandardScheme getScheme() { + return new get_indexed_slices_argsStandardScheme(); + } + } + + private static class get_indexed_slices_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, get_indexed_slices_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // COLUMN_PARENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.column_parent = new ColumnParent(); + struct.column_parent.read(iprot); + struct.setColumn_parentIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // INDEX_CLAUSE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.index_clause = new IndexClause(); + struct.index_clause.read(iprot); + struct.setIndex_clauseIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMN_PREDICATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.column_predicate = new SlicePredicate(); + struct.column_predicate.read(iprot); + struct.setColumn_predicateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CONSISTENCY_LEVEL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, get_indexed_slices_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.column_parent != null) { + oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); + struct.column_parent.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.index_clause != null) { + oprot.writeFieldBegin(INDEX_CLAUSE_FIELD_DESC); + struct.index_clause.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.column_predicate != null) { + oprot.writeFieldBegin(COLUMN_PREDICATE_FIELD_DESC); + struct.column_predicate.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.consistency_level != null) { + oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); + oprot.writeI32(struct.consistency_level.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_indexed_slices_argsTupleSchemeFactory implements SchemeFactory { + public get_indexed_slices_argsTupleScheme getScheme() { + return new get_indexed_slices_argsTupleScheme(); + } + } + + private static class get_indexed_slices_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_indexed_slices_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.column_parent.write(oprot); + struct.index_clause.write(oprot); + struct.column_predicate.write(oprot); + oprot.writeI32(struct.consistency_level.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_indexed_slices_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.column_parent = new ColumnParent(); + struct.column_parent.read(iprot); + struct.setColumn_parentIsSet(true); + struct.index_clause = new IndexClause(); + struct.index_clause.read(iprot); + struct.setIndex_clauseIsSet(true); + struct.column_predicate = new SlicePredicate(); + struct.column_predicate.read(iprot); + struct.setColumn_predicateIsSet(true); + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } + } + } public static class get_indexed_slices_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -14921,6 +16684,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new get_indexed_slices_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new get_indexed_slices_resultTupleSchemeFactory()); + } + public List success; // required public InvalidRequestException ire; // required public UnavailableException ue; // required @@ -14994,7 +16763,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -15381,98 +17149,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list129 = iprot.readListBegin(); - this.success = new ArrayList(_list129.size); - for (int _i130 = 0; _i130 < _list129.size; ++_i130) - { - KeySlice _elem131; // required - _elem131 = new KeySlice(); - _elem131.read(iprot); - this.success.add(_elem131); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (KeySlice _iter132 : this.success) - { - _iter132.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -15516,6 +17198,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -15534,6 +17217,199 @@ public class Cassandra { } } + private static class get_indexed_slices_resultStandardSchemeFactory implements SchemeFactory { + public get_indexed_slices_resultStandardScheme getScheme() { + return new get_indexed_slices_resultStandardScheme(); + } + } + + private static class get_indexed_slices_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, get_indexed_slices_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list258 = iprot.readListBegin(); + struct.success = new ArrayList(_list258.size); + for (int _i259 = 0; _i259 < _list258.size; ++_i259) + { + KeySlice _elem260; // required + _elem260 = new KeySlice(); + _elem260.read(iprot); + struct.success.add(_elem260); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, get_indexed_slices_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (KeySlice _iter261 : struct.success) + { + _iter261.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class get_indexed_slices_resultTupleSchemeFactory implements SchemeFactory { + public get_indexed_slices_resultTupleScheme getScheme() { + return new get_indexed_slices_resultTupleScheme(); + } + } + + private static class get_indexed_slices_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, get_indexed_slices_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetUe()) { + optionals.set(2); + } + if (struct.isSetTe()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (KeySlice _iter262 : struct.success) + { + _iter262.write(oprot); + } + } + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, get_indexed_slices_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list263 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list263.size); + for (int _i264 = 0; _i264 < _list263.size; ++_i264) + { + KeySlice _elem265; // required + _elem265 = new KeySlice(); + _elem265.read(iprot); + struct.success.add(_elem265); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(3)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + } + } + } public static class insert_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -15544,6 +17420,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new insert_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new insert_argsTupleSchemeFactory()); + } + public ByteBuffer key; // required public ColumnParent column_parent; // required public Column column; // required @@ -15625,7 +17507,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -16014,82 +17895,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.key = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COLUMN_PARENT - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column_parent = new ColumnParent(); - this.column_parent.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // COLUMN - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column = new Column(); - this.column.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeBinary(this.key); - oprot.writeFieldEnd(); - } - if (this.column_parent != null) { - oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); - this.column_parent.write(oprot); - oprot.writeFieldEnd(); - } - if (this.column != null) { - oprot.writeFieldBegin(COLUMN_FIELD_DESC); - this.column.write(oprot); - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -16146,6 +17956,13 @@ public class Cassandra { if (consistency_level == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); } + // check for sub-struct validity + if (column_parent != null) { + column_parent.validate(); + } + if (column != null) { + column.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -16164,6 +17981,132 @@ public class Cassandra { } } + private static class insert_argsStandardSchemeFactory implements SchemeFactory { + public insert_argsStandardScheme getScheme() { + return new insert_argsStandardScheme(); + } + } + + private static class insert_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, insert_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_PARENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.column_parent = new ColumnParent(); + struct.column_parent.read(iprot); + struct.setColumn_parentIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.column = new Column(); + struct.column.read(iprot); + struct.setColumnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CONSISTENCY_LEVEL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, insert_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.key != null) { + oprot.writeFieldBegin(KEY_FIELD_DESC); + oprot.writeBinary(struct.key); + oprot.writeFieldEnd(); + } + if (struct.column_parent != null) { + oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); + struct.column_parent.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.column != null) { + oprot.writeFieldBegin(COLUMN_FIELD_DESC); + struct.column.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.consistency_level != null) { + oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); + oprot.writeI32(struct.consistency_level.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class insert_argsTupleSchemeFactory implements SchemeFactory { + public insert_argsTupleScheme getScheme() { + return new insert_argsTupleScheme(); + } + } + + private static class insert_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, insert_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.key); + struct.column_parent.write(oprot); + struct.column.write(oprot); + oprot.writeI32(struct.consistency_level.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, insert_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + struct.column_parent = new ColumnParent(); + struct.column_parent.read(iprot); + struct.setColumn_parentIsSet(true); + struct.column = new Column(); + struct.column.read(iprot); + struct.setColumnIsSet(true); + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } + } + } public static class insert_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -16173,6 +18116,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new insert_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new insert_resultTupleSchemeFactory()); + } + public InvalidRequestException ire; // required public UnavailableException ue; // required public TimedOutException te; // required @@ -16242,7 +18191,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -16540,69 +18488,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -16638,6 +18529,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -16656,6 +18548,142 @@ public class Cassandra { } } + private static class insert_resultStandardSchemeFactory implements SchemeFactory { + public insert_resultStandardScheme getScheme() { + return new insert_resultStandardScheme(); + } + } + + private static class insert_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, insert_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, insert_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class insert_resultTupleSchemeFactory implements SchemeFactory { + public insert_resultTupleScheme getScheme() { + return new insert_resultTupleScheme(); + } + } + + private static class insert_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, insert_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIre()) { + optionals.set(0); + } + if (struct.isSetUe()) { + optionals.set(1); + } + if (struct.isSetTe()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, insert_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(1)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(2)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + } + } + } public static class add_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -16666,6 +18694,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new add_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new add_argsTupleSchemeFactory()); + } + public ByteBuffer key; // required public ColumnParent column_parent; // required public CounterColumn column; // required @@ -16747,7 +18781,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -17136,82 +19169,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.key = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COLUMN_PARENT - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column_parent = new ColumnParent(); - this.column_parent.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // COLUMN - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column = new CounterColumn(); - this.column.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeBinary(this.key); - oprot.writeFieldEnd(); - } - if (this.column_parent != null) { - oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); - this.column_parent.write(oprot); - oprot.writeFieldEnd(); - } - if (this.column != null) { - oprot.writeFieldBegin(COLUMN_FIELD_DESC); - this.column.write(oprot); - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -17268,6 +19230,13 @@ public class Cassandra { if (consistency_level == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); } + // check for sub-struct validity + if (column_parent != null) { + column_parent.validate(); + } + if (column != null) { + column.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -17286,6 +19255,132 @@ public class Cassandra { } } + private static class add_argsStandardSchemeFactory implements SchemeFactory { + public add_argsStandardScheme getScheme() { + return new add_argsStandardScheme(); + } + } + + private static class add_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, add_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_PARENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.column_parent = new ColumnParent(); + struct.column_parent.read(iprot); + struct.setColumn_parentIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.column = new CounterColumn(); + struct.column.read(iprot); + struct.setColumnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CONSISTENCY_LEVEL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, add_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.key != null) { + oprot.writeFieldBegin(KEY_FIELD_DESC); + oprot.writeBinary(struct.key); + oprot.writeFieldEnd(); + } + if (struct.column_parent != null) { + oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); + struct.column_parent.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.column != null) { + oprot.writeFieldBegin(COLUMN_FIELD_DESC); + struct.column.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.consistency_level != null) { + oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); + oprot.writeI32(struct.consistency_level.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class add_argsTupleSchemeFactory implements SchemeFactory { + public add_argsTupleScheme getScheme() { + return new add_argsTupleScheme(); + } + } + + private static class add_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, add_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.key); + struct.column_parent.write(oprot); + struct.column.write(oprot); + oprot.writeI32(struct.consistency_level.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, add_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + struct.column_parent = new ColumnParent(); + struct.column_parent.read(iprot); + struct.setColumn_parentIsSet(true); + struct.column = new CounterColumn(); + struct.column.read(iprot); + struct.setColumnIsSet(true); + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } + } + } public static class add_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -17295,6 +19390,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new add_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new add_resultTupleSchemeFactory()); + } + public InvalidRequestException ire; // required public UnavailableException ue; // required public TimedOutException te; // required @@ -17364,7 +19465,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -17662,69 +19762,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -17760,6 +19803,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -17778,6 +19822,142 @@ public class Cassandra { } } + private static class add_resultStandardSchemeFactory implements SchemeFactory { + public add_resultStandardScheme getScheme() { + return new add_resultStandardScheme(); + } + } + + private static class add_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, add_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, add_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class add_resultTupleSchemeFactory implements SchemeFactory { + public add_resultTupleScheme getScheme() { + return new add_resultTupleScheme(); + } + } + + private static class add_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, add_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIre()) { + optionals.set(0); + } + if (struct.isSetUe()) { + optionals.set(1); + } + if (struct.isSetTe()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, add_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(1)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(2)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + } + } + } public static class remove_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -17788,6 +19968,12 @@ public class Cassandra { 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 CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new remove_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new remove_argsTupleSchemeFactory()); + } + public ByteBuffer key; // required public ColumnPath column_path; // required public long timestamp; // required @@ -17870,8 +20056,7 @@ public class Cassandra { // isset id assignments private static final int __TIMESTAMP_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -17910,8 +20095,7 @@ public class Cassandra { * Performs a deep copy on other. */ public remove_args(remove_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetKey()) { this.key = org.apache.thrift.TBaseHelper.copyBinary(other.key); ; @@ -18008,16 +20192,16 @@ public class Cassandra { } public void unsetTimestamp() { - __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); } /** 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); + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); } public void setTimestampIsSet(boolean value) { - __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); } /** @@ -18261,83 +20445,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.key = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COLUMN_PATH - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column_path = new ColumnPath(); - this.column_path.read(iprot); - } 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: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } 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 org.apache.thrift.protocol.TProtocolException("Required field 'timestamp' was not found in serialized data! Struct: " + toString()); - } - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeBinary(this.key); - oprot.writeFieldEnd(); - } - if (this.column_path != null) { - oprot.writeFieldBegin(COLUMN_PATH_FIELD_DESC); - this.column_path.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); - oprot.writeI64(this.timestamp); - oprot.writeFieldEnd(); - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -18385,6 +20497,10 @@ public class Cassandra { throw new org.apache.thrift.protocol.TProtocolException("Required field 'column_path' was not present! Struct: " + toString()); } // alas, we cannot check 'timestamp' because it's a primitive and you chose the non-beans generator. + // check for sub-struct validity + if (column_path != null) { + column_path.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -18398,13 +20514,148 @@ public class Cassandra { 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); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class remove_argsStandardSchemeFactory implements SchemeFactory { + public remove_argsStandardScheme getScheme() { + return new remove_argsStandardScheme(); + } + } + + private static class remove_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, remove_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMN_PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.column_path = new ColumnPath(); + struct.column_path.read(iprot); + struct.setColumn_pathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CONSISTENCY_LEVEL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetTimestamp()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'timestamp' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, remove_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.key != null) { + oprot.writeFieldBegin(KEY_FIELD_DESC); + oprot.writeBinary(struct.key); + oprot.writeFieldEnd(); + } + if (struct.column_path != null) { + oprot.writeFieldBegin(COLUMN_PATH_FIELD_DESC); + struct.column_path.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + if (struct.consistency_level != null) { + oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); + oprot.writeI32(struct.consistency_level.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class remove_argsTupleSchemeFactory implements SchemeFactory { + public remove_argsTupleScheme getScheme() { + return new remove_argsTupleScheme(); + } + } + + private static class remove_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, remove_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.key); + struct.column_path.write(oprot); + oprot.writeI64(struct.timestamp); + BitSet optionals = new BitSet(); + if (struct.isSetConsistency_level()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetConsistency_level()) { + oprot.writeI32(struct.consistency_level.getValue()); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, remove_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + struct.column_path = new ColumnPath(); + struct.column_path.read(iprot); + struct.setColumn_pathIsSet(true); + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } + } + } + } public static class remove_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -18414,6 +20665,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new remove_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new remove_resultTupleSchemeFactory()); + } + public InvalidRequestException ire; // required public UnavailableException ue; // required public TimedOutException te; // required @@ -18483,7 +20740,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -18781,69 +21037,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -18879,6 +21078,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -18897,6 +21097,142 @@ public class Cassandra { } } + private static class remove_resultStandardSchemeFactory implements SchemeFactory { + public remove_resultStandardScheme getScheme() { + return new remove_resultStandardScheme(); + } + } + + private static class remove_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, remove_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, remove_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class remove_resultTupleSchemeFactory implements SchemeFactory { + public remove_resultTupleScheme getScheme() { + return new remove_resultTupleScheme(); + } + } + + private static class remove_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, remove_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIre()) { + optionals.set(0); + } + if (struct.isSetUe()) { + optionals.set(1); + } + if (struct.isSetTe()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, remove_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(1)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(2)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + } + } + } public static class remove_counter_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -18906,6 +21242,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new remove_counter_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new remove_counter_argsTupleSchemeFactory()); + } + public ByteBuffer key; // required public ColumnPath path; // required /** @@ -18983,7 +21325,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -19303,69 +21644,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.key = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.path = new ColumnPath(); - this.path.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeBinary(this.key); - oprot.writeFieldEnd(); - } - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - this.path.write(oprot); - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -19411,6 +21694,10 @@ public class Cassandra { if (consistency_level == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); } + // check for sub-struct validity + if (path != null) { + path.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -19429,6 +21716,114 @@ public class Cassandra { } } + private static class remove_counter_argsStandardSchemeFactory implements SchemeFactory { + public remove_counter_argsStandardScheme getScheme() { + return new remove_counter_argsStandardScheme(); + } + } + + private static class remove_counter_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, remove_counter_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.path = new ColumnPath(); + struct.path.read(iprot); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // CONSISTENCY_LEVEL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, remove_counter_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.key != null) { + oprot.writeFieldBegin(KEY_FIELD_DESC); + oprot.writeBinary(struct.key); + oprot.writeFieldEnd(); + } + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + struct.path.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.consistency_level != null) { + oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); + oprot.writeI32(struct.consistency_level.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class remove_counter_argsTupleSchemeFactory implements SchemeFactory { + public remove_counter_argsTupleScheme getScheme() { + return new remove_counter_argsTupleScheme(); + } + } + + private static class remove_counter_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, remove_counter_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.key); + struct.path.write(oprot); + oprot.writeI32(struct.consistency_level.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, remove_counter_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + struct.path = new ColumnPath(); + struct.path.read(iprot); + struct.setPathIsSet(true); + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } + } + } public static class remove_counter_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -19438,6 +21833,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new remove_counter_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new remove_counter_resultTupleSchemeFactory()); + } + public InvalidRequestException ire; // required public UnavailableException ue; // required public TimedOutException te; // required @@ -19507,7 +21908,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -19805,69 +22205,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -19903,6 +22246,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -19921,6 +22265,142 @@ public class Cassandra { } } + private static class remove_counter_resultStandardSchemeFactory implements SchemeFactory { + public remove_counter_resultStandardScheme getScheme() { + return new remove_counter_resultStandardScheme(); + } + } + + private static class remove_counter_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, remove_counter_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, remove_counter_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class remove_counter_resultTupleSchemeFactory implements SchemeFactory { + public remove_counter_resultTupleScheme getScheme() { + return new remove_counter_resultTupleScheme(); + } + } + + private static class remove_counter_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, remove_counter_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIre()) { + optionals.set(0); + } + if (struct.isSetUe()) { + optionals.set(1); + } + if (struct.isSetTe()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, remove_counter_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(1)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(2)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + } + } + } public static class batch_mutate_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -19929,6 +22409,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField MUTATION_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("mutation_map", org.apache.thrift.protocol.TType.MAP, (short)1); private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new batch_mutate_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new batch_mutate_argsTupleSchemeFactory()); + } + public Map>> mutation_map; // required /** * @@ -20002,7 +22488,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -20285,114 +22770,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // MUTATION_MAP - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map133 = iprot.readMapBegin(); - this.mutation_map = new HashMap>>(2*_map133.size); - for (int _i134 = 0; _i134 < _map133.size; ++_i134) - { - ByteBuffer _key135; // required - Map> _val136; // required - _key135 = iprot.readBinary(); - { - org.apache.thrift.protocol.TMap _map137 = iprot.readMapBegin(); - _val136 = new HashMap>(2*_map137.size); - for (int _i138 = 0; _i138 < _map137.size; ++_i138) - { - String _key139; // required - List _val140; // required - _key139 = iprot.readString(); - { - org.apache.thrift.protocol.TList _list141 = iprot.readListBegin(); - _val140 = new ArrayList(_list141.size); - for (int _i142 = 0; _i142 < _list141.size; ++_i142) - { - Mutation _elem143; // required - _elem143 = new Mutation(); - _elem143.read(iprot); - _val140.add(_elem143); - } - iprot.readListEnd(); - } - _val136.put(_key139, _val140); - } - iprot.readMapEnd(); - } - this.mutation_map.put(_key135, _val136); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.mutation_map != null) { - oprot.writeFieldBegin(MUTATION_MAP_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, this.mutation_map.size())); - for (Map.Entry>> _iter144 : this.mutation_map.entrySet()) - { - oprot.writeBinary(_iter144.getKey()); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, _iter144.getValue().size())); - for (Map.Entry> _iter145 : _iter144.getValue().entrySet()) - { - oprot.writeString(_iter145.getKey()); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter145.getValue().size())); - for (Mutation _iter146 : _iter145.getValue()) - { - _iter146.write(oprot); - } - oprot.writeListEnd(); - } - } - oprot.writeMapEnd(); - } - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -20427,6 +22809,7 @@ public class Cassandra { if (consistency_level == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -20445,6 +22828,206 @@ public class Cassandra { } } + private static class batch_mutate_argsStandardSchemeFactory implements SchemeFactory { + public batch_mutate_argsStandardScheme getScheme() { + return new batch_mutate_argsStandardScheme(); + } + } + + private static class batch_mutate_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, batch_mutate_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // MUTATION_MAP + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map266 = iprot.readMapBegin(); + struct.mutation_map = new HashMap>>(2*_map266.size); + for (int _i267 = 0; _i267 < _map266.size; ++_i267) + { + ByteBuffer _key268; // required + Map> _val269; // required + _key268 = iprot.readBinary(); + { + org.apache.thrift.protocol.TMap _map270 = iprot.readMapBegin(); + _val269 = new HashMap>(2*_map270.size); + for (int _i271 = 0; _i271 < _map270.size; ++_i271) + { + String _key272; // required + List _val273; // required + _key272 = iprot.readString(); + { + org.apache.thrift.protocol.TList _list274 = iprot.readListBegin(); + _val273 = new ArrayList(_list274.size); + for (int _i275 = 0; _i275 < _list274.size; ++_i275) + { + Mutation _elem276; // required + _elem276 = new Mutation(); + _elem276.read(iprot); + _val273.add(_elem276); + } + iprot.readListEnd(); + } + _val269.put(_key272, _val273); + } + iprot.readMapEnd(); + } + struct.mutation_map.put(_key268, _val269); + } + iprot.readMapEnd(); + } + struct.setMutation_mapIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // CONSISTENCY_LEVEL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, batch_mutate_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.mutation_map != null) { + oprot.writeFieldBegin(MUTATION_MAP_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.mutation_map.size())); + for (Map.Entry>> _iter277 : struct.mutation_map.entrySet()) + { + oprot.writeBinary(_iter277.getKey()); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, _iter277.getValue().size())); + for (Map.Entry> _iter278 : _iter277.getValue().entrySet()) + { + oprot.writeString(_iter278.getKey()); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter278.getValue().size())); + for (Mutation _iter279 : _iter278.getValue()) + { + _iter279.write(oprot); + } + oprot.writeListEnd(); + } + } + oprot.writeMapEnd(); + } + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.consistency_level != null) { + oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); + oprot.writeI32(struct.consistency_level.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class batch_mutate_argsTupleSchemeFactory implements SchemeFactory { + public batch_mutate_argsTupleScheme getScheme() { + return new batch_mutate_argsTupleScheme(); + } + } + + private static class batch_mutate_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, batch_mutate_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.mutation_map.size()); + for (Map.Entry>> _iter280 : struct.mutation_map.entrySet()) + { + oprot.writeBinary(_iter280.getKey()); + { + oprot.writeI32(_iter280.getValue().size()); + for (Map.Entry> _iter281 : _iter280.getValue().entrySet()) + { + oprot.writeString(_iter281.getKey()); + { + oprot.writeI32(_iter281.getValue().size()); + for (Mutation _iter282 : _iter281.getValue()) + { + _iter282.write(oprot); + } + } + } + } + } + } + oprot.writeI32(struct.consistency_level.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, batch_mutate_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TMap _map283 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32()); + struct.mutation_map = new HashMap>>(2*_map283.size); + for (int _i284 = 0; _i284 < _map283.size; ++_i284) + { + ByteBuffer _key285; // required + Map> _val286; // required + _key285 = iprot.readBinary(); + { + org.apache.thrift.protocol.TMap _map287 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, iprot.readI32()); + _val286 = new HashMap>(2*_map287.size); + for (int _i288 = 0; _i288 < _map287.size; ++_i288) + { + String _key289; // required + List _val290; // required + _key289 = iprot.readString(); + { + org.apache.thrift.protocol.TList _list291 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + _val290 = new ArrayList(_list291.size); + for (int _i292 = 0; _i292 < _list291.size; ++_i292) + { + Mutation _elem293; // required + _elem293 = new Mutation(); + _elem293.read(iprot); + _val290.add(_elem293); + } + } + _val286.put(_key289, _val290); + } + } + struct.mutation_map.put(_key285, _val286); + } + } + struct.setMutation_mapIsSet(true); + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } + } + } public static class batch_mutate_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -20454,6 +23037,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new batch_mutate_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new batch_mutate_resultTupleSchemeFactory()); + } + public InvalidRequestException ire; // required public UnavailableException ue; // required public TimedOutException te; // required @@ -20523,7 +23112,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -20821,69 +23409,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -20919,6 +23450,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -20937,6 +23469,142 @@ public class Cassandra { } } + private static class batch_mutate_resultStandardSchemeFactory implements SchemeFactory { + public batch_mutate_resultStandardScheme getScheme() { + return new batch_mutate_resultStandardScheme(); + } + } + + private static class batch_mutate_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, batch_mutate_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, batch_mutate_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class batch_mutate_resultTupleSchemeFactory implements SchemeFactory { + public batch_mutate_resultTupleScheme getScheme() { + return new batch_mutate_resultTupleScheme(); + } + } + + private static class batch_mutate_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, batch_mutate_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIre()) { + optionals.set(0); + } + if (struct.isSetUe()) { + optionals.set(1); + } + if (struct.isSetTe()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, batch_mutate_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(1)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(2)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + } + } + } public static class atomic_batch_mutate_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -20945,6 +23613,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField MUTATION_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("mutation_map", org.apache.thrift.protocol.TType.MAP, (short)1); private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new atomic_batch_mutate_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new atomic_batch_mutate_argsTupleSchemeFactory()); + } + public Map>> mutation_map; // required /** * @@ -21018,7 +23692,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -21301,114 +23974,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // MUTATION_MAP - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map147 = iprot.readMapBegin(); - this.mutation_map = new HashMap>>(2*_map147.size); - for (int _i148 = 0; _i148 < _map147.size; ++_i148) - { - ByteBuffer _key149; // required - Map> _val150; // required - _key149 = iprot.readBinary(); - { - org.apache.thrift.protocol.TMap _map151 = iprot.readMapBegin(); - _val150 = new HashMap>(2*_map151.size); - for (int _i152 = 0; _i152 < _map151.size; ++_i152) - { - String _key153; // required - List _val154; // required - _key153 = iprot.readString(); - { - org.apache.thrift.protocol.TList _list155 = iprot.readListBegin(); - _val154 = new ArrayList(_list155.size); - for (int _i156 = 0; _i156 < _list155.size; ++_i156) - { - Mutation _elem157; // required - _elem157 = new Mutation(); - _elem157.read(iprot); - _val154.add(_elem157); - } - iprot.readListEnd(); - } - _val150.put(_key153, _val154); - } - iprot.readMapEnd(); - } - this.mutation_map.put(_key149, _val150); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.mutation_map != null) { - oprot.writeFieldBegin(MUTATION_MAP_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, this.mutation_map.size())); - for (Map.Entry>> _iter158 : this.mutation_map.entrySet()) - { - oprot.writeBinary(_iter158.getKey()); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, _iter158.getValue().size())); - for (Map.Entry> _iter159 : _iter158.getValue().entrySet()) - { - oprot.writeString(_iter159.getKey()); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter159.getValue().size())); - for (Mutation _iter160 : _iter159.getValue()) - { - _iter160.write(oprot); - } - oprot.writeListEnd(); - } - } - oprot.writeMapEnd(); - } - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -21443,6 +24013,7 @@ public class Cassandra { if (consistency_level == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -21461,6 +24032,206 @@ public class Cassandra { } } + private static class atomic_batch_mutate_argsStandardSchemeFactory implements SchemeFactory { + public atomic_batch_mutate_argsStandardScheme getScheme() { + return new atomic_batch_mutate_argsStandardScheme(); + } + } + + private static class atomic_batch_mutate_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, atomic_batch_mutate_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // MUTATION_MAP + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map294 = iprot.readMapBegin(); + struct.mutation_map = new HashMap>>(2*_map294.size); + for (int _i295 = 0; _i295 < _map294.size; ++_i295) + { + ByteBuffer _key296; // required + Map> _val297; // required + _key296 = iprot.readBinary(); + { + org.apache.thrift.protocol.TMap _map298 = iprot.readMapBegin(); + _val297 = new HashMap>(2*_map298.size); + for (int _i299 = 0; _i299 < _map298.size; ++_i299) + { + String _key300; // required + List _val301; // required + _key300 = iprot.readString(); + { + org.apache.thrift.protocol.TList _list302 = iprot.readListBegin(); + _val301 = new ArrayList(_list302.size); + for (int _i303 = 0; _i303 < _list302.size; ++_i303) + { + Mutation _elem304; // required + _elem304 = new Mutation(); + _elem304.read(iprot); + _val301.add(_elem304); + } + iprot.readListEnd(); + } + _val297.put(_key300, _val301); + } + iprot.readMapEnd(); + } + struct.mutation_map.put(_key296, _val297); + } + iprot.readMapEnd(); + } + struct.setMutation_mapIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // CONSISTENCY_LEVEL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, atomic_batch_mutate_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.mutation_map != null) { + oprot.writeFieldBegin(MUTATION_MAP_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, struct.mutation_map.size())); + for (Map.Entry>> _iter305 : struct.mutation_map.entrySet()) + { + oprot.writeBinary(_iter305.getKey()); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, _iter305.getValue().size())); + for (Map.Entry> _iter306 : _iter305.getValue().entrySet()) + { + oprot.writeString(_iter306.getKey()); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter306.getValue().size())); + for (Mutation _iter307 : _iter306.getValue()) + { + _iter307.write(oprot); + } + oprot.writeListEnd(); + } + } + oprot.writeMapEnd(); + } + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.consistency_level != null) { + oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); + oprot.writeI32(struct.consistency_level.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class atomic_batch_mutate_argsTupleSchemeFactory implements SchemeFactory { + public atomic_batch_mutate_argsTupleScheme getScheme() { + return new atomic_batch_mutate_argsTupleScheme(); + } + } + + private static class atomic_batch_mutate_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, atomic_batch_mutate_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.mutation_map.size()); + for (Map.Entry>> _iter308 : struct.mutation_map.entrySet()) + { + oprot.writeBinary(_iter308.getKey()); + { + oprot.writeI32(_iter308.getValue().size()); + for (Map.Entry> _iter309 : _iter308.getValue().entrySet()) + { + oprot.writeString(_iter309.getKey()); + { + oprot.writeI32(_iter309.getValue().size()); + for (Mutation _iter310 : _iter309.getValue()) + { + _iter310.write(oprot); + } + } + } + } + } + } + oprot.writeI32(struct.consistency_level.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, atomic_batch_mutate_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TMap _map311 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32()); + struct.mutation_map = new HashMap>>(2*_map311.size); + for (int _i312 = 0; _i312 < _map311.size; ++_i312) + { + ByteBuffer _key313; // required + Map> _val314; // required + _key313 = iprot.readBinary(); + { + org.apache.thrift.protocol.TMap _map315 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, iprot.readI32()); + _val314 = new HashMap>(2*_map315.size); + for (int _i316 = 0; _i316 < _map315.size; ++_i316) + { + String _key317; // required + List _val318; // required + _key317 = iprot.readString(); + { + org.apache.thrift.protocol.TList _list319 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + _val318 = new ArrayList(_list319.size); + for (int _i320 = 0; _i320 < _list319.size; ++_i320) + { + Mutation _elem321; // required + _elem321 = new Mutation(); + _elem321.read(iprot); + _val318.add(_elem321); + } + } + _val314.put(_key317, _val318); + } + } + struct.mutation_map.put(_key313, _val314); + } + } + struct.setMutation_mapIsSet(true); + struct.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistency_levelIsSet(true); + } + } + } public static class atomic_batch_mutate_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -21470,6 +24241,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new atomic_batch_mutate_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new atomic_batch_mutate_resultTupleSchemeFactory()); + } + public InvalidRequestException ire; // required public UnavailableException ue; // required public TimedOutException te; // required @@ -21539,7 +24316,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -21837,69 +24613,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -21935,6 +24654,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -21953,6 +24673,142 @@ public class Cassandra { } } + private static class atomic_batch_mutate_resultStandardSchemeFactory implements SchemeFactory { + public atomic_batch_mutate_resultStandardScheme getScheme() { + return new atomic_batch_mutate_resultStandardScheme(); + } + } + + private static class atomic_batch_mutate_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, atomic_batch_mutate_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, atomic_batch_mutate_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class atomic_batch_mutate_resultTupleSchemeFactory implements SchemeFactory { + public atomic_batch_mutate_resultTupleScheme getScheme() { + return new atomic_batch_mutate_resultTupleScheme(); + } + } + + private static class atomic_batch_mutate_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, atomic_batch_mutate_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIre()) { + optionals.set(0); + } + if (struct.isSetUe()) { + optionals.set(1); + } + if (struct.isSetTe()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, atomic_batch_mutate_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(1)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(2)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + } + } + } public static class truncate_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -21960,6 +24816,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField CFNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("cfname", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new truncate_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new truncate_argsTupleSchemeFactory()); + } + public String cfname; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -22021,7 +24883,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -22181,44 +25042,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // CFNAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.cfname = 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.cfname != null) { - oprot.writeFieldBegin(CFNAME_FIELD_DESC); - oprot.writeString(this.cfname); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -22242,6 +25070,7 @@ public class Cassandra { if (cfname == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'cfname' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -22260,6 +25089,80 @@ public class Cassandra { } } + private static class truncate_argsStandardSchemeFactory implements SchemeFactory { + public truncate_argsStandardScheme getScheme() { + return new truncate_argsStandardScheme(); + } + } + + private static class truncate_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, truncate_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // CFNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.cfname = iprot.readString(); + struct.setCfnameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, truncate_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.cfname != null) { + oprot.writeFieldBegin(CFNAME_FIELD_DESC); + oprot.writeString(struct.cfname); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class truncate_argsTupleSchemeFactory implements SchemeFactory { + public truncate_argsTupleScheme getScheme() { + return new truncate_argsTupleScheme(); + } + } + + private static class truncate_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, truncate_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.cfname); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, truncate_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.cfname = iprot.readString(); + struct.setCfnameIsSet(true); + } + } + } public static class truncate_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -22269,6 +25172,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new truncate_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new truncate_resultTupleSchemeFactory()); + } + public InvalidRequestException ire; // required public UnavailableException ue; // required public TimedOutException te; // required @@ -22338,7 +25247,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -22636,69 +25544,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -22734,6 +25585,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -22752,12 +25604,154 @@ public class Cassandra { } } + private static class truncate_resultStandardSchemeFactory implements SchemeFactory { + public truncate_resultStandardScheme getScheme() { + return new truncate_resultStandardScheme(); + } + } + + private static class truncate_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, truncate_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, truncate_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class truncate_resultTupleSchemeFactory implements SchemeFactory { + public truncate_resultTupleScheme getScheme() { + return new truncate_resultTupleScheme(); + } + } + + private static class truncate_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, truncate_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIre()) { + optionals.set(0); + } + if (struct.isSetUe()) { + optionals.set(1); + } + if (struct.isSetTe()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, truncate_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(1)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(2)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + } + } + } public static class describe_schema_versions_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("describe_schema_versions_args"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_schema_versions_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_schema_versions_argsTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -22899,32 +25893,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -22938,6 +25911,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -22956,6 +25930,64 @@ public class Cassandra { } } + private static class describe_schema_versions_argsStandardSchemeFactory implements SchemeFactory { + public describe_schema_versions_argsStandardScheme getScheme() { + return new describe_schema_versions_argsStandardScheme(); + } + } + + private static class describe_schema_versions_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_schema_versions_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_schema_versions_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_schema_versions_argsTupleSchemeFactory implements SchemeFactory { + public describe_schema_versions_argsTupleScheme getScheme() { + return new describe_schema_versions_argsTupleScheme(); + } + } + + private static class describe_schema_versions_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_schema_versions_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_schema_versions_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class describe_schema_versions_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -22964,6 +25996,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_schema_versions_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_schema_versions_resultTupleSchemeFactory()); + } + public Map> success; // required public InvalidRequestException ire; // required @@ -23029,7 +26067,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -23287,93 +26324,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map161 = iprot.readMapBegin(); - this.success = new HashMap>(2*_map161.size); - for (int _i162 = 0; _i162 < _map161.size; ++_i162) - { - String _key163; // required - List _val164; // required - _key163 = iprot.readString(); - { - org.apache.thrift.protocol.TList _list165 = iprot.readListBegin(); - _val164 = new ArrayList(_list165.size); - for (int _i166 = 0; _i166 < _list165.size; ++_i166) - { - String _elem167; // required - _elem167 = iprot.readString(); - _val164.add(_elem167); - } - iprot.readListEnd(); - } - this.success.put(_key163, _val164); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, this.success.size())); - for (Map.Entry> _iter168 : this.success.entrySet()) - { - oprot.writeString(_iter168.getKey()); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter168.getValue().size())); - for (String _iter169 : _iter168.getValue()) - { - oprot.writeString(_iter169); - } - oprot.writeListEnd(); - } - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -23401,6 +26357,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -23419,12 +26376,197 @@ public class Cassandra { } } + private static class describe_schema_versions_resultStandardSchemeFactory implements SchemeFactory { + public describe_schema_versions_resultStandardScheme getScheme() { + return new describe_schema_versions_resultStandardScheme(); + } + } + + private static class describe_schema_versions_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_schema_versions_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map322 = iprot.readMapBegin(); + struct.success = new HashMap>(2*_map322.size); + for (int _i323 = 0; _i323 < _map322.size; ++_i323) + { + String _key324; // required + List _val325; // required + _key324 = iprot.readString(); + { + org.apache.thrift.protocol.TList _list326 = iprot.readListBegin(); + _val325 = new ArrayList(_list326.size); + for (int _i327 = 0; _i327 < _list326.size; ++_i327) + { + String _elem328; // required + _elem328 = iprot.readString(); + _val325.add(_elem328); + } + iprot.readListEnd(); + } + struct.success.put(_key324, _val325); + } + iprot.readMapEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_schema_versions_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, struct.success.size())); + for (Map.Entry> _iter329 : struct.success.entrySet()) + { + oprot.writeString(_iter329.getKey()); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter329.getValue().size())); + for (String _iter330 : _iter329.getValue()) + { + oprot.writeString(_iter330); + } + oprot.writeListEnd(); + } + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_schema_versions_resultTupleSchemeFactory implements SchemeFactory { + public describe_schema_versions_resultTupleScheme getScheme() { + return new describe_schema_versions_resultTupleScheme(); + } + } + + private static class describe_schema_versions_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_schema_versions_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (Map.Entry> _iter331 : struct.success.entrySet()) + { + oprot.writeString(_iter331.getKey()); + { + oprot.writeI32(_iter331.getValue().size()); + for (String _iter332 : _iter331.getValue()) + { + oprot.writeString(_iter332); + } + } + } + } + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_schema_versions_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map333 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, iprot.readI32()); + struct.success = new HashMap>(2*_map333.size); + for (int _i334 = 0; _i334 < _map333.size; ++_i334) + { + String _key335; // required + List _val336; // required + _key335 = iprot.readString(); + { + org.apache.thrift.protocol.TList _list337 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + _val336 = new ArrayList(_list337.size); + for (int _i338 = 0; _i338 < _list337.size; ++_i338) + { + String _elem339; // required + _elem339 = iprot.readString(); + _val336.add(_elem339); + } + } + struct.success.put(_key335, _val336); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + } + } + } public static class describe_keyspaces_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("describe_keyspaces_args"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_keyspaces_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_keyspaces_argsTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -23566,32 +26708,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -23605,6 +26726,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -23623,6 +26745,64 @@ public class Cassandra { } } + private static class describe_keyspaces_argsStandardSchemeFactory implements SchemeFactory { + public describe_keyspaces_argsStandardScheme getScheme() { + return new describe_keyspaces_argsStandardScheme(); + } + } + + private static class describe_keyspaces_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_keyspaces_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_keyspaces_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_keyspaces_argsTupleSchemeFactory implements SchemeFactory { + public describe_keyspaces_argsTupleScheme getScheme() { + return new describe_keyspaces_argsTupleScheme(); + } + } + + private static class describe_keyspaces_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_keyspaces_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_keyspaces_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class describe_keyspaces_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -23631,6 +26811,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_keyspaces_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_keyspaces_resultTupleSchemeFactory()); + } + public List success; // required public InvalidRequestException ire; // required @@ -23696,7 +26882,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -23945,74 +27130,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list170 = iprot.readListBegin(); - this.success = new ArrayList(_list170.size); - for (int _i171 = 0; _i171 < _list170.size; ++_i171) - { - KsDef _elem172; // required - _elem172 = new KsDef(); - _elem172.read(iprot); - this.success.add(_elem172); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (KsDef _iter173 : this.success) - { - _iter173.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -24040,6 +27163,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -24058,12 +27182,161 @@ public class Cassandra { } } + private static class describe_keyspaces_resultStandardSchemeFactory implements SchemeFactory { + public describe_keyspaces_resultStandardScheme getScheme() { + return new describe_keyspaces_resultStandardScheme(); + } + } + + private static class describe_keyspaces_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_keyspaces_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list340 = iprot.readListBegin(); + struct.success = new ArrayList(_list340.size); + for (int _i341 = 0; _i341 < _list340.size; ++_i341) + { + KsDef _elem342; // required + _elem342 = new KsDef(); + _elem342.read(iprot); + struct.success.add(_elem342); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_keyspaces_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (KsDef _iter343 : struct.success) + { + _iter343.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_keyspaces_resultTupleSchemeFactory implements SchemeFactory { + public describe_keyspaces_resultTupleScheme getScheme() { + return new describe_keyspaces_resultTupleScheme(); + } + } + + private static class describe_keyspaces_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_keyspaces_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (KsDef _iter344 : struct.success) + { + _iter344.write(oprot); + } + } + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_keyspaces_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list345 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list345.size); + for (int _i346 = 0; _i346 < _list345.size; ++_i346) + { + KsDef _elem347; // required + _elem347 = new KsDef(); + _elem347.read(iprot); + struct.success.add(_elem347); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + } + } + } public static class describe_cluster_name_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("describe_cluster_name_args"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_cluster_name_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_cluster_name_argsTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -24205,32 +27478,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -24244,6 +27496,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -24262,6 +27515,64 @@ public class Cassandra { } } + private static class describe_cluster_name_argsStandardSchemeFactory implements SchemeFactory { + public describe_cluster_name_argsStandardScheme getScheme() { + return new describe_cluster_name_argsStandardScheme(); + } + } + + private static class describe_cluster_name_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_cluster_name_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_cluster_name_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_cluster_name_argsTupleSchemeFactory implements SchemeFactory { + public describe_cluster_name_argsTupleScheme getScheme() { + return new describe_cluster_name_argsTupleScheme(); + } + } + + private static class describe_cluster_name_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_cluster_name_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_cluster_name_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class describe_cluster_name_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -24269,6 +27580,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_cluster_name_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_cluster_name_resultTupleSchemeFactory()); + } + public String success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -24330,7 +27647,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -24490,44 +27806,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -24547,6 +27831,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -24565,12 +27850,102 @@ public class Cassandra { } } + private static class describe_cluster_name_resultStandardSchemeFactory implements SchemeFactory { + public describe_cluster_name_resultStandardScheme getScheme() { + return new describe_cluster_name_resultStandardScheme(); + } + } + + private static class describe_cluster_name_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_cluster_name_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_cluster_name_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_cluster_name_resultTupleSchemeFactory implements SchemeFactory { + public describe_cluster_name_resultTupleScheme getScheme() { + return new describe_cluster_name_resultTupleScheme(); + } + } + + private static class describe_cluster_name_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_cluster_name_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_cluster_name_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + } + } + } public static class describe_version_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("describe_version_args"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_version_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_version_argsTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -24712,32 +28087,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -24751,6 +28105,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -24769,6 +28124,64 @@ public class Cassandra { } } + private static class describe_version_argsStandardSchemeFactory implements SchemeFactory { + public describe_version_argsStandardScheme getScheme() { + return new describe_version_argsStandardScheme(); + } + } + + private static class describe_version_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_version_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_version_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_version_argsTupleSchemeFactory implements SchemeFactory { + public describe_version_argsTupleScheme getScheme() { + return new describe_version_argsTupleScheme(); + } + } + + private static class describe_version_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_version_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_version_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class describe_version_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -24776,6 +28189,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_version_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_version_resultTupleSchemeFactory()); + } + public String success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -24837,7 +28256,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -24997,44 +28415,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -25054,6 +28440,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -25072,6 +28459,90 @@ public class Cassandra { } } + private static class describe_version_resultStandardSchemeFactory implements SchemeFactory { + public describe_version_resultStandardScheme getScheme() { + return new describe_version_resultStandardScheme(); + } + } + + private static class describe_version_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_version_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_version_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_version_resultTupleSchemeFactory implements SchemeFactory { + public describe_version_resultTupleScheme getScheme() { + return new describe_version_resultTupleScheme(); + } + } + + private static class describe_version_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_version_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_version_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + } + } + } public static class describe_ring_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -25079,6 +28550,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField KEYSPACE_FIELD_DESC = new org.apache.thrift.protocol.TField("keyspace", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_ring_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_ring_argsTupleSchemeFactory()); + } + public String keyspace; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -25140,7 +28617,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -25300,44 +28776,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEYSPACE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.keyspace = 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.keyspace != null) { - oprot.writeFieldBegin(KEYSPACE_FIELD_DESC); - oprot.writeString(this.keyspace); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -25361,6 +28804,7 @@ public class Cassandra { if (keyspace == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'keyspace' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -25379,6 +28823,80 @@ public class Cassandra { } } + private static class describe_ring_argsStandardSchemeFactory implements SchemeFactory { + public describe_ring_argsStandardScheme getScheme() { + return new describe_ring_argsStandardScheme(); + } + } + + private static class describe_ring_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_ring_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEYSPACE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.keyspace = iprot.readString(); + struct.setKeyspaceIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_ring_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.keyspace != null) { + oprot.writeFieldBegin(KEYSPACE_FIELD_DESC); + oprot.writeString(struct.keyspace); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_ring_argsTupleSchemeFactory implements SchemeFactory { + public describe_ring_argsTupleScheme getScheme() { + return new describe_ring_argsTupleScheme(); + } + } + + private static class describe_ring_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_ring_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.keyspace); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_ring_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.keyspace = iprot.readString(); + struct.setKeyspaceIsSet(true); + } + } + } public static class describe_ring_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -25387,6 +28905,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_ring_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_ring_resultTupleSchemeFactory()); + } + public List success; // required public InvalidRequestException ire; // required @@ -25452,7 +28976,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -25701,74 +29224,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list174 = iprot.readListBegin(); - this.success = new ArrayList(_list174.size); - for (int _i175 = 0; _i175 < _list174.size; ++_i175) - { - TokenRange _elem176; // required - _elem176 = new TokenRange(); - _elem176.read(iprot); - this.success.add(_elem176); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (TokenRange _iter177 : this.success) - { - _iter177.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -25796,6 +29257,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -25814,12 +29276,161 @@ public class Cassandra { } } + private static class describe_ring_resultStandardSchemeFactory implements SchemeFactory { + public describe_ring_resultStandardScheme getScheme() { + return new describe_ring_resultStandardScheme(); + } + } + + private static class describe_ring_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_ring_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list348 = iprot.readListBegin(); + struct.success = new ArrayList(_list348.size); + for (int _i349 = 0; _i349 < _list348.size; ++_i349) + { + TokenRange _elem350; // required + _elem350 = new TokenRange(); + _elem350.read(iprot); + struct.success.add(_elem350); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_ring_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (TokenRange _iter351 : struct.success) + { + _iter351.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_ring_resultTupleSchemeFactory implements SchemeFactory { + public describe_ring_resultTupleScheme getScheme() { + return new describe_ring_resultTupleScheme(); + } + } + + private static class describe_ring_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_ring_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (TokenRange _iter352 : struct.success) + { + _iter352.write(oprot); + } + } + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_ring_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list353 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list353.size); + for (int _i354 = 0; _i354 < _list353.size; ++_i354) + { + TokenRange _elem355; // required + _elem355 = new TokenRange(); + _elem355.read(iprot); + struct.success.add(_elem355); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + } + } + } public static class describe_token_map_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("describe_token_map_args"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_token_map_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_token_map_argsTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -25961,32 +29572,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -26000,6 +29590,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -26018,6 +29609,64 @@ public class Cassandra { } } + private static class describe_token_map_argsStandardSchemeFactory implements SchemeFactory { + public describe_token_map_argsStandardScheme getScheme() { + return new describe_token_map_argsStandardScheme(); + } + } + + private static class describe_token_map_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_token_map_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_token_map_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_token_map_argsTupleSchemeFactory implements SchemeFactory { + public describe_token_map_argsTupleScheme getScheme() { + return new describe_token_map_argsTupleScheme(); + } + } + + private static class describe_token_map_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_token_map_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_token_map_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class describe_token_map_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -26026,6 +29675,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_token_map_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_token_map_resultTupleSchemeFactory()); + } + public Map success; // required public InvalidRequestException ire; // required @@ -26091,7 +29746,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -26345,76 +29999,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map178 = iprot.readMapBegin(); - this.success = new HashMap(2*_map178.size); - for (int _i179 = 0; _i179 < _map178.size; ++_i179) - { - String _key180; // required - String _val181; // required - _key180 = iprot.readString(); - _val181 = iprot.readString(); - this.success.put(_key180, _val181); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, this.success.size())); - for (Map.Entry _iter182 : this.success.entrySet()) - { - oprot.writeString(_iter182.getKey()); - oprot.writeString(_iter182.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -26442,6 +30032,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -26460,12 +30051,165 @@ public class Cassandra { } } + private static class describe_token_map_resultStandardSchemeFactory implements SchemeFactory { + public describe_token_map_resultStandardScheme getScheme() { + return new describe_token_map_resultStandardScheme(); + } + } + + private static class describe_token_map_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_token_map_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map356 = iprot.readMapBegin(); + struct.success = new HashMap(2*_map356.size); + for (int _i357 = 0; _i357 < _map356.size; ++_i357) + { + String _key358; // required + String _val359; // required + _key358 = iprot.readString(); + _val359 = iprot.readString(); + struct.success.put(_key358, _val359); + } + iprot.readMapEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_token_map_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size())); + for (Map.Entry _iter360 : struct.success.entrySet()) + { + oprot.writeString(_iter360.getKey()); + oprot.writeString(_iter360.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_token_map_resultTupleSchemeFactory implements SchemeFactory { + public describe_token_map_resultTupleScheme getScheme() { + return new describe_token_map_resultTupleScheme(); + } + } + + private static class describe_token_map_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_token_map_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (Map.Entry _iter361 : struct.success.entrySet()) + { + oprot.writeString(_iter361.getKey()); + oprot.writeString(_iter361.getValue()); + } + } + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_token_map_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map362 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new HashMap(2*_map362.size); + for (int _i363 = 0; _i363 < _map362.size; ++_i363) + { + String _key364; // required + String _val365; // required + _key364 = iprot.readString(); + _val365 = iprot.readString(); + struct.success.put(_key364, _val365); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + } + } + } public static class describe_partitioner_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("describe_partitioner_args"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_partitioner_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_partitioner_argsTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -26607,32 +30351,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -26646,6 +30369,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -26664,6 +30388,64 @@ public class Cassandra { } } + private static class describe_partitioner_argsStandardSchemeFactory implements SchemeFactory { + public describe_partitioner_argsStandardScheme getScheme() { + return new describe_partitioner_argsStandardScheme(); + } + } + + private static class describe_partitioner_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_partitioner_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_partitioner_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_partitioner_argsTupleSchemeFactory implements SchemeFactory { + public describe_partitioner_argsTupleScheme getScheme() { + return new describe_partitioner_argsTupleScheme(); + } + } + + private static class describe_partitioner_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_partitioner_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_partitioner_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class describe_partitioner_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -26671,6 +30453,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_partitioner_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_partitioner_resultTupleSchemeFactory()); + } + public String success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -26732,7 +30520,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -26892,44 +30679,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -26949,6 +30704,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -26967,12 +30723,102 @@ public class Cassandra { } } + private static class describe_partitioner_resultStandardSchemeFactory implements SchemeFactory { + public describe_partitioner_resultStandardScheme getScheme() { + return new describe_partitioner_resultStandardScheme(); + } + } + + private static class describe_partitioner_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_partitioner_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_partitioner_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_partitioner_resultTupleSchemeFactory implements SchemeFactory { + public describe_partitioner_resultTupleScheme getScheme() { + return new describe_partitioner_resultTupleScheme(); + } + } + + private static class describe_partitioner_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_partitioner_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_partitioner_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + } + } + } public static class describe_snitch_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("describe_snitch_args"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_snitch_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_snitch_argsTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -27114,32 +30960,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -27153,6 +30978,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -27171,6 +30997,64 @@ public class Cassandra { } } + private static class describe_snitch_argsStandardSchemeFactory implements SchemeFactory { + public describe_snitch_argsStandardScheme getScheme() { + return new describe_snitch_argsStandardScheme(); + } + } + + private static class describe_snitch_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_snitch_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_snitch_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_snitch_argsTupleSchemeFactory implements SchemeFactory { + public describe_snitch_argsTupleScheme getScheme() { + return new describe_snitch_argsTupleScheme(); + } + } + + private static class describe_snitch_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_snitch_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_snitch_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class describe_snitch_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -27178,6 +31062,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_snitch_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_snitch_resultTupleSchemeFactory()); + } + public String success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -27239,7 +31129,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -27399,44 +31288,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -27456,6 +31313,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -27474,6 +31332,90 @@ public class Cassandra { } } + private static class describe_snitch_resultStandardSchemeFactory implements SchemeFactory { + public describe_snitch_resultStandardScheme getScheme() { + return new describe_snitch_resultStandardScheme(); + } + } + + private static class describe_snitch_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_snitch_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_snitch_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_snitch_resultTupleSchemeFactory implements SchemeFactory { + public describe_snitch_resultTupleScheme getScheme() { + return new describe_snitch_resultTupleScheme(); + } + } + + private static class describe_snitch_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_snitch_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_snitch_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + } + } + } public static class describe_keyspace_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -27481,6 +31423,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField KEYSPACE_FIELD_DESC = new org.apache.thrift.protocol.TField("keyspace", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_keyspace_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_keyspace_argsTupleSchemeFactory()); + } + public String keyspace; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -27542,7 +31490,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -27702,44 +31649,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEYSPACE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.keyspace = 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.keyspace != null) { - oprot.writeFieldBegin(KEYSPACE_FIELD_DESC); - oprot.writeString(this.keyspace); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -27763,6 +31677,7 @@ public class Cassandra { if (keyspace == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'keyspace' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -27781,6 +31696,80 @@ public class Cassandra { } } + private static class describe_keyspace_argsStandardSchemeFactory implements SchemeFactory { + public describe_keyspace_argsStandardScheme getScheme() { + return new describe_keyspace_argsStandardScheme(); + } + } + + private static class describe_keyspace_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_keyspace_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEYSPACE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.keyspace = iprot.readString(); + struct.setKeyspaceIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_keyspace_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.keyspace != null) { + oprot.writeFieldBegin(KEYSPACE_FIELD_DESC); + oprot.writeString(struct.keyspace); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_keyspace_argsTupleSchemeFactory implements SchemeFactory { + public describe_keyspace_argsTupleScheme getScheme() { + return new describe_keyspace_argsTupleScheme(); + } + } + + private static class describe_keyspace_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_keyspace_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.keyspace); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_keyspace_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.keyspace = iprot.readString(); + struct.setKeyspaceIsSet(true); + } + } + } public static class describe_keyspace_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -27790,6 +31779,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField NFE_FIELD_DESC = new org.apache.thrift.protocol.TField("nfe", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_keyspace_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_keyspace_resultTupleSchemeFactory()); + } + public KsDef success; // required public NotFoundException nfe; // required public InvalidRequestException ire; // required @@ -27859,7 +31854,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -28157,69 +32151,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new KsDef(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // NFE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.nfe = new NotFoundException(); - this.nfe.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetNfe()) { - oprot.writeFieldBegin(NFE_FIELD_DESC); - this.nfe.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -28255,6 +32192,10 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -28273,6 +32214,142 @@ public class Cassandra { } } + private static class describe_keyspace_resultStandardSchemeFactory implements SchemeFactory { + public describe_keyspace_resultStandardScheme getScheme() { + return new describe_keyspace_resultStandardScheme(); + } + } + + private static class describe_keyspace_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_keyspace_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new KsDef(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // NFE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.nfe = new NotFoundException(); + struct.nfe.read(iprot); + struct.setNfeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_keyspace_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.nfe != null) { + oprot.writeFieldBegin(NFE_FIELD_DESC); + struct.nfe.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_keyspace_resultTupleSchemeFactory implements SchemeFactory { + public describe_keyspace_resultTupleScheme getScheme() { + return new describe_keyspace_resultTupleScheme(); + } + } + + private static class describe_keyspace_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_keyspace_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetNfe()) { + optionals.set(1); + } + if (struct.isSetIre()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetNfe()) { + struct.nfe.write(oprot); + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_keyspace_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.success = new KsDef(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.nfe = new NotFoundException(); + struct.nfe.read(iprot); + struct.setNfeIsSet(true); + } + if (incoming.get(2)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + } + } + } public static class describe_splits_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -28283,6 +32360,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField END_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("end_token", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField KEYS_PER_SPLIT_FIELD_DESC = new org.apache.thrift.protocol.TField("keys_per_split", org.apache.thrift.protocol.TType.I32, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_splits_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_splits_argsTupleSchemeFactory()); + } + public String cfName; // required public String start_token; // required public String end_token; // required @@ -28357,8 +32440,7 @@ public class Cassandra { // isset id assignments private static final int __KEYS_PER_SPLIT_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -28395,8 +32477,7 @@ public class Cassandra { * Performs a deep copy on other. */ public describe_splits_args(describe_splits_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetCfName()) { this.cfName = other.cfName; } @@ -28505,16 +32586,16 @@ public class Cassandra { } public void unsetKeys_per_split() { - __isset_bit_vector.clear(__KEYS_PER_SPLIT_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __KEYS_PER_SPLIT_ISSET_ID); } /** Returns true if field keys_per_split is set (has been assigned a value) and false otherwise */ public boolean isSetKeys_per_split() { - return __isset_bit_vector.get(__KEYS_PER_SPLIT_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __KEYS_PER_SPLIT_ISSET_ID); } public void setKeys_per_splitIsSet(boolean value) { - __isset_bit_vector.set(__KEYS_PER_SPLIT_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __KEYS_PER_SPLIT_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -28726,82 +32807,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // CF_NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.cfName = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // START_TOKEN - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.start_token = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // END_TOKEN - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.end_token = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // KEYS_PER_SPLIT - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.keys_per_split = iprot.readI32(); - setKeys_per_splitIsSet(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 (!isSetKeys_per_split()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'keys_per_split' was not found in serialized data! Struct: " + toString()); - } - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.cfName != null) { - oprot.writeFieldBegin(CF_NAME_FIELD_DESC); - oprot.writeString(this.cfName); - oprot.writeFieldEnd(); - } - if (this.start_token != null) { - oprot.writeFieldBegin(START_TOKEN_FIELD_DESC); - oprot.writeString(this.start_token); - oprot.writeFieldEnd(); - } - if (this.end_token != null) { - oprot.writeFieldBegin(END_TOKEN_FIELD_DESC); - oprot.writeString(this.end_token); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(KEYS_PER_SPLIT_FIELD_DESC); - oprot.writeI32(this.keys_per_split); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -28852,6 +32862,7 @@ public class Cassandra { throw new org.apache.thrift.protocol.TProtocolException("Required field 'end_token' was not present! Struct: " + toString()); } // alas, we cannot check 'keys_per_split' because it's a primitive and you chose the non-beans generator. + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -28864,12 +32875,137 @@ public class Cassandra { 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_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class describe_splits_argsStandardSchemeFactory implements SchemeFactory { + public describe_splits_argsStandardScheme getScheme() { + return new describe_splits_argsStandardScheme(); + } + } + + private static class describe_splits_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_splits_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // CF_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.cfName = iprot.readString(); + struct.setCfNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // START_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.start_token = iprot.readString(); + struct.setStart_tokenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // END_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.end_token = iprot.readString(); + struct.setEnd_tokenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // KEYS_PER_SPLIT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.keys_per_split = iprot.readI32(); + struct.setKeys_per_splitIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetKeys_per_split()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'keys_per_split' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_splits_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.cfName != null) { + oprot.writeFieldBegin(CF_NAME_FIELD_DESC); + oprot.writeString(struct.cfName); + oprot.writeFieldEnd(); + } + if (struct.start_token != null) { + oprot.writeFieldBegin(START_TOKEN_FIELD_DESC); + oprot.writeString(struct.start_token); + oprot.writeFieldEnd(); + } + if (struct.end_token != null) { + oprot.writeFieldBegin(END_TOKEN_FIELD_DESC); + oprot.writeString(struct.end_token); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(KEYS_PER_SPLIT_FIELD_DESC); + oprot.writeI32(struct.keys_per_split); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_splits_argsTupleSchemeFactory implements SchemeFactory { + public describe_splits_argsTupleScheme getScheme() { + return new describe_splits_argsTupleScheme(); + } + } + + private static class describe_splits_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_splits_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.cfName); + oprot.writeString(struct.start_token); + oprot.writeString(struct.end_token); + oprot.writeI32(struct.keys_per_split); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_splits_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.cfName = iprot.readString(); + struct.setCfNameIsSet(true); + struct.start_token = iprot.readString(); + struct.setStart_tokenIsSet(true); + struct.end_token = iprot.readString(); + struct.setEnd_tokenIsSet(true); + struct.keys_per_split = iprot.readI32(); + struct.setKeys_per_splitIsSet(true); + } + } + } public static class describe_splits_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -28878,6 +33014,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_splits_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_splits_resultTupleSchemeFactory()); + } + public List success; // required public InvalidRequestException ire; // required @@ -28943,7 +33085,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -29192,73 +33333,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list183 = iprot.readListBegin(); - this.success = new ArrayList(_list183.size); - for (int _i184 = 0; _i184 < _list183.size; ++_i184) - { - String _elem185; // required - _elem185 = iprot.readString(); - this.success.add(_elem185); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.success.size())); - for (String _iter186 : this.success) - { - oprot.writeString(_iter186); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -29286,6 +33366,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -29304,12 +33385,159 @@ public class Cassandra { } } + private static class describe_splits_resultStandardSchemeFactory implements SchemeFactory { + public describe_splits_resultStandardScheme getScheme() { + return new describe_splits_resultStandardScheme(); + } + } + + private static class describe_splits_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_splits_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list366 = iprot.readListBegin(); + struct.success = new ArrayList(_list366.size); + for (int _i367 = 0; _i367 < _list366.size; ++_i367) + { + String _elem368; // required + _elem368 = iprot.readString(); + struct.success.add(_elem368); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_splits_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); + for (String _iter369 : struct.success) + { + oprot.writeString(_iter369); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_splits_resultTupleSchemeFactory implements SchemeFactory { + public describe_splits_resultTupleScheme getScheme() { + return new describe_splits_resultTupleScheme(); + } + } + + private static class describe_splits_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_splits_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (String _iter370 : struct.success) + { + oprot.writeString(_iter370); + } + } + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_splits_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list371 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new ArrayList(_list371.size); + for (int _i372 = 0; _i372 < _list371.size; ++_i372) + { + String _elem373; // required + _elem373 = iprot.readString(); + struct.success.add(_elem373); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + } + } + } public static class trace_next_query_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trace_next_query_args"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new trace_next_query_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new trace_next_query_argsTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -29451,32 +33679,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -29490,6 +33697,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -29508,6 +33716,64 @@ public class Cassandra { } } + private static class trace_next_query_argsStandardSchemeFactory implements SchemeFactory { + public trace_next_query_argsStandardScheme getScheme() { + return new trace_next_query_argsStandardScheme(); + } + } + + private static class trace_next_query_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, trace_next_query_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, trace_next_query_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class trace_next_query_argsTupleSchemeFactory implements SchemeFactory { + public trace_next_query_argsTupleScheme getScheme() { + return new trace_next_query_argsTupleScheme(); + } + } + + private static class trace_next_query_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, trace_next_query_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, trace_next_query_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class trace_next_query_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -29515,6 +33781,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new trace_next_query_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new trace_next_query_resultTupleSchemeFactory()); + } + public ByteBuffer success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -29576,7 +33848,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -29747,44 +34018,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = iprot.readBinary(); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBinary(this.success); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -29804,6 +34043,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -29822,6 +34062,90 @@ public class Cassandra { } } + private static class trace_next_query_resultStandardSchemeFactory implements SchemeFactory { + public trace_next_query_resultStandardScheme getScheme() { + return new trace_next_query_resultStandardScheme(); + } + } + + private static class trace_next_query_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, trace_next_query_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readBinary(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, trace_next_query_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBinary(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class trace_next_query_resultTupleSchemeFactory implements SchemeFactory { + public trace_next_query_resultTupleScheme getScheme() { + return new trace_next_query_resultTupleScheme(); + } + } + + private static class trace_next_query_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, trace_next_query_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBinary(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, trace_next_query_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBinary(); + struct.setSuccessIsSet(true); + } + } + } + } public static class describe_splits_ex_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -29832,6 +34156,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField END_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("end_token", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField KEYS_PER_SPLIT_FIELD_DESC = new org.apache.thrift.protocol.TField("keys_per_split", org.apache.thrift.protocol.TType.I32, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_splits_ex_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_splits_ex_argsTupleSchemeFactory()); + } + public String cfName; // required public String start_token; // required public String end_token; // required @@ -29906,8 +34236,7 @@ public class Cassandra { // isset id assignments private static final int __KEYS_PER_SPLIT_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -29944,8 +34273,7 @@ public class Cassandra { * Performs a deep copy on other. */ public describe_splits_ex_args(describe_splits_ex_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetCfName()) { this.cfName = other.cfName; } @@ -30054,16 +34382,16 @@ public class Cassandra { } public void unsetKeys_per_split() { - __isset_bit_vector.clear(__KEYS_PER_SPLIT_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __KEYS_PER_SPLIT_ISSET_ID); } /** Returns true if field keys_per_split is set (has been assigned a value) and false otherwise */ public boolean isSetKeys_per_split() { - return __isset_bit_vector.get(__KEYS_PER_SPLIT_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __KEYS_PER_SPLIT_ISSET_ID); } public void setKeys_per_splitIsSet(boolean value) { - __isset_bit_vector.set(__KEYS_PER_SPLIT_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __KEYS_PER_SPLIT_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -30275,82 +34603,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // CF_NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.cfName = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // START_TOKEN - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.start_token = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // END_TOKEN - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.end_token = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // KEYS_PER_SPLIT - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.keys_per_split = iprot.readI32(); - setKeys_per_splitIsSet(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 (!isSetKeys_per_split()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'keys_per_split' was not found in serialized data! Struct: " + toString()); - } - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.cfName != null) { - oprot.writeFieldBegin(CF_NAME_FIELD_DESC); - oprot.writeString(this.cfName); - oprot.writeFieldEnd(); - } - if (this.start_token != null) { - oprot.writeFieldBegin(START_TOKEN_FIELD_DESC); - oprot.writeString(this.start_token); - oprot.writeFieldEnd(); - } - if (this.end_token != null) { - oprot.writeFieldBegin(END_TOKEN_FIELD_DESC); - oprot.writeString(this.end_token); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(KEYS_PER_SPLIT_FIELD_DESC); - oprot.writeI32(this.keys_per_split); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -30401,6 +34658,7 @@ public class Cassandra { throw new org.apache.thrift.protocol.TProtocolException("Required field 'end_token' was not present! Struct: " + toString()); } // alas, we cannot check 'keys_per_split' because it's a primitive and you chose the non-beans generator. + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -30414,13 +34672,136 @@ public class Cassandra { 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); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class describe_splits_ex_argsStandardSchemeFactory implements SchemeFactory { + public describe_splits_ex_argsStandardScheme getScheme() { + return new describe_splits_ex_argsStandardScheme(); + } + } + + private static class describe_splits_ex_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_splits_ex_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // CF_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.cfName = iprot.readString(); + struct.setCfNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // START_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.start_token = iprot.readString(); + struct.setStart_tokenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // END_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.end_token = iprot.readString(); + struct.setEnd_tokenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // KEYS_PER_SPLIT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.keys_per_split = iprot.readI32(); + struct.setKeys_per_splitIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetKeys_per_split()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'keys_per_split' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_splits_ex_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.cfName != null) { + oprot.writeFieldBegin(CF_NAME_FIELD_DESC); + oprot.writeString(struct.cfName); + oprot.writeFieldEnd(); + } + if (struct.start_token != null) { + oprot.writeFieldBegin(START_TOKEN_FIELD_DESC); + oprot.writeString(struct.start_token); + oprot.writeFieldEnd(); + } + if (struct.end_token != null) { + oprot.writeFieldBegin(END_TOKEN_FIELD_DESC); + oprot.writeString(struct.end_token); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(KEYS_PER_SPLIT_FIELD_DESC); + oprot.writeI32(struct.keys_per_split); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_splits_ex_argsTupleSchemeFactory implements SchemeFactory { + public describe_splits_ex_argsTupleScheme getScheme() { + return new describe_splits_ex_argsTupleScheme(); + } + } + + private static class describe_splits_ex_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_splits_ex_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.cfName); + oprot.writeString(struct.start_token); + oprot.writeString(struct.end_token); + oprot.writeI32(struct.keys_per_split); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_splits_ex_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.cfName = iprot.readString(); + struct.setCfNameIsSet(true); + struct.start_token = iprot.readString(); + struct.setStart_tokenIsSet(true); + struct.end_token = iprot.readString(); + struct.setEnd_tokenIsSet(true); + struct.keys_per_split = iprot.readI32(); + struct.setKeys_per_splitIsSet(true); + } + } + } public static class describe_splits_ex_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -30429,6 +34810,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new describe_splits_ex_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new describe_splits_ex_resultTupleSchemeFactory()); + } + public List success; // required public InvalidRequestException ire; // required @@ -30494,7 +34881,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -30743,74 +35129,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list187 = iprot.readListBegin(); - this.success = new ArrayList(_list187.size); - for (int _i188 = 0; _i188 < _list187.size; ++_i188) - { - CfSplit _elem189; // required - _elem189 = new CfSplit(); - _elem189.read(iprot); - this.success.add(_elem189); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (CfSplit _iter190 : this.success) - { - _iter190.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -30838,6 +35162,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -30856,6 +35181,149 @@ public class Cassandra { } } + private static class describe_splits_ex_resultStandardSchemeFactory implements SchemeFactory { + public describe_splits_ex_resultStandardScheme getScheme() { + return new describe_splits_ex_resultStandardScheme(); + } + } + + private static class describe_splits_ex_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, describe_splits_ex_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list374 = iprot.readListBegin(); + struct.success = new ArrayList(_list374.size); + for (int _i375 = 0; _i375 < _list374.size; ++_i375) + { + CfSplit _elem376; // required + _elem376 = new CfSplit(); + _elem376.read(iprot); + struct.success.add(_elem376); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, describe_splits_ex_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (CfSplit _iter377 : struct.success) + { + _iter377.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class describe_splits_ex_resultTupleSchemeFactory implements SchemeFactory { + public describe_splits_ex_resultTupleScheme getScheme() { + return new describe_splits_ex_resultTupleScheme(); + } + } + + private static class describe_splits_ex_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, describe_splits_ex_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (CfSplit _iter378 : struct.success) + { + _iter378.write(oprot); + } + } + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, describe_splits_ex_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list379 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list379.size); + for (int _i380 = 0; _i380 < _list379.size; ++_i380) + { + CfSplit _elem381; // required + _elem381 = new CfSplit(); + _elem381.read(iprot); + struct.success.add(_elem381); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + } + } + } public static class system_add_column_family_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -30863,6 +35331,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField CF_DEF_FIELD_DESC = new org.apache.thrift.protocol.TField("cf_def", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new system_add_column_family_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new system_add_column_family_argsTupleSchemeFactory()); + } + public CfDef cf_def; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -30924,7 +35398,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -31084,45 +35557,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // CF_DEF - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.cf_def = new CfDef(); - this.cf_def.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.cf_def != null) { - oprot.writeFieldBegin(CF_DEF_FIELD_DESC); - this.cf_def.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -31146,6 +35585,10 @@ public class Cassandra { if (cf_def == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'cf_def' was not present! Struct: " + toString()); } + // check for sub-struct validity + if (cf_def != null) { + cf_def.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -31164,6 +35607,82 @@ public class Cassandra { } } + private static class system_add_column_family_argsStandardSchemeFactory implements SchemeFactory { + public system_add_column_family_argsStandardScheme getScheme() { + return new system_add_column_family_argsStandardScheme(); + } + } + + private static class system_add_column_family_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, system_add_column_family_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // CF_DEF + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.cf_def = new CfDef(); + struct.cf_def.read(iprot); + struct.setCf_defIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, system_add_column_family_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.cf_def != null) { + oprot.writeFieldBegin(CF_DEF_FIELD_DESC); + struct.cf_def.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class system_add_column_family_argsTupleSchemeFactory implements SchemeFactory { + public system_add_column_family_argsTupleScheme getScheme() { + return new system_add_column_family_argsTupleScheme(); + } + } + + private static class system_add_column_family_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, system_add_column_family_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.cf_def.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, system_add_column_family_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.cf_def = new CfDef(); + struct.cf_def.read(iprot); + struct.setCf_defIsSet(true); + } + } + } public static class system_add_column_family_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -31173,6 +35692,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField SDE_FIELD_DESC = new org.apache.thrift.protocol.TField("sde", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new system_add_column_family_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new system_add_column_family_resultTupleSchemeFactory()); + } + public String success; // required public InvalidRequestException ire; // required public SchemaDisagreementException sde; // required @@ -31242,7 +35767,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -31540,68 +36064,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // SDE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.sde = new SchemaDisagreementException(); - this.sde.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetSde()) { - oprot.writeFieldBegin(SDE_FIELD_DESC); - this.sde.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -31637,6 +36105,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -31655,6 +36124,140 @@ public class Cassandra { } } + private static class system_add_column_family_resultStandardSchemeFactory implements SchemeFactory { + public system_add_column_family_resultStandardScheme getScheme() { + return new system_add_column_family_resultStandardScheme(); + } + } + + private static class system_add_column_family_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, system_add_column_family_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SDE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, system_add_column_family_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.sde != null) { + oprot.writeFieldBegin(SDE_FIELD_DESC); + struct.sde.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class system_add_column_family_resultTupleSchemeFactory implements SchemeFactory { + public system_add_column_family_resultTupleScheme getScheme() { + return new system_add_column_family_resultTupleScheme(); + } + } + + private static class system_add_column_family_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, system_add_column_family_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetSde()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetSde()) { + struct.sde.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, system_add_column_family_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } + } + } + } public static class system_drop_column_family_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -31662,6 +36265,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField COLUMN_FAMILY_FIELD_DESC = new org.apache.thrift.protocol.TField("column_family", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new system_drop_column_family_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new system_drop_column_family_argsTupleSchemeFactory()); + } + public String column_family; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -31723,7 +36332,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -31883,44 +36491,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // COLUMN_FAMILY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.column_family = 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.column_family != null) { - oprot.writeFieldBegin(COLUMN_FAMILY_FIELD_DESC); - oprot.writeString(this.column_family); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -31944,6 +36519,7 @@ public class Cassandra { if (column_family == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'column_family' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -31962,6 +36538,80 @@ public class Cassandra { } } + private static class system_drop_column_family_argsStandardSchemeFactory implements SchemeFactory { + public system_drop_column_family_argsStandardScheme getScheme() { + return new system_drop_column_family_argsStandardScheme(); + } + } + + private static class system_drop_column_family_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, system_drop_column_family_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // COLUMN_FAMILY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.column_family = iprot.readString(); + struct.setColumn_familyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, system_drop_column_family_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.column_family != null) { + oprot.writeFieldBegin(COLUMN_FAMILY_FIELD_DESC); + oprot.writeString(struct.column_family); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class system_drop_column_family_argsTupleSchemeFactory implements SchemeFactory { + public system_drop_column_family_argsTupleScheme getScheme() { + return new system_drop_column_family_argsTupleScheme(); + } + } + + private static class system_drop_column_family_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, system_drop_column_family_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.column_family); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, system_drop_column_family_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.column_family = iprot.readString(); + struct.setColumn_familyIsSet(true); + } + } + } public static class system_drop_column_family_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -31971,6 +36621,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField SDE_FIELD_DESC = new org.apache.thrift.protocol.TField("sde", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new system_drop_column_family_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new system_drop_column_family_resultTupleSchemeFactory()); + } + public String success; // required public InvalidRequestException ire; // required public SchemaDisagreementException sde; // required @@ -32040,7 +36696,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -32338,68 +36993,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // SDE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.sde = new SchemaDisagreementException(); - this.sde.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetSde()) { - oprot.writeFieldBegin(SDE_FIELD_DESC); - this.sde.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -32435,6 +37034,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -32453,6 +37053,140 @@ public class Cassandra { } } + private static class system_drop_column_family_resultStandardSchemeFactory implements SchemeFactory { + public system_drop_column_family_resultStandardScheme getScheme() { + return new system_drop_column_family_resultStandardScheme(); + } + } + + private static class system_drop_column_family_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, system_drop_column_family_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SDE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, system_drop_column_family_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.sde != null) { + oprot.writeFieldBegin(SDE_FIELD_DESC); + struct.sde.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class system_drop_column_family_resultTupleSchemeFactory implements SchemeFactory { + public system_drop_column_family_resultTupleScheme getScheme() { + return new system_drop_column_family_resultTupleScheme(); + } + } + + private static class system_drop_column_family_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, system_drop_column_family_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetSde()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetSde()) { + struct.sde.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, system_drop_column_family_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } + } + } + } public static class system_add_keyspace_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -32460,6 +37194,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField KS_DEF_FIELD_DESC = new org.apache.thrift.protocol.TField("ks_def", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new system_add_keyspace_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new system_add_keyspace_argsTupleSchemeFactory()); + } + public KsDef ks_def; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -32521,7 +37261,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -32681,45 +37420,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KS_DEF - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ks_def = new KsDef(); - this.ks_def.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.ks_def != null) { - oprot.writeFieldBegin(KS_DEF_FIELD_DESC); - this.ks_def.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -32743,6 +37448,10 @@ public class Cassandra { if (ks_def == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'ks_def' was not present! Struct: " + toString()); } + // check for sub-struct validity + if (ks_def != null) { + ks_def.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -32761,6 +37470,82 @@ public class Cassandra { } } + private static class system_add_keyspace_argsStandardSchemeFactory implements SchemeFactory { + public system_add_keyspace_argsStandardScheme getScheme() { + return new system_add_keyspace_argsStandardScheme(); + } + } + + private static class system_add_keyspace_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, system_add_keyspace_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KS_DEF + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ks_def = new KsDef(); + struct.ks_def.read(iprot); + struct.setKs_defIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, system_add_keyspace_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.ks_def != null) { + oprot.writeFieldBegin(KS_DEF_FIELD_DESC); + struct.ks_def.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class system_add_keyspace_argsTupleSchemeFactory implements SchemeFactory { + public system_add_keyspace_argsTupleScheme getScheme() { + return new system_add_keyspace_argsTupleScheme(); + } + } + + private static class system_add_keyspace_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, system_add_keyspace_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.ks_def.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, system_add_keyspace_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.ks_def = new KsDef(); + struct.ks_def.read(iprot); + struct.setKs_defIsSet(true); + } + } + } public static class system_add_keyspace_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -32770,6 +37555,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField SDE_FIELD_DESC = new org.apache.thrift.protocol.TField("sde", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new system_add_keyspace_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new system_add_keyspace_resultTupleSchemeFactory()); + } + public String success; // required public InvalidRequestException ire; // required public SchemaDisagreementException sde; // required @@ -32839,7 +37630,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -33137,68 +37927,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // SDE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.sde = new SchemaDisagreementException(); - this.sde.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetSde()) { - oprot.writeFieldBegin(SDE_FIELD_DESC); - this.sde.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -33234,6 +37968,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -33252,6 +37987,140 @@ public class Cassandra { } } + private static class system_add_keyspace_resultStandardSchemeFactory implements SchemeFactory { + public system_add_keyspace_resultStandardScheme getScheme() { + return new system_add_keyspace_resultStandardScheme(); + } + } + + private static class system_add_keyspace_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, system_add_keyspace_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SDE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, system_add_keyspace_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.sde != null) { + oprot.writeFieldBegin(SDE_FIELD_DESC); + struct.sde.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class system_add_keyspace_resultTupleSchemeFactory implements SchemeFactory { + public system_add_keyspace_resultTupleScheme getScheme() { + return new system_add_keyspace_resultTupleScheme(); + } + } + + private static class system_add_keyspace_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, system_add_keyspace_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetSde()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetSde()) { + struct.sde.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, system_add_keyspace_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } + } + } + } public static class system_drop_keyspace_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -33259,6 +38128,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField KEYSPACE_FIELD_DESC = new org.apache.thrift.protocol.TField("keyspace", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new system_drop_keyspace_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new system_drop_keyspace_argsTupleSchemeFactory()); + } + public String keyspace; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -33320,7 +38195,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -33480,44 +38354,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEYSPACE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.keyspace = 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.keyspace != null) { - oprot.writeFieldBegin(KEYSPACE_FIELD_DESC); - oprot.writeString(this.keyspace); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -33541,6 +38382,7 @@ public class Cassandra { if (keyspace == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'keyspace' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -33559,6 +38401,80 @@ public class Cassandra { } } + private static class system_drop_keyspace_argsStandardSchemeFactory implements SchemeFactory { + public system_drop_keyspace_argsStandardScheme getScheme() { + return new system_drop_keyspace_argsStandardScheme(); + } + } + + private static class system_drop_keyspace_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, system_drop_keyspace_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEYSPACE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.keyspace = iprot.readString(); + struct.setKeyspaceIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, system_drop_keyspace_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.keyspace != null) { + oprot.writeFieldBegin(KEYSPACE_FIELD_DESC); + oprot.writeString(struct.keyspace); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class system_drop_keyspace_argsTupleSchemeFactory implements SchemeFactory { + public system_drop_keyspace_argsTupleScheme getScheme() { + return new system_drop_keyspace_argsTupleScheme(); + } + } + + private static class system_drop_keyspace_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, system_drop_keyspace_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.keyspace); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, system_drop_keyspace_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.keyspace = iprot.readString(); + struct.setKeyspaceIsSet(true); + } + } + } public static class system_drop_keyspace_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -33568,6 +38484,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField SDE_FIELD_DESC = new org.apache.thrift.protocol.TField("sde", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new system_drop_keyspace_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new system_drop_keyspace_resultTupleSchemeFactory()); + } + public String success; // required public InvalidRequestException ire; // required public SchemaDisagreementException sde; // required @@ -33637,7 +38559,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -33935,68 +38856,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // SDE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.sde = new SchemaDisagreementException(); - this.sde.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetSde()) { - oprot.writeFieldBegin(SDE_FIELD_DESC); - this.sde.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -34032,6 +38897,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -34050,6 +38916,140 @@ public class Cassandra { } } + private static class system_drop_keyspace_resultStandardSchemeFactory implements SchemeFactory { + public system_drop_keyspace_resultStandardScheme getScheme() { + return new system_drop_keyspace_resultStandardScheme(); + } + } + + private static class system_drop_keyspace_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, system_drop_keyspace_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SDE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, system_drop_keyspace_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.sde != null) { + oprot.writeFieldBegin(SDE_FIELD_DESC); + struct.sde.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class system_drop_keyspace_resultTupleSchemeFactory implements SchemeFactory { + public system_drop_keyspace_resultTupleScheme getScheme() { + return new system_drop_keyspace_resultTupleScheme(); + } + } + + private static class system_drop_keyspace_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, system_drop_keyspace_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetSde()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetSde()) { + struct.sde.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, system_drop_keyspace_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } + } + } + } public static class system_update_keyspace_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -34057,6 +39057,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField KS_DEF_FIELD_DESC = new org.apache.thrift.protocol.TField("ks_def", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new system_update_keyspace_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new system_update_keyspace_argsTupleSchemeFactory()); + } + public KsDef ks_def; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -34118,7 +39124,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -34278,45 +39283,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KS_DEF - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ks_def = new KsDef(); - this.ks_def.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.ks_def != null) { - oprot.writeFieldBegin(KS_DEF_FIELD_DESC); - this.ks_def.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -34340,6 +39311,10 @@ public class Cassandra { if (ks_def == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'ks_def' was not present! Struct: " + toString()); } + // check for sub-struct validity + if (ks_def != null) { + ks_def.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -34358,6 +39333,82 @@ public class Cassandra { } } + private static class system_update_keyspace_argsStandardSchemeFactory implements SchemeFactory { + public system_update_keyspace_argsStandardScheme getScheme() { + return new system_update_keyspace_argsStandardScheme(); + } + } + + private static class system_update_keyspace_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, system_update_keyspace_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KS_DEF + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ks_def = new KsDef(); + struct.ks_def.read(iprot); + struct.setKs_defIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, system_update_keyspace_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.ks_def != null) { + oprot.writeFieldBegin(KS_DEF_FIELD_DESC); + struct.ks_def.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class system_update_keyspace_argsTupleSchemeFactory implements SchemeFactory { + public system_update_keyspace_argsTupleScheme getScheme() { + return new system_update_keyspace_argsTupleScheme(); + } + } + + private static class system_update_keyspace_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, system_update_keyspace_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.ks_def.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, system_update_keyspace_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.ks_def = new KsDef(); + struct.ks_def.read(iprot); + struct.setKs_defIsSet(true); + } + } + } public static class system_update_keyspace_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -34367,6 +39418,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField SDE_FIELD_DESC = new org.apache.thrift.protocol.TField("sde", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new system_update_keyspace_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new system_update_keyspace_resultTupleSchemeFactory()); + } + public String success; // required public InvalidRequestException ire; // required public SchemaDisagreementException sde; // required @@ -34436,7 +39493,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -34734,68 +39790,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // SDE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.sde = new SchemaDisagreementException(); - this.sde.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetSde()) { - oprot.writeFieldBegin(SDE_FIELD_DESC); - this.sde.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -34831,6 +39831,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -34849,6 +39850,140 @@ public class Cassandra { } } + private static class system_update_keyspace_resultStandardSchemeFactory implements SchemeFactory { + public system_update_keyspace_resultStandardScheme getScheme() { + return new system_update_keyspace_resultStandardScheme(); + } + } + + private static class system_update_keyspace_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, system_update_keyspace_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SDE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, system_update_keyspace_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.sde != null) { + oprot.writeFieldBegin(SDE_FIELD_DESC); + struct.sde.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class system_update_keyspace_resultTupleSchemeFactory implements SchemeFactory { + public system_update_keyspace_resultTupleScheme getScheme() { + return new system_update_keyspace_resultTupleScheme(); + } + } + + private static class system_update_keyspace_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, system_update_keyspace_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetSde()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetSde()) { + struct.sde.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, system_update_keyspace_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } + } + } + } public static class system_update_column_family_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -34856,6 +39991,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField CF_DEF_FIELD_DESC = new org.apache.thrift.protocol.TField("cf_def", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new system_update_column_family_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new system_update_column_family_argsTupleSchemeFactory()); + } + public CfDef cf_def; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -34917,7 +40058,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -35077,45 +40217,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // CF_DEF - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.cf_def = new CfDef(); - this.cf_def.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.cf_def != null) { - oprot.writeFieldBegin(CF_DEF_FIELD_DESC); - this.cf_def.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -35139,6 +40245,10 @@ public class Cassandra { if (cf_def == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'cf_def' was not present! Struct: " + toString()); } + // check for sub-struct validity + if (cf_def != null) { + cf_def.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -35157,6 +40267,82 @@ public class Cassandra { } } + private static class system_update_column_family_argsStandardSchemeFactory implements SchemeFactory { + public system_update_column_family_argsStandardScheme getScheme() { + return new system_update_column_family_argsStandardScheme(); + } + } + + private static class system_update_column_family_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, system_update_column_family_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // CF_DEF + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.cf_def = new CfDef(); + struct.cf_def.read(iprot); + struct.setCf_defIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, system_update_column_family_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.cf_def != null) { + oprot.writeFieldBegin(CF_DEF_FIELD_DESC); + struct.cf_def.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class system_update_column_family_argsTupleSchemeFactory implements SchemeFactory { + public system_update_column_family_argsTupleScheme getScheme() { + return new system_update_column_family_argsTupleScheme(); + } + } + + private static class system_update_column_family_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, system_update_column_family_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.cf_def.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, system_update_column_family_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.cf_def = new CfDef(); + struct.cf_def.read(iprot); + struct.setCf_defIsSet(true); + } + } + } public static class system_update_column_family_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -35166,6 +40352,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField SDE_FIELD_DESC = new org.apache.thrift.protocol.TField("sde", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new system_update_column_family_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new system_update_column_family_resultTupleSchemeFactory()); + } + public String success; // required public InvalidRequestException ire; // required public SchemaDisagreementException sde; // required @@ -35235,7 +40427,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -35533,68 +40724,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // SDE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.sde = new SchemaDisagreementException(); - this.sde.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetSde()) { - oprot.writeFieldBegin(SDE_FIELD_DESC); - this.sde.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -35630,6 +40765,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -35648,6 +40784,140 @@ public class Cassandra { } } + private static class system_update_column_family_resultStandardSchemeFactory implements SchemeFactory { + public system_update_column_family_resultStandardScheme getScheme() { + return new system_update_column_family_resultStandardScheme(); + } + } + + private static class system_update_column_family_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, system_update_column_family_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SDE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, system_update_column_family_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.sde != null) { + oprot.writeFieldBegin(SDE_FIELD_DESC); + struct.sde.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class system_update_column_family_resultTupleSchemeFactory implements SchemeFactory { + public system_update_column_family_resultTupleScheme getScheme() { + return new system_update_column_family_resultTupleScheme(); + } + } + + private static class system_update_column_family_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, system_update_column_family_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetSde()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetSde()) { + struct.sde.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, system_update_column_family_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } + } + } + } public static class execute_cql_query_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -35656,6 +40926,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField QUERY_FIELD_DESC = new org.apache.thrift.protocol.TField("query", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField COMPRESSION_FIELD_DESC = new org.apache.thrift.protocol.TField("compression", org.apache.thrift.protocol.TType.I32, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new execute_cql_query_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new execute_cql_query_argsTupleSchemeFactory()); + } + public ByteBuffer query; // required /** * @@ -35729,7 +41005,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -35977,56 +41252,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // QUERY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.query = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COMPRESSION - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.compression = Compression.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.query != null) { - oprot.writeFieldBegin(QUERY_FIELD_DESC); - oprot.writeBinary(this.query); - oprot.writeFieldEnd(); - } - if (this.compression != null) { - oprot.writeFieldBegin(COMPRESSION_FIELD_DESC); - oprot.writeI32(this.compression.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -36061,6 +41291,7 @@ public class Cassandra { if (compression == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'compression' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -36079,6 +41310,96 @@ public class Cassandra { } } + private static class execute_cql_query_argsStandardSchemeFactory implements SchemeFactory { + public execute_cql_query_argsStandardScheme getScheme() { + return new execute_cql_query_argsStandardScheme(); + } + } + + private static class execute_cql_query_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, execute_cql_query_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // QUERY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.query = iprot.readBinary(); + struct.setQueryIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COMPRESSION + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.compression = Compression.findByValue(iprot.readI32()); + struct.setCompressionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, execute_cql_query_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.query != null) { + oprot.writeFieldBegin(QUERY_FIELD_DESC); + oprot.writeBinary(struct.query); + oprot.writeFieldEnd(); + } + if (struct.compression != null) { + oprot.writeFieldBegin(COMPRESSION_FIELD_DESC); + oprot.writeI32(struct.compression.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class execute_cql_query_argsTupleSchemeFactory implements SchemeFactory { + public execute_cql_query_argsTupleScheme getScheme() { + return new execute_cql_query_argsTupleScheme(); + } + } + + private static class execute_cql_query_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, execute_cql_query_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.query); + oprot.writeI32(struct.compression.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, execute_cql_query_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.query = iprot.readBinary(); + struct.setQueryIsSet(true); + struct.compression = Compression.findByValue(iprot.readI32()); + struct.setCompressionIsSet(true); + } + } + } public static class execute_cql_query_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -36090,6 +41411,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField SDE_FIELD_DESC = new org.apache.thrift.protocol.TField("sde", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new execute_cql_query_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new execute_cql_query_resultTupleSchemeFactory()); + } + public CqlResult success; // required public InvalidRequestException ire; // required public UnavailableException ue; // required @@ -36167,7 +41494,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -36603,93 +41929,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new CqlResult(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // SDE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.sde = new SchemaDisagreementException(); - this.sde.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetSde()) { - oprot.writeFieldBegin(SDE_FIELD_DESC); - this.sde.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -36741,6 +41986,10 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -36759,6 +42008,192 @@ public class Cassandra { } } + private static class execute_cql_query_resultStandardSchemeFactory implements SchemeFactory { + public execute_cql_query_resultStandardScheme getScheme() { + return new execute_cql_query_resultStandardScheme(); + } + } + + private static class execute_cql_query_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, execute_cql_query_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new CqlResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // SDE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, execute_cql_query_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.sde != null) { + oprot.writeFieldBegin(SDE_FIELD_DESC); + struct.sde.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class execute_cql_query_resultTupleSchemeFactory implements SchemeFactory { + public execute_cql_query_resultTupleScheme getScheme() { + return new execute_cql_query_resultTupleScheme(); + } + } + + private static class execute_cql_query_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, execute_cql_query_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetUe()) { + optionals.set(2); + } + if (struct.isSetTe()) { + optionals.set(3); + } + if (struct.isSetSde()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + if (struct.isSetSde()) { + struct.sde.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, execute_cql_query_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.success = new CqlResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(3)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + if (incoming.get(4)) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } + } + } + } public static class execute_cql3_query_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -36768,6 +42203,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField COMPRESSION_FIELD_DESC = new org.apache.thrift.protocol.TField("compression", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField CONSISTENCY_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency", org.apache.thrift.protocol.TType.I32, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new execute_cql3_query_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new execute_cql3_query_argsTupleSchemeFactory()); + } + public ByteBuffer query; // required /** * @@ -36853,7 +42294,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -37178,68 +42618,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // QUERY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.query = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COMPRESSION - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.compression = Compression.findByValue(iprot.readI32()); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // CONSISTENCY - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency = ConsistencyLevel.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.query != null) { - oprot.writeFieldBegin(QUERY_FIELD_DESC); - oprot.writeBinary(this.query); - oprot.writeFieldEnd(); - } - if (this.compression != null) { - oprot.writeFieldBegin(COMPRESSION_FIELD_DESC); - oprot.writeI32(this.compression.getValue()); - oprot.writeFieldEnd(); - } - if (this.consistency != null) { - oprot.writeFieldBegin(CONSISTENCY_FIELD_DESC); - oprot.writeI32(this.consistency.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -37285,6 +42668,7 @@ public class Cassandra { if (consistency == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -37303,6 +42687,112 @@ public class Cassandra { } } + private static class execute_cql3_query_argsStandardSchemeFactory implements SchemeFactory { + public execute_cql3_query_argsStandardScheme getScheme() { + return new execute_cql3_query_argsStandardScheme(); + } + } + + private static class execute_cql3_query_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, execute_cql3_query_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // QUERY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.query = iprot.readBinary(); + struct.setQueryIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COMPRESSION + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.compression = Compression.findByValue(iprot.readI32()); + struct.setCompressionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // CONSISTENCY + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.consistency = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistencyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, execute_cql3_query_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.query != null) { + oprot.writeFieldBegin(QUERY_FIELD_DESC); + oprot.writeBinary(struct.query); + oprot.writeFieldEnd(); + } + if (struct.compression != null) { + oprot.writeFieldBegin(COMPRESSION_FIELD_DESC); + oprot.writeI32(struct.compression.getValue()); + oprot.writeFieldEnd(); + } + if (struct.consistency != null) { + oprot.writeFieldBegin(CONSISTENCY_FIELD_DESC); + oprot.writeI32(struct.consistency.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class execute_cql3_query_argsTupleSchemeFactory implements SchemeFactory { + public execute_cql3_query_argsTupleScheme getScheme() { + return new execute_cql3_query_argsTupleScheme(); + } + } + + private static class execute_cql3_query_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, execute_cql3_query_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.query); + oprot.writeI32(struct.compression.getValue()); + oprot.writeI32(struct.consistency.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, execute_cql3_query_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.query = iprot.readBinary(); + struct.setQueryIsSet(true); + struct.compression = Compression.findByValue(iprot.readI32()); + struct.setCompressionIsSet(true); + struct.consistency = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistencyIsSet(true); + } + } + } public static class execute_cql3_query_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -37314,6 +42804,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField SDE_FIELD_DESC = new org.apache.thrift.protocol.TField("sde", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new execute_cql3_query_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new execute_cql3_query_resultTupleSchemeFactory()); + } + public CqlResult success; // required public InvalidRequestException ire; // required public UnavailableException ue; // required @@ -37391,7 +42887,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -37827,93 +43322,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new CqlResult(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // SDE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.sde = new SchemaDisagreementException(); - this.sde.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetSde()) { - oprot.writeFieldBegin(SDE_FIELD_DESC); - this.sde.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -37965,6 +43379,10 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -37983,6 +43401,192 @@ public class Cassandra { } } + private static class execute_cql3_query_resultStandardSchemeFactory implements SchemeFactory { + public execute_cql3_query_resultStandardScheme getScheme() { + return new execute_cql3_query_resultStandardScheme(); + } + } + + private static class execute_cql3_query_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, execute_cql3_query_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new CqlResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // SDE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, execute_cql3_query_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.sde != null) { + oprot.writeFieldBegin(SDE_FIELD_DESC); + struct.sde.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class execute_cql3_query_resultTupleSchemeFactory implements SchemeFactory { + public execute_cql3_query_resultTupleScheme getScheme() { + return new execute_cql3_query_resultTupleScheme(); + } + } + + private static class execute_cql3_query_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, execute_cql3_query_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetUe()) { + optionals.set(2); + } + if (struct.isSetTe()) { + optionals.set(3); + } + if (struct.isSetSde()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + if (struct.isSetSde()) { + struct.sde.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, execute_cql3_query_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.success = new CqlResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(3)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + if (incoming.get(4)) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } + } + } + } public static class prepare_cql_query_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -37991,6 +43595,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField QUERY_FIELD_DESC = new org.apache.thrift.protocol.TField("query", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField COMPRESSION_FIELD_DESC = new org.apache.thrift.protocol.TField("compression", org.apache.thrift.protocol.TType.I32, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new prepare_cql_query_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new prepare_cql_query_argsTupleSchemeFactory()); + } + public ByteBuffer query; // required /** * @@ -38064,7 +43674,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -38312,56 +43921,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // QUERY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.query = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COMPRESSION - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.compression = Compression.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.query != null) { - oprot.writeFieldBegin(QUERY_FIELD_DESC); - oprot.writeBinary(this.query); - oprot.writeFieldEnd(); - } - if (this.compression != null) { - oprot.writeFieldBegin(COMPRESSION_FIELD_DESC); - oprot.writeI32(this.compression.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -38396,6 +43960,7 @@ public class Cassandra { if (compression == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'compression' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -38414,6 +43979,96 @@ public class Cassandra { } } + private static class prepare_cql_query_argsStandardSchemeFactory implements SchemeFactory { + public prepare_cql_query_argsStandardScheme getScheme() { + return new prepare_cql_query_argsStandardScheme(); + } + } + + private static class prepare_cql_query_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, prepare_cql_query_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // QUERY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.query = iprot.readBinary(); + struct.setQueryIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COMPRESSION + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.compression = Compression.findByValue(iprot.readI32()); + struct.setCompressionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, prepare_cql_query_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.query != null) { + oprot.writeFieldBegin(QUERY_FIELD_DESC); + oprot.writeBinary(struct.query); + oprot.writeFieldEnd(); + } + if (struct.compression != null) { + oprot.writeFieldBegin(COMPRESSION_FIELD_DESC); + oprot.writeI32(struct.compression.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class prepare_cql_query_argsTupleSchemeFactory implements SchemeFactory { + public prepare_cql_query_argsTupleScheme getScheme() { + return new prepare_cql_query_argsTupleScheme(); + } + } + + private static class prepare_cql_query_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, prepare_cql_query_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.query); + oprot.writeI32(struct.compression.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, prepare_cql_query_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.query = iprot.readBinary(); + struct.setQueryIsSet(true); + struct.compression = Compression.findByValue(iprot.readI32()); + struct.setCompressionIsSet(true); + } + } + } public static class prepare_cql_query_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -38422,6 +44077,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new prepare_cql_query_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new prepare_cql_query_resultTupleSchemeFactory()); + } + public CqlPreparedResult success; // required public InvalidRequestException ire; // required @@ -38487,7 +44148,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -38716,57 +44376,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new CqlPreparedResult(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -38794,6 +44409,10 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -38812,6 +44431,117 @@ public class Cassandra { } } + private static class prepare_cql_query_resultStandardSchemeFactory implements SchemeFactory { + public prepare_cql_query_resultStandardScheme getScheme() { + return new prepare_cql_query_resultStandardScheme(); + } + } + + private static class prepare_cql_query_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, prepare_cql_query_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new CqlPreparedResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, prepare_cql_query_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class prepare_cql_query_resultTupleSchemeFactory implements SchemeFactory { + public prepare_cql_query_resultTupleScheme getScheme() { + return new prepare_cql_query_resultTupleScheme(); + } + } + + private static class prepare_cql_query_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, prepare_cql_query_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, prepare_cql_query_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new CqlPreparedResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + } + } + } public static class prepare_cql3_query_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -38820,6 +44550,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField QUERY_FIELD_DESC = new org.apache.thrift.protocol.TField("query", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField COMPRESSION_FIELD_DESC = new org.apache.thrift.protocol.TField("compression", org.apache.thrift.protocol.TType.I32, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new prepare_cql3_query_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new prepare_cql3_query_argsTupleSchemeFactory()); + } + public ByteBuffer query; // required /** * @@ -38893,7 +44629,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -39141,56 +44876,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // QUERY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.query = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COMPRESSION - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.compression = Compression.findByValue(iprot.readI32()); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.query != null) { - oprot.writeFieldBegin(QUERY_FIELD_DESC); - oprot.writeBinary(this.query); - oprot.writeFieldEnd(); - } - if (this.compression != null) { - oprot.writeFieldBegin(COMPRESSION_FIELD_DESC); - oprot.writeI32(this.compression.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -39225,6 +44915,7 @@ public class Cassandra { if (compression == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'compression' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -39243,6 +44934,96 @@ public class Cassandra { } } + private static class prepare_cql3_query_argsStandardSchemeFactory implements SchemeFactory { + public prepare_cql3_query_argsStandardScheme getScheme() { + return new prepare_cql3_query_argsStandardScheme(); + } + } + + private static class prepare_cql3_query_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, prepare_cql3_query_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // QUERY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.query = iprot.readBinary(); + struct.setQueryIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COMPRESSION + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.compression = Compression.findByValue(iprot.readI32()); + struct.setCompressionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, prepare_cql3_query_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.query != null) { + oprot.writeFieldBegin(QUERY_FIELD_DESC); + oprot.writeBinary(struct.query); + oprot.writeFieldEnd(); + } + if (struct.compression != null) { + oprot.writeFieldBegin(COMPRESSION_FIELD_DESC); + oprot.writeI32(struct.compression.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class prepare_cql3_query_argsTupleSchemeFactory implements SchemeFactory { + public prepare_cql3_query_argsTupleScheme getScheme() { + return new prepare_cql3_query_argsTupleScheme(); + } + } + + private static class prepare_cql3_query_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, prepare_cql3_query_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.query); + oprot.writeI32(struct.compression.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, prepare_cql3_query_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.query = iprot.readBinary(); + struct.setQueryIsSet(true); + struct.compression = Compression.findByValue(iprot.readI32()); + struct.setCompressionIsSet(true); + } + } + } public static class prepare_cql3_query_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -39251,6 +45032,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new prepare_cql3_query_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new prepare_cql3_query_resultTupleSchemeFactory()); + } + public CqlPreparedResult success; // required public InvalidRequestException ire; // required @@ -39316,7 +45103,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -39545,57 +45331,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new CqlPreparedResult(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -39623,6 +45364,10 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -39641,6 +45386,117 @@ public class Cassandra { } } + private static class prepare_cql3_query_resultStandardSchemeFactory implements SchemeFactory { + public prepare_cql3_query_resultStandardScheme getScheme() { + return new prepare_cql3_query_resultStandardScheme(); + } + } + + private static class prepare_cql3_query_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, prepare_cql3_query_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new CqlPreparedResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, prepare_cql3_query_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class prepare_cql3_query_resultTupleSchemeFactory implements SchemeFactory { + public prepare_cql3_query_resultTupleScheme getScheme() { + return new prepare_cql3_query_resultTupleScheme(); + } + } + + private static class prepare_cql3_query_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, prepare_cql3_query_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, prepare_cql3_query_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new CqlPreparedResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + } + } + } public static class execute_prepared_cql_query_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -39649,6 +45505,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new execute_prepared_cql_query_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new execute_prepared_cql_query_argsTupleSchemeFactory()); + } + public int itemId; // required public List values; // required @@ -39715,8 +45577,7 @@ public class Cassandra { // isset id assignments private static final int __ITEMID_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -39746,8 +45607,7 @@ public class Cassandra { * Performs a deep copy on other. */ public execute_prepared_cql_query_args(execute_prepared_cql_query_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.itemId = other.itemId; if (other.isSetValues()) { List __this__values = new ArrayList(); @@ -39782,16 +45642,16 @@ public class Cassandra { } public void unsetItemId() { - __isset_bit_vector.clear(__ITEMID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ITEMID_ISSET_ID); } /** Returns true if field itemId is set (has been assigned a value) and false otherwise */ public boolean isSetItemId() { - return __isset_bit_vector.get(__ITEMID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __ITEMID_ISSET_ID); } public void setItemIdIsSet(boolean value) { - __isset_bit_vector.set(__ITEMID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ITEMID_ISSET_ID, value); } public int getValuesSize() { @@ -39968,75 +45828,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // ITEM_ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.itemId = iprot.readI32(); - setItemIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // VALUES - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list191 = iprot.readListBegin(); - this.values = new ArrayList(_list191.size); - for (int _i192 = 0; _i192 < _list191.size; ++_i192) - { - ByteBuffer _elem193; // required - _elem193 = iprot.readBinary(); - this.values.add(_elem193); - } - iprot.readListEnd(); - } - } 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 (!isSetItemId()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'itemId' was not found in serialized data! Struct: " + toString()); - } - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ITEM_ID_FIELD_DESC); - oprot.writeI32(this.itemId); - oprot.writeFieldEnd(); - if (this.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.values.size())); - for (ByteBuffer _iter194 : this.values) - { - oprot.writeBinary(_iter194); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -40065,6 +45861,7 @@ public class Cassandra { if (values == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -40077,12 +45874,137 @@ public class Cassandra { 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_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class execute_prepared_cql_query_argsStandardSchemeFactory implements SchemeFactory { + public execute_prepared_cql_query_argsStandardScheme getScheme() { + return new execute_prepared_cql_query_argsStandardScheme(); + } + } + + private static class execute_prepared_cql_query_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, execute_prepared_cql_query_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // ITEM_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.itemId = iprot.readI32(); + struct.setItemIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list382 = iprot.readListBegin(); + struct.values = new ArrayList(_list382.size); + for (int _i383 = 0; _i383 < _list382.size; ++_i383) + { + ByteBuffer _elem384; // required + _elem384 = iprot.readBinary(); + struct.values.add(_elem384); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetItemId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'itemId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, execute_prepared_cql_query_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ITEM_ID_FIELD_DESC); + oprot.writeI32(struct.itemId); + oprot.writeFieldEnd(); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); + for (ByteBuffer _iter385 : struct.values) + { + oprot.writeBinary(_iter385); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class execute_prepared_cql_query_argsTupleSchemeFactory implements SchemeFactory { + public execute_prepared_cql_query_argsTupleScheme getScheme() { + return new execute_prepared_cql_query_argsTupleScheme(); + } + } + + private static class execute_prepared_cql_query_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, execute_prepared_cql_query_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.itemId); + { + oprot.writeI32(struct.values.size()); + for (ByteBuffer _iter386 : struct.values) + { + oprot.writeBinary(_iter386); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, execute_prepared_cql_query_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.itemId = iprot.readI32(); + struct.setItemIdIsSet(true); + { + org.apache.thrift.protocol.TList _list387 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.values = new ArrayList(_list387.size); + for (int _i388 = 0; _i388 < _list387.size; ++_i388) + { + ByteBuffer _elem389; // required + _elem389 = iprot.readBinary(); + struct.values.add(_elem389); + } + } + struct.setValuesIsSet(true); + } + } + } public static class execute_prepared_cql_query_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -40094,6 +46016,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField SDE_FIELD_DESC = new org.apache.thrift.protocol.TField("sde", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new execute_prepared_cql_query_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new execute_prepared_cql_query_resultTupleSchemeFactory()); + } + public CqlResult success; // required public InvalidRequestException ire; // required public UnavailableException ue; // required @@ -40171,7 +46099,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -40607,93 +46534,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new CqlResult(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // SDE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.sde = new SchemaDisagreementException(); - this.sde.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetSde()) { - oprot.writeFieldBegin(SDE_FIELD_DESC); - this.sde.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -40745,6 +46591,10 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -40763,6 +46613,192 @@ public class Cassandra { } } + private static class execute_prepared_cql_query_resultStandardSchemeFactory implements SchemeFactory { + public execute_prepared_cql_query_resultStandardScheme getScheme() { + return new execute_prepared_cql_query_resultStandardScheme(); + } + } + + private static class execute_prepared_cql_query_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, execute_prepared_cql_query_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new CqlResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // SDE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, execute_prepared_cql_query_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.sde != null) { + oprot.writeFieldBegin(SDE_FIELD_DESC); + struct.sde.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class execute_prepared_cql_query_resultTupleSchemeFactory implements SchemeFactory { + public execute_prepared_cql_query_resultTupleScheme getScheme() { + return new execute_prepared_cql_query_resultTupleScheme(); + } + } + + private static class execute_prepared_cql_query_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, execute_prepared_cql_query_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetUe()) { + optionals.set(2); + } + if (struct.isSetTe()) { + optionals.set(3); + } + if (struct.isSetSde()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + if (struct.isSetSde()) { + struct.sde.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, execute_prepared_cql_query_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.success = new CqlResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(3)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + if (incoming.get(4)) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } + } + } + } public static class execute_prepared_cql3_query_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -40772,6 +46808,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)2); private static final org.apache.thrift.protocol.TField CONSISTENCY_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency", org.apache.thrift.protocol.TType.I32, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new execute_prepared_cql3_query_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new execute_prepared_cql3_query_argsTupleSchemeFactory()); + } + public int itemId; // required public List values; // required /** @@ -40850,8 +46892,7 @@ public class Cassandra { // isset id assignments private static final int __ITEMID_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -40885,8 +46926,7 @@ public class Cassandra { * Performs a deep copy on other. */ public execute_prepared_cql3_query_args(execute_prepared_cql3_query_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.itemId = other.itemId; if (other.isSetValues()) { List __this__values = new ArrayList(); @@ -40925,16 +46965,16 @@ public class Cassandra { } public void unsetItemId() { - __isset_bit_vector.clear(__ITEMID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ITEMID_ISSET_ID); } /** Returns true if field itemId is set (has been assigned a value) and false otherwise */ public boolean isSetItemId() { - return __isset_bit_vector.get(__ITEMID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __ITEMID_ISSET_ID); } public void setItemIdIsSet(boolean value) { - __isset_bit_vector.set(__ITEMID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ITEMID_ISSET_ID, value); } public int getValuesSize() { @@ -41180,87 +47220,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // ITEM_ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.itemId = iprot.readI32(); - setItemIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // VALUES - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list195 = iprot.readListBegin(); - this.values = new ArrayList(_list195.size); - for (int _i196 = 0; _i196 < _list195.size; ++_i196) - { - ByteBuffer _elem197; // required - _elem197 = iprot.readBinary(); - this.values.add(_elem197); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // CONSISTENCY - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency = ConsistencyLevel.findByValue(iprot.readI32()); - } 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 (!isSetItemId()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'itemId' was not found in serialized data! Struct: " + toString()); - } - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ITEM_ID_FIELD_DESC); - oprot.writeI32(this.itemId); - oprot.writeFieldEnd(); - if (this.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.values.size())); - for (ByteBuffer _iter198 : this.values) - { - oprot.writeBinary(_iter198); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (this.consistency != null) { - oprot.writeFieldBegin(CONSISTENCY_FIELD_DESC); - oprot.writeI32(this.consistency.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -41300,6 +47264,7 @@ public class Cassandra { if (consistency == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -41313,13 +47278,152 @@ public class Cassandra { 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); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class execute_prepared_cql3_query_argsStandardSchemeFactory implements SchemeFactory { + public execute_prepared_cql3_query_argsStandardScheme getScheme() { + return new execute_prepared_cql3_query_argsStandardScheme(); + } + } + + private static class execute_prepared_cql3_query_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, execute_prepared_cql3_query_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // ITEM_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.itemId = iprot.readI32(); + struct.setItemIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list390 = iprot.readListBegin(); + struct.values = new ArrayList(_list390.size); + for (int _i391 = 0; _i391 < _list390.size; ++_i391) + { + ByteBuffer _elem392; // required + _elem392 = iprot.readBinary(); + struct.values.add(_elem392); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // CONSISTENCY + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.consistency = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistencyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetItemId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'itemId' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, execute_prepared_cql3_query_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ITEM_ID_FIELD_DESC); + oprot.writeI32(struct.itemId); + oprot.writeFieldEnd(); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); + for (ByteBuffer _iter393 : struct.values) + { + oprot.writeBinary(_iter393); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.consistency != null) { + oprot.writeFieldBegin(CONSISTENCY_FIELD_DESC); + oprot.writeI32(struct.consistency.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class execute_prepared_cql3_query_argsTupleSchemeFactory implements SchemeFactory { + public execute_prepared_cql3_query_argsTupleScheme getScheme() { + return new execute_prepared_cql3_query_argsTupleScheme(); + } + } + + private static class execute_prepared_cql3_query_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, execute_prepared_cql3_query_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.itemId); + { + oprot.writeI32(struct.values.size()); + for (ByteBuffer _iter394 : struct.values) + { + oprot.writeBinary(_iter394); + } + } + oprot.writeI32(struct.consistency.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, execute_prepared_cql3_query_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.itemId = iprot.readI32(); + struct.setItemIdIsSet(true); + { + org.apache.thrift.protocol.TList _list395 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.values = new ArrayList(_list395.size); + for (int _i396 = 0; _i396 < _list395.size; ++_i396) + { + ByteBuffer _elem397; // required + _elem397 = iprot.readBinary(); + struct.values.add(_elem397); + } + } + struct.setValuesIsSet(true); + struct.consistency = ConsistencyLevel.findByValue(iprot.readI32()); + struct.setConsistencyIsSet(true); + } + } + } public static class execute_prepared_cql3_query_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -41331,6 +47435,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField SDE_FIELD_DESC = new org.apache.thrift.protocol.TField("sde", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new execute_prepared_cql3_query_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new execute_prepared_cql3_query_resultTupleSchemeFactory()); + } + public CqlResult success; // required public InvalidRequestException ire; // required public UnavailableException ue; // required @@ -41408,7 +47518,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -41844,93 +47953,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new CqlResult(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // SDE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.sde = new SchemaDisagreementException(); - this.sde.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetSde()) { - oprot.writeFieldBegin(SDE_FIELD_DESC); - this.sde.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -41982,6 +48010,10 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -42000,6 +48032,192 @@ public class Cassandra { } } + private static class execute_prepared_cql3_query_resultStandardSchemeFactory implements SchemeFactory { + public execute_prepared_cql3_query_resultStandardScheme getScheme() { + return new execute_prepared_cql3_query_resultStandardScheme(); + } + } + + private static class execute_prepared_cql3_query_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, execute_prepared_cql3_query_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new CqlResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // UE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // SDE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, execute_prepared_cql3_query_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ue != null) { + oprot.writeFieldBegin(UE_FIELD_DESC); + struct.ue.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.te != null) { + oprot.writeFieldBegin(TE_FIELD_DESC); + struct.te.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.sde != null) { + oprot.writeFieldBegin(SDE_FIELD_DESC); + struct.sde.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class execute_prepared_cql3_query_resultTupleSchemeFactory implements SchemeFactory { + public execute_prepared_cql3_query_resultTupleScheme getScheme() { + return new execute_prepared_cql3_query_resultTupleScheme(); + } + } + + private static class execute_prepared_cql3_query_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, execute_prepared_cql3_query_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetIre()) { + optionals.set(1); + } + if (struct.isSetUe()) { + optionals.set(2); + } + if (struct.isSetTe()) { + optionals.set(3); + } + if (struct.isSetSde()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + if (struct.isSetUe()) { + struct.ue.write(oprot); + } + if (struct.isSetTe()) { + struct.te.write(oprot); + } + if (struct.isSetSde()) { + struct.sde.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, execute_prepared_cql3_query_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.success = new CqlResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + if (incoming.get(2)) { + struct.ue = new UnavailableException(); + struct.ue.read(iprot); + struct.setUeIsSet(true); + } + if (incoming.get(3)) { + struct.te = new TimedOutException(); + struct.te.read(iprot); + struct.setTeIsSet(true); + } + if (incoming.get(4)) { + struct.sde = new SchemaDisagreementException(); + struct.sde.read(iprot); + struct.setSdeIsSet(true); + } + } + } + } public static class set_cql_version_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -42007,6 +48225,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new set_cql_version_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new set_cql_version_argsTupleSchemeFactory()); + } + public String version; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -42068,7 +48292,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -42228,44 +48451,11 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // VERSION - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.version = 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.version != null) { - oprot.writeFieldBegin(VERSION_FIELD_DESC); - oprot.writeString(this.version); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -42289,6 +48479,7 @@ public class Cassandra { if (version == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'version' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -42307,6 +48498,80 @@ public class Cassandra { } } + private static class set_cql_version_argsStandardSchemeFactory implements SchemeFactory { + public set_cql_version_argsStandardScheme getScheme() { + return new set_cql_version_argsStandardScheme(); + } + } + + private static class set_cql_version_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, set_cql_version_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, set_cql_version_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.version != null) { + oprot.writeFieldBegin(VERSION_FIELD_DESC); + oprot.writeString(struct.version); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class set_cql_version_argsTupleSchemeFactory implements SchemeFactory { + public set_cql_version_argsTupleScheme getScheme() { + return new set_cql_version_argsTupleScheme(); + } + } + + private static class set_cql_version_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, set_cql_version_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.version); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, set_cql_version_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } + } + } public static class set_cql_version_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -42314,6 +48579,12 @@ public class Cassandra { private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new set_cql_version_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new set_cql_version_resultTupleSchemeFactory()); + } + public InvalidRequestException ire; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -42375,7 +48646,6 @@ public class Cassandra { } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -42535,45 +48805,12 @@ public class Cassandra { } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -42593,6 +48830,7 @@ public class Cassandra { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -42611,6 +48849,92 @@ public class Cassandra { } } + private static class set_cql_version_resultStandardSchemeFactory implements SchemeFactory { + public set_cql_version_resultStandardScheme getScheme() { + return new set_cql_version_resultStandardScheme(); + } + } + + private static class set_cql_version_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, set_cql_version_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // IRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, set_cql_version_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.ire != null) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + struct.ire.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class set_cql_version_resultTupleSchemeFactory implements SchemeFactory { + public set_cql_version_resultTupleScheme getScheme() { + return new set_cql_version_resultTupleScheme(); + } + } + + private static class set_cql_version_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, set_cql_version_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetIre()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetIre()) { + struct.ire.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, set_cql_version_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.ire = new InvalidRequestException(); + struct.ire.read(iprot); + struct.setIreIsSet(true); + } + } + } + } } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java index e2c32cc3a0..602e9df154 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -81,71 +91,77 @@ public class CfDef implements org.apache.thrift.TBase, jav private static final org.apache.thrift.protocol.TField ROW_CACHE_PROVIDER_FIELD_DESC = new org.apache.thrift.protocol.TField("row_cache_provider", org.apache.thrift.protocol.TType.STRING, (short)27); private static final org.apache.thrift.protocol.TField ROW_CACHE_KEYS_TO_SAVE_FIELD_DESC = new org.apache.thrift.protocol.TField("row_cache_keys_to_save", org.apache.thrift.protocol.TType.I32, (short)31); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CfDefStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CfDefTupleSchemeFactory()); + } + public String keyspace; // required public String name; // required - public String column_type; // required - public String comparator_type; // required - public String subcomparator_type; // required - public String comment; // required - public double read_repair_chance; // required - public List column_metadata; // required - public int gc_grace_seconds; // required - public String default_validation_class; // required - public int id; // required - public int min_compaction_threshold; // required - public int max_compaction_threshold; // required - public boolean replicate_on_write; // required - public String key_validation_class; // required - public ByteBuffer key_alias; // required - public String compaction_strategy; // required - public Map compaction_strategy_options; // required - public Map compression_options; // required - public double bloom_filter_fp_chance; // required - public String caching; // required - public double dclocal_read_repair_chance; // required - public int memtable_flush_period_in_ms; // required - public int default_time_to_live; // required - public int index_interval; // required + public String column_type; // optional + public String comparator_type; // optional + public String subcomparator_type; // optional + public String comment; // optional + public double read_repair_chance; // optional + public List column_metadata; // optional + public int gc_grace_seconds; // optional + public String default_validation_class; // optional + public int id; // optional + public int min_compaction_threshold; // optional + public int max_compaction_threshold; // optional + public boolean replicate_on_write; // optional + public String key_validation_class; // optional + public ByteBuffer key_alias; // optional + public String compaction_strategy; // optional + public Map compaction_strategy_options; // optional + public Map compression_options; // optional + public double bloom_filter_fp_chance; // optional + public String caching; // optional + public double dclocal_read_repair_chance; // optional + public int memtable_flush_period_in_ms; // optional + public int default_time_to_live; // optional + public int index_interval; // optional /** * @deprecated */ - public double row_cache_size; // required + public double row_cache_size; // optional /** * @deprecated */ - public double key_cache_size; // required + public double key_cache_size; // optional /** * @deprecated */ - public int row_cache_save_period_in_seconds; // required + public int row_cache_save_period_in_seconds; // optional /** * @deprecated */ - public int key_cache_save_period_in_seconds; // required + public int key_cache_save_period_in_seconds; // optional /** * @deprecated */ - public int memtable_flush_after_mins; // required + public int memtable_flush_after_mins; // optional /** * @deprecated */ - public int memtable_throughput_in_mb; // required + public int memtable_throughput_in_mb; // optional /** * @deprecated */ - public double memtable_operations_in_millions; // required + public double memtable_operations_in_millions; // optional /** * @deprecated */ - public double merge_shards_chance; // required + public double merge_shards_chance; // optional /** * @deprecated */ - public String row_cache_provider; // required + public String row_cache_provider; // optional /** * @deprecated */ - public int row_cache_keys_to_save; // required + public int row_cache_keys_to_save; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -358,8 +374,8 @@ public class CfDef implements org.apache.thrift.TBase, jav private static final int __MEMTABLE_OPERATIONS_IN_MILLIONS_ISSET_ID = 17; private static final int __MERGE_SHARDS_CHANCE_ISSET_ID = 18; private static final int __ROW_CACHE_KEYS_TO_SAVE_ISSET_ID = 19; - private BitSet __isset_bit_vector = new BitSet(20); - + private int __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.COLUMN_TYPE,_Fields.COMPARATOR_TYPE,_Fields.SUBCOMPARATOR_TYPE,_Fields.COMMENT,_Fields.READ_REPAIR_CHANCE,_Fields.COLUMN_METADATA,_Fields.GC_GRACE_SECONDS,_Fields.DEFAULT_VALIDATION_CLASS,_Fields.ID,_Fields.MIN_COMPACTION_THRESHOLD,_Fields.MAX_COMPACTION_THRESHOLD,_Fields.REPLICATE_ON_WRITE,_Fields.KEY_VALIDATION_CLASS,_Fields.KEY_ALIAS,_Fields.COMPACTION_STRATEGY,_Fields.COMPACTION_STRATEGY_OPTIONS,_Fields.COMPRESSION_OPTIONS,_Fields.BLOOM_FILTER_FP_CHANCE,_Fields.CACHING,_Fields.DCLOCAL_READ_REPAIR_CHANCE,_Fields.MEMTABLE_FLUSH_PERIOD_IN_MS,_Fields.DEFAULT_TIME_TO_LIVE,_Fields.INDEX_INTERVAL,_Fields.ROW_CACHE_SIZE,_Fields.KEY_CACHE_SIZE,_Fields.ROW_CACHE_SAVE_PERIOD_IN_SECONDS,_Fields.KEY_CACHE_SAVE_PERIOD_IN_SECONDS,_Fields.MEMTABLE_FLUSH_AFTER_MINS,_Fields.MEMTABLE_THROUGHPUT_IN_MB,_Fields.MEMTABLE_OPERATIONS_IN_MILLIONS,_Fields.MERGE_SHARDS_CHANCE,_Fields.ROW_CACHE_PROVIDER,_Fields.ROW_CACHE_KEYS_TO_SAVE}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -466,8 +482,7 @@ public class CfDef implements org.apache.thrift.TBase, jav * Performs a deep copy on other. */ public CfDef(CfDef other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetKeyspace()) { this.keyspace = other.keyspace; } @@ -785,16 +800,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetRead_repair_chance() { - __isset_bit_vector.clear(__READ_REPAIR_CHANCE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __READ_REPAIR_CHANCE_ISSET_ID); } /** Returns true if field read_repair_chance is set (has been assigned a value) and false otherwise */ public boolean isSetRead_repair_chance() { - return __isset_bit_vector.get(__READ_REPAIR_CHANCE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __READ_REPAIR_CHANCE_ISSET_ID); } public void setRead_repair_chanceIsSet(boolean value) { - __isset_bit_vector.set(__READ_REPAIR_CHANCE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __READ_REPAIR_CHANCE_ISSET_ID, value); } public int getColumn_metadataSize() { @@ -847,16 +862,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetGc_grace_seconds() { - __isset_bit_vector.clear(__GC_GRACE_SECONDS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __GC_GRACE_SECONDS_ISSET_ID); } /** Returns true if field gc_grace_seconds is set (has been assigned a value) and false otherwise */ public boolean isSetGc_grace_seconds() { - return __isset_bit_vector.get(__GC_GRACE_SECONDS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __GC_GRACE_SECONDS_ISSET_ID); } public void setGc_grace_secondsIsSet(boolean value) { - __isset_bit_vector.set(__GC_GRACE_SECONDS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __GC_GRACE_SECONDS_ISSET_ID, value); } public String getDefault_validation_class() { @@ -894,16 +909,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetId() { - __isset_bit_vector.clear(__ID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); } /** Returns true if field id is set (has been assigned a value) and false otherwise */ public boolean isSetId() { - return __isset_bit_vector.get(__ID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); } public void setIdIsSet(boolean value) { - __isset_bit_vector.set(__ID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); } public int getMin_compaction_threshold() { @@ -917,16 +932,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetMin_compaction_threshold() { - __isset_bit_vector.clear(__MIN_COMPACTION_THRESHOLD_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MIN_COMPACTION_THRESHOLD_ISSET_ID); } /** Returns true if field min_compaction_threshold is set (has been assigned a value) and false otherwise */ public boolean isSetMin_compaction_threshold() { - return __isset_bit_vector.get(__MIN_COMPACTION_THRESHOLD_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __MIN_COMPACTION_THRESHOLD_ISSET_ID); } public void setMin_compaction_thresholdIsSet(boolean value) { - __isset_bit_vector.set(__MIN_COMPACTION_THRESHOLD_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MIN_COMPACTION_THRESHOLD_ISSET_ID, value); } public int getMax_compaction_threshold() { @@ -940,16 +955,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetMax_compaction_threshold() { - __isset_bit_vector.clear(__MAX_COMPACTION_THRESHOLD_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAX_COMPACTION_THRESHOLD_ISSET_ID); } /** Returns true if field max_compaction_threshold is set (has been assigned a value) and false otherwise */ public boolean isSetMax_compaction_threshold() { - return __isset_bit_vector.get(__MAX_COMPACTION_THRESHOLD_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __MAX_COMPACTION_THRESHOLD_ISSET_ID); } public void setMax_compaction_thresholdIsSet(boolean value) { - __isset_bit_vector.set(__MAX_COMPACTION_THRESHOLD_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAX_COMPACTION_THRESHOLD_ISSET_ID, value); } public boolean isReplicate_on_write() { @@ -963,16 +978,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetReplicate_on_write() { - __isset_bit_vector.clear(__REPLICATE_ON_WRITE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REPLICATE_ON_WRITE_ISSET_ID); } /** Returns true if field replicate_on_write is set (has been assigned a value) and false otherwise */ public boolean isSetReplicate_on_write() { - return __isset_bit_vector.get(__REPLICATE_ON_WRITE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __REPLICATE_ON_WRITE_ISSET_ID); } public void setReplicate_on_writeIsSet(boolean value) { - __isset_bit_vector.set(__REPLICATE_ON_WRITE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REPLICATE_ON_WRITE_ISSET_ID, value); } public String getKey_validation_class() { @@ -1138,16 +1153,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetBloom_filter_fp_chance() { - __isset_bit_vector.clear(__BLOOM_FILTER_FP_CHANCE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOOM_FILTER_FP_CHANCE_ISSET_ID); } /** Returns true if field bloom_filter_fp_chance is set (has been assigned a value) and false otherwise */ public boolean isSetBloom_filter_fp_chance() { - return __isset_bit_vector.get(__BLOOM_FILTER_FP_CHANCE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __BLOOM_FILTER_FP_CHANCE_ISSET_ID); } public void setBloom_filter_fp_chanceIsSet(boolean value) { - __isset_bit_vector.set(__BLOOM_FILTER_FP_CHANCE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOOM_FILTER_FP_CHANCE_ISSET_ID, value); } public String getCaching() { @@ -1185,16 +1200,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetDclocal_read_repair_chance() { - __isset_bit_vector.clear(__DCLOCAL_READ_REPAIR_CHANCE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DCLOCAL_READ_REPAIR_CHANCE_ISSET_ID); } /** Returns true if field dclocal_read_repair_chance is set (has been assigned a value) and false otherwise */ public boolean isSetDclocal_read_repair_chance() { - return __isset_bit_vector.get(__DCLOCAL_READ_REPAIR_CHANCE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __DCLOCAL_READ_REPAIR_CHANCE_ISSET_ID); } public void setDclocal_read_repair_chanceIsSet(boolean value) { - __isset_bit_vector.set(__DCLOCAL_READ_REPAIR_CHANCE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DCLOCAL_READ_REPAIR_CHANCE_ISSET_ID, value); } public int getMemtable_flush_period_in_ms() { @@ -1208,16 +1223,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetMemtable_flush_period_in_ms() { - __isset_bit_vector.clear(__MEMTABLE_FLUSH_PERIOD_IN_MS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MEMTABLE_FLUSH_PERIOD_IN_MS_ISSET_ID); } /** Returns true if field memtable_flush_period_in_ms is set (has been assigned a value) and false otherwise */ public boolean isSetMemtable_flush_period_in_ms() { - return __isset_bit_vector.get(__MEMTABLE_FLUSH_PERIOD_IN_MS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __MEMTABLE_FLUSH_PERIOD_IN_MS_ISSET_ID); } public void setMemtable_flush_period_in_msIsSet(boolean value) { - __isset_bit_vector.set(__MEMTABLE_FLUSH_PERIOD_IN_MS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MEMTABLE_FLUSH_PERIOD_IN_MS_ISSET_ID, value); } public int getDefault_time_to_live() { @@ -1231,16 +1246,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetDefault_time_to_live() { - __isset_bit_vector.clear(__DEFAULT_TIME_TO_LIVE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DEFAULT_TIME_TO_LIVE_ISSET_ID); } /** Returns true if field default_time_to_live is set (has been assigned a value) and false otherwise */ public boolean isSetDefault_time_to_live() { - return __isset_bit_vector.get(__DEFAULT_TIME_TO_LIVE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __DEFAULT_TIME_TO_LIVE_ISSET_ID); } public void setDefault_time_to_liveIsSet(boolean value) { - __isset_bit_vector.set(__DEFAULT_TIME_TO_LIVE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DEFAULT_TIME_TO_LIVE_ISSET_ID, value); } public int getIndex_interval() { @@ -1254,16 +1269,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetIndex_interval() { - __isset_bit_vector.clear(__INDEX_INTERVAL_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INDEX_INTERVAL_ISSET_ID); } /** Returns true if field index_interval is set (has been assigned a value) and false otherwise */ public boolean isSetIndex_interval() { - return __isset_bit_vector.get(__INDEX_INTERVAL_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __INDEX_INTERVAL_ISSET_ID); } public void setIndex_intervalIsSet(boolean value) { - __isset_bit_vector.set(__INDEX_INTERVAL_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INDEX_INTERVAL_ISSET_ID, value); } /** @@ -1283,16 +1298,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetRow_cache_size() { - __isset_bit_vector.clear(__ROW_CACHE_SIZE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ROW_CACHE_SIZE_ISSET_ID); } /** Returns true if field row_cache_size is set (has been assigned a value) and false otherwise */ public boolean isSetRow_cache_size() { - return __isset_bit_vector.get(__ROW_CACHE_SIZE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __ROW_CACHE_SIZE_ISSET_ID); } public void setRow_cache_sizeIsSet(boolean value) { - __isset_bit_vector.set(__ROW_CACHE_SIZE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ROW_CACHE_SIZE_ISSET_ID, value); } /** @@ -1312,16 +1327,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetKey_cache_size() { - __isset_bit_vector.clear(__KEY_CACHE_SIZE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __KEY_CACHE_SIZE_ISSET_ID); } /** Returns true if field key_cache_size is set (has been assigned a value) and false otherwise */ public boolean isSetKey_cache_size() { - return __isset_bit_vector.get(__KEY_CACHE_SIZE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __KEY_CACHE_SIZE_ISSET_ID); } public void setKey_cache_sizeIsSet(boolean value) { - __isset_bit_vector.set(__KEY_CACHE_SIZE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __KEY_CACHE_SIZE_ISSET_ID, value); } /** @@ -1341,16 +1356,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetRow_cache_save_period_in_seconds() { - __isset_bit_vector.clear(__ROW_CACHE_SAVE_PERIOD_IN_SECONDS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ROW_CACHE_SAVE_PERIOD_IN_SECONDS_ISSET_ID); } /** Returns true if field row_cache_save_period_in_seconds is set (has been assigned a value) and false otherwise */ public boolean isSetRow_cache_save_period_in_seconds() { - return __isset_bit_vector.get(__ROW_CACHE_SAVE_PERIOD_IN_SECONDS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __ROW_CACHE_SAVE_PERIOD_IN_SECONDS_ISSET_ID); } public void setRow_cache_save_period_in_secondsIsSet(boolean value) { - __isset_bit_vector.set(__ROW_CACHE_SAVE_PERIOD_IN_SECONDS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ROW_CACHE_SAVE_PERIOD_IN_SECONDS_ISSET_ID, value); } /** @@ -1370,16 +1385,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetKey_cache_save_period_in_seconds() { - __isset_bit_vector.clear(__KEY_CACHE_SAVE_PERIOD_IN_SECONDS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __KEY_CACHE_SAVE_PERIOD_IN_SECONDS_ISSET_ID); } /** Returns true if field key_cache_save_period_in_seconds is set (has been assigned a value) and false otherwise */ public boolean isSetKey_cache_save_period_in_seconds() { - return __isset_bit_vector.get(__KEY_CACHE_SAVE_PERIOD_IN_SECONDS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __KEY_CACHE_SAVE_PERIOD_IN_SECONDS_ISSET_ID); } public void setKey_cache_save_period_in_secondsIsSet(boolean value) { - __isset_bit_vector.set(__KEY_CACHE_SAVE_PERIOD_IN_SECONDS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __KEY_CACHE_SAVE_PERIOD_IN_SECONDS_ISSET_ID, value); } /** @@ -1399,16 +1414,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetMemtable_flush_after_mins() { - __isset_bit_vector.clear(__MEMTABLE_FLUSH_AFTER_MINS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MEMTABLE_FLUSH_AFTER_MINS_ISSET_ID); } /** Returns true if field memtable_flush_after_mins is set (has been assigned a value) and false otherwise */ public boolean isSetMemtable_flush_after_mins() { - return __isset_bit_vector.get(__MEMTABLE_FLUSH_AFTER_MINS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __MEMTABLE_FLUSH_AFTER_MINS_ISSET_ID); } public void setMemtable_flush_after_minsIsSet(boolean value) { - __isset_bit_vector.set(__MEMTABLE_FLUSH_AFTER_MINS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MEMTABLE_FLUSH_AFTER_MINS_ISSET_ID, value); } /** @@ -1428,16 +1443,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetMemtable_throughput_in_mb() { - __isset_bit_vector.clear(__MEMTABLE_THROUGHPUT_IN_MB_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MEMTABLE_THROUGHPUT_IN_MB_ISSET_ID); } /** Returns true if field memtable_throughput_in_mb is set (has been assigned a value) and false otherwise */ public boolean isSetMemtable_throughput_in_mb() { - return __isset_bit_vector.get(__MEMTABLE_THROUGHPUT_IN_MB_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __MEMTABLE_THROUGHPUT_IN_MB_ISSET_ID); } public void setMemtable_throughput_in_mbIsSet(boolean value) { - __isset_bit_vector.set(__MEMTABLE_THROUGHPUT_IN_MB_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MEMTABLE_THROUGHPUT_IN_MB_ISSET_ID, value); } /** @@ -1457,16 +1472,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetMemtable_operations_in_millions() { - __isset_bit_vector.clear(__MEMTABLE_OPERATIONS_IN_MILLIONS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MEMTABLE_OPERATIONS_IN_MILLIONS_ISSET_ID); } /** Returns true if field memtable_operations_in_millions is set (has been assigned a value) and false otherwise */ public boolean isSetMemtable_operations_in_millions() { - return __isset_bit_vector.get(__MEMTABLE_OPERATIONS_IN_MILLIONS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __MEMTABLE_OPERATIONS_IN_MILLIONS_ISSET_ID); } public void setMemtable_operations_in_millionsIsSet(boolean value) { - __isset_bit_vector.set(__MEMTABLE_OPERATIONS_IN_MILLIONS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MEMTABLE_OPERATIONS_IN_MILLIONS_ISSET_ID, value); } /** @@ -1486,16 +1501,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetMerge_shards_chance() { - __isset_bit_vector.clear(__MERGE_SHARDS_CHANCE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MERGE_SHARDS_CHANCE_ISSET_ID); } /** Returns true if field merge_shards_chance is set (has been assigned a value) and false otherwise */ public boolean isSetMerge_shards_chance() { - return __isset_bit_vector.get(__MERGE_SHARDS_CHANCE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __MERGE_SHARDS_CHANCE_ISSET_ID); } public void setMerge_shards_chanceIsSet(boolean value) { - __isset_bit_vector.set(__MERGE_SHARDS_CHANCE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MERGE_SHARDS_CHANCE_ISSET_ID, value); } /** @@ -1545,16 +1560,16 @@ public class CfDef implements org.apache.thrift.TBase, jav } public void unsetRow_cache_keys_to_save() { - __isset_bit_vector.clear(__ROW_CACHE_KEYS_TO_SAVE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ROW_CACHE_KEYS_TO_SAVE_ISSET_ID); } /** Returns true if field row_cache_keys_to_save is set (has been assigned a value) and false otherwise */ public boolean isSetRow_cache_keys_to_save() { - return __isset_bit_vector.get(__ROW_CACHE_KEYS_TO_SAVE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __ROW_CACHE_KEYS_TO_SAVE_ISSET_ID); } public void setRow_cache_keys_to_saveIsSet(boolean value) { - __isset_bit_vector.set(__ROW_CACHE_KEYS_TO_SAVE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ROW_CACHE_KEYS_TO_SAVE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -2913,556 +2928,11 @@ public class CfDef implements org.apache.thrift.TBase, jav } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEYSPACE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.keyspace = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.name = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // COLUMN_TYPE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.column_type = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 5: // COMPARATOR_TYPE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.comparator_type = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 6: // SUBCOMPARATOR_TYPE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.subcomparator_type = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 8: // COMMENT - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.comment = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 12: // READ_REPAIR_CHANCE - if (field.type == org.apache.thrift.protocol.TType.DOUBLE) { - this.read_repair_chance = iprot.readDouble(); - setRead_repair_chanceIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 13: // COLUMN_METADATA - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list46 = iprot.readListBegin(); - this.column_metadata = new ArrayList(_list46.size); - for (int _i47 = 0; _i47 < _list46.size; ++_i47) - { - ColumnDef _elem48; // required - _elem48 = new ColumnDef(); - _elem48.read(iprot); - this.column_metadata.add(_elem48); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 14: // GC_GRACE_SECONDS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.gc_grace_seconds = iprot.readI32(); - setGc_grace_secondsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 15: // DEFAULT_VALIDATION_CLASS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.default_validation_class = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 16: // ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.id = iprot.readI32(); - setIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 17: // MIN_COMPACTION_THRESHOLD - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.min_compaction_threshold = iprot.readI32(); - setMin_compaction_thresholdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 18: // MAX_COMPACTION_THRESHOLD - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.max_compaction_threshold = iprot.readI32(); - setMax_compaction_thresholdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 24: // REPLICATE_ON_WRITE - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.replicate_on_write = iprot.readBool(); - setReplicate_on_writeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 26: // KEY_VALIDATION_CLASS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.key_validation_class = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 28: // KEY_ALIAS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.key_alias = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 29: // COMPACTION_STRATEGY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.compaction_strategy = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 30: // COMPACTION_STRATEGY_OPTIONS - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map49 = iprot.readMapBegin(); - this.compaction_strategy_options = new HashMap(2*_map49.size); - for (int _i50 = 0; _i50 < _map49.size; ++_i50) - { - String _key51; // required - String _val52; // required - _key51 = iprot.readString(); - _val52 = iprot.readString(); - this.compaction_strategy_options.put(_key51, _val52); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 32: // COMPRESSION_OPTIONS - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map53 = iprot.readMapBegin(); - this.compression_options = new HashMap(2*_map53.size); - for (int _i54 = 0; _i54 < _map53.size; ++_i54) - { - String _key55; // required - String _val56; // required - _key55 = iprot.readString(); - _val56 = iprot.readString(); - this.compression_options.put(_key55, _val56); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 33: // BLOOM_FILTER_FP_CHANCE - if (field.type == org.apache.thrift.protocol.TType.DOUBLE) { - this.bloom_filter_fp_chance = iprot.readDouble(); - setBloom_filter_fp_chanceIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 34: // CACHING - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.caching = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 37: // DCLOCAL_READ_REPAIR_CHANCE - if (field.type == org.apache.thrift.protocol.TType.DOUBLE) { - this.dclocal_read_repair_chance = iprot.readDouble(); - setDclocal_read_repair_chanceIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 38: // MEMTABLE_FLUSH_PERIOD_IN_MS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.memtable_flush_period_in_ms = iprot.readI32(); - setMemtable_flush_period_in_msIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 39: // DEFAULT_TIME_TO_LIVE - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.default_time_to_live = iprot.readI32(); - setDefault_time_to_liveIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 40: // INDEX_INTERVAL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.index_interval = iprot.readI32(); - setIndex_intervalIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 9: // ROW_CACHE_SIZE - if (field.type == org.apache.thrift.protocol.TType.DOUBLE) { - this.row_cache_size = iprot.readDouble(); - setRow_cache_sizeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 11: // KEY_CACHE_SIZE - if (field.type == org.apache.thrift.protocol.TType.DOUBLE) { - this.key_cache_size = iprot.readDouble(); - setKey_cache_sizeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 19: // ROW_CACHE_SAVE_PERIOD_IN_SECONDS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.row_cache_save_period_in_seconds = iprot.readI32(); - setRow_cache_save_period_in_secondsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 20: // KEY_CACHE_SAVE_PERIOD_IN_SECONDS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.key_cache_save_period_in_seconds = iprot.readI32(); - setKey_cache_save_period_in_secondsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 21: // MEMTABLE_FLUSH_AFTER_MINS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.memtable_flush_after_mins = iprot.readI32(); - setMemtable_flush_after_minsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 22: // MEMTABLE_THROUGHPUT_IN_MB - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.memtable_throughput_in_mb = iprot.readI32(); - setMemtable_throughput_in_mbIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 23: // MEMTABLE_OPERATIONS_IN_MILLIONS - if (field.type == org.apache.thrift.protocol.TType.DOUBLE) { - this.memtable_operations_in_millions = iprot.readDouble(); - setMemtable_operations_in_millionsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 25: // MERGE_SHARDS_CHANCE - if (field.type == org.apache.thrift.protocol.TType.DOUBLE) { - this.merge_shards_chance = iprot.readDouble(); - setMerge_shards_chanceIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 27: // ROW_CACHE_PROVIDER - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.row_cache_provider = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 31: // ROW_CACHE_KEYS_TO_SAVE - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.row_cache_keys_to_save = iprot.readI32(); - setRow_cache_keys_to_saveIsSet(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 - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.keyspace != null) { - oprot.writeFieldBegin(KEYSPACE_FIELD_DESC); - oprot.writeString(this.keyspace); - oprot.writeFieldEnd(); - } - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); - oprot.writeFieldEnd(); - } - if (this.column_type != null) { - if (isSetColumn_type()) { - oprot.writeFieldBegin(COLUMN_TYPE_FIELD_DESC); - oprot.writeString(this.column_type); - oprot.writeFieldEnd(); - } - } - if (this.comparator_type != null) { - if (isSetComparator_type()) { - oprot.writeFieldBegin(COMPARATOR_TYPE_FIELD_DESC); - oprot.writeString(this.comparator_type); - oprot.writeFieldEnd(); - } - } - if (this.subcomparator_type != null) { - if (isSetSubcomparator_type()) { - oprot.writeFieldBegin(SUBCOMPARATOR_TYPE_FIELD_DESC); - oprot.writeString(this.subcomparator_type); - oprot.writeFieldEnd(); - } - } - if (this.comment != null) { - if (isSetComment()) { - oprot.writeFieldBegin(COMMENT_FIELD_DESC); - oprot.writeString(this.comment); - oprot.writeFieldEnd(); - } - } - if (isSetRow_cache_size()) { - oprot.writeFieldBegin(ROW_CACHE_SIZE_FIELD_DESC); - oprot.writeDouble(this.row_cache_size); - oprot.writeFieldEnd(); - } - if (isSetKey_cache_size()) { - oprot.writeFieldBegin(KEY_CACHE_SIZE_FIELD_DESC); - oprot.writeDouble(this.key_cache_size); - oprot.writeFieldEnd(); - } - if (isSetRead_repair_chance()) { - oprot.writeFieldBegin(READ_REPAIR_CHANCE_FIELD_DESC); - oprot.writeDouble(this.read_repair_chance); - oprot.writeFieldEnd(); - } - if (this.column_metadata != null) { - if (isSetColumn_metadata()) { - oprot.writeFieldBegin(COLUMN_METADATA_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.column_metadata.size())); - for (ColumnDef _iter57 : this.column_metadata) - { - _iter57.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - if (isSetGc_grace_seconds()) { - oprot.writeFieldBegin(GC_GRACE_SECONDS_FIELD_DESC); - oprot.writeI32(this.gc_grace_seconds); - oprot.writeFieldEnd(); - } - if (this.default_validation_class != null) { - if (isSetDefault_validation_class()) { - oprot.writeFieldBegin(DEFAULT_VALIDATION_CLASS_FIELD_DESC); - oprot.writeString(this.default_validation_class); - oprot.writeFieldEnd(); - } - } - if (isSetId()) { - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeI32(this.id); - oprot.writeFieldEnd(); - } - if (isSetMin_compaction_threshold()) { - oprot.writeFieldBegin(MIN_COMPACTION_THRESHOLD_FIELD_DESC); - oprot.writeI32(this.min_compaction_threshold); - oprot.writeFieldEnd(); - } - if (isSetMax_compaction_threshold()) { - oprot.writeFieldBegin(MAX_COMPACTION_THRESHOLD_FIELD_DESC); - oprot.writeI32(this.max_compaction_threshold); - oprot.writeFieldEnd(); - } - if (isSetRow_cache_save_period_in_seconds()) { - oprot.writeFieldBegin(ROW_CACHE_SAVE_PERIOD_IN_SECONDS_FIELD_DESC); - oprot.writeI32(this.row_cache_save_period_in_seconds); - oprot.writeFieldEnd(); - } - if (isSetKey_cache_save_period_in_seconds()) { - oprot.writeFieldBegin(KEY_CACHE_SAVE_PERIOD_IN_SECONDS_FIELD_DESC); - oprot.writeI32(this.key_cache_save_period_in_seconds); - oprot.writeFieldEnd(); - } - if (isSetMemtable_flush_after_mins()) { - oprot.writeFieldBegin(MEMTABLE_FLUSH_AFTER_MINS_FIELD_DESC); - oprot.writeI32(this.memtable_flush_after_mins); - oprot.writeFieldEnd(); - } - if (isSetMemtable_throughput_in_mb()) { - oprot.writeFieldBegin(MEMTABLE_THROUGHPUT_IN_MB_FIELD_DESC); - oprot.writeI32(this.memtable_throughput_in_mb); - oprot.writeFieldEnd(); - } - if (isSetMemtable_operations_in_millions()) { - oprot.writeFieldBegin(MEMTABLE_OPERATIONS_IN_MILLIONS_FIELD_DESC); - oprot.writeDouble(this.memtable_operations_in_millions); - oprot.writeFieldEnd(); - } - if (isSetReplicate_on_write()) { - oprot.writeFieldBegin(REPLICATE_ON_WRITE_FIELD_DESC); - oprot.writeBool(this.replicate_on_write); - oprot.writeFieldEnd(); - } - if (isSetMerge_shards_chance()) { - oprot.writeFieldBegin(MERGE_SHARDS_CHANCE_FIELD_DESC); - oprot.writeDouble(this.merge_shards_chance); - oprot.writeFieldEnd(); - } - if (this.key_validation_class != null) { - if (isSetKey_validation_class()) { - oprot.writeFieldBegin(KEY_VALIDATION_CLASS_FIELD_DESC); - oprot.writeString(this.key_validation_class); - oprot.writeFieldEnd(); - } - } - if (this.row_cache_provider != null) { - if (isSetRow_cache_provider()) { - oprot.writeFieldBegin(ROW_CACHE_PROVIDER_FIELD_DESC); - oprot.writeString(this.row_cache_provider); - oprot.writeFieldEnd(); - } - } - if (this.key_alias != null) { - if (isSetKey_alias()) { - oprot.writeFieldBegin(KEY_ALIAS_FIELD_DESC); - oprot.writeBinary(this.key_alias); - oprot.writeFieldEnd(); - } - } - if (this.compaction_strategy != null) { - if (isSetCompaction_strategy()) { - oprot.writeFieldBegin(COMPACTION_STRATEGY_FIELD_DESC); - oprot.writeString(this.compaction_strategy); - oprot.writeFieldEnd(); - } - } - if (this.compaction_strategy_options != null) { - if (isSetCompaction_strategy_options()) { - oprot.writeFieldBegin(COMPACTION_STRATEGY_OPTIONS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, this.compaction_strategy_options.size())); - for (Map.Entry _iter58 : this.compaction_strategy_options.entrySet()) - { - oprot.writeString(_iter58.getKey()); - oprot.writeString(_iter58.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - } - if (isSetRow_cache_keys_to_save()) { - oprot.writeFieldBegin(ROW_CACHE_KEYS_TO_SAVE_FIELD_DESC); - oprot.writeI32(this.row_cache_keys_to_save); - oprot.writeFieldEnd(); - } - if (this.compression_options != null) { - if (isSetCompression_options()) { - oprot.writeFieldBegin(COMPRESSION_OPTIONS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, this.compression_options.size())); - for (Map.Entry _iter59 : this.compression_options.entrySet()) - { - oprot.writeString(_iter59.getKey()); - oprot.writeString(_iter59.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - } - if (isSetBloom_filter_fp_chance()) { - oprot.writeFieldBegin(BLOOM_FILTER_FP_CHANCE_FIELD_DESC); - oprot.writeDouble(this.bloom_filter_fp_chance); - oprot.writeFieldEnd(); - } - if (this.caching != null) { - if (isSetCaching()) { - oprot.writeFieldBegin(CACHING_FIELD_DESC); - oprot.writeString(this.caching); - oprot.writeFieldEnd(); - } - } - if (isSetDclocal_read_repair_chance()) { - oprot.writeFieldBegin(DCLOCAL_READ_REPAIR_CHANCE_FIELD_DESC); - oprot.writeDouble(this.dclocal_read_repair_chance); - oprot.writeFieldEnd(); - } - if (isSetMemtable_flush_period_in_ms()) { - oprot.writeFieldBegin(MEMTABLE_FLUSH_PERIOD_IN_MS_FIELD_DESC); - oprot.writeI32(this.memtable_flush_period_in_ms); - oprot.writeFieldEnd(); - } - if (isSetDefault_time_to_live()) { - oprot.writeFieldBegin(DEFAULT_TIME_TO_LIVE_FIELD_DESC); - oprot.writeI32(this.default_time_to_live); - oprot.writeFieldEnd(); - } - if (isSetIndex_interval()) { - oprot.writeFieldBegin(INDEX_INTERVAL_FIELD_DESC); - oprot.writeI32(this.index_interval); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -3747,6 +3217,7 @@ public class CfDef implements org.apache.thrift.TBase, jav if (name == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -3760,12 +3231,1000 @@ public class CfDef implements org.apache.thrift.TBase, jav 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); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class CfDefStandardSchemeFactory implements SchemeFactory { + public CfDefStandardScheme getScheme() { + return new CfDefStandardScheme(); + } + } + + private static class CfDefStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CfDef struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEYSPACE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.keyspace = iprot.readString(); + struct.setKeyspaceIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMN_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.column_type = iprot.readString(); + struct.setColumn_typeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // COMPARATOR_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.comparator_type = iprot.readString(); + struct.setComparator_typeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // SUBCOMPARATOR_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.subcomparator_type = iprot.readString(); + struct.setSubcomparator_typeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // COMMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.comment = iprot.readString(); + struct.setCommentIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 12: // READ_REPAIR_CHANCE + if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { + struct.read_repair_chance = iprot.readDouble(); + struct.setRead_repair_chanceIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 13: // COLUMN_METADATA + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list92 = iprot.readListBegin(); + struct.column_metadata = new ArrayList(_list92.size); + for (int _i93 = 0; _i93 < _list92.size; ++_i93) + { + ColumnDef _elem94; // required + _elem94 = new ColumnDef(); + _elem94.read(iprot); + struct.column_metadata.add(_elem94); + } + iprot.readListEnd(); + } + struct.setColumn_metadataIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 14: // GC_GRACE_SECONDS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.gc_grace_seconds = iprot.readI32(); + struct.setGc_grace_secondsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 15: // DEFAULT_VALIDATION_CLASS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.default_validation_class = iprot.readString(); + struct.setDefault_validation_classIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 16: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.id = iprot.readI32(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 17: // MIN_COMPACTION_THRESHOLD + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.min_compaction_threshold = iprot.readI32(); + struct.setMin_compaction_thresholdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 18: // MAX_COMPACTION_THRESHOLD + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.max_compaction_threshold = iprot.readI32(); + struct.setMax_compaction_thresholdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 24: // REPLICATE_ON_WRITE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.replicate_on_write = iprot.readBool(); + struct.setReplicate_on_writeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 26: // KEY_VALIDATION_CLASS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.key_validation_class = iprot.readString(); + struct.setKey_validation_classIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 28: // KEY_ALIAS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.key_alias = iprot.readBinary(); + struct.setKey_aliasIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 29: // COMPACTION_STRATEGY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.compaction_strategy = iprot.readString(); + struct.setCompaction_strategyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 30: // COMPACTION_STRATEGY_OPTIONS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map95 = iprot.readMapBegin(); + struct.compaction_strategy_options = new HashMap(2*_map95.size); + for (int _i96 = 0; _i96 < _map95.size; ++_i96) + { + String _key97; // required + String _val98; // required + _key97 = iprot.readString(); + _val98 = iprot.readString(); + struct.compaction_strategy_options.put(_key97, _val98); + } + iprot.readMapEnd(); + } + struct.setCompaction_strategy_optionsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 32: // COMPRESSION_OPTIONS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map99 = iprot.readMapBegin(); + struct.compression_options = new HashMap(2*_map99.size); + for (int _i100 = 0; _i100 < _map99.size; ++_i100) + { + String _key101; // required + String _val102; // required + _key101 = iprot.readString(); + _val102 = iprot.readString(); + struct.compression_options.put(_key101, _val102); + } + iprot.readMapEnd(); + } + struct.setCompression_optionsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 33: // BLOOM_FILTER_FP_CHANCE + if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { + struct.bloom_filter_fp_chance = iprot.readDouble(); + struct.setBloom_filter_fp_chanceIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 34: // CACHING + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.caching = iprot.readString(); + struct.setCachingIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 37: // DCLOCAL_READ_REPAIR_CHANCE + if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { + struct.dclocal_read_repair_chance = iprot.readDouble(); + struct.setDclocal_read_repair_chanceIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 38: // MEMTABLE_FLUSH_PERIOD_IN_MS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.memtable_flush_period_in_ms = iprot.readI32(); + struct.setMemtable_flush_period_in_msIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 39: // DEFAULT_TIME_TO_LIVE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.default_time_to_live = iprot.readI32(); + struct.setDefault_time_to_liveIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 40: // INDEX_INTERVAL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.index_interval = iprot.readI32(); + struct.setIndex_intervalIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // ROW_CACHE_SIZE + if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { + struct.row_cache_size = iprot.readDouble(); + struct.setRow_cache_sizeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 11: // KEY_CACHE_SIZE + if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { + struct.key_cache_size = iprot.readDouble(); + struct.setKey_cache_sizeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 19: // ROW_CACHE_SAVE_PERIOD_IN_SECONDS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.row_cache_save_period_in_seconds = iprot.readI32(); + struct.setRow_cache_save_period_in_secondsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 20: // KEY_CACHE_SAVE_PERIOD_IN_SECONDS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.key_cache_save_period_in_seconds = iprot.readI32(); + struct.setKey_cache_save_period_in_secondsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 21: // MEMTABLE_FLUSH_AFTER_MINS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.memtable_flush_after_mins = iprot.readI32(); + struct.setMemtable_flush_after_minsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 22: // MEMTABLE_THROUGHPUT_IN_MB + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.memtable_throughput_in_mb = iprot.readI32(); + struct.setMemtable_throughput_in_mbIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 23: // MEMTABLE_OPERATIONS_IN_MILLIONS + if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { + struct.memtable_operations_in_millions = iprot.readDouble(); + struct.setMemtable_operations_in_millionsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 25: // MERGE_SHARDS_CHANCE + if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { + struct.merge_shards_chance = iprot.readDouble(); + struct.setMerge_shards_chanceIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 27: // ROW_CACHE_PROVIDER + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.row_cache_provider = iprot.readString(); + struct.setRow_cache_providerIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 31: // ROW_CACHE_KEYS_TO_SAVE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.row_cache_keys_to_save = iprot.readI32(); + struct.setRow_cache_keys_to_saveIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, CfDef struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.keyspace != null) { + oprot.writeFieldBegin(KEYSPACE_FIELD_DESC); + oprot.writeString(struct.keyspace); + oprot.writeFieldEnd(); + } + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + if (struct.column_type != null) { + if (struct.isSetColumn_type()) { + oprot.writeFieldBegin(COLUMN_TYPE_FIELD_DESC); + oprot.writeString(struct.column_type); + oprot.writeFieldEnd(); + } + } + if (struct.comparator_type != null) { + if (struct.isSetComparator_type()) { + oprot.writeFieldBegin(COMPARATOR_TYPE_FIELD_DESC); + oprot.writeString(struct.comparator_type); + oprot.writeFieldEnd(); + } + } + if (struct.subcomparator_type != null) { + if (struct.isSetSubcomparator_type()) { + oprot.writeFieldBegin(SUBCOMPARATOR_TYPE_FIELD_DESC); + oprot.writeString(struct.subcomparator_type); + oprot.writeFieldEnd(); + } + } + if (struct.comment != null) { + if (struct.isSetComment()) { + oprot.writeFieldBegin(COMMENT_FIELD_DESC); + oprot.writeString(struct.comment); + oprot.writeFieldEnd(); + } + } + if (struct.isSetRow_cache_size()) { + oprot.writeFieldBegin(ROW_CACHE_SIZE_FIELD_DESC); + oprot.writeDouble(struct.row_cache_size); + oprot.writeFieldEnd(); + } + if (struct.isSetKey_cache_size()) { + oprot.writeFieldBegin(KEY_CACHE_SIZE_FIELD_DESC); + oprot.writeDouble(struct.key_cache_size); + oprot.writeFieldEnd(); + } + if (struct.isSetRead_repair_chance()) { + oprot.writeFieldBegin(READ_REPAIR_CHANCE_FIELD_DESC); + oprot.writeDouble(struct.read_repair_chance); + oprot.writeFieldEnd(); + } + if (struct.column_metadata != null) { + if (struct.isSetColumn_metadata()) { + oprot.writeFieldBegin(COLUMN_METADATA_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.column_metadata.size())); + for (ColumnDef _iter103 : struct.column_metadata) + { + _iter103.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.isSetGc_grace_seconds()) { + oprot.writeFieldBegin(GC_GRACE_SECONDS_FIELD_DESC); + oprot.writeI32(struct.gc_grace_seconds); + oprot.writeFieldEnd(); + } + if (struct.default_validation_class != null) { + if (struct.isSetDefault_validation_class()) { + oprot.writeFieldBegin(DEFAULT_VALIDATION_CLASS_FIELD_DESC); + oprot.writeString(struct.default_validation_class); + oprot.writeFieldEnd(); + } + } + if (struct.isSetId()) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeI32(struct.id); + oprot.writeFieldEnd(); + } + if (struct.isSetMin_compaction_threshold()) { + oprot.writeFieldBegin(MIN_COMPACTION_THRESHOLD_FIELD_DESC); + oprot.writeI32(struct.min_compaction_threshold); + oprot.writeFieldEnd(); + } + if (struct.isSetMax_compaction_threshold()) { + oprot.writeFieldBegin(MAX_COMPACTION_THRESHOLD_FIELD_DESC); + oprot.writeI32(struct.max_compaction_threshold); + oprot.writeFieldEnd(); + } + if (struct.isSetRow_cache_save_period_in_seconds()) { + oprot.writeFieldBegin(ROW_CACHE_SAVE_PERIOD_IN_SECONDS_FIELD_DESC); + oprot.writeI32(struct.row_cache_save_period_in_seconds); + oprot.writeFieldEnd(); + } + if (struct.isSetKey_cache_save_period_in_seconds()) { + oprot.writeFieldBegin(KEY_CACHE_SAVE_PERIOD_IN_SECONDS_FIELD_DESC); + oprot.writeI32(struct.key_cache_save_period_in_seconds); + oprot.writeFieldEnd(); + } + if (struct.isSetMemtable_flush_after_mins()) { + oprot.writeFieldBegin(MEMTABLE_FLUSH_AFTER_MINS_FIELD_DESC); + oprot.writeI32(struct.memtable_flush_after_mins); + oprot.writeFieldEnd(); + } + if (struct.isSetMemtable_throughput_in_mb()) { + oprot.writeFieldBegin(MEMTABLE_THROUGHPUT_IN_MB_FIELD_DESC); + oprot.writeI32(struct.memtable_throughput_in_mb); + oprot.writeFieldEnd(); + } + if (struct.isSetMemtable_operations_in_millions()) { + oprot.writeFieldBegin(MEMTABLE_OPERATIONS_IN_MILLIONS_FIELD_DESC); + oprot.writeDouble(struct.memtable_operations_in_millions); + oprot.writeFieldEnd(); + } + if (struct.isSetReplicate_on_write()) { + oprot.writeFieldBegin(REPLICATE_ON_WRITE_FIELD_DESC); + oprot.writeBool(struct.replicate_on_write); + oprot.writeFieldEnd(); + } + if (struct.isSetMerge_shards_chance()) { + oprot.writeFieldBegin(MERGE_SHARDS_CHANCE_FIELD_DESC); + oprot.writeDouble(struct.merge_shards_chance); + oprot.writeFieldEnd(); + } + if (struct.key_validation_class != null) { + if (struct.isSetKey_validation_class()) { + oprot.writeFieldBegin(KEY_VALIDATION_CLASS_FIELD_DESC); + oprot.writeString(struct.key_validation_class); + oprot.writeFieldEnd(); + } + } + if (struct.row_cache_provider != null) { + if (struct.isSetRow_cache_provider()) { + oprot.writeFieldBegin(ROW_CACHE_PROVIDER_FIELD_DESC); + oprot.writeString(struct.row_cache_provider); + oprot.writeFieldEnd(); + } + } + if (struct.key_alias != null) { + if (struct.isSetKey_alias()) { + oprot.writeFieldBegin(KEY_ALIAS_FIELD_DESC); + oprot.writeBinary(struct.key_alias); + oprot.writeFieldEnd(); + } + } + if (struct.compaction_strategy != null) { + if (struct.isSetCompaction_strategy()) { + oprot.writeFieldBegin(COMPACTION_STRATEGY_FIELD_DESC); + oprot.writeString(struct.compaction_strategy); + oprot.writeFieldEnd(); + } + } + if (struct.compaction_strategy_options != null) { + if (struct.isSetCompaction_strategy_options()) { + oprot.writeFieldBegin(COMPACTION_STRATEGY_OPTIONS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.compaction_strategy_options.size())); + for (Map.Entry _iter104 : struct.compaction_strategy_options.entrySet()) + { + oprot.writeString(_iter104.getKey()); + oprot.writeString(_iter104.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.isSetRow_cache_keys_to_save()) { + oprot.writeFieldBegin(ROW_CACHE_KEYS_TO_SAVE_FIELD_DESC); + oprot.writeI32(struct.row_cache_keys_to_save); + oprot.writeFieldEnd(); + } + if (struct.compression_options != null) { + if (struct.isSetCompression_options()) { + oprot.writeFieldBegin(COMPRESSION_OPTIONS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.compression_options.size())); + for (Map.Entry _iter105 : struct.compression_options.entrySet()) + { + oprot.writeString(_iter105.getKey()); + oprot.writeString(_iter105.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.isSetBloom_filter_fp_chance()) { + oprot.writeFieldBegin(BLOOM_FILTER_FP_CHANCE_FIELD_DESC); + oprot.writeDouble(struct.bloom_filter_fp_chance); + oprot.writeFieldEnd(); + } + if (struct.caching != null) { + if (struct.isSetCaching()) { + oprot.writeFieldBegin(CACHING_FIELD_DESC); + oprot.writeString(struct.caching); + oprot.writeFieldEnd(); + } + } + if (struct.isSetDclocal_read_repair_chance()) { + oprot.writeFieldBegin(DCLOCAL_READ_REPAIR_CHANCE_FIELD_DESC); + oprot.writeDouble(struct.dclocal_read_repair_chance); + oprot.writeFieldEnd(); + } + if (struct.isSetMemtable_flush_period_in_ms()) { + oprot.writeFieldBegin(MEMTABLE_FLUSH_PERIOD_IN_MS_FIELD_DESC); + oprot.writeI32(struct.memtable_flush_period_in_ms); + oprot.writeFieldEnd(); + } + if (struct.isSetDefault_time_to_live()) { + oprot.writeFieldBegin(DEFAULT_TIME_TO_LIVE_FIELD_DESC); + oprot.writeI32(struct.default_time_to_live); + oprot.writeFieldEnd(); + } + if (struct.isSetIndex_interval()) { + oprot.writeFieldBegin(INDEX_INTERVAL_FIELD_DESC); + oprot.writeI32(struct.index_interval); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class CfDefTupleSchemeFactory implements SchemeFactory { + public CfDefTupleScheme getScheme() { + return new CfDefTupleScheme(); + } + } + + private static class CfDefTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CfDef struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.keyspace); + oprot.writeString(struct.name); + BitSet optionals = new BitSet(); + if (struct.isSetColumn_type()) { + optionals.set(0); + } + if (struct.isSetComparator_type()) { + optionals.set(1); + } + if (struct.isSetSubcomparator_type()) { + optionals.set(2); + } + if (struct.isSetComment()) { + optionals.set(3); + } + if (struct.isSetRead_repair_chance()) { + optionals.set(4); + } + if (struct.isSetColumn_metadata()) { + optionals.set(5); + } + if (struct.isSetGc_grace_seconds()) { + optionals.set(6); + } + if (struct.isSetDefault_validation_class()) { + optionals.set(7); + } + if (struct.isSetId()) { + optionals.set(8); + } + if (struct.isSetMin_compaction_threshold()) { + optionals.set(9); + } + if (struct.isSetMax_compaction_threshold()) { + optionals.set(10); + } + if (struct.isSetReplicate_on_write()) { + optionals.set(11); + } + if (struct.isSetKey_validation_class()) { + optionals.set(12); + } + if (struct.isSetKey_alias()) { + optionals.set(13); + } + if (struct.isSetCompaction_strategy()) { + optionals.set(14); + } + if (struct.isSetCompaction_strategy_options()) { + optionals.set(15); + } + if (struct.isSetCompression_options()) { + optionals.set(16); + } + if (struct.isSetBloom_filter_fp_chance()) { + optionals.set(17); + } + if (struct.isSetCaching()) { + optionals.set(18); + } + if (struct.isSetDclocal_read_repair_chance()) { + optionals.set(19); + } + if (struct.isSetMemtable_flush_period_in_ms()) { + optionals.set(20); + } + if (struct.isSetDefault_time_to_live()) { + optionals.set(21); + } + if (struct.isSetIndex_interval()) { + optionals.set(22); + } + if (struct.isSetRow_cache_size()) { + optionals.set(23); + } + if (struct.isSetKey_cache_size()) { + optionals.set(24); + } + if (struct.isSetRow_cache_save_period_in_seconds()) { + optionals.set(25); + } + if (struct.isSetKey_cache_save_period_in_seconds()) { + optionals.set(26); + } + if (struct.isSetMemtable_flush_after_mins()) { + optionals.set(27); + } + if (struct.isSetMemtable_throughput_in_mb()) { + optionals.set(28); + } + if (struct.isSetMemtable_operations_in_millions()) { + optionals.set(29); + } + if (struct.isSetMerge_shards_chance()) { + optionals.set(30); + } + if (struct.isSetRow_cache_provider()) { + optionals.set(31); + } + if (struct.isSetRow_cache_keys_to_save()) { + optionals.set(32); + } + oprot.writeBitSet(optionals, 33); + if (struct.isSetColumn_type()) { + oprot.writeString(struct.column_type); + } + if (struct.isSetComparator_type()) { + oprot.writeString(struct.comparator_type); + } + if (struct.isSetSubcomparator_type()) { + oprot.writeString(struct.subcomparator_type); + } + if (struct.isSetComment()) { + oprot.writeString(struct.comment); + } + if (struct.isSetRead_repair_chance()) { + oprot.writeDouble(struct.read_repair_chance); + } + if (struct.isSetColumn_metadata()) { + { + oprot.writeI32(struct.column_metadata.size()); + for (ColumnDef _iter106 : struct.column_metadata) + { + _iter106.write(oprot); + } + } + } + if (struct.isSetGc_grace_seconds()) { + oprot.writeI32(struct.gc_grace_seconds); + } + if (struct.isSetDefault_validation_class()) { + oprot.writeString(struct.default_validation_class); + } + if (struct.isSetId()) { + oprot.writeI32(struct.id); + } + if (struct.isSetMin_compaction_threshold()) { + oprot.writeI32(struct.min_compaction_threshold); + } + if (struct.isSetMax_compaction_threshold()) { + oprot.writeI32(struct.max_compaction_threshold); + } + if (struct.isSetReplicate_on_write()) { + oprot.writeBool(struct.replicate_on_write); + } + if (struct.isSetKey_validation_class()) { + oprot.writeString(struct.key_validation_class); + } + if (struct.isSetKey_alias()) { + oprot.writeBinary(struct.key_alias); + } + if (struct.isSetCompaction_strategy()) { + oprot.writeString(struct.compaction_strategy); + } + if (struct.isSetCompaction_strategy_options()) { + { + oprot.writeI32(struct.compaction_strategy_options.size()); + for (Map.Entry _iter107 : struct.compaction_strategy_options.entrySet()) + { + oprot.writeString(_iter107.getKey()); + oprot.writeString(_iter107.getValue()); + } + } + } + if (struct.isSetCompression_options()) { + { + oprot.writeI32(struct.compression_options.size()); + for (Map.Entry _iter108 : struct.compression_options.entrySet()) + { + oprot.writeString(_iter108.getKey()); + oprot.writeString(_iter108.getValue()); + } + } + } + if (struct.isSetBloom_filter_fp_chance()) { + oprot.writeDouble(struct.bloom_filter_fp_chance); + } + if (struct.isSetCaching()) { + oprot.writeString(struct.caching); + } + if (struct.isSetDclocal_read_repair_chance()) { + oprot.writeDouble(struct.dclocal_read_repair_chance); + } + if (struct.isSetMemtable_flush_period_in_ms()) { + oprot.writeI32(struct.memtable_flush_period_in_ms); + } + if (struct.isSetDefault_time_to_live()) { + oprot.writeI32(struct.default_time_to_live); + } + if (struct.isSetIndex_interval()) { + oprot.writeI32(struct.index_interval); + } + if (struct.isSetRow_cache_size()) { + oprot.writeDouble(struct.row_cache_size); + } + if (struct.isSetKey_cache_size()) { + oprot.writeDouble(struct.key_cache_size); + } + if (struct.isSetRow_cache_save_period_in_seconds()) { + oprot.writeI32(struct.row_cache_save_period_in_seconds); + } + if (struct.isSetKey_cache_save_period_in_seconds()) { + oprot.writeI32(struct.key_cache_save_period_in_seconds); + } + if (struct.isSetMemtable_flush_after_mins()) { + oprot.writeI32(struct.memtable_flush_after_mins); + } + if (struct.isSetMemtable_throughput_in_mb()) { + oprot.writeI32(struct.memtable_throughput_in_mb); + } + if (struct.isSetMemtable_operations_in_millions()) { + oprot.writeDouble(struct.memtable_operations_in_millions); + } + if (struct.isSetMerge_shards_chance()) { + oprot.writeDouble(struct.merge_shards_chance); + } + if (struct.isSetRow_cache_provider()) { + oprot.writeString(struct.row_cache_provider); + } + if (struct.isSetRow_cache_keys_to_save()) { + oprot.writeI32(struct.row_cache_keys_to_save); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, CfDef struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.keyspace = iprot.readString(); + struct.setKeyspaceIsSet(true); + struct.name = iprot.readString(); + struct.setNameIsSet(true); + BitSet incoming = iprot.readBitSet(33); + if (incoming.get(0)) { + struct.column_type = iprot.readString(); + struct.setColumn_typeIsSet(true); + } + if (incoming.get(1)) { + struct.comparator_type = iprot.readString(); + struct.setComparator_typeIsSet(true); + } + if (incoming.get(2)) { + struct.subcomparator_type = iprot.readString(); + struct.setSubcomparator_typeIsSet(true); + } + if (incoming.get(3)) { + struct.comment = iprot.readString(); + struct.setCommentIsSet(true); + } + if (incoming.get(4)) { + struct.read_repair_chance = iprot.readDouble(); + struct.setRead_repair_chanceIsSet(true); + } + if (incoming.get(5)) { + { + org.apache.thrift.protocol.TList _list109 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.column_metadata = new ArrayList(_list109.size); + for (int _i110 = 0; _i110 < _list109.size; ++_i110) + { + ColumnDef _elem111; // required + _elem111 = new ColumnDef(); + _elem111.read(iprot); + struct.column_metadata.add(_elem111); + } + } + struct.setColumn_metadataIsSet(true); + } + if (incoming.get(6)) { + struct.gc_grace_seconds = iprot.readI32(); + struct.setGc_grace_secondsIsSet(true); + } + if (incoming.get(7)) { + struct.default_validation_class = iprot.readString(); + struct.setDefault_validation_classIsSet(true); + } + if (incoming.get(8)) { + struct.id = iprot.readI32(); + struct.setIdIsSet(true); + } + if (incoming.get(9)) { + struct.min_compaction_threshold = iprot.readI32(); + struct.setMin_compaction_thresholdIsSet(true); + } + if (incoming.get(10)) { + struct.max_compaction_threshold = iprot.readI32(); + struct.setMax_compaction_thresholdIsSet(true); + } + if (incoming.get(11)) { + struct.replicate_on_write = iprot.readBool(); + struct.setReplicate_on_writeIsSet(true); + } + if (incoming.get(12)) { + struct.key_validation_class = iprot.readString(); + struct.setKey_validation_classIsSet(true); + } + if (incoming.get(13)) { + struct.key_alias = iprot.readBinary(); + struct.setKey_aliasIsSet(true); + } + if (incoming.get(14)) { + struct.compaction_strategy = iprot.readString(); + struct.setCompaction_strategyIsSet(true); + } + if (incoming.get(15)) { + { + org.apache.thrift.protocol.TMap _map112 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.compaction_strategy_options = new HashMap(2*_map112.size); + for (int _i113 = 0; _i113 < _map112.size; ++_i113) + { + String _key114; // required + String _val115; // required + _key114 = iprot.readString(); + _val115 = iprot.readString(); + struct.compaction_strategy_options.put(_key114, _val115); + } + } + struct.setCompaction_strategy_optionsIsSet(true); + } + if (incoming.get(16)) { + { + org.apache.thrift.protocol.TMap _map116 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.compression_options = new HashMap(2*_map116.size); + for (int _i117 = 0; _i117 < _map116.size; ++_i117) + { + String _key118; // required + String _val119; // required + _key118 = iprot.readString(); + _val119 = iprot.readString(); + struct.compression_options.put(_key118, _val119); + } + } + struct.setCompression_optionsIsSet(true); + } + if (incoming.get(17)) { + struct.bloom_filter_fp_chance = iprot.readDouble(); + struct.setBloom_filter_fp_chanceIsSet(true); + } + if (incoming.get(18)) { + struct.caching = iprot.readString(); + struct.setCachingIsSet(true); + } + if (incoming.get(19)) { + struct.dclocal_read_repair_chance = iprot.readDouble(); + struct.setDclocal_read_repair_chanceIsSet(true); + } + if (incoming.get(20)) { + struct.memtable_flush_period_in_ms = iprot.readI32(); + struct.setMemtable_flush_period_in_msIsSet(true); + } + if (incoming.get(21)) { + struct.default_time_to_live = iprot.readI32(); + struct.setDefault_time_to_liveIsSet(true); + } + if (incoming.get(22)) { + struct.index_interval = iprot.readI32(); + struct.setIndex_intervalIsSet(true); + } + if (incoming.get(23)) { + struct.row_cache_size = iprot.readDouble(); + struct.setRow_cache_sizeIsSet(true); + } + if (incoming.get(24)) { + struct.key_cache_size = iprot.readDouble(); + struct.setKey_cache_sizeIsSet(true); + } + if (incoming.get(25)) { + struct.row_cache_save_period_in_seconds = iprot.readI32(); + struct.setRow_cache_save_period_in_secondsIsSet(true); + } + if (incoming.get(26)) { + struct.key_cache_save_period_in_seconds = iprot.readI32(); + struct.setKey_cache_save_period_in_secondsIsSet(true); + } + if (incoming.get(27)) { + struct.memtable_flush_after_mins = iprot.readI32(); + struct.setMemtable_flush_after_minsIsSet(true); + } + if (incoming.get(28)) { + struct.memtable_throughput_in_mb = iprot.readI32(); + struct.setMemtable_throughput_in_mbIsSet(true); + } + if (incoming.get(29)) { + struct.memtable_operations_in_millions = iprot.readDouble(); + struct.setMemtable_operations_in_millionsIsSet(true); + } + if (incoming.get(30)) { + struct.merge_shards_chance = iprot.readDouble(); + struct.setMerge_shards_chanceIsSet(true); + } + if (incoming.get(31)) { + struct.row_cache_provider = iprot.readString(); + struct.setRow_cache_providerIsSet(true); + } + if (incoming.get(32)) { + struct.row_cache_keys_to_save = iprot.readI32(); + struct.setRow_cache_keys_to_saveIsSet(true); + } + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/CfSplit.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/CfSplit.java index 2519f9f4b1..b975e2120d 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/CfSplit.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/CfSplit.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -52,6 +62,12 @@ public class CfSplit implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CfSplitStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CfSplitTupleSchemeFactory()); + } + public String start_token; // required public String end_token; // required public long row_count; // required @@ -122,8 +138,7 @@ public class CfSplit implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -156,8 +171,7 @@ public class CfSplit implements org.apache.thrift.TBaseother. */ public CfSplit(CfSplit other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetStart_token()) { this.start_token = other.start_token; } @@ -238,16 +252,16 @@ public class CfSplit implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CfSplit struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // START_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.start_token = iprot.readString(); + struct.setStart_tokenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // END_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.end_token = iprot.readString(); + struct.setEnd_tokenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // ROW_COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.row_count = iprot.readI64(); + struct.setRow_countIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetRow_count()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'row_count' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, CfSplit struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.start_token != null) { + oprot.writeFieldBegin(START_TOKEN_FIELD_DESC); + oprot.writeString(struct.start_token); + oprot.writeFieldEnd(); + } + if (struct.end_token != null) { + oprot.writeFieldBegin(END_TOKEN_FIELD_DESC); + oprot.writeString(struct.end_token); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(ROW_COUNT_FIELD_DESC); + oprot.writeI64(struct.row_count); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class CfSplitTupleSchemeFactory implements SchemeFactory { + public CfSplitTupleScheme getScheme() { + return new CfSplitTupleScheme(); + } + } + + private static class CfSplitTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CfSplit struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.start_token); + oprot.writeString(struct.end_token); + oprot.writeI64(struct.row_count); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, CfSplit struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.start_token = iprot.readString(); + struct.setStart_tokenIsSet(true); + struct.end_token = iprot.readString(); + struct.setEnd_tokenIsSet(true); + struct.row_count = iprot.readI64(); + struct.setRow_countIsSet(true); + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java index d655124a26..b66f174e9a 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -57,10 +67,16 @@ public class Column implements org.apache.thrift.TBase, 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); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ColumnTupleSchemeFactory()); + } + public ByteBuffer name; // required - public ByteBuffer value; // required - public long timestamp; // required - public int ttl; // required + public ByteBuffer value; // optional + public long timestamp; // optional + public int ttl; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -132,8 +148,8 @@ public class Column implements org.apache.thrift.TBase, // isset id assignments private static final int __TIMESTAMP_ISSET_ID = 0; private static final int __TTL_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - + private byte __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.VALUE,_Fields.TIMESTAMP,_Fields.TTL}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -163,8 +179,7 @@ public class Column implements org.apache.thrift.TBase, * Performs a deep copy on other. */ public Column(Column other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetName()) { this.name = org.apache.thrift.TBaseHelper.copyBinary(other.name); ; @@ -270,16 +285,16 @@ public class Column implements org.apache.thrift.TBase, } public void unsetTimestamp() { - __isset_bit_vector.clear(__TIMESTAMP_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); } /** 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); + return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); } public void setTimestampIsSet(boolean value) { - __isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); } public int getTtl() { @@ -293,16 +308,16 @@ public class Column implements org.apache.thrift.TBase, } public void unsetTtl() { - __isset_bit_vector.clear(__TTL_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TTL_ISSET_ID); } /** 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); + return EncodingUtils.testBit(__isset_bitfield, __TTL_ISSET_ID); } public void setTtlIsSet(boolean value) { - __isset_bit_vector.set(__TTL_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TTL_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -514,84 +529,11 @@ public class Column implements org.apache.thrift.TBase, } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - 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 - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeBinary(this.name); - oprot.writeFieldEnd(); - } - if (this.value != null) { - 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(); - } - if (isSetTtl()) { - oprot.writeFieldBegin(TTL_FIELD_DESC); - oprot.writeI32(this.ttl); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -637,6 +579,7 @@ public class Column implements org.apache.thrift.TBase, if (name == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -650,12 +593,160 @@ public class Column implements org.apache.thrift.TBase, 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); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class ColumnStandardSchemeFactory implements SchemeFactory { + public ColumnStandardScheme getScheme() { + return new ColumnStandardScheme(); + } + } + + private static class ColumnStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Column struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readBinary(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TTL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.ttl = iprot.readI32(); + struct.setTtlIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, Column struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeBinary(struct.name); + oprot.writeFieldEnd(); + } + if (struct.value != null) { + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + } + if (struct.isSetTimestamp()) { + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + } + if (struct.isSetTtl()) { + oprot.writeFieldBegin(TTL_FIELD_DESC); + oprot.writeI32(struct.ttl); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ColumnTupleSchemeFactory implements SchemeFactory { + public ColumnTupleScheme getScheme() { + return new ColumnTupleScheme(); + } + } + + private static class ColumnTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Column struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.name); + BitSet optionals = new BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + if (struct.isSetTimestamp()) { + optionals.set(1); + } + if (struct.isSetTtl()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetValue()) { + oprot.writeBinary(struct.value); + } + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetTtl()) { + oprot.writeI32(struct.ttl); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Column struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.name = iprot.readBinary(); + struct.setNameIsSet(true); + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } + if (incoming.get(1)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(2)) { + struct.ttl = iprot.readI32(); + struct.setTtlIsSet(true); + } + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnDef.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnDef.java index 37d8db6af2..bc27225078 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnDef.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnDef.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -51,15 +61,21 @@ public class ColumnDef implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ColumnDefStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ColumnDefTupleSchemeFactory()); + } + public ByteBuffer name; // required public String validation_class; // required /** * * @see IndexType */ - public IndexType index_type; // required - public String index_name; // required - public Map index_options; // required + public IndexType index_type; // optional + public String index_name; // optional + public Map index_options; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -136,7 +152,7 @@ public class ColumnDef implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -610,118 +626,11 @@ public class ColumnDef implements org.apache.thrift.TBase(2*_map41.size); - for (int _i42 = 0; _i42 < _map41.size; ++_i42) - { - String _key43; // required - String _val44; // required - _key43 = iprot.readString(); - _val44 = iprot.readString(); - this.index_options.put(_key43, _val44); - } - iprot.readMapEnd(); - } - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeBinary(this.name); - oprot.writeFieldEnd(); - } - if (this.validation_class != null) { - oprot.writeFieldBegin(VALIDATION_CLASS_FIELD_DESC); - oprot.writeString(this.validation_class); - oprot.writeFieldEnd(); - } - if (this.index_type != null) { - if (isSetIndex_type()) { - oprot.writeFieldBegin(INDEX_TYPE_FIELD_DESC); - oprot.writeI32(this.index_type.getValue()); - oprot.writeFieldEnd(); - } - } - if (this.index_name != null) { - if (isSetIndex_name()) { - oprot.writeFieldBegin(INDEX_NAME_FIELD_DESC); - oprot.writeString(this.index_name); - oprot.writeFieldEnd(); - } - } - if (this.index_options != null) { - if (isSetIndex_options()) { - oprot.writeFieldBegin(INDEX_OPTIONS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, this.index_options.size())); - for (Map.Entry _iter45 : this.index_options.entrySet()) - { - oprot.writeString(_iter45.getKey()); - oprot.writeString(_iter45.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -786,6 +695,7 @@ public class ColumnDef implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ColumnDef struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readBinary(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // VALIDATION_CLASS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.validation_class = iprot.readString(); + struct.setValidation_classIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // INDEX_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.index_type = IndexType.findByValue(iprot.readI32()); + struct.setIndex_typeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // INDEX_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.index_name = iprot.readString(); + struct.setIndex_nameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // INDEX_OPTIONS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map82 = iprot.readMapBegin(); + struct.index_options = new HashMap(2*_map82.size); + for (int _i83 = 0; _i83 < _map82.size; ++_i83) + { + String _key84; // required + String _val85; // required + _key84 = iprot.readString(); + _val85 = iprot.readString(); + struct.index_options.put(_key84, _val85); + } + iprot.readMapEnd(); + } + struct.setIndex_optionsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, ColumnDef struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeBinary(struct.name); + oprot.writeFieldEnd(); + } + if (struct.validation_class != null) { + oprot.writeFieldBegin(VALIDATION_CLASS_FIELD_DESC); + oprot.writeString(struct.validation_class); + oprot.writeFieldEnd(); + } + if (struct.index_type != null) { + if (struct.isSetIndex_type()) { + oprot.writeFieldBegin(INDEX_TYPE_FIELD_DESC); + oprot.writeI32(struct.index_type.getValue()); + oprot.writeFieldEnd(); + } + } + if (struct.index_name != null) { + if (struct.isSetIndex_name()) { + oprot.writeFieldBegin(INDEX_NAME_FIELD_DESC); + oprot.writeString(struct.index_name); + oprot.writeFieldEnd(); + } + } + if (struct.index_options != null) { + if (struct.isSetIndex_options()) { + oprot.writeFieldBegin(INDEX_OPTIONS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.index_options.size())); + for (Map.Entry _iter86 : struct.index_options.entrySet()) + { + oprot.writeString(_iter86.getKey()); + oprot.writeString(_iter86.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ColumnDefTupleSchemeFactory implements SchemeFactory { + public ColumnDefTupleScheme getScheme() { + return new ColumnDefTupleScheme(); + } + } + + private static class ColumnDefTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ColumnDef struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.name); + oprot.writeString(struct.validation_class); + BitSet optionals = new BitSet(); + if (struct.isSetIndex_type()) { + optionals.set(0); + } + if (struct.isSetIndex_name()) { + optionals.set(1); + } + if (struct.isSetIndex_options()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetIndex_type()) { + oprot.writeI32(struct.index_type.getValue()); + } + if (struct.isSetIndex_name()) { + oprot.writeString(struct.index_name); + } + if (struct.isSetIndex_options()) { + { + oprot.writeI32(struct.index_options.size()); + for (Map.Entry _iter87 : struct.index_options.entrySet()) + { + oprot.writeString(_iter87.getKey()); + oprot.writeString(_iter87.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ColumnDef struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.name = iprot.readBinary(); + struct.setNameIsSet(true); + struct.validation_class = iprot.readString(); + struct.setValidation_classIsSet(true); + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.index_type = IndexType.findByValue(iprot.readI32()); + struct.setIndex_typeIsSet(true); + } + if (incoming.get(1)) { + struct.index_name = iprot.readString(); + struct.setIndex_nameIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TMap _map88 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.index_options = new HashMap(2*_map88.size); + for (int _i89 = 0; _i89 < _map88.size; ++_i89) + { + String _key90; // required + String _val91; // required + _key90 = iprot.readString(); + _val91 = iprot.readString(); + struct.index_options.put(_key90, _val91); + } + } + struct.setIndex_optionsIsSet(true); + } + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnOrSuperColumn.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnOrSuperColumn.java index 2b7f185e6d..8831e3848b 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnOrSuperColumn.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnOrSuperColumn.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -65,10 +75,16 @@ public class ColumnOrSuperColumn implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ColumnOrSuperColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ColumnOrSuperColumnTupleSchemeFactory()); + } + + public Column column; // optional + public SuperColumn super_column; // optional + public CounterColumn counter_column; // optional + public CounterSuperColumn counter_super_column; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -138,7 +154,7 @@ public class ColumnOrSuperColumn implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -492,92 +508,11 @@ public class ColumnOrSuperColumn implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ColumnOrSuperColumn struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.column = new Column(); + struct.column.read(iprot); + struct.setColumnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SUPER_COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.super_column = new SuperColumn(); + struct.super_column.read(iprot); + struct.setSuper_columnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COUNTER_COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.counter_column = new CounterColumn(); + struct.counter_column.read(iprot); + struct.setCounter_columnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // COUNTER_SUPER_COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.counter_super_column = new CounterSuperColumn(); + struct.counter_super_column.read(iprot); + struct.setCounter_super_columnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, ColumnOrSuperColumn struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.column != null) { + if (struct.isSetColumn()) { + oprot.writeFieldBegin(COLUMN_FIELD_DESC); + struct.column.write(oprot); + oprot.writeFieldEnd(); + } + } + if (struct.super_column != null) { + if (struct.isSetSuper_column()) { + oprot.writeFieldBegin(SUPER_COLUMN_FIELD_DESC); + struct.super_column.write(oprot); + oprot.writeFieldEnd(); + } + } + if (struct.counter_column != null) { + if (struct.isSetCounter_column()) { + oprot.writeFieldBegin(COUNTER_COLUMN_FIELD_DESC); + struct.counter_column.write(oprot); + oprot.writeFieldEnd(); + } + } + if (struct.counter_super_column != null) { + if (struct.isSetCounter_super_column()) { + oprot.writeFieldBegin(COUNTER_SUPER_COLUMN_FIELD_DESC); + struct.counter_super_column.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ColumnOrSuperColumnTupleSchemeFactory implements SchemeFactory { + public ColumnOrSuperColumnTupleScheme getScheme() { + return new ColumnOrSuperColumnTupleScheme(); + } + } + + private static class ColumnOrSuperColumnTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ColumnOrSuperColumn struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetColumn()) { + optionals.set(0); + } + if (struct.isSetSuper_column()) { + optionals.set(1); + } + if (struct.isSetCounter_column()) { + optionals.set(2); + } + if (struct.isSetCounter_super_column()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetColumn()) { + struct.column.write(oprot); + } + if (struct.isSetSuper_column()) { + struct.super_column.write(oprot); + } + if (struct.isSetCounter_column()) { + struct.counter_column.write(oprot); + } + if (struct.isSetCounter_super_column()) { + struct.counter_super_column.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ColumnOrSuperColumn struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.column = new Column(); + struct.column.read(iprot); + struct.setColumnIsSet(true); + } + if (incoming.get(1)) { + struct.super_column = new SuperColumn(); + struct.super_column.read(iprot); + struct.setSuper_columnIsSet(true); + } + if (incoming.get(2)) { + struct.counter_column = new CounterColumn(); + struct.counter_column.read(iprot); + struct.setCounter_columnIsSet(true); + } + if (incoming.get(3)) { + struct.counter_super_column = new CounterSuperColumn(); + struct.counter_super_column.read(iprot); + struct.setCounter_super_columnIsSet(true); + } + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnParent.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnParent.java index 40ee56d48d..525a53cad5 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnParent.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnParent.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -54,8 +64,14 @@ public class ColumnParent implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ColumnParentStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ColumnParentTupleSchemeFactory()); + } + public String column_family; // required - public ByteBuffer super_column; // required + public ByteBuffer super_column; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -119,7 +135,7 @@ public class ColumnParent implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -357,58 +373,11 @@ public class ColumnParent implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ColumnParent struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 3: // COLUMN_FAMILY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.column_family = iprot.readString(); + struct.setColumn_familyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // SUPER_COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.super_column = iprot.readBinary(); + struct.setSuper_columnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, ColumnParent struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.column_family != null) { + oprot.writeFieldBegin(COLUMN_FAMILY_FIELD_DESC); + oprot.writeString(struct.column_family); + oprot.writeFieldEnd(); + } + if (struct.super_column != null) { + if (struct.isSetSuper_column()) { + oprot.writeFieldBegin(SUPER_COLUMN_FIELD_DESC); + oprot.writeBinary(struct.super_column); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ColumnParentTupleSchemeFactory implements SchemeFactory { + public ColumnParentTupleScheme getScheme() { + return new ColumnParentTupleScheme(); + } + } + + private static class ColumnParentTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ColumnParent struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.column_family); + BitSet optionals = new BitSet(); + if (struct.isSetSuper_column()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuper_column()) { + oprot.writeBinary(struct.super_column); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ColumnParent struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.column_family = iprot.readString(); + struct.setColumn_familyIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.super_column = iprot.readBinary(); + struct.setSuper_columnIsSet(true); + } + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnPath.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnPath.java index c25e238f25..288c4d5efd 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnPath.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnPath.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -59,9 +69,15 @@ public class ColumnPath implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ColumnPathStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ColumnPathTupleSchemeFactory()); + } + public String column_family; // required - public ByteBuffer super_column; // required - public ByteBuffer column; // required + public ByteBuffer super_column; // optional + public ByteBuffer column; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -128,7 +144,7 @@ public class ColumnPath implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -444,72 +460,11 @@ public class ColumnPath implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ColumnPath struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 3: // COLUMN_FAMILY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.column_family = iprot.readString(); + struct.setColumn_familyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // SUPER_COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.super_column = iprot.readBinary(); + struct.setSuper_columnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, ColumnPath struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.column_family != null) { + oprot.writeFieldBegin(COLUMN_FAMILY_FIELD_DESC); + oprot.writeString(struct.column_family); + oprot.writeFieldEnd(); + } + if (struct.super_column != null) { + if (struct.isSetSuper_column()) { + oprot.writeFieldBegin(SUPER_COLUMN_FIELD_DESC); + oprot.writeBinary(struct.super_column); + oprot.writeFieldEnd(); + } + } + if (struct.column != null) { + if (struct.isSetColumn()) { + oprot.writeFieldBegin(COLUMN_FIELD_DESC); + oprot.writeBinary(struct.column); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ColumnPathTupleSchemeFactory implements SchemeFactory { + public ColumnPathTupleScheme getScheme() { + return new ColumnPathTupleScheme(); + } + } + + private static class ColumnPathTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ColumnPath struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.column_family); + BitSet optionals = new BitSet(); + if (struct.isSetSuper_column()) { + optionals.set(0); + } + if (struct.isSetColumn()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuper_column()) { + oprot.writeBinary(struct.super_column); + } + if (struct.isSetColumn()) { + oprot.writeBinary(struct.column); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ColumnPath struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.column_family = iprot.readString(); + struct.setColumn_familyIsSet(true); + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.super_column = iprot.readBinary(); + struct.setSuper_columnIsSet(true); + } + if (incoming.get(1)) { + struct.column = iprot.readBinary(); + struct.setColumnIsSet(true); + } + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/Compression.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/Compression.java index 453a8a2ec7..607ad32b35 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/Compression.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/Compression.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/ConsistencyLevel.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/ConsistencyLevel.java index 2f4cf50d6a..8386797710 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/ConsistencyLevel.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/ConsistencyLevel.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/CounterColumn.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/CounterColumn.java index 7d90872efa..1535653f52 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/CounterColumn.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/CounterColumn.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -48,6 +58,12 @@ public class CounterColumn implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CounterColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CounterColumnTupleSchemeFactory()); + } + public ByteBuffer name; // required public long value; // required @@ -114,8 +130,7 @@ public class CounterColumn implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -144,8 +159,7 @@ public class CounterColumn implements org.apache.thrift.TBaseother. */ public CounterColumn(CounterColumn other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetName()) { this.name = org.apache.thrift.TBaseHelper.copyBinary(other.name); ; @@ -209,16 +223,16 @@ public class CounterColumn implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CounterColumn struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readBinary(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.value = iprot.readI64(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetValue()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'value' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, CounterColumn struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeBinary(struct.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeI64(struct.value); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class CounterColumnTupleSchemeFactory implements SchemeFactory { + public CounterColumnTupleScheme getScheme() { + return new CounterColumnTupleScheme(); + } + } + + private static class CounterColumnTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CounterColumn struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.name); + oprot.writeI64(struct.value); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, CounterColumn struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.name = iprot.readBinary(); + struct.setNameIsSet(true); + struct.value = iprot.readI64(); + struct.setValueIsSet(true); + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/CounterSuperColumn.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/CounterSuperColumn.java index ce15984b09..ea719cc908 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/CounterSuperColumn.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/CounterSuperColumn.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -48,6 +58,12 @@ public class CounterSuperColumn implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CounterSuperColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CounterSuperColumnTupleSchemeFactory()); + } + public ByteBuffer name; // required public List columns; // required @@ -113,7 +129,6 @@ public class CounterSuperColumn implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -373,74 +388,11 @@ public class CounterSuperColumn implements org.apache.thrift.TBase(_list4.size); - for (int _i5 = 0; _i5 < _list4.size; ++_i5) - { - CounterColumn _elem6; // required - _elem6 = new CounterColumn(); - _elem6.read(iprot); - this.columns.add(_elem6); - } - iprot.readListEnd(); - } - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeBinary(this.name); - oprot.writeFieldEnd(); - } - if (this.columns != null) { - oprot.writeFieldBegin(COLUMNS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.columns.size())); - for (CounterColumn _iter7 : this.columns) - { - _iter7.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -475,6 +427,7 @@ public class CounterSuperColumn implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CounterSuperColumn struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readBinary(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); + struct.columns = new ArrayList(_list8.size); + for (int _i9 = 0; _i9 < _list8.size; ++_i9) + { + CounterColumn _elem10; // required + _elem10 = new CounterColumn(); + _elem10.read(iprot); + struct.columns.add(_elem10); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, CounterSuperColumn struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeBinary(struct.name); + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); + for (CounterColumn _iter11 : struct.columns) + { + _iter11.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class CounterSuperColumnTupleSchemeFactory implements SchemeFactory { + public CounterSuperColumnTupleScheme getScheme() { + return new CounterSuperColumnTupleScheme(); + } + } + + private static class CounterSuperColumnTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CounterSuperColumn struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.name); + { + oprot.writeI32(struct.columns.size()); + for (CounterColumn _iter12 : struct.columns) + { + _iter12.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, CounterSuperColumn struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.name = iprot.readBinary(); + struct.setNameIsSet(true); + { + org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columns = new ArrayList(_list13.size); + for (int _i14 = 0; _i14 < _list13.size; ++_i14) + { + CounterColumn _elem15; // required + _elem15 = new CounterColumn(); + _elem15.read(iprot); + struct.columns.add(_elem15); + } + } + struct.setColumnsIsSet(true); + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlMetadata.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlMetadata.java index f7df6b66f4..6af8e9e547 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlMetadata.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlMetadata.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -50,6 +60,12 @@ public class CqlMetadata implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CqlMetadataStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CqlMetadataTupleSchemeFactory()); + } + public Map name_types; // required public Map value_types; // required public String default_name_type; // required @@ -123,7 +139,6 @@ public class CqlMetadata implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -542,120 +557,11 @@ public class CqlMetadata implements org.apache.thrift.TBase(2*_map73.size); - for (int _i74 = 0; _i74 < _map73.size; ++_i74) - { - ByteBuffer _key75; // required - String _val76; // required - _key75 = iprot.readBinary(); - _val76 = iprot.readString(); - this.name_types.put(_key75, _val76); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // VALUE_TYPES - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map77 = iprot.readMapBegin(); - this.value_types = new HashMap(2*_map77.size); - for (int _i78 = 0; _i78 < _map77.size; ++_i78) - { - ByteBuffer _key79; // required - String _val80; // required - _key79 = iprot.readBinary(); - _val80 = iprot.readString(); - this.value_types.put(_key79, _val80); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // DEFAULT_NAME_TYPE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.default_name_type = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // DEFAULT_VALUE_TYPE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.default_value_type = 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.name_types != null) { - oprot.writeFieldBegin(NAME_TYPES_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, this.name_types.size())); - for (Map.Entry _iter81 : this.name_types.entrySet()) - { - oprot.writeBinary(_iter81.getKey()); - oprot.writeString(_iter81.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - if (this.value_types != null) { - oprot.writeFieldBegin(VALUE_TYPES_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, this.value_types.size())); - for (Map.Entry _iter82 : this.value_types.entrySet()) - { - oprot.writeBinary(_iter82.getKey()); - oprot.writeString(_iter82.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - if (this.default_name_type != null) { - oprot.writeFieldBegin(DEFAULT_NAME_TYPE_FIELD_DESC); - oprot.writeString(this.default_name_type); - oprot.writeFieldEnd(); - } - if (this.default_value_type != null) { - oprot.writeFieldBegin(DEFAULT_VALUE_TYPE_FIELD_DESC); - oprot.writeString(this.default_value_type); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -712,6 +618,7 @@ public class CqlMetadata implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CqlMetadata struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // NAME_TYPES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map146 = iprot.readMapBegin(); + struct.name_types = new HashMap(2*_map146.size); + for (int _i147 = 0; _i147 < _map146.size; ++_i147) + { + ByteBuffer _key148; // required + String _val149; // required + _key148 = iprot.readBinary(); + _val149 = iprot.readString(); + struct.name_types.put(_key148, _val149); + } + iprot.readMapEnd(); + } + struct.setName_typesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // VALUE_TYPES + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map150 = iprot.readMapBegin(); + struct.value_types = new HashMap(2*_map150.size); + for (int _i151 = 0; _i151 < _map150.size; ++_i151) + { + ByteBuffer _key152; // required + String _val153; // required + _key152 = iprot.readBinary(); + _val153 = iprot.readString(); + struct.value_types.put(_key152, _val153); + } + iprot.readMapEnd(); + } + struct.setValue_typesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // DEFAULT_NAME_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.default_name_type = iprot.readString(); + struct.setDefault_name_typeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // DEFAULT_VALUE_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.default_value_type = iprot.readString(); + struct.setDefault_value_typeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, CqlMetadata struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name_types != null) { + oprot.writeFieldBegin(NAME_TYPES_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.name_types.size())); + for (Map.Entry _iter154 : struct.name_types.entrySet()) + { + oprot.writeBinary(_iter154.getKey()); + oprot.writeString(_iter154.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.value_types != null) { + oprot.writeFieldBegin(VALUE_TYPES_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.value_types.size())); + for (Map.Entry _iter155 : struct.value_types.entrySet()) + { + oprot.writeBinary(_iter155.getKey()); + oprot.writeString(_iter155.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.default_name_type != null) { + oprot.writeFieldBegin(DEFAULT_NAME_TYPE_FIELD_DESC); + oprot.writeString(struct.default_name_type); + oprot.writeFieldEnd(); + } + if (struct.default_value_type != null) { + oprot.writeFieldBegin(DEFAULT_VALUE_TYPE_FIELD_DESC); + oprot.writeString(struct.default_value_type); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class CqlMetadataTupleSchemeFactory implements SchemeFactory { + public CqlMetadataTupleScheme getScheme() { + return new CqlMetadataTupleScheme(); + } + } + + private static class CqlMetadataTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CqlMetadata struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.name_types.size()); + for (Map.Entry _iter156 : struct.name_types.entrySet()) + { + oprot.writeBinary(_iter156.getKey()); + oprot.writeString(_iter156.getValue()); + } + } + { + oprot.writeI32(struct.value_types.size()); + for (Map.Entry _iter157 : struct.value_types.entrySet()) + { + oprot.writeBinary(_iter157.getKey()); + oprot.writeString(_iter157.getValue()); + } + } + oprot.writeString(struct.default_name_type); + oprot.writeString(struct.default_value_type); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, CqlMetadata struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TMap _map158 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.name_types = new HashMap(2*_map158.size); + for (int _i159 = 0; _i159 < _map158.size; ++_i159) + { + ByteBuffer _key160; // required + String _val161; // required + _key160 = iprot.readBinary(); + _val161 = iprot.readString(); + struct.name_types.put(_key160, _val161); + } + } + struct.setName_typesIsSet(true); + { + org.apache.thrift.protocol.TMap _map162 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.value_types = new HashMap(2*_map162.size); + for (int _i163 = 0; _i163 < _map162.size; ++_i163) + { + ByteBuffer _key164; // required + String _val165; // required + _key164 = iprot.readBinary(); + _val165 = iprot.readString(); + struct.value_types.put(_key164, _val165); + } + } + struct.setValue_typesIsSet(true); + struct.default_name_type = iprot.readString(); + struct.setDefault_name_typeIsSet(true); + struct.default_value_type = iprot.readString(); + struct.setDefault_value_typeIsSet(true); + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlPreparedResult.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlPreparedResult.java index 25e5f0ffcf..7d3460c4e9 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlPreparedResult.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlPreparedResult.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -50,10 +60,16 @@ public class CqlPreparedResult implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CqlPreparedResultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CqlPreparedResultTupleSchemeFactory()); + } + public int itemId; // required public int count; // required - public List variable_types; // required - public List variable_names; // required + public List variable_types; // optional + public List variable_names; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -125,8 +141,8 @@ public class CqlPreparedResult implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -162,8 +178,7 @@ public class CqlPreparedResult implements org.apache.thrift.TBaseother. */ public CqlPreparedResult(CqlPreparedResult other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.itemId = other.itemId; this.count = other.count; if (other.isSetVariable_types()) { @@ -207,16 +222,16 @@ public class CqlPreparedResult implements org.apache.thrift.TBase(_list87.size); - for (int _i88 = 0; _i88 < _list87.size; ++_i88) - { - String _elem89; // required - _elem89 = iprot.readString(); - this.variable_types.add(_elem89); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // VARIABLE_NAMES - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list90 = iprot.readListBegin(); - this.variable_names = new ArrayList(_list90.size); - for (int _i91 = 0; _i91 < _list90.size; ++_i91) - { - String _elem92; // required - _elem92 = iprot.readString(); - this.variable_names.add(_elem92); - } - iprot.readListEnd(); - } - } 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 (!isSetItemId()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'itemId' was not found in serialized data! Struct: " + toString()); - } - if (!isSetCount()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'count' was not found in serialized data! Struct: " + toString()); - } - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ITEM_ID_FIELD_DESC); - oprot.writeI32(this.itemId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(COUNT_FIELD_DESC); - oprot.writeI32(this.count); - oprot.writeFieldEnd(); - if (this.variable_types != null) { - if (isSetVariable_types()) { - oprot.writeFieldBegin(VARIABLE_TYPES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.variable_types.size())); - for (String _iter93 : this.variable_types) - { - oprot.writeString(_iter93); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - if (this.variable_names != null) { - if (isSetVariable_names()) { - oprot.writeFieldBegin(VARIABLE_NAMES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.variable_names.size())); - for (String _iter94 : this.variable_names) - { - oprot.writeString(_iter94); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -687,6 +591,7 @@ public class CqlPreparedResult implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CqlPreparedResult struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // ITEM_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.itemId = iprot.readI32(); + struct.setItemIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.count = iprot.readI32(); + struct.setCountIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // VARIABLE_TYPES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list174 = iprot.readListBegin(); + struct.variable_types = new ArrayList(_list174.size); + for (int _i175 = 0; _i175 < _list174.size; ++_i175) + { + String _elem176; // required + _elem176 = iprot.readString(); + struct.variable_types.add(_elem176); + } + iprot.readListEnd(); + } + struct.setVariable_typesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // VARIABLE_NAMES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list177 = iprot.readListBegin(); + struct.variable_names = new ArrayList(_list177.size); + for (int _i178 = 0; _i178 < _list177.size; ++_i178) + { + String _elem179; // required + _elem179 = iprot.readString(); + struct.variable_names.add(_elem179); + } + iprot.readListEnd(); + } + struct.setVariable_namesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetItemId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'itemId' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetCount()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'count' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, CqlPreparedResult struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ITEM_ID_FIELD_DESC); + oprot.writeI32(struct.itemId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(COUNT_FIELD_DESC); + oprot.writeI32(struct.count); + oprot.writeFieldEnd(); + if (struct.variable_types != null) { + if (struct.isSetVariable_types()) { + oprot.writeFieldBegin(VARIABLE_TYPES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.variable_types.size())); + for (String _iter180 : struct.variable_types) + { + oprot.writeString(_iter180); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.variable_names != null) { + if (struct.isSetVariable_names()) { + oprot.writeFieldBegin(VARIABLE_NAMES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.variable_names.size())); + for (String _iter181 : struct.variable_names) + { + oprot.writeString(_iter181); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class CqlPreparedResultTupleSchemeFactory implements SchemeFactory { + public CqlPreparedResultTupleScheme getScheme() { + return new CqlPreparedResultTupleScheme(); + } + } + + private static class CqlPreparedResultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CqlPreparedResult struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.itemId); + oprot.writeI32(struct.count); + BitSet optionals = new BitSet(); + if (struct.isSetVariable_types()) { + optionals.set(0); + } + if (struct.isSetVariable_names()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetVariable_types()) { + { + oprot.writeI32(struct.variable_types.size()); + for (String _iter182 : struct.variable_types) + { + oprot.writeString(_iter182); + } + } + } + if (struct.isSetVariable_names()) { + { + oprot.writeI32(struct.variable_names.size()); + for (String _iter183 : struct.variable_names) + { + oprot.writeString(_iter183); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, CqlPreparedResult struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.itemId = iprot.readI32(); + struct.setItemIdIsSet(true); + struct.count = iprot.readI32(); + struct.setCountIsSet(true); + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list184 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.variable_types = new ArrayList(_list184.size); + for (int _i185 = 0; _i185 < _list184.size; ++_i185) + { + String _elem186; // required + _elem186 = iprot.readString(); + struct.variable_types.add(_elem186); + } + } + struct.setVariable_typesIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list187 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.variable_names = new ArrayList(_list187.size); + for (int _i188 = 0; _i188 < _list187.size; ++_i188) + { + String _elem189; // required + _elem189 = iprot.readString(); + struct.variable_names.add(_elem189); + } + } + struct.setVariable_namesIsSet(true); + } + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlResult.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlResult.java index 7c0129fb32..53afbaa80f 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlResult.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlResult.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -50,14 +60,20 @@ public class CqlResult implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CqlResultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CqlResultTupleSchemeFactory()); + } + /** * * @see CqlResultType */ public CqlResultType type; // required - public List rows; // required - public int num; // required - public CqlMetadata schema; // required + public List rows; // optional + public int num; // optional + public CqlMetadata schema; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -132,8 +148,8 @@ public class CqlResult implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -164,8 +180,7 @@ public class CqlResult implements org.apache.thrift.TBaseother. */ public CqlResult(CqlResult other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetType()) { this.type = other.type; } @@ -277,16 +292,16 @@ public class CqlResult implements org.apache.thrift.TBase(_list83.size); - for (int _i84 = 0; _i84 < _list83.size; ++_i84) - { - CqlRow _elem85; // required - _elem85 = new CqlRow(); - _elem85.read(iprot); - this.rows.add(_elem85); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // NUM - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.num = iprot.readI32(); - setNumIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // SCHEMA - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.schema = new CqlMetadata(); - this.schema.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.type != null) { - oprot.writeFieldBegin(TYPE_FIELD_DESC); - oprot.writeI32(this.type.getValue()); - oprot.writeFieldEnd(); - } - if (this.rows != null) { - if (isSetRows()) { - oprot.writeFieldBegin(ROWS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.rows.size())); - for (CqlRow _iter86 : this.rows) - { - _iter86.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - if (isSetNum()) { - oprot.writeFieldBegin(NUM_FIELD_DESC); - oprot.writeI32(this.num); - oprot.writeFieldEnd(); - } - if (this.schema != null) { - if (isSetSchema()) { - oprot.writeFieldBegin(SCHEMA_FIELD_DESC); - this.schema.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -669,6 +591,10 @@ public class CqlResult implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CqlResult struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.type = CqlResultType.findByValue(iprot.readI32()); + struct.setTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list166 = iprot.readListBegin(); + struct.rows = new ArrayList(_list166.size); + for (int _i167 = 0; _i167 < _list166.size; ++_i167) + { + CqlRow _elem168; // required + _elem168 = new CqlRow(); + _elem168.read(iprot); + struct.rows.add(_elem168); + } + iprot.readListEnd(); + } + struct.setRowsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // NUM + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.num = iprot.readI32(); + struct.setNumIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // SCHEMA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.schema = new CqlMetadata(); + struct.schema.read(iprot); + struct.setSchemaIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, CqlResult struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.type != null) { + oprot.writeFieldBegin(TYPE_FIELD_DESC); + oprot.writeI32(struct.type.getValue()); + oprot.writeFieldEnd(); + } + if (struct.rows != null) { + if (struct.isSetRows()) { + oprot.writeFieldBegin(ROWS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.rows.size())); + for (CqlRow _iter169 : struct.rows) + { + _iter169.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.isSetNum()) { + oprot.writeFieldBegin(NUM_FIELD_DESC); + oprot.writeI32(struct.num); + oprot.writeFieldEnd(); + } + if (struct.schema != null) { + if (struct.isSetSchema()) { + oprot.writeFieldBegin(SCHEMA_FIELD_DESC); + struct.schema.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class CqlResultTupleSchemeFactory implements SchemeFactory { + public CqlResultTupleScheme getScheme() { + return new CqlResultTupleScheme(); + } + } + + private static class CqlResultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CqlResult struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.type.getValue()); + BitSet optionals = new BitSet(); + if (struct.isSetRows()) { + optionals.set(0); + } + if (struct.isSetNum()) { + optionals.set(1); + } + if (struct.isSetSchema()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetRows()) { + { + oprot.writeI32(struct.rows.size()); + for (CqlRow _iter170 : struct.rows) + { + _iter170.write(oprot); + } + } + } + if (struct.isSetNum()) { + oprot.writeI32(struct.num); + } + if (struct.isSetSchema()) { + struct.schema.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, CqlResult struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.type = CqlResultType.findByValue(iprot.readI32()); + struct.setTypeIsSet(true); + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list171 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.rows = new ArrayList(_list171.size); + for (int _i172 = 0; _i172 < _list171.size; ++_i172) + { + CqlRow _elem173; // required + _elem173 = new CqlRow(); + _elem173.read(iprot); + struct.rows.add(_elem173); + } + } + struct.setRowsIsSet(true); + } + if (incoming.get(1)) { + struct.num = iprot.readI32(); + struct.setNumIsSet(true); + } + if (incoming.get(2)) { + struct.schema = new CqlMetadata(); + struct.schema.read(iprot); + struct.setSchemaIsSet(true); + } + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlResultType.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlResultType.java index 09c37b2033..524d67bbc7 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlResultType.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlResultType.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlRow.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlRow.java index df7ec85951..8fce2e1f14 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlRow.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/CqlRow.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -51,6 +61,12 @@ public class CqlRow implements org.apache.thrift.TBase, private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CqlRowStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CqlRowTupleSchemeFactory()); + } + public ByteBuffer key; // required public List columns; // required @@ -116,7 +132,6 @@ public class CqlRow implements org.apache.thrift.TBase, } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -376,74 +391,11 @@ public class CqlRow implements org.apache.thrift.TBase, } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.key = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COLUMNS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list69 = iprot.readListBegin(); - this.columns = new ArrayList(_list69.size); - for (int _i70 = 0; _i70 < _list69.size; ++_i70) - { - Column _elem71; // required - _elem71 = new Column(); - _elem71.read(iprot); - this.columns.add(_elem71); - } - iprot.readListEnd(); - } - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeBinary(this.key); - oprot.writeFieldEnd(); - } - if (this.columns != null) { - oprot.writeFieldBegin(COLUMNS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.columns.size())); - for (Column _iter72 : this.columns) - { - _iter72.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -478,6 +430,7 @@ public class CqlRow implements org.apache.thrift.TBase, if (columns == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'columns' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -496,5 +449,129 @@ public class CqlRow implements org.apache.thrift.TBase, } } + private static class CqlRowStandardSchemeFactory implements SchemeFactory { + public CqlRowStandardScheme getScheme() { + return new CqlRowStandardScheme(); + } + } + + private static class CqlRowStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CqlRow struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list138 = iprot.readListBegin(); + struct.columns = new ArrayList(_list138.size); + for (int _i139 = 0; _i139 < _list138.size; ++_i139) + { + Column _elem140; // required + _elem140 = new Column(); + _elem140.read(iprot); + struct.columns.add(_elem140); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, CqlRow struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.key != null) { + oprot.writeFieldBegin(KEY_FIELD_DESC); + oprot.writeBinary(struct.key); + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); + for (Column _iter141 : struct.columns) + { + _iter141.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class CqlRowTupleSchemeFactory implements SchemeFactory { + public CqlRowTupleScheme getScheme() { + return new CqlRowTupleScheme(); + } + } + + private static class CqlRowTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CqlRow struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.key); + { + oprot.writeI32(struct.columns.size()); + for (Column _iter142 : struct.columns) + { + _iter142.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, CqlRow struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + { + org.apache.thrift.protocol.TList _list143 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columns = new ArrayList(_list143.size); + for (int _i144 = 0; _i144 < _list143.size; ++_i144) + { + Column _elem145; // required + _elem145 = new Column(); + _elem145.read(iprot); + struct.columns.add(_elem145); + } + } + struct.setColumnsIsSet(true); + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/Deletion.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/Deletion.java index 180a2b3fdb..c98aab6f63 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/Deletion.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/Deletion.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -52,9 +62,15 @@ public class Deletion implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new DeletionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new DeletionTupleSchemeFactory()); + } + + public long timestamp; // optional + public ByteBuffer super_column; // optional + public SlicePredicate predicate; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -122,8 +138,8 @@ public class Deletion implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -144,8 +160,7 @@ public class Deletion implements org.apache.thrift.TBaseother. */ public Deletion(Deletion other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.timestamp = other.timestamp; if (other.isSetSuper_column()) { this.super_column = org.apache.thrift.TBaseHelper.copyBinary(other.super_column); @@ -179,16 +194,16 @@ public class Deletion implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Deletion struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TIMESTAMP + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SUPER_COLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.super_column = iprot.readBinary(); + struct.setSuper_columnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PREDICATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.predicate = new SlicePredicate(); + struct.predicate.read(iprot); + struct.setPredicateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, Deletion struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetTimestamp()) { + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); + oprot.writeI64(struct.timestamp); + oprot.writeFieldEnd(); + } + if (struct.super_column != null) { + if (struct.isSetSuper_column()) { + oprot.writeFieldBegin(SUPER_COLUMN_FIELD_DESC); + oprot.writeBinary(struct.super_column); + oprot.writeFieldEnd(); + } + } + if (struct.predicate != null) { + if (struct.isSetPredicate()) { + oprot.writeFieldBegin(PREDICATE_FIELD_DESC); + struct.predicate.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class DeletionTupleSchemeFactory implements SchemeFactory { + public DeletionTupleScheme getScheme() { + return new DeletionTupleScheme(); + } + } + + private static class DeletionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Deletion struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTimestamp()) { + optionals.set(0); + } + if (struct.isSetSuper_column()) { + optionals.set(1); + } + if (struct.isSetPredicate()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetTimestamp()) { + oprot.writeI64(struct.timestamp); + } + if (struct.isSetSuper_column()) { + oprot.writeBinary(struct.super_column); + } + if (struct.isSetPredicate()) { + struct.predicate.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Deletion struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.timestamp = iprot.readI64(); + struct.setTimestampIsSet(true); + } + if (incoming.get(1)) { + struct.super_column = iprot.readBinary(); + struct.setSuper_columnIsSet(true); + } + if (incoming.get(2)) { + struct.predicate = new SlicePredicate(); + struct.predicate.read(iprot); + struct.setPredicateIsSet(true); + } + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/EndpointDetails.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/EndpointDetails.java index 125b1592aa..7654e9e0b9 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/EndpointDetails.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/EndpointDetails.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -49,9 +59,15 @@ public class EndpointDetails implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new EndpointDetailsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new EndpointDetailsTupleSchemeFactory()); + } + public String host; // required public String datacenter; // required - public String rack; // required + public String rack; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -118,7 +134,7 @@ public class EndpointDetails implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -414,70 +430,11 @@ public class EndpointDetails implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, EndpointDetails struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // HOST + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.host = iprot.readString(); + struct.setHostIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // DATACENTER + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.datacenter = iprot.readString(); + struct.setDatacenterIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // RACK + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.rack = iprot.readString(); + struct.setRackIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, EndpointDetails struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.host != null) { + oprot.writeFieldBegin(HOST_FIELD_DESC); + oprot.writeString(struct.host); + oprot.writeFieldEnd(); + } + if (struct.datacenter != null) { + oprot.writeFieldBegin(DATACENTER_FIELD_DESC); + oprot.writeString(struct.datacenter); + oprot.writeFieldEnd(); + } + if (struct.rack != null) { + if (struct.isSetRack()) { + oprot.writeFieldBegin(RACK_FIELD_DESC); + oprot.writeString(struct.rack); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class EndpointDetailsTupleSchemeFactory implements SchemeFactory { + public EndpointDetailsTupleScheme getScheme() { + return new EndpointDetailsTupleScheme(); + } + } + + private static class EndpointDetailsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, EndpointDetails struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetHost()) { + optionals.set(0); + } + if (struct.isSetDatacenter()) { + optionals.set(1); + } + if (struct.isSetRack()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetHost()) { + oprot.writeString(struct.host); + } + if (struct.isSetDatacenter()) { + oprot.writeString(struct.datacenter); + } + if (struct.isSetRack()) { + oprot.writeString(struct.rack); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, EndpointDetails struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.host = iprot.readString(); + struct.setHostIsSet(true); + } + if (incoming.get(1)) { + struct.datacenter = iprot.readString(); + struct.setDatacenterIsSet(true); + } + if (incoming.get(2)) { + struct.rack = iprot.readString(); + struct.setRackIsSet(true); + } + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexClause.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexClause.java index 76c2606d66..499a081152 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexClause.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexClause.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -52,6 +62,12 @@ public class IndexClause implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new IndexClauseStandardSchemeFactory()); + schemes.put(TupleScheme.class, new IndexClauseTupleSchemeFactory()); + } + public List expressions; // required public ByteBuffer start_key; // required public int count; // required @@ -122,8 +138,7 @@ public class IndexClause implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -159,8 +174,7 @@ public class IndexClause implements org.apache.thrift.TBaseother. */ public IndexClause(IndexClause other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetExpressions()) { List __this__expressions = new ArrayList(); for (IndexExpression other_element : other.expressions) { @@ -271,16 +285,16 @@ public class IndexClause implements org.apache.thrift.TBase(_list12.size); - for (int _i13 = 0; _i13 < _list12.size; ++_i13) - { - IndexExpression _elem14; // required - _elem14 = new IndexExpression(); - _elem14.read(iprot); - this.expressions.add(_elem14); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // START_KEY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.start_key = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // COUNT - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.count = iprot.readI32(); - setCountIsSet(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 (!isSetCount()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'count' was not found in serialized data! Struct: " + toString()); - } - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.expressions != null) { - oprot.writeFieldBegin(EXPRESSIONS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.expressions.size())); - for (IndexExpression _iter15 : this.expressions) - { - _iter15.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (this.start_key != null) { - oprot.writeFieldBegin(START_KEY_FIELD_DESC); - oprot.writeBinary(this.start_key); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(COUNT_FIELD_DESC); - oprot.writeI32(this.count); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -576,6 +513,7 @@ public class IndexClause implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, IndexClause struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // EXPRESSIONS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list24 = iprot.readListBegin(); + struct.expressions = new ArrayList(_list24.size); + for (int _i25 = 0; _i25 < _list24.size; ++_i25) + { + IndexExpression _elem26; // required + _elem26 = new IndexExpression(); + _elem26.read(iprot); + struct.expressions.add(_elem26); + } + iprot.readListEnd(); + } + struct.setExpressionsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // START_KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.start_key = iprot.readBinary(); + struct.setStart_keyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.count = iprot.readI32(); + struct.setCountIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetCount()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'count' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, IndexClause struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.expressions != null) { + oprot.writeFieldBegin(EXPRESSIONS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.expressions.size())); + for (IndexExpression _iter27 : struct.expressions) + { + _iter27.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.start_key != null) { + oprot.writeFieldBegin(START_KEY_FIELD_DESC); + oprot.writeBinary(struct.start_key); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(COUNT_FIELD_DESC); + oprot.writeI32(struct.count); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class IndexClauseTupleSchemeFactory implements SchemeFactory { + public IndexClauseTupleScheme getScheme() { + return new IndexClauseTupleScheme(); + } + } + + private static class IndexClauseTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, IndexClause struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.expressions.size()); + for (IndexExpression _iter28 : struct.expressions) + { + _iter28.write(oprot); + } + } + oprot.writeBinary(struct.start_key); + oprot.writeI32(struct.count); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, IndexClause struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.expressions = new ArrayList(_list29.size); + for (int _i30 = 0; _i30 < _list29.size; ++_i30) + { + IndexExpression _elem31; // required + _elem31 = new IndexExpression(); + _elem31.read(iprot); + struct.expressions.add(_elem31); + } + } + struct.setExpressionsIsSet(true); + struct.start_key = iprot.readBinary(); + struct.setStart_keyIsSet(true); + struct.count = iprot.readI32(); + struct.setCountIsSet(true); + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexExpression.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexExpression.java index 43b89a84b9..0622fd4a29 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexExpression.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexExpression.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -49,6 +59,12 @@ public class IndexExpression implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new IndexExpressionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new IndexExpressionTupleSchemeFactory()); + } + public ByteBuffer column_name; // required /** * @@ -126,7 +142,6 @@ public class IndexExpression implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -454,68 +469,11 @@ public class IndexExpression implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, IndexExpression struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // COLUMN_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.column_name = iprot.readBinary(); + struct.setColumn_nameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // OP + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.op = IndexOperator.findByValue(iprot.readI32()); + struct.setOpIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, IndexExpression struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.column_name != null) { + oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); + oprot.writeBinary(struct.column_name); + oprot.writeFieldEnd(); + } + if (struct.op != null) { + oprot.writeFieldBegin(OP_FIELD_DESC); + oprot.writeI32(struct.op.getValue()); + oprot.writeFieldEnd(); + } + if (struct.value != null) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBinary(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class IndexExpressionTupleSchemeFactory implements SchemeFactory { + public IndexExpressionTupleScheme getScheme() { + return new IndexExpressionTupleScheme(); + } + } + + private static class IndexExpressionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, IndexExpression struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.column_name); + oprot.writeI32(struct.op.getValue()); + oprot.writeBinary(struct.value); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, IndexExpression struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.column_name = iprot.readBinary(); + struct.setColumn_nameIsSet(true); + struct.op = IndexOperator.findByValue(iprot.readI32()); + struct.setOpIsSet(true); + struct.value = iprot.readBinary(); + struct.setValueIsSet(true); + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexOperator.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexOperator.java index c5d29e3b67..a35e089744 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexOperator.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexOperator.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexType.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexType.java index 283fa7103c..6bdf7dbe14 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexType.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexType.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java index 7ee266be3a..1344ba6251 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -46,11 +56,17 @@ import org.slf4j.LoggerFactory; * Invalid request could mean keyspace or column family does not exist, required parameters are missing, or a parameter is malformed. * why contains an associated error message. */ -public class InvalidRequestException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class InvalidRequestException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InvalidRequestException"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new InvalidRequestExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new InvalidRequestExceptionTupleSchemeFactory()); + } + public String why; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -112,7 +128,6 @@ public class InvalidRequestException extends Exception implements org.apache.thr } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -272,44 +287,11 @@ public class InvalidRequestException extends Exception implements org.apache.thr } 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 == org.apache.thrift.protocol.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); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.why != null) { - oprot.writeFieldBegin(WHY_FIELD_DESC); - oprot.writeString(this.why); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -333,6 +315,7 @@ public class InvalidRequestException extends Exception implements org.apache.thr if (why == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'why' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -351,5 +334,79 @@ public class InvalidRequestException extends Exception implements org.apache.thr } } + private static class InvalidRequestExceptionStandardSchemeFactory implements SchemeFactory { + public InvalidRequestExceptionStandardScheme getScheme() { + return new InvalidRequestExceptionStandardScheme(); + } + } + + private static class InvalidRequestExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, InvalidRequestException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // WHY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.why = iprot.readString(); + struct.setWhyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, InvalidRequestException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.why != null) { + oprot.writeFieldBegin(WHY_FIELD_DESC); + oprot.writeString(struct.why); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class InvalidRequestExceptionTupleSchemeFactory implements SchemeFactory { + public InvalidRequestExceptionTupleScheme getScheme() { + return new InvalidRequestExceptionTupleScheme(); + } + } + + private static class InvalidRequestExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, InvalidRequestException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.why); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, InvalidRequestException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.why = iprot.readString(); + struct.setWhyIsSet(true); + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/KeyCount.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/KeyCount.java index 30f194e22e..54c7656f20 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/KeyCount.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/KeyCount.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -48,6 +58,12 @@ public class KeyCount implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new KeyCountStandardSchemeFactory()); + schemes.put(TupleScheme.class, new KeyCountTupleSchemeFactory()); + } + public ByteBuffer key; // required public int count; // required @@ -114,8 +130,7 @@ public class KeyCount implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -144,8 +159,7 @@ public class KeyCount implements org.apache.thrift.TBaseother. */ public KeyCount(KeyCount other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetKey()) { this.key = org.apache.thrift.TBaseHelper.copyBinary(other.key); ; @@ -209,16 +223,16 @@ public class KeyCount implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, KeyCount struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.count = iprot.readI32(); + struct.setCountIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetCount()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'count' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, KeyCount struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.key != null) { + oprot.writeFieldBegin(KEY_FIELD_DESC); + oprot.writeBinary(struct.key); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(COUNT_FIELD_DESC); + oprot.writeI32(struct.count); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class KeyCountTupleSchemeFactory implements SchemeFactory { + public KeyCountTupleScheme getScheme() { + return new KeyCountTupleScheme(); + } + } + + private static class KeyCountTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, KeyCount struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.key); + oprot.writeI32(struct.count); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, KeyCount struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + struct.count = iprot.readI32(); + struct.setCountIsSet(true); + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/KeyRange.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/KeyRange.java index 585d40e2a0..243327ddbb 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/KeyRange.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/KeyRange.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -60,11 +70,17 @@ public class KeyRange implements org.apache.thrift.TBase row_filter; // required + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new KeyRangeStandardSchemeFactory()); + schemes.put(TupleScheme.class, new KeyRangeTupleSchemeFactory()); + } + + public ByteBuffer start_key; // optional + public ByteBuffer end_key; // optional + public String start_token; // optional + public String end_token; // optional + public List row_filter; // optional public int count; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -142,8 +158,8 @@ public class KeyRange implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -181,8 +197,7 @@ public class KeyRange implements org.apache.thrift.TBaseother. */ public KeyRange(KeyRange other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetStart_key()) { this.start_key = org.apache.thrift.TBaseHelper.copyBinary(other.start_key); ; @@ -388,16 +403,16 @@ public class KeyRange implements org.apache.thrift.TBase(_list16.size); - for (int _i17 = 0; _i17 < _list16.size; ++_i17) - { - IndexExpression _elem18; // required - _elem18 = new IndexExpression(); - _elem18.read(iprot); - this.row_filter.add(_elem18); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 5: // COUNT - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.count = iprot.readI32(); - setCountIsSet(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 (!isSetCount()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'count' was not found in serialized data! Struct: " + toString()); - } - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.start_key != null) { - if (isSetStart_key()) { - oprot.writeFieldBegin(START_KEY_FIELD_DESC); - oprot.writeBinary(this.start_key); - oprot.writeFieldEnd(); - } - } - if (this.end_key != null) { - if (isSetEnd_key()) { - oprot.writeFieldBegin(END_KEY_FIELD_DESC); - oprot.writeBinary(this.end_key); - oprot.writeFieldEnd(); - } - } - if (this.start_token != null) { - if (isSetStart_token()) { - oprot.writeFieldBegin(START_TOKEN_FIELD_DESC); - oprot.writeString(this.start_token); - oprot.writeFieldEnd(); - } - } - if (this.end_token != null) { - if (isSetEnd_token()) { - oprot.writeFieldBegin(END_TOKEN_FIELD_DESC); - oprot.writeString(this.end_token); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldBegin(COUNT_FIELD_DESC); - oprot.writeI32(this.count); - oprot.writeFieldEnd(); - if (this.row_filter != null) { - if (isSetRow_filter()) { - oprot.writeFieldBegin(ROW_FILTER_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.row_filter.size())); - for (IndexExpression _iter19 : this.row_filter) - { - _iter19.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -878,6 +770,7 @@ public class KeyRange implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, KeyRange struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // START_KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.start_key = iprot.readBinary(); + struct.setStart_keyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // END_KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.end_key = iprot.readBinary(); + struct.setEnd_keyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // START_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.start_token = iprot.readString(); + struct.setStart_tokenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // END_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.end_token = iprot.readString(); + struct.setEnd_tokenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // ROW_FILTER + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list32 = iprot.readListBegin(); + struct.row_filter = new ArrayList(_list32.size); + for (int _i33 = 0; _i33 < _list32.size; ++_i33) + { + IndexExpression _elem34; // required + _elem34 = new IndexExpression(); + _elem34.read(iprot); + struct.row_filter.add(_elem34); + } + iprot.readListEnd(); + } + struct.setRow_filterIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.count = iprot.readI32(); + struct.setCountIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetCount()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'count' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, KeyRange struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.start_key != null) { + if (struct.isSetStart_key()) { + oprot.writeFieldBegin(START_KEY_FIELD_DESC); + oprot.writeBinary(struct.start_key); + oprot.writeFieldEnd(); + } + } + if (struct.end_key != null) { + if (struct.isSetEnd_key()) { + oprot.writeFieldBegin(END_KEY_FIELD_DESC); + oprot.writeBinary(struct.end_key); + oprot.writeFieldEnd(); + } + } + if (struct.start_token != null) { + if (struct.isSetStart_token()) { + oprot.writeFieldBegin(START_TOKEN_FIELD_DESC); + oprot.writeString(struct.start_token); + oprot.writeFieldEnd(); + } + } + if (struct.end_token != null) { + if (struct.isSetEnd_token()) { + oprot.writeFieldBegin(END_TOKEN_FIELD_DESC); + oprot.writeString(struct.end_token); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldBegin(COUNT_FIELD_DESC); + oprot.writeI32(struct.count); + oprot.writeFieldEnd(); + if (struct.row_filter != null) { + if (struct.isSetRow_filter()) { + oprot.writeFieldBegin(ROW_FILTER_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.row_filter.size())); + for (IndexExpression _iter35 : struct.row_filter) + { + _iter35.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class KeyRangeTupleSchemeFactory implements SchemeFactory { + public KeyRangeTupleScheme getScheme() { + return new KeyRangeTupleScheme(); + } + } + + private static class KeyRangeTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, KeyRange struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.count); + BitSet optionals = new BitSet(); + if (struct.isSetStart_key()) { + optionals.set(0); + } + if (struct.isSetEnd_key()) { + optionals.set(1); + } + if (struct.isSetStart_token()) { + optionals.set(2); + } + if (struct.isSetEnd_token()) { + optionals.set(3); + } + if (struct.isSetRow_filter()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetStart_key()) { + oprot.writeBinary(struct.start_key); + } + if (struct.isSetEnd_key()) { + oprot.writeBinary(struct.end_key); + } + if (struct.isSetStart_token()) { + oprot.writeString(struct.start_token); + } + if (struct.isSetEnd_token()) { + oprot.writeString(struct.end_token); + } + if (struct.isSetRow_filter()) { + { + oprot.writeI32(struct.row_filter.size()); + for (IndexExpression _iter36 : struct.row_filter) + { + _iter36.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, KeyRange struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.count = iprot.readI32(); + struct.setCountIsSet(true); + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.start_key = iprot.readBinary(); + struct.setStart_keyIsSet(true); + } + if (incoming.get(1)) { + struct.end_key = iprot.readBinary(); + struct.setEnd_keyIsSet(true); + } + if (incoming.get(2)) { + struct.start_token = iprot.readString(); + struct.setStart_tokenIsSet(true); + } + if (incoming.get(3)) { + struct.end_token = iprot.readString(); + struct.setEnd_tokenIsSet(true); + } + if (incoming.get(4)) { + { + org.apache.thrift.protocol.TList _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.row_filter = new ArrayList(_list37.size); + for (int _i38 = 0; _i38 < _list37.size; ++_i38) + { + IndexExpression _elem39; // required + _elem39 = new IndexExpression(); + _elem39.read(iprot); + struct.row_filter.add(_elem39); + } + } + struct.setRow_filterIsSet(true); + } + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/KeySlice.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/KeySlice.java index a13c8e01f1..e7de670979 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/KeySlice.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/KeySlice.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -55,6 +65,12 @@ public class KeySlice implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new KeySliceStandardSchemeFactory()); + schemes.put(TupleScheme.class, new KeySliceTupleSchemeFactory()); + } + public ByteBuffer key; // required public List columns; // required @@ -120,7 +136,6 @@ public class KeySlice implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -380,74 +395,11 @@ public class KeySlice implements org.apache.thrift.TBase(_list20.size); - for (int _i21 = 0; _i21 < _list20.size; ++_i21) - { - ColumnOrSuperColumn _elem22; // required - _elem22 = new ColumnOrSuperColumn(); - _elem22.read(iprot); - this.columns.add(_elem22); - } - iprot.readListEnd(); - } - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeBinary(this.key); - oprot.writeFieldEnd(); - } - if (this.columns != null) { - oprot.writeFieldBegin(COLUMNS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.columns.size())); - for (ColumnOrSuperColumn _iter23 : this.columns) - { - _iter23.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -482,6 +434,7 @@ public class KeySlice implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, KeySlice struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // KEY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list40 = iprot.readListBegin(); + struct.columns = new ArrayList(_list40.size); + for (int _i41 = 0; _i41 < _list40.size; ++_i41) + { + ColumnOrSuperColumn _elem42; // required + _elem42 = new ColumnOrSuperColumn(); + _elem42.read(iprot); + struct.columns.add(_elem42); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, KeySlice struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.key != null) { + oprot.writeFieldBegin(KEY_FIELD_DESC); + oprot.writeBinary(struct.key); + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); + for (ColumnOrSuperColumn _iter43 : struct.columns) + { + _iter43.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class KeySliceTupleSchemeFactory implements SchemeFactory { + public KeySliceTupleScheme getScheme() { + return new KeySliceTupleScheme(); + } + } + + private static class KeySliceTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, KeySlice struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.key); + { + oprot.writeI32(struct.columns.size()); + for (ColumnOrSuperColumn _iter44 : struct.columns) + { + _iter44.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, KeySlice struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.key = iprot.readBinary(); + struct.setKeyIsSet(true); + { + org.apache.thrift.protocol.TList _list45 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columns = new ArrayList(_list45.size); + for (int _i46 = 0; _i46 < _list45.size; ++_i46) + { + ColumnOrSuperColumn _elem47; // required + _elem47 = new ColumnOrSuperColumn(); + _elem47.read(iprot); + struct.columns.add(_elem47); + } + } + struct.setColumnsIsSet(true); + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/KsDef.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/KsDef.java index 1004a6d73e..c1530a1698 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/KsDef.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/KsDef.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -52,15 +62,21 @@ public class KsDef implements org.apache.thrift.TBase, jav private static final org.apache.thrift.protocol.TField CF_DEFS_FIELD_DESC = new org.apache.thrift.protocol.TField("cf_defs", org.apache.thrift.protocol.TType.LIST, (short)5); private static final org.apache.thrift.protocol.TField DURABLE_WRITES_FIELD_DESC = new org.apache.thrift.protocol.TField("durable_writes", org.apache.thrift.protocol.TType.BOOL, (short)6); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new KsDefStandardSchemeFactory()); + schemes.put(TupleScheme.class, new KsDefTupleSchemeFactory()); + } + public String name; // required public String strategy_class; // required - public Map strategy_options; // required + public Map strategy_options; // optional /** * @deprecated ignored */ - public int replication_factor; // required + public int replication_factor; // optional public List cf_defs; // required - public boolean durable_writes; // required + public boolean durable_writes; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -141,8 +157,8 @@ public class KsDef implements org.apache.thrift.TBase, jav // isset id assignments private static final int __REPLICATION_FACTOR_ISSET_ID = 0; private static final int __DURABLE_WRITES_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - + private byte __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.STRATEGY_OPTIONS,_Fields.REPLICATION_FACTOR,_Fields.DURABLE_WRITES}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -185,8 +201,7 @@ public class KsDef implements org.apache.thrift.TBase, jav * Performs a deep copy on other. */ public KsDef(KsDef other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetName()) { this.name = other.name; } @@ -335,16 +350,16 @@ public class KsDef implements org.apache.thrift.TBase, jav } public void unsetReplication_factor() { - __isset_bit_vector.clear(__REPLICATION_FACTOR_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REPLICATION_FACTOR_ISSET_ID); } /** Returns true if field replication_factor is set (has been assigned a value) and false otherwise */ public boolean isSetReplication_factor() { - return __isset_bit_vector.get(__REPLICATION_FACTOR_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __REPLICATION_FACTOR_ISSET_ID); } public void setReplication_factorIsSet(boolean value) { - __isset_bit_vector.set(__REPLICATION_FACTOR_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REPLICATION_FACTOR_ISSET_ID, value); } public int getCf_defsSize() { @@ -397,16 +412,16 @@ public class KsDef implements org.apache.thrift.TBase, jav } public void unsetDurable_writes() { - __isset_bit_vector.clear(__DURABLE_WRITES_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DURABLE_WRITES_ISSET_ID); } /** Returns true if field durable_writes is set (has been assigned a value) and false otherwise */ public boolean isSetDurable_writes() { - return __isset_bit_vector.get(__DURABLE_WRITES_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __DURABLE_WRITES_ISSET_ID); } public void setDurable_writesIsSet(boolean value) { - __isset_bit_vector.set(__DURABLE_WRITES_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DURABLE_WRITES_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -692,146 +707,11 @@ public class KsDef implements org.apache.thrift.TBase, jav } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.name = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // STRATEGY_CLASS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.strategy_class = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // STRATEGY_OPTIONS - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map60 = iprot.readMapBegin(); - this.strategy_options = new HashMap(2*_map60.size); - for (int _i61 = 0; _i61 < _map60.size; ++_i61) - { - String _key62; // required - String _val63; // required - _key62 = iprot.readString(); - _val63 = iprot.readString(); - this.strategy_options.put(_key62, _val63); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // REPLICATION_FACTOR - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.replication_factor = iprot.readI32(); - setReplication_factorIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 5: // CF_DEFS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list64 = iprot.readListBegin(); - this.cf_defs = new ArrayList(_list64.size); - for (int _i65 = 0; _i65 < _list64.size; ++_i65) - { - CfDef _elem66; // required - _elem66 = new CfDef(); - _elem66.read(iprot); - this.cf_defs.add(_elem66); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 6: // DURABLE_WRITES - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.durable_writes = iprot.readBool(); - setDurable_writesIsSet(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 - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); - oprot.writeFieldEnd(); - } - if (this.strategy_class != null) { - oprot.writeFieldBegin(STRATEGY_CLASS_FIELD_DESC); - oprot.writeString(this.strategy_class); - oprot.writeFieldEnd(); - } - if (this.strategy_options != null) { - if (isSetStrategy_options()) { - oprot.writeFieldBegin(STRATEGY_OPTIONS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, this.strategy_options.size())); - for (Map.Entry _iter67 : this.strategy_options.entrySet()) - { - oprot.writeString(_iter67.getKey()); - oprot.writeString(_iter67.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - } - if (isSetReplication_factor()) { - oprot.writeFieldBegin(REPLICATION_FACTOR_FIELD_DESC); - oprot.writeI32(this.replication_factor); - oprot.writeFieldEnd(); - } - if (this.cf_defs != null) { - oprot.writeFieldBegin(CF_DEFS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.cf_defs.size())); - for (CfDef _iter68 : this.cf_defs) - { - _iter68.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (isSetDurable_writes()) { - oprot.writeFieldBegin(DURABLE_WRITES_FIELD_DESC); - oprot.writeBool(this.durable_writes); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -899,6 +779,7 @@ public class KsDef implements org.apache.thrift.TBase, jav if (cf_defs == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'cf_defs' was not present! Struct: " + toString()); } + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -912,12 +793,264 @@ public class KsDef implements org.apache.thrift.TBase, jav 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); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class KsDefStandardSchemeFactory implements SchemeFactory { + public KsDefStandardScheme getScheme() { + return new KsDefStandardScheme(); + } + } + + private static class KsDefStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, KsDef struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // STRATEGY_CLASS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.strategy_class = iprot.readString(); + struct.setStrategy_classIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // STRATEGY_OPTIONS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map120 = iprot.readMapBegin(); + struct.strategy_options = new HashMap(2*_map120.size); + for (int _i121 = 0; _i121 < _map120.size; ++_i121) + { + String _key122; // required + String _val123; // required + _key122 = iprot.readString(); + _val123 = iprot.readString(); + struct.strategy_options.put(_key122, _val123); + } + iprot.readMapEnd(); + } + struct.setStrategy_optionsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // REPLICATION_FACTOR + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.replication_factor = iprot.readI32(); + struct.setReplication_factorIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // CF_DEFS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list124 = iprot.readListBegin(); + struct.cf_defs = new ArrayList(_list124.size); + for (int _i125 = 0; _i125 < _list124.size; ++_i125) + { + CfDef _elem126; // required + _elem126 = new CfDef(); + _elem126.read(iprot); + struct.cf_defs.add(_elem126); + } + iprot.readListEnd(); + } + struct.setCf_defsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // DURABLE_WRITES + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.durable_writes = iprot.readBool(); + struct.setDurable_writesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, KsDef struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + if (struct.strategy_class != null) { + oprot.writeFieldBegin(STRATEGY_CLASS_FIELD_DESC); + oprot.writeString(struct.strategy_class); + oprot.writeFieldEnd(); + } + if (struct.strategy_options != null) { + if (struct.isSetStrategy_options()) { + oprot.writeFieldBegin(STRATEGY_OPTIONS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.strategy_options.size())); + for (Map.Entry _iter127 : struct.strategy_options.entrySet()) + { + oprot.writeString(_iter127.getKey()); + oprot.writeString(_iter127.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.isSetReplication_factor()) { + oprot.writeFieldBegin(REPLICATION_FACTOR_FIELD_DESC); + oprot.writeI32(struct.replication_factor); + oprot.writeFieldEnd(); + } + if (struct.cf_defs != null) { + oprot.writeFieldBegin(CF_DEFS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.cf_defs.size())); + for (CfDef _iter128 : struct.cf_defs) + { + _iter128.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.isSetDurable_writes()) { + oprot.writeFieldBegin(DURABLE_WRITES_FIELD_DESC); + oprot.writeBool(struct.durable_writes); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class KsDefTupleSchemeFactory implements SchemeFactory { + public KsDefTupleScheme getScheme() { + return new KsDefTupleScheme(); + } + } + + private static class KsDefTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, KsDef struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.name); + oprot.writeString(struct.strategy_class); + { + oprot.writeI32(struct.cf_defs.size()); + for (CfDef _iter129 : struct.cf_defs) + { + _iter129.write(oprot); + } + } + BitSet optionals = new BitSet(); + if (struct.isSetStrategy_options()) { + optionals.set(0); + } + if (struct.isSetReplication_factor()) { + optionals.set(1); + } + if (struct.isSetDurable_writes()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetStrategy_options()) { + { + oprot.writeI32(struct.strategy_options.size()); + for (Map.Entry _iter130 : struct.strategy_options.entrySet()) + { + oprot.writeString(_iter130.getKey()); + oprot.writeString(_iter130.getValue()); + } + } + } + if (struct.isSetReplication_factor()) { + oprot.writeI32(struct.replication_factor); + } + if (struct.isSetDurable_writes()) { + oprot.writeBool(struct.durable_writes); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, KsDef struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.name = iprot.readString(); + struct.setNameIsSet(true); + struct.strategy_class = iprot.readString(); + struct.setStrategy_classIsSet(true); + { + org.apache.thrift.protocol.TList _list131 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.cf_defs = new ArrayList(_list131.size); + for (int _i132 = 0; _i132 < _list131.size; ++_i132) + { + CfDef _elem133; // required + _elem133 = new CfDef(); + _elem133.read(iprot); + struct.cf_defs.add(_elem133); + } + } + struct.setCf_defsIsSet(true); + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map134 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.strategy_options = new HashMap(2*_map134.size); + for (int _i135 = 0; _i135 < _map134.size; ++_i135) + { + String _key136; // required + String _val137; // required + _key136 = iprot.readString(); + _val137 = iprot.readString(); + struct.strategy_options.put(_key136, _val137); + } + } + struct.setStrategy_optionsIsSet(true); + } + if (incoming.get(1)) { + struct.replication_factor = iprot.readI32(); + struct.setReplication_factorIsSet(true); + } + if (incoming.get(2)) { + struct.durable_writes = iprot.readBool(); + struct.setDurable_writesIsSet(true); + } + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/Mutation.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/Mutation.java index f267d4baf4..0076e11645 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/Mutation.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/Mutation.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -53,8 +63,14 @@ public class Mutation implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new MutationStandardSchemeFactory()); + schemes.put(TupleScheme.class, new MutationTupleSchemeFactory()); + } + + public ColumnOrSuperColumn column_or_supercolumn; // optional + public Deletion deletion; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -118,7 +134,7 @@ public class Mutation implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -338,62 +354,11 @@ public class Mutation implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Mutation struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // COLUMN_OR_SUPERCOLUMN + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.column_or_supercolumn = new ColumnOrSuperColumn(); + struct.column_or_supercolumn.read(iprot); + struct.setColumn_or_supercolumnIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // DELETION + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.deletion = new Deletion(); + struct.deletion.read(iprot); + struct.setDeletionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, Mutation struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.column_or_supercolumn != null) { + if (struct.isSetColumn_or_supercolumn()) { + oprot.writeFieldBegin(COLUMN_OR_SUPERCOLUMN_FIELD_DESC); + struct.column_or_supercolumn.write(oprot); + oprot.writeFieldEnd(); + } + } + if (struct.deletion != null) { + if (struct.isSetDeletion()) { + oprot.writeFieldBegin(DELETION_FIELD_DESC); + struct.deletion.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class MutationTupleSchemeFactory implements SchemeFactory { + public MutationTupleScheme getScheme() { + return new MutationTupleScheme(); + } + } + + private static class MutationTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Mutation struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetColumn_or_supercolumn()) { + optionals.set(0); + } + if (struct.isSetDeletion()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetColumn_or_supercolumn()) { + struct.column_or_supercolumn.write(oprot); + } + if (struct.isSetDeletion()) { + struct.deletion.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Mutation struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.column_or_supercolumn = new ColumnOrSuperColumn(); + struct.column_or_supercolumn.read(iprot); + struct.setColumn_or_supercolumnIsSet(true); + } + if (incoming.get(1)) { + struct.deletion = new Deletion(); + struct.deletion.read(iprot); + struct.setDeletionIsSet(true); + } + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java index b05d38c8f1..02d1c26f3e 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -45,10 +55,16 @@ import org.slf4j.LoggerFactory; /** * A specific column was requested that does not exist. */ -public class NotFoundException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class NotFoundException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NotFoundException"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new NotFoundExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new NotFoundExceptionTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -190,32 +206,11 @@ public class NotFoundException extends Exception implements org.apache.thrift.TB } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -229,6 +224,7 @@ public class NotFoundException extends Exception implements org.apache.thrift.TB public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -247,5 +243,63 @@ public class NotFoundException extends Exception implements org.apache.thrift.TB } } + private static class NotFoundExceptionStandardSchemeFactory implements SchemeFactory { + public NotFoundExceptionStandardScheme getScheme() { + return new NotFoundExceptionStandardScheme(); + } + } + + private static class NotFoundExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, NotFoundException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, NotFoundException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class NotFoundExceptionTupleSchemeFactory implements SchemeFactory { + public NotFoundExceptionTupleScheme getScheme() { + return new NotFoundExceptionTupleScheme(); + } + } + + private static class NotFoundExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, NotFoundException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, NotFoundException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/SchemaDisagreementException.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/SchemaDisagreementException.java index 999bdd7625..2f498a6859 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/SchemaDisagreementException.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/SchemaDisagreementException.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -48,10 +58,16 @@ import org.slf4j.LoggerFactory; * * schemas are not in agreement across all nodes */ -public class SchemaDisagreementException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class SchemaDisagreementException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SchemaDisagreementException"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new SchemaDisagreementExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SchemaDisagreementExceptionTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -193,32 +209,11 @@ public class SchemaDisagreementException extends Exception implements org.apache } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -232,6 +227,7 @@ public class SchemaDisagreementException extends Exception implements org.apache public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -250,5 +246,63 @@ public class SchemaDisagreementException extends Exception implements org.apache } } + private static class SchemaDisagreementExceptionStandardSchemeFactory implements SchemeFactory { + public SchemaDisagreementExceptionStandardScheme getScheme() { + return new SchemaDisagreementExceptionStandardScheme(); + } + } + + private static class SchemaDisagreementExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SchemaDisagreementException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, SchemaDisagreementException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class SchemaDisagreementExceptionTupleSchemeFactory implements SchemeFactory { + public SchemaDisagreementExceptionTupleScheme getScheme() { + return new SchemaDisagreementExceptionTupleScheme(); + } + } + + private static class SchemaDisagreementExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SchemaDisagreementException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, SchemaDisagreementException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/SlicePredicate.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/SlicePredicate.java index 671e3d0725..0624e93e7f 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/SlicePredicate.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/SlicePredicate.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -60,8 +70,14 @@ public class SlicePredicate implements org.apache.thrift.TBase column_names; // required - public SliceRange slice_range; // required + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new SlicePredicateStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SlicePredicateTupleSchemeFactory()); + } + + public List column_names; // optional + public SliceRange slice_range; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -125,7 +141,7 @@ public class SlicePredicate implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -367,78 +383,11 @@ public class SlicePredicate implements org.apache.thrift.TBase(_list8.size); - for (int _i9 = 0; _i9 < _list8.size; ++_i9) - { - ByteBuffer _elem10; // required - _elem10 = iprot.readBinary(); - this.column_names.add(_elem10); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // SLICE_RANGE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.slice_range = new SliceRange(); - this.slice_range.read(iprot); - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.column_names != null) { - if (isSetColumn_names()) { - oprot.writeFieldBegin(COLUMN_NAMES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.column_names.size())); - for (ByteBuffer _iter11 : this.column_names) - { - oprot.writeBinary(_iter11); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - if (this.slice_range != null) { - if (isSetSlice_range()) { - oprot.writeFieldBegin(SLICE_RANGE_FIELD_DESC); - this.slice_range.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -471,6 +420,10 @@ public class SlicePredicate implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SlicePredicate struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // COLUMN_NAMES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list16 = iprot.readListBegin(); + struct.column_names = new ArrayList(_list16.size); + for (int _i17 = 0; _i17 < _list16.size; ++_i17) + { + ByteBuffer _elem18; // required + _elem18 = iprot.readBinary(); + struct.column_names.add(_elem18); + } + iprot.readListEnd(); + } + struct.setColumn_namesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SLICE_RANGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.slice_range = new SliceRange(); + struct.slice_range.read(iprot); + struct.setSlice_rangeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, SlicePredicate struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.column_names != null) { + if (struct.isSetColumn_names()) { + oprot.writeFieldBegin(COLUMN_NAMES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.column_names.size())); + for (ByteBuffer _iter19 : struct.column_names) + { + oprot.writeBinary(_iter19); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.slice_range != null) { + if (struct.isSetSlice_range()) { + oprot.writeFieldBegin(SLICE_RANGE_FIELD_DESC); + struct.slice_range.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class SlicePredicateTupleSchemeFactory implements SchemeFactory { + public SlicePredicateTupleScheme getScheme() { + return new SlicePredicateTupleScheme(); + } + } + + private static class SlicePredicateTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SlicePredicate struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetColumn_names()) { + optionals.set(0); + } + if (struct.isSetSlice_range()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetColumn_names()) { + { + oprot.writeI32(struct.column_names.size()); + for (ByteBuffer _iter20 : struct.column_names) + { + oprot.writeBinary(_iter20); + } + } + } + if (struct.isSetSlice_range()) { + struct.slice_range.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, SlicePredicate struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.column_names = new ArrayList(_list21.size); + for (int _i22 = 0; _i22 < _list21.size; ++_i22) + { + ByteBuffer _elem23; // required + _elem23 = iprot.readBinary(); + struct.column_names.add(_elem23); + } + } + struct.setColumn_namesIsSet(true); + } + if (incoming.get(1)) { + struct.slice_range = new SliceRange(); + struct.slice_range.read(iprot); + struct.setSlice_rangeIsSet(true); + } + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/SliceRange.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/SliceRange.java index d66ce58f19..543265cb3f 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/SliceRange.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/SliceRange.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -66,6 +76,12 @@ public class SliceRange implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new SliceRangeStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SliceRangeTupleSchemeFactory()); + } + public ByteBuffer start; // required public ByteBuffer finish; // required public boolean reversed; // required @@ -141,8 +157,7 @@ public class SliceRange implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -184,8 +199,7 @@ public class SliceRange implements org.apache.thrift.TBaseother. */ public SliceRange(SliceRange other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetStart()) { this.start = org.apache.thrift.TBaseHelper.copyBinary(other.start); ; @@ -291,16 +305,16 @@ public class SliceRange implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SliceRange struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // START + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.start = iprot.readBinary(); + struct.setStartIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // FINISH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.finish = iprot.readBinary(); + struct.setFinishIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // REVERSED + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.reversed = iprot.readBool(); + struct.setReversedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.count = iprot.readI32(); + struct.setCountIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + if (!struct.isSetReversed()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'reversed' was not found in serialized data! Struct: " + toString()); + } + if (!struct.isSetCount()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'count' was not found in serialized data! Struct: " + toString()); + } + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, SliceRange struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.start != null) { + oprot.writeFieldBegin(START_FIELD_DESC); + oprot.writeBinary(struct.start); + oprot.writeFieldEnd(); + } + if (struct.finish != null) { + oprot.writeFieldBegin(FINISH_FIELD_DESC); + oprot.writeBinary(struct.finish); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(REVERSED_FIELD_DESC); + oprot.writeBool(struct.reversed); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(COUNT_FIELD_DESC); + oprot.writeI32(struct.count); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class SliceRangeTupleSchemeFactory implements SchemeFactory { + public SliceRangeTupleScheme getScheme() { + return new SliceRangeTupleScheme(); + } + } + + private static class SliceRangeTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SliceRange struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.start); + oprot.writeBinary(struct.finish); + oprot.writeBool(struct.reversed); + oprot.writeI32(struct.count); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, SliceRange struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.start = iprot.readBinary(); + struct.setStartIsSet(true); + struct.finish = iprot.readBinary(); + struct.setFinishIsSet(true); + struct.reversed = iprot.readBool(); + struct.setReversedIsSet(true); + struct.count = iprot.readI32(); + struct.setCountIsSet(true); + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java index 776fede83f..3a30a215e7 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -54,6 +64,12 @@ public class SuperColumn implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new SuperColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SuperColumnTupleSchemeFactory()); + } + public ByteBuffer name; // required public List columns; // required @@ -119,7 +135,6 @@ public class SuperColumn implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -379,74 +394,11 @@ public class SuperColumn implements org.apache.thrift.TBase(_list0.size); - for (int _i1 = 0; _i1 < _list0.size; ++_i1) - { - Column _elem2; // required - _elem2 = new Column(); - _elem2.read(iprot); - this.columns.add(_elem2); - } - iprot.readListEnd(); - } - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeBinary(this.name); - oprot.writeFieldEnd(); - } - if (this.columns != null) { - oprot.writeFieldBegin(COLUMNS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.columns.size())); - for (Column _iter3 : this.columns) - { - _iter3.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -481,6 +433,7 @@ public class SuperColumn implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SuperColumn struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readBinary(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); + struct.columns = new ArrayList(_list0.size); + for (int _i1 = 0; _i1 < _list0.size; ++_i1) + { + Column _elem2; // required + _elem2 = new Column(); + _elem2.read(iprot); + struct.columns.add(_elem2); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, SuperColumn struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeBinary(struct.name); + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); + for (Column _iter3 : struct.columns) + { + _iter3.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class SuperColumnTupleSchemeFactory implements SchemeFactory { + public SuperColumnTupleScheme getScheme() { + return new SuperColumnTupleScheme(); + } + } + + private static class SuperColumnTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SuperColumn struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.name); + { + oprot.writeI32(struct.columns.size()); + for (Column _iter4 : struct.columns) + { + _iter4.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, SuperColumn struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.name = iprot.readBinary(); + struct.setNameIsSet(true); + { + org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columns = new ArrayList(_list5.size); + for (int _i6 = 0; _i6 < _list5.size; ++_i6) + { + Column _elem7; // required + _elem7 = new Column(); + _elem7.read(iprot); + struct.columns.add(_elem7); + } + } + struct.setColumnsIsSet(true); + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/TimedOutException.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/TimedOutException.java index 0a53222924..3112c98542 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/TimedOutException.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/TimedOutException.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -45,23 +55,29 @@ import org.slf4j.LoggerFactory; /** * RPC timeout was exceeded. either a node failed mid-operation, or load was too high, or the requested op was too large. */ -public class TimedOutException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class TimedOutException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TimedOutException"); private static final org.apache.thrift.protocol.TField ACKNOWLEDGED_BY_FIELD_DESC = new org.apache.thrift.protocol.TField("acknowledged_by", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField ACKNOWLEDGED_BY_BATCHLOG_FIELD_DESC = new org.apache.thrift.protocol.TField("acknowledged_by_batchlog", org.apache.thrift.protocol.TType.BOOL, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TimedOutExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TimedOutExceptionTupleSchemeFactory()); + } + /** * if a write operation was acknowledged by some replicas but not by enough to * satisfy the required ConsistencyLevel, the number of successful * replies will be given here. In case of atomic_batch_mutate method this field * will be set to -1 if the batch was written to the batchlog and to 0 if it wasn't. */ - public int acknowledged_by; // required + public int acknowledged_by; // optional /** * in case of atomic_batch_mutate method this field tells if the batch was written to the batchlog. */ - public boolean acknowledged_by_batchlog; // required + public boolean acknowledged_by_batchlog; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -136,8 +152,8 @@ public class TimedOutException extends Exception implements org.apache.thrift.TB // isset id assignments private static final int __ACKNOWLEDGED_BY_ISSET_ID = 0; private static final int __ACKNOWLEDGED_BY_BATCHLOG_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - + private byte __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.ACKNOWLEDGED_BY,_Fields.ACKNOWLEDGED_BY_BATCHLOG}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -156,8 +172,7 @@ public class TimedOutException extends Exception implements org.apache.thrift.TB * Performs a deep copy on other. */ public TimedOutException(TimedOutException other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.acknowledged_by = other.acknowledged_by; this.acknowledged_by_batchlog = other.acknowledged_by_batchlog; } @@ -197,16 +212,16 @@ public class TimedOutException extends Exception implements org.apache.thrift.TB } public void unsetAcknowledged_by() { - __isset_bit_vector.clear(__ACKNOWLEDGED_BY_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ACKNOWLEDGED_BY_ISSET_ID); } /** Returns true if field acknowledged_by is set (has been assigned a value) and false otherwise */ public boolean isSetAcknowledged_by() { - return __isset_bit_vector.get(__ACKNOWLEDGED_BY_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __ACKNOWLEDGED_BY_ISSET_ID); } public void setAcknowledged_byIsSet(boolean value) { - __isset_bit_vector.set(__ACKNOWLEDGED_BY_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ACKNOWLEDGED_BY_ISSET_ID, value); } /** @@ -226,16 +241,16 @@ public class TimedOutException extends Exception implements org.apache.thrift.TB } public void unsetAcknowledged_by_batchlog() { - __isset_bit_vector.clear(__ACKNOWLEDGED_BY_BATCHLOG_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ACKNOWLEDGED_BY_BATCHLOG_ISSET_ID); } /** Returns true if field acknowledged_by_batchlog is set (has been assigned a value) and false otherwise */ public boolean isSetAcknowledged_by_batchlog() { - return __isset_bit_vector.get(__ACKNOWLEDGED_BY_BATCHLOG_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __ACKNOWLEDGED_BY_BATCHLOG_ISSET_ID); } public void setAcknowledged_by_batchlogIsSet(boolean value) { - __isset_bit_vector.set(__ACKNOWLEDGED_BY_BATCHLOG_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ACKNOWLEDGED_BY_BATCHLOG_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -373,58 +388,11 @@ public class TimedOutException extends Exception implements org.apache.thrift.TB } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // ACKNOWLEDGED_BY - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.acknowledged_by = iprot.readI32(); - setAcknowledged_byIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // ACKNOWLEDGED_BY_BATCHLOG - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.acknowledged_by_batchlog = iprot.readBool(); - setAcknowledged_by_batchlogIsSet(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 - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (isSetAcknowledged_by()) { - oprot.writeFieldBegin(ACKNOWLEDGED_BY_FIELD_DESC); - oprot.writeI32(this.acknowledged_by); - oprot.writeFieldEnd(); - } - if (isSetAcknowledged_by_batchlog()) { - oprot.writeFieldBegin(ACKNOWLEDGED_BY_BATCHLOG_FIELD_DESC); - oprot.writeBool(this.acknowledged_by_batchlog); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -449,6 +417,7 @@ public class TimedOutException extends Exception implements org.apache.thrift.TB public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -462,12 +431,119 @@ public class TimedOutException extends Exception implements org.apache.thrift.TB 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); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class TimedOutExceptionStandardSchemeFactory implements SchemeFactory { + public TimedOutExceptionStandardScheme getScheme() { + return new TimedOutExceptionStandardScheme(); + } + } + + private static class TimedOutExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TimedOutException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // ACKNOWLEDGED_BY + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.acknowledged_by = iprot.readI32(); + struct.setAcknowledged_byIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ACKNOWLEDGED_BY_BATCHLOG + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.acknowledged_by_batchlog = iprot.readBool(); + struct.setAcknowledged_by_batchlogIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, TimedOutException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetAcknowledged_by()) { + oprot.writeFieldBegin(ACKNOWLEDGED_BY_FIELD_DESC); + oprot.writeI32(struct.acknowledged_by); + oprot.writeFieldEnd(); + } + if (struct.isSetAcknowledged_by_batchlog()) { + oprot.writeFieldBegin(ACKNOWLEDGED_BY_BATCHLOG_FIELD_DESC); + oprot.writeBool(struct.acknowledged_by_batchlog); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TimedOutExceptionTupleSchemeFactory implements SchemeFactory { + public TimedOutExceptionTupleScheme getScheme() { + return new TimedOutExceptionTupleScheme(); + } + } + + private static class TimedOutExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TimedOutException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAcknowledged_by()) { + optionals.set(0); + } + if (struct.isSetAcknowledged_by_batchlog()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetAcknowledged_by()) { + oprot.writeI32(struct.acknowledged_by); + } + if (struct.isSetAcknowledged_by_batchlog()) { + oprot.writeBool(struct.acknowledged_by_batchlog); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TimedOutException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.acknowledged_by = iprot.readI32(); + struct.setAcknowledged_byIsSet(true); + } + if (incoming.get(1)) { + struct.acknowledged_by_batchlog = iprot.readBool(); + struct.setAcknowledged_by_batchlogIsSet(true); + } + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/TokenRange.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/TokenRange.java index bcf57269c5..1393fd5197 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/TokenRange.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/TokenRange.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -59,11 +69,17 @@ public class TokenRange implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TokenRangeStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TokenRangeTupleSchemeFactory()); + } + public String start_token; // required public String end_token; // required public List endpoints; // required - public List rpc_endpoints; // required - public List endpoint_details; // required + public List rpc_endpoints; // optional + public List endpoint_details; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -136,7 +152,7 @@ public class TokenRange implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -628,148 +644,11 @@ public class TokenRange implements org.apache.thrift.TBase(_list24.size); - for (int _i25 = 0; _i25 < _list24.size; ++_i25) - { - String _elem26; // required - _elem26 = iprot.readString(); - this.endpoints.add(_elem26); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // RPC_ENDPOINTS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list27 = iprot.readListBegin(); - this.rpc_endpoints = new ArrayList(_list27.size); - for (int _i28 = 0; _i28 < _list27.size; ++_i28) - { - String _elem29; // required - _elem29 = iprot.readString(); - this.rpc_endpoints.add(_elem29); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 5: // ENDPOINT_DETAILS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list30 = iprot.readListBegin(); - this.endpoint_details = new ArrayList(_list30.size); - for (int _i31 = 0; _i31 < _list30.size; ++_i31) - { - EndpointDetails _elem32; // required - _elem32 = new EndpointDetails(); - _elem32.read(iprot); - this.endpoint_details.add(_elem32); - } - iprot.readListEnd(); - } - } 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.start_token != null) { - oprot.writeFieldBegin(START_TOKEN_FIELD_DESC); - oprot.writeString(this.start_token); - oprot.writeFieldEnd(); - } - if (this.end_token != null) { - oprot.writeFieldBegin(END_TOKEN_FIELD_DESC); - oprot.writeString(this.end_token); - oprot.writeFieldEnd(); - } - if (this.endpoints != null) { - oprot.writeFieldBegin(ENDPOINTS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.endpoints.size())); - for (String _iter33 : this.endpoints) - { - oprot.writeString(_iter33); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (this.rpc_endpoints != null) { - if (isSetRpc_endpoints()) { - oprot.writeFieldBegin(RPC_ENDPOINTS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.rpc_endpoints.size())); - for (String _iter34 : this.rpc_endpoints) - { - oprot.writeString(_iter34); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - if (this.endpoint_details != null) { - if (isSetEndpoint_details()) { - oprot.writeFieldBegin(ENDPOINT_DETAILS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.endpoint_details.size())); - for (EndpointDetails _iter35 : this.endpoint_details) - { - _iter35.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -835,6 +714,7 @@ public class TokenRange implements org.apache.thrift.TBase { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TokenRange struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // START_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.start_token = iprot.readString(); + struct.setStart_tokenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // END_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.end_token = iprot.readString(); + struct.setEnd_tokenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // ENDPOINTS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list48 = iprot.readListBegin(); + struct.endpoints = new ArrayList(_list48.size); + for (int _i49 = 0; _i49 < _list48.size; ++_i49) + { + String _elem50; // required + _elem50 = iprot.readString(); + struct.endpoints.add(_elem50); + } + iprot.readListEnd(); + } + struct.setEndpointsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // RPC_ENDPOINTS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list51 = iprot.readListBegin(); + struct.rpc_endpoints = new ArrayList(_list51.size); + for (int _i52 = 0; _i52 < _list51.size; ++_i52) + { + String _elem53; // required + _elem53 = iprot.readString(); + struct.rpc_endpoints.add(_elem53); + } + iprot.readListEnd(); + } + struct.setRpc_endpointsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // ENDPOINT_DETAILS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list54 = iprot.readListBegin(); + struct.endpoint_details = new ArrayList(_list54.size); + for (int _i55 = 0; _i55 < _list54.size; ++_i55) + { + EndpointDetails _elem56; // required + _elem56 = new EndpointDetails(); + _elem56.read(iprot); + struct.endpoint_details.add(_elem56); + } + iprot.readListEnd(); + } + struct.setEndpoint_detailsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, TokenRange struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.start_token != null) { + oprot.writeFieldBegin(START_TOKEN_FIELD_DESC); + oprot.writeString(struct.start_token); + oprot.writeFieldEnd(); + } + if (struct.end_token != null) { + oprot.writeFieldBegin(END_TOKEN_FIELD_DESC); + oprot.writeString(struct.end_token); + oprot.writeFieldEnd(); + } + if (struct.endpoints != null) { + oprot.writeFieldBegin(ENDPOINTS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.endpoints.size())); + for (String _iter57 : struct.endpoints) + { + oprot.writeString(_iter57); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.rpc_endpoints != null) { + if (struct.isSetRpc_endpoints()) { + oprot.writeFieldBegin(RPC_ENDPOINTS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.rpc_endpoints.size())); + for (String _iter58 : struct.rpc_endpoints) + { + oprot.writeString(_iter58); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.endpoint_details != null) { + if (struct.isSetEndpoint_details()) { + oprot.writeFieldBegin(ENDPOINT_DETAILS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.endpoint_details.size())); + for (EndpointDetails _iter59 : struct.endpoint_details) + { + _iter59.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TokenRangeTupleSchemeFactory implements SchemeFactory { + public TokenRangeTupleScheme getScheme() { + return new TokenRangeTupleScheme(); + } + } + + private static class TokenRangeTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TokenRange struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.start_token); + oprot.writeString(struct.end_token); + { + oprot.writeI32(struct.endpoints.size()); + for (String _iter60 : struct.endpoints) + { + oprot.writeString(_iter60); + } + } + BitSet optionals = new BitSet(); + if (struct.isSetRpc_endpoints()) { + optionals.set(0); + } + if (struct.isSetEndpoint_details()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetRpc_endpoints()) { + { + oprot.writeI32(struct.rpc_endpoints.size()); + for (String _iter61 : struct.rpc_endpoints) + { + oprot.writeString(_iter61); + } + } + } + if (struct.isSetEndpoint_details()) { + { + oprot.writeI32(struct.endpoint_details.size()); + for (EndpointDetails _iter62 : struct.endpoint_details) + { + _iter62.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TokenRange struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.start_token = iprot.readString(); + struct.setStart_tokenIsSet(true); + struct.end_token = iprot.readString(); + struct.setEnd_tokenIsSet(true); + { + org.apache.thrift.protocol.TList _list63 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.endpoints = new ArrayList(_list63.size); + for (int _i64 = 0; _i64 < _list63.size; ++_i64) + { + String _elem65; // required + _elem65 = iprot.readString(); + struct.endpoints.add(_elem65); + } + } + struct.setEndpointsIsSet(true); + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list66 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.rpc_endpoints = new ArrayList(_list66.size); + for (int _i67 = 0; _i67 < _list66.size; ++_i67) + { + String _elem68; // required + _elem68 = iprot.readString(); + struct.rpc_endpoints.add(_elem68); + } + } + struct.setRpc_endpointsIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list69 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.endpoint_details = new ArrayList(_list69.size); + for (int _i70 = 0; _i70 < _list69.size; ++_i70) + { + EndpointDetails _elem71; // required + _elem71 = new EndpointDetails(); + _elem71.read(iprot); + struct.endpoint_details.add(_elem71); + } + } + struct.setEndpoint_detailsIsSet(true); + } + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/UnavailableException.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/UnavailableException.java index da4d7a006c..a59b3dc1e6 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/UnavailableException.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/UnavailableException.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -45,10 +55,16 @@ import org.slf4j.LoggerFactory; /** * Not all the replicas required could be created and/or read. */ -public class UnavailableException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class UnavailableException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UnavailableException"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new UnavailableExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new UnavailableExceptionTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -190,32 +206,11 @@ public class UnavailableException extends Exception implements org.apache.thrift } 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 == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - 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(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -229,6 +224,7 @@ public class UnavailableException extends Exception implements org.apache.thrift public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -247,5 +243,63 @@ public class UnavailableException extends Exception implements org.apache.thrift } } + private static class UnavailableExceptionStandardSchemeFactory implements SchemeFactory { + public UnavailableExceptionStandardScheme getScheme() { + return new UnavailableExceptionStandardScheme(); + } + } + + private static class UnavailableExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, UnavailableException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, UnavailableException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class UnavailableExceptionTupleSchemeFactory implements SchemeFactory { + public UnavailableExceptionTupleScheme getScheme() { + return new UnavailableExceptionTupleScheme(); + } + } + + private static class UnavailableExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, UnavailableException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, UnavailableException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/cassandraConstants.java similarity index 75% rename from interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java rename to interface/thrift/gen-java/org/apache/cassandra/thrift/cassandraConstants.java index d8ab801be1..c17fde4d46 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/cassandraConstants.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package org.apache.cassandra.thrift; /* @@ -27,6 +28,15 @@ package org.apache.cassandra.thrift; import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; import java.util.List; import java.util.ArrayList; import java.util.Map; @@ -42,7 +52,7 @@ import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class Constants { +public class cassandraConstants { public static final String VERSION = "19.36.0"; diff --git a/lib/libthrift-0.7.0.jar b/lib/libthrift-0.7.0.jar deleted file mode 100644 index a0cc175620..0000000000 Binary files a/lib/libthrift-0.7.0.jar and /dev/null differ diff --git a/lib/libthrift-0.9.0.jar b/lib/libthrift-0.9.0.jar new file mode 100644 index 0000000000..6c2f9de8c2 Binary files /dev/null and b/lib/libthrift-0.9.0.jar differ diff --git a/lib/licenses/libthrift-0.7.txt b/lib/licenses/libthrift-0.9.txt similarity index 100% rename from lib/licenses/libthrift-0.7.txt rename to lib/licenses/libthrift-0.9.txt diff --git a/src/java/org/apache/cassandra/cli/CliMain.java b/src/java/org/apache/cassandra/cli/CliMain.java index a3477478be..3f6ef02e61 100644 --- a/src/java/org/apache/cassandra/cli/CliMain.java +++ b/src/java/org/apache/cassandra/cli/CliMain.java @@ -127,16 +127,16 @@ public class CliMain sessionState.err.println("Keyspace " + sessionState.keyspace + " not found"); return; } - catch (TException e) - { - sessionState.err.println("Did you specify 'keyspace'?"); - return; - } catch (NotFoundException e) { sessionState.err.println("Keyspace " + sessionState.keyspace + " not found"); return; } + catch (TException e) + { + sessionState.err.println("Did you specify 'keyspace'?"); + return; + } } // Lookup the cluster name, this is to make it clear which cluster the user is connected to diff --git a/src/java/org/apache/cassandra/db/SystemTable.java b/src/java/org/apache/cassandra/db/SystemTable.java index 940300cb67..70a254769c 100644 --- a/src/java/org/apache/cassandra/db/SystemTable.java +++ b/src/java/org/apache/cassandra/db/SystemTable.java @@ -52,7 +52,7 @@ import org.apache.cassandra.io.util.DataOutputBuffer; import org.apache.cassandra.io.util.FastByteArrayOutputStream; import org.apache.cassandra.locator.IEndpointSnitch; import org.apache.cassandra.service.StorageService; -import org.apache.cassandra.thrift.Constants; +import org.apache.cassandra.thrift.cassandraConstants; import org.apache.cassandra.utils.ByteBufferUtil; import org.apache.cassandra.utils.CounterId; import org.apache.cassandra.utils.FBUtilities; @@ -139,7 +139,7 @@ public class SystemTable LOCAL_KEY, FBUtilities.getReleaseVersionString(), QueryProcessor.CQL_VERSION.toString(), - Constants.VERSION, + cassandraConstants.VERSION, snitch.getDatacenter(FBUtilities.getBroadcastAddress()), snitch.getRack(FBUtilities.getBroadcastAddress()), DatabaseDescriptor.getPartitioner().getClass().getName())); diff --git a/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java b/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java index a78a4ca97b..2d153ab9c1 100644 --- a/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java +++ b/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java @@ -271,11 +271,11 @@ public class ColumnFamilyInputFormat extends InputFormat describe_ring(String keyspace) throws InvalidRequestException diff --git a/src/java/org/apache/cassandra/thrift/CustomTHsHaServer.java b/src/java/org/apache/cassandra/thrift/CustomTHsHaServer.java index a199a27fbb..4606fbccde 100644 --- a/src/java/org/apache/cassandra/thrift/CustomTHsHaServer.java +++ b/src/java/org/apache/cassandra/thrift/CustomTHsHaServer.java @@ -17,16 +17,8 @@ */ package org.apache.cassandra.thrift; -import java.io.IOException; import java.net.InetSocketAddress; -import java.nio.channels.SelectionKey; -import java.nio.channels.Selector; -import java.nio.channels.spi.SelectorProvider; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; import java.util.concurrent.ExecutorService; -import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.SynchronousQueue; import java.util.concurrent.TimeUnit; @@ -37,11 +29,10 @@ import org.slf4j.LoggerFactory; import org.apache.cassandra.concurrent.JMXEnabledThreadPoolExecutor; import org.apache.cassandra.concurrent.NamedThreadFactory; import org.apache.cassandra.config.DatabaseDescriptor; -import org.apache.thrift.server.TNonblockingServer; +import org.apache.thrift.server.THsHaServer; import org.apache.thrift.server.TServer; import org.apache.thrift.transport.TNonblockingServerTransport; import org.apache.thrift.transport.TNonblockingSocket; -import org.apache.thrift.transport.TNonblockingTransport; import org.apache.thrift.transport.TTransportException; /** @@ -51,12 +42,9 @@ import org.apache.thrift.transport.TTransportException; * it is spread across multiple threads. Number of selector thread can be the * number of CPU available. */ -public class CustomTHsHaServer extends TNonblockingServer +public class CustomTHsHaServer extends THsHaServer { private static final Logger LOGGER = LoggerFactory.getLogger(CustomTHsHaServer.class.getName()); - private final Set ioThreads = new HashSet(); - private volatile boolean stopped = true; - private final ExecutorService invoker; /** * All the arguments to Non Blocking Server will apply here. In addition, @@ -64,290 +52,19 @@ public class CustomTHsHaServer extends TNonblockingServer * will process the data. threads for selection usually are equal to the * number of cpu's */ - public CustomTHsHaServer(Args args, ExecutorService invoker, int threadCount) + public CustomTHsHaServer(Args args) { super(args); - this.invoker = invoker; - // Create all the Network IO Threads. - for (int i = 0; i < threadCount; ++i) - ioThreads.add(new SelectorThread("Selector-Thread-" + i)); } - /** @inheritDoc */ - @Override - public void serve() + protected boolean requestInvoke(FrameBuffer frameBuffer) { - if (!startListening()) - return; - if (!startThreads()) - return; - setServing(true); - joinSelector(); - invoker.shutdown(); - setServing(false); - stopListening(); - } - - /** - * Save the remote socket as a thead local for future use of client state. - */ - protected class Invocation implements Runnable - { - private final FrameBuffer frameBuffer; - private final SelectorThread thread; - - public Invocation(final FrameBuffer frameBuffer, SelectorThread thread) - { - this.frameBuffer = frameBuffer; - this.thread = thread; - } - - public void run() - { - TNonblockingSocket socket = (TNonblockingSocket) frameBuffer.trans_; - ThriftSessionManager.instance.setCurrentSocket(socket.getSocketChannel().socket().getRemoteSocketAddress()); - frameBuffer.invoke(); - // this is how we let the same selector thread change the selection type. - thread.requestSelectInterestChange(frameBuffer); - } - } - - protected boolean startThreads() - { - stopped = false; - // start all the threads. - for (SelectorThread thread : ioThreads) - thread.start(); + TNonblockingSocket socket = (TNonblockingSocket) frameBuffer.trans_; + ThriftSessionManager.instance.setCurrentSocket(socket.getSocketChannel().socket().getRemoteSocketAddress()); + frameBuffer.invoke(); return true; } - @Override - protected void joinSelector() - { - try - { - // wait till all done with stuff's - for (SelectorThread thread : ioThreads) - thread.join(); - } - catch (InterruptedException e) - { - LOGGER.error("Interrupted while joining threads!", e); - } - } - - /** - * Stop serving and shut everything down. - */ - @Override - public void stop() - { - stopListening(); - stopped = true; - for (SelectorThread thread : ioThreads) - thread.wakeupSelector(); - joinSelector(); - } - - /** - * IO Threads will perform expensive IO operations... - */ - protected class SelectorThread extends Thread - { - private final Selector selector; - private final TNonblockingServerTransport serverTransport; - private final Set selectInterestChanges = new HashSet(); - - public SelectorThread(String name) - { - super(name); - try - { - this.selector = SelectorProvider.provider().openSelector(); - this.serverTransport = (TNonblockingServerTransport) serverTransport_; - this.serverTransport.registerSelector(selector); - } - catch (IOException ex) - { - throw new RuntimeException("Couldnt open the NIO selector", ex); - } - } - - public void run() - { - try - { - while (!stopped) - { - select(); - } - } - catch (Throwable t) - { - LOGGER.error("Uncaught Exception: ", t); - } - finally - { - try - { - selector.close(); // CASSANDRA-3867 - } - catch (IOException e) - { - // ignore this exception. - } - } - } - - private void select() throws InterruptedException, IOException - { - // wait for new keys - selector.select(); - Iterator keyIterator = selector.selectedKeys().iterator(); - while (keyIterator.hasNext()) - { - SelectionKey key = keyIterator.next(); - keyIterator.remove(); - - try - { - if (!key.isValid()) - { - // if invalid cleanup. - cleanupSelectionkey(key); - continue; - } - - if (key.isAcceptable()) - handleAccept(); - if (key.isReadable()) - handleRead(key); - else if (key.isWritable()) - handleWrite(key); - else - LOGGER.debug("Unexpected state " + key.interestOps()); - } - catch (Exception io) - { - // just ignore (?) - cleanupSelectionkey(key); - } - } - // process the changes which are inserted after completion. - processInterestChanges(); - } - - private void handleAccept() - { - SelectionKey clientKey = null; - TNonblockingTransport client = null; - try - { - // accept the connection - client = (TNonblockingTransport) serverTransport.accept(); - clientKey = client.registerSelector(selector, SelectionKey.OP_READ); - // add this key to the map - FrameBuffer frameBuffer = new FrameBuffer(client, clientKey); - clientKey.attach(frameBuffer); - } catch (TTransportException ex) - { - // ignore this might have been handled by the other threads. - // serverTransport.accept() as it returns null as nothing to accept. - return; - } - catch (IOException tte) - { - // something went wrong accepting. - LOGGER.warn("Exception trying to accept!", tte); - tte.printStackTrace(); - if (clientKey != null) - cleanupSelectionkey(clientKey); - if (client != null) - client.close(); - } - } - - private void handleRead(SelectionKey key) - { - FrameBuffer buffer = (FrameBuffer) key.attachment(); - if (!buffer.read()) - { - cleanupSelectionkey(key); - return; - } - - if (buffer.isFrameFullyRead()) - { - if (!requestInvoke(buffer, this)) - cleanupSelectionkey(key); - } - } - - private void handleWrite(SelectionKey key) - { - FrameBuffer buffer = (FrameBuffer) key.attachment(); - if (!buffer.write()) - cleanupSelectionkey(key); - } - - public void requestSelectInterestChange(FrameBuffer frameBuffer) - { - synchronized (selectInterestChanges) - { - selectInterestChanges.add(frameBuffer); - } - // Wake-up the selector, if it's currently blocked. - selector.wakeup(); - } - - private void processInterestChanges() - { - synchronized (selectInterestChanges) - { - for (FrameBuffer fb : selectInterestChanges) - fb.changeSelectInterests(); - selectInterestChanges.clear(); - } - } - - private void cleanupSelectionkey(SelectionKey key) - { - FrameBuffer buffer = (FrameBuffer) key.attachment(); - if (buffer != null) - buffer.close(); - // cancel the selection key - key.cancel(); - } - - public void wakeupSelector() - { - selector.wakeup(); - } - } - - protected boolean requestInvoke(FrameBuffer frameBuffer, SelectorThread thread) - { - try - { - Runnable invocation = new Invocation(frameBuffer, thread); - invoker.execute(invocation); - return true; - } - catch (RejectedExecutionException rx) - { - LOGGER.warn("ExecutorService rejected execution!", rx); - return false; - } - } - - @Override - protected void requestSelectInterestChange(FrameBuffer fb) - { - // Dont change the interest here, this has to be done by the selector - // thread because the method is not synchronized with the rest of the - // selectors threads. - } - public static class Factory implements TServerFactory { public TServer buildTServer(Args args) @@ -373,13 +90,14 @@ public class CustomTHsHaServer extends TNonblockingServer TimeUnit.SECONDS, new SynchronousQueue(), new NamedThreadFactory("RPC-Thread"), "RPC-THREAD-POOL"); - TNonblockingServer.Args serverArgs = new TNonblockingServer.Args(serverTransport).inputTransportFactory(args.inTransportFactory) + THsHaServer.Args serverArgs = new THsHaServer.Args(serverTransport).inputTransportFactory(args.inTransportFactory) .outputTransportFactory(args.outTransportFactory) .inputProtocolFactory(args.tProtocolFactory) .outputProtocolFactory(args.tProtocolFactory) - .processor(args.processor); + .processor(args.processor) + .executorService(executorService); // Check for available processors in the system which will be equal to the IO Threads. - return new CustomTHsHaServer(serverArgs, executorService, FBUtilities.getAvailableProcessors()); + return new CustomTHsHaServer(serverArgs); } } } diff --git a/src/java/org/apache/cassandra/tools/Shuffle.java b/src/java/org/apache/cassandra/tools/Shuffle.java index 8cf38b92fb..8395776843 100644 --- a/src/java/org/apache/cassandra/tools/Shuffle.java +++ b/src/java/org/apache/cassandra/tools/Shuffle.java @@ -538,15 +538,15 @@ public class Shuffle extends AbstractJmxClient { partitionerName = getThriftClient(hostName, port, framed).describe_partitioner(); } + catch (InvalidRequestException e) + { + throw new RuntimeException("Error calling describe_partitioner() defies explanation", e); + } catch (TException e) { throw new ShuffleError( String.format("Thrift request to %s:%d failed: %s", hostName, port, e.getMessage())); } - catch (InvalidRequestException e) - { - throw new RuntimeException("Error calling describe_partitioner() defies explanation", e); - } try {