mirror of https://github.com/apache/cassandra
Upgrade thrift version to 0.9.0
Patch by jfarrell; reviewed by tjake for CASSANDRA-3719
This commit is contained in:
parent
ec361ab002
commit
b153d45644
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@
|
|||
<exclusion groupId="org.apache.velocity" artifactId="velocity"/>
|
||||
</dependency>
|
||||
|
||||
<dependency groupId="org.apache.thrift" artifactId="libthrift" version="0.7.0"/>
|
||||
<dependency groupId="org.apache.thrift" artifactId="libthrift" version="0.9.0"/>
|
||||
|
||||
<dependency groupId="com.thoughtworks.paranamer" artifactId="paranamer-ant" version="2.1"/>
|
||||
<dependency groupId="junit" artifactId="junit" version="4.6" />
|
||||
|
|
|
|||
|
|
@ -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<AuthenticationException, AuthenticationException._Fields>, java.io.Serializable, Cloneable {
|
||||
public class AuthenticationException extends TException implements org.apache.thrift.TBase<AuthenticationException, AuthenticationException._Fields>, java.io.Serializable, Cloneable {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AuthenticationException");
|
||||
|
||||
private static final 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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<AuthenticationException> {
|
||||
|
||||
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<AuthenticationException> {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<Authentica
|
|||
|
||||
private static final org.apache.thrift.protocol.TField CREDENTIALS_FIELD_DESC = new org.apache.thrift.protocol.TField("credentials", org.apache.thrift.protocol.TType.MAP, (short)1);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new AuthenticationRequestStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new AuthenticationRequestTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public Map<String,String> 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<Authentica
|
|||
}
|
||||
|
||||
// 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);
|
||||
|
|
@ -296,64 +311,11 @@ public class AuthenticationRequest implements org.apache.thrift.TBase<Authentica
|
|||
}
|
||||
|
||||
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: // CREDENTIALS
|
||||
if (field.type == org.apache.thrift.protocol.TType.MAP) {
|
||||
{
|
||||
org.apache.thrift.protocol.TMap _map36 = iprot.readMapBegin();
|
||||
this.credentials = new HashMap<String,String>(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<String, String> _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<Authentica
|
|||
if (credentials == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'credentials' was not present! Struct: " + toString());
|
||||
}
|
||||
// check for sub-struct validity
|
||||
}
|
||||
|
||||
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
||||
|
|
@ -395,5 +358,117 @@ public class AuthenticationRequest implements org.apache.thrift.TBase<Authentica
|
|||
}
|
||||
}
|
||||
|
||||
private static class AuthenticationRequestStandardSchemeFactory implements SchemeFactory {
|
||||
public AuthenticationRequestStandardScheme getScheme() {
|
||||
return new AuthenticationRequestStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class AuthenticationRequestStandardScheme extends StandardScheme<AuthenticationRequest> {
|
||||
|
||||
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<String,String>(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<String, String> _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<AuthenticationRequest> {
|
||||
|
||||
@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<String, String> _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<String,String>(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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<AuthorizationException, AuthorizationException._Fields>, java.io.Serializable, Cloneable {
|
||||
public class AuthorizationException extends TException implements org.apache.thrift.TBase<AuthorizationException, AuthorizationException._Fields>, java.io.Serializable, Cloneable {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AuthorizationException");
|
||||
|
||||
private static final 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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<AuthorizationException> {
|
||||
|
||||
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<AuthorizationException> {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -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<CfSplit, CfSplit._Fields
|
|||
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)2);
|
||||
private static final org.apache.thrift.protocol.TField ROW_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("row_count", org.apache.thrift.protocol.TType.I64, (short)3);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<CfSplit, CfSplit._Fields
|
|||
|
||||
// isset id assignments
|
||||
private static final int __ROW_COUNT_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);
|
||||
|
|
@ -156,8 +171,7 @@ public class CfSplit implements org.apache.thrift.TBase<CfSplit, CfSplit._Fields
|
|||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
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<CfSplit, CfSplit._Fields
|
|||
}
|
||||
|
||||
public void unsetRow_count() {
|
||||
__isset_bit_vector.clear(__ROW_COUNT_ISSET_ID);
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ROW_COUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field row_count is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetRow_count() {
|
||||
return __isset_bit_vector.get(__ROW_COUNT_ISSET_ID);
|
||||
return EncodingUtils.testBit(__isset_bitfield, __ROW_COUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setRow_countIsSet(boolean value) {
|
||||
__isset_bit_vector.set(__ROW_COUNT_ISSET_ID, value);
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ROW_COUNT_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
|
|
@ -422,70 +436,11 @@ public class CfSplit implements org.apache.thrift.TBase<CfSplit, CfSplit._Fields
|
|||
}
|
||||
|
||||
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: // 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 2: // 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 3: // ROW_COUNT
|
||||
if (field.type == org.apache.thrift.protocol.TType.I64) {
|
||||
this.row_count = iprot.readI64();
|
||||
setRow_countIsSet(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 (!isSetRow_count()) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'row_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_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(ROW_COUNT_FIELD_DESC);
|
||||
oprot.writeI64(this.row_count);
|
||||
oprot.writeFieldEnd();
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -525,6 +480,7 @@ public class CfSplit implements org.apache.thrift.TBase<CfSplit, CfSplit._Fields
|
|||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'end_token' was not present! Struct: " + toString());
|
||||
}
|
||||
// alas, we cannot check 'row_count' 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 {
|
||||
|
|
@ -538,12 +494,119 @@ public class CfSplit implements org.apache.thrift.TBase<CfSplit, CfSplit._Fields
|
|||
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 CfSplitStandardSchemeFactory implements SchemeFactory {
|
||||
public CfSplitStandardScheme getScheme() {
|
||||
return new CfSplitStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class CfSplitStandardScheme extends StandardScheme<CfSplit> {
|
||||
|
||||
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<CfSplit> {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<Column, Column._Fields>,
|
|||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<Column, Column._Fields>,
|
|||
// 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<Column, Column._Fields>,
|
|||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
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<Column, Column._Fields>,
|
|||
}
|
||||
|
||||
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<Column, Column._Fields>,
|
|||
}
|
||||
|
||||
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<Column, Column._Fields>,
|
|||
}
|
||||
|
||||
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<Column, Column._Fields>,
|
|||
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<Column, Column._Fields>,
|
|||
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<Column> {
|
||||
|
||||
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<Column> {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<ColumnDef, ColumnDef._
|
|||
private static final org.apache.thrift.protocol.TField INDEX_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("index_name", org.apache.thrift.protocol.TType.STRING, (short)4);
|
||||
private static final org.apache.thrift.protocol.TField INDEX_OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("index_options", org.apache.thrift.protocol.TType.MAP, (short)5);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String,String> index_options; // required
|
||||
public IndexType index_type; // optional
|
||||
public String index_name; // optional
|
||||
public Map<String,String> 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<ColumnDef, ColumnDef._
|
|||
}
|
||||
|
||||
// isset id assignments
|
||||
|
||||
private _Fields optionals[] = {_Fields.INDEX_TYPE,_Fields.INDEX_NAME,_Fields.INDEX_OPTIONS};
|
||||
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);
|
||||
|
|
@ -610,118 +626,11 @@ public class ColumnDef implements org.apache.thrift.TBase<ColumnDef, ColumnDef._
|
|||
}
|
||||
|
||||
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: // VALIDATION_CLASS
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
this.validation_class = iprot.readString();
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 3: // INDEX_TYPE
|
||||
if (field.type == org.apache.thrift.protocol.TType.I32) {
|
||||
this.index_type = IndexType.findByValue(iprot.readI32());
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 4: // INDEX_NAME
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
this.index_name = iprot.readString();
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 5: // INDEX_OPTIONS
|
||||
if (field.type == org.apache.thrift.protocol.TType.MAP) {
|
||||
{
|
||||
org.apache.thrift.protocol.TMap _map41 = iprot.readMapBegin();
|
||||
this.index_options = new HashMap<String,String>(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<String, String> _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<ColumnDef, ColumnDef._
|
|||
if (validation_class == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'validation_class' was not present! Struct: " + toString());
|
||||
}
|
||||
// check for sub-struct validity
|
||||
}
|
||||
|
||||
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
||||
|
|
@ -804,5 +714,211 @@ public class ColumnDef implements org.apache.thrift.TBase<ColumnDef, ColumnDef._
|
|||
}
|
||||
}
|
||||
|
||||
private static class ColumnDefStandardSchemeFactory implements SchemeFactory {
|
||||
public ColumnDefStandardScheme getScheme() {
|
||||
return new ColumnDefStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class ColumnDefStandardScheme extends StandardScheme<ColumnDef> {
|
||||
|
||||
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<String,String>(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<String, String> _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<ColumnDef> {
|
||||
|
||||
@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<String, String> _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<String,String>(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<ColumnOrSupe
|
|||
private static final org.apache.thrift.protocol.TField COUNTER_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("counter_column", org.apache.thrift.protocol.TType.STRUCT, (short)3);
|
||||
private static final org.apache.thrift.protocol.TField COUNTER_SUPER_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("counter_super_column", org.apache.thrift.protocol.TType.STRUCT, (short)4);
|
||||
|
||||
public Column column; // required
|
||||
public SuperColumn super_column; // required
|
||||
public CounterColumn counter_column; // required
|
||||
public CounterSuperColumn counter_super_column; // required
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<ColumnOrSupe
|
|||
}
|
||||
|
||||
// isset id assignments
|
||||
|
||||
private _Fields optionals[] = {_Fields.COLUMN,_Fields.SUPER_COLUMN,_Fields.COUNTER_COLUMN,_Fields.COUNTER_SUPER_COLUMN};
|
||||
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);
|
||||
|
|
@ -492,92 +508,11 @@ public class ColumnOrSuperColumn implements org.apache.thrift.TBase<ColumnOrSupe
|
|||
}
|
||||
|
||||
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
|
||||
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 2: // SUPER_COLUMN
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
|
||||
this.super_column = new SuperColumn();
|
||||
this.super_column.read(iprot);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 3: // COUNTER_COLUMN
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
|
||||
this.counter_column = new CounterColumn();
|
||||
this.counter_column.read(iprot);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 4: // COUNTER_SUPER_COLUMN
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
|
||||
this.counter_super_column = new CounterSuperColumn();
|
||||
this.counter_super_column.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 != null) {
|
||||
if (isSetColumn()) {
|
||||
oprot.writeFieldBegin(COLUMN_FIELD_DESC);
|
||||
this.column.write(oprot);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
if (this.super_column != null) {
|
||||
if (isSetSuper_column()) {
|
||||
oprot.writeFieldBegin(SUPER_COLUMN_FIELD_DESC);
|
||||
this.super_column.write(oprot);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
if (this.counter_column != null) {
|
||||
if (isSetCounter_column()) {
|
||||
oprot.writeFieldBegin(COUNTER_COLUMN_FIELD_DESC);
|
||||
this.counter_column.write(oprot);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
if (this.counter_super_column != null) {
|
||||
if (isSetCounter_super_column()) {
|
||||
oprot.writeFieldBegin(COUNTER_SUPER_COLUMN_FIELD_DESC);
|
||||
this.counter_super_column.write(oprot);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -630,6 +565,19 @@ public class ColumnOrSuperColumn implements org.apache.thrift.TBase<ColumnOrSupe
|
|||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
// check for sub-struct validity
|
||||
if (column != null) {
|
||||
column.validate();
|
||||
}
|
||||
if (super_column != null) {
|
||||
super_column.validate();
|
||||
}
|
||||
if (counter_column != null) {
|
||||
counter_column.validate();
|
||||
}
|
||||
if (counter_super_column != null) {
|
||||
counter_super_column.validate();
|
||||
}
|
||||
}
|
||||
|
||||
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
||||
|
|
@ -648,5 +596,174 @@ public class ColumnOrSuperColumn implements org.apache.thrift.TBase<ColumnOrSupe
|
|||
}
|
||||
}
|
||||
|
||||
private static class ColumnOrSuperColumnStandardSchemeFactory implements SchemeFactory {
|
||||
public ColumnOrSuperColumnStandardScheme getScheme() {
|
||||
return new ColumnOrSuperColumnStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class ColumnOrSuperColumnStandardScheme extends StandardScheme<ColumnOrSuperColumn> {
|
||||
|
||||
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<ColumnOrSuperColumn> {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<ColumnParent, Colum
|
|||
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)3);
|
||||
private static final org.apache.thrift.protocol.TField SUPER_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("super_column", org.apache.thrift.protocol.TType.STRING, (short)4);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<ColumnParent, Colum
|
|||
}
|
||||
|
||||
// isset id assignments
|
||||
|
||||
private _Fields optionals[] = {_Fields.SUPER_COLUMN};
|
||||
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);
|
||||
|
|
@ -357,58 +373,11 @@ public class ColumnParent implements org.apache.thrift.TBase<ColumnParent, Colum
|
|||
}
|
||||
|
||||
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 3: // 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 4: // SUPER_COLUMN
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
this.super_column = 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 {
|
||||
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.super_column != null) {
|
||||
if (isSetSuper_column()) {
|
||||
oprot.writeFieldBegin(SUPER_COLUMN_FIELD_DESC);
|
||||
oprot.writeBinary(this.super_column);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -442,6 +411,7 @@ public class ColumnParent implements org.apache.thrift.TBase<ColumnParent, Colum
|
|||
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 {
|
||||
|
|
@ -460,5 +430,107 @@ public class ColumnParent implements org.apache.thrift.TBase<ColumnParent, Colum
|
|||
}
|
||||
}
|
||||
|
||||
private static class ColumnParentStandardSchemeFactory implements SchemeFactory {
|
||||
public ColumnParentStandardScheme getScheme() {
|
||||
return new ColumnParentStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class ColumnParentStandardScheme extends StandardScheme<ColumnParent> {
|
||||
|
||||
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<ColumnParent> {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<ColumnPath, ColumnPat
|
|||
private static final org.apache.thrift.protocol.TField SUPER_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("super_column", org.apache.thrift.protocol.TType.STRING, (short)4);
|
||||
private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRING, (short)5);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<ColumnPath, ColumnPat
|
|||
}
|
||||
|
||||
// isset id assignments
|
||||
|
||||
private _Fields optionals[] = {_Fields.SUPER_COLUMN,_Fields.COLUMN};
|
||||
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);
|
||||
|
|
@ -444,72 +460,11 @@ public class ColumnPath implements org.apache.thrift.TBase<ColumnPath, ColumnPat
|
|||
}
|
||||
|
||||
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 3: // 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 4: // SUPER_COLUMN
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
this.super_column = iprot.readBinary();
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 5: // COLUMN
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
this.column = 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 {
|
||||
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.super_column != null) {
|
||||
if (isSetSuper_column()) {
|
||||
oprot.writeFieldBegin(SUPER_COLUMN_FIELD_DESC);
|
||||
oprot.writeBinary(this.super_column);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
if (this.column != null) {
|
||||
if (isSetColumn()) {
|
||||
oprot.writeFieldBegin(COLUMN_FIELD_DESC);
|
||||
oprot.writeBinary(this.column);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -553,6 +508,7 @@ public class ColumnPath implements org.apache.thrift.TBase<ColumnPath, ColumnPat
|
|||
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 {
|
||||
|
|
@ -571,5 +527,132 @@ public class ColumnPath implements org.apache.thrift.TBase<ColumnPath, ColumnPat
|
|||
}
|
||||
}
|
||||
|
||||
private static class ColumnPathStandardSchemeFactory implements SchemeFactory {
|
||||
public ColumnPathStandardScheme getScheme() {
|
||||
return new ColumnPathStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class ColumnPathStandardScheme extends StandardScheme<ColumnPath> {
|
||||
|
||||
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<ColumnPath> {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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<CounterColumn, Cou
|
|||
private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
|
||||
private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I64, (short)2);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<CounterColumn, Cou
|
|||
|
||||
// isset id assignments
|
||||
private static final int __VALUE_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);
|
||||
|
|
@ -144,8 +159,7 @@ public class CounterColumn implements org.apache.thrift.TBase<CounterColumn, Cou
|
|||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
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<CounterColumn, Cou
|
|||
}
|
||||
|
||||
public void unsetValue() {
|
||||
__isset_bit_vector.clear(__VALUE_ISSET_ID);
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field value is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetValue() {
|
||||
return __isset_bit_vector.get(__VALUE_ISSET_ID);
|
||||
return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setValueIsSet(boolean value) {
|
||||
__isset_bit_vector.set(__VALUE_ISSET_ID, value);
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
|
|
@ -356,58 +370,11 @@ public class CounterColumn implements org.apache.thrift.TBase<CounterColumn, Cou
|
|||
}
|
||||
|
||||
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.I64) {
|
||||
this.value = iprot.readI64();
|
||||
setValueIsSet(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 (!isSetValue()) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'value' 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.name != null) {
|
||||
oprot.writeFieldBegin(NAME_FIELD_DESC);
|
||||
oprot.writeBinary(this.name);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldBegin(VALUE_FIELD_DESC);
|
||||
oprot.writeI64(this.value);
|
||||
oprot.writeFieldEnd();
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -436,6 +403,7 @@ public class CounterColumn implements org.apache.thrift.TBase<CounterColumn, Cou
|
|||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' was not present! Struct: " + toString());
|
||||
}
|
||||
// alas, we cannot check 'value' 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 {
|
||||
|
|
@ -449,12 +417,103 @@ public class CounterColumn implements org.apache.thrift.TBase<CounterColumn, Cou
|
|||
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 CounterColumnStandardSchemeFactory implements SchemeFactory {
|
||||
public CounterColumnStandardScheme getScheme() {
|
||||
return new CounterColumnStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class CounterColumnStandardScheme extends StandardScheme<CounterColumn> {
|
||||
|
||||
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<CounterColumn> {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<CounterSuperC
|
|||
private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
|
||||
private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)2);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new CounterSuperColumnStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new CounterSuperColumnTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public ByteBuffer name; // required
|
||||
public List<CounterColumn> columns; // required
|
||||
|
||||
|
|
@ -113,7 +129,6 @@ public class CounterSuperColumn implements org.apache.thrift.TBase<CounterSuperC
|
|||
}
|
||||
|
||||
// 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);
|
||||
|
|
@ -373,74 +388,11 @@ public class CounterSuperColumn implements org.apache.thrift.TBase<CounterSuperC
|
|||
}
|
||||
|
||||
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: // COLUMNS
|
||||
if (field.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list4 = iprot.readListBegin();
|
||||
this.columns = new ArrayList<CounterColumn>(_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<CounterSuperC
|
|||
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 {
|
||||
|
|
@ -493,5 +446,129 @@ public class CounterSuperColumn implements org.apache.thrift.TBase<CounterSuperC
|
|||
}
|
||||
}
|
||||
|
||||
private static class CounterSuperColumnStandardSchemeFactory implements SchemeFactory {
|
||||
public CounterSuperColumnStandardScheme getScheme() {
|
||||
return new CounterSuperColumnStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class CounterSuperColumnStandardScheme extends StandardScheme<CounterSuperColumn> {
|
||||
|
||||
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<CounterColumn>(_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<CounterSuperColumn> {
|
||||
|
||||
@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<CounterColumn>(_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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<CqlMetadata, CqlMeta
|
|||
private static final org.apache.thrift.protocol.TField DEFAULT_NAME_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("default_name_type", org.apache.thrift.protocol.TType.STRING, (short)3);
|
||||
private static final org.apache.thrift.protocol.TField DEFAULT_VALUE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("default_value_type", org.apache.thrift.protocol.TType.STRING, (short)4);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new CqlMetadataStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new CqlMetadataTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public Map<ByteBuffer,String> name_types; // required
|
||||
public Map<ByteBuffer,String> value_types; // required
|
||||
public String default_name_type; // required
|
||||
|
|
@ -123,7 +139,6 @@ public class CqlMetadata implements org.apache.thrift.TBase<CqlMetadata, CqlMeta
|
|||
}
|
||||
|
||||
// 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);
|
||||
|
|
@ -542,120 +557,11 @@ public class CqlMetadata implements org.apache.thrift.TBase<CqlMetadata, CqlMeta
|
|||
}
|
||||
|
||||
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_TYPES
|
||||
if (field.type == org.apache.thrift.protocol.TType.MAP) {
|
||||
{
|
||||
org.apache.thrift.protocol.TMap _map73 = iprot.readMapBegin();
|
||||
this.name_types = new HashMap<ByteBuffer,String>(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<ByteBuffer,String>(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<ByteBuffer, String> _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<ByteBuffer, String> _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<CqlMetadata, CqlMeta
|
|||
if (default_value_type == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'default_value_type' was not present! Struct: " + toString());
|
||||
}
|
||||
// check for sub-struct validity
|
||||
}
|
||||
|
||||
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
||||
|
|
@ -730,5 +637,203 @@ public class CqlMetadata implements org.apache.thrift.TBase<CqlMetadata, CqlMeta
|
|||
}
|
||||
}
|
||||
|
||||
private static class CqlMetadataStandardSchemeFactory implements SchemeFactory {
|
||||
public CqlMetadataStandardScheme getScheme() {
|
||||
return new CqlMetadataStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class CqlMetadataStandardScheme extends StandardScheme<CqlMetadata> {
|
||||
|
||||
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<ByteBuffer,String>(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<ByteBuffer,String>(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<ByteBuffer, String> _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<ByteBuffer, String> _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<CqlMetadata> {
|
||||
|
||||
@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<ByteBuffer, String> _iter156 : struct.name_types.entrySet())
|
||||
{
|
||||
oprot.writeBinary(_iter156.getKey());
|
||||
oprot.writeString(_iter156.getValue());
|
||||
}
|
||||
}
|
||||
{
|
||||
oprot.writeI32(struct.value_types.size());
|
||||
for (Map.Entry<ByteBuffer, String> _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<ByteBuffer,String>(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<ByteBuffer,String>(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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<CqlPreparedRes
|
|||
private static final org.apache.thrift.protocol.TField VARIABLE_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("variable_types", org.apache.thrift.protocol.TType.LIST, (short)3);
|
||||
private static final org.apache.thrift.protocol.TField VARIABLE_NAMES_FIELD_DESC = new org.apache.thrift.protocol.TField("variable_names", org.apache.thrift.protocol.TType.LIST, (short)4);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new CqlPreparedResultStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new CqlPreparedResultTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public int itemId; // required
|
||||
public int count; // required
|
||||
public List<String> variable_types; // required
|
||||
public List<String> variable_names; // required
|
||||
public List<String> variable_types; // optional
|
||||
public List<String> 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<CqlPreparedRes
|
|||
// isset id assignments
|
||||
private static final int __ITEMID_ISSET_ID = 0;
|
||||
private static final int __COUNT_ISSET_ID = 1;
|
||||
private BitSet __isset_bit_vector = new BitSet(2);
|
||||
|
||||
private byte __isset_bitfield = 0;
|
||||
private _Fields optionals[] = {_Fields.VARIABLE_TYPES,_Fields.VARIABLE_NAMES};
|
||||
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);
|
||||
|
|
@ -162,8 +178,7 @@ public class CqlPreparedResult implements org.apache.thrift.TBase<CqlPreparedRes
|
|||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
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<CqlPreparedRes
|
|||
}
|
||||
|
||||
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 getCount() {
|
||||
|
|
@ -230,16 +245,16 @@ public class CqlPreparedResult implements org.apache.thrift.TBase<CqlPreparedRes
|
|||
}
|
||||
|
||||
public void unsetCount() {
|
||||
__isset_bit_vector.clear(__COUNT_ISSET_ID);
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field count is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetCount() {
|
||||
return __isset_bit_vector.get(__COUNT_ISSET_ID);
|
||||
return EncodingUtils.testBit(__isset_bitfield, __COUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setCountIsSet(boolean value) {
|
||||
__isset_bit_vector.set(__COUNT_ISSET_ID, value);
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COUNT_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public int getVariable_typesSize() {
|
||||
|
|
@ -529,122 +544,11 @@ public class CqlPreparedResult implements org.apache.thrift.TBase<CqlPreparedRes
|
|||
}
|
||||
|
||||
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: // 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;
|
||||
case 3: // VARIABLE_TYPES
|
||||
if (field.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list87 = iprot.readListBegin();
|
||||
this.variable_types = new ArrayList<String>(_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<String>(_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<CqlPreparedRes
|
|||
// check for required fields
|
||||
// alas, we cannot check 'itemId' because it's a primitive and you chose the non-beans generator.
|
||||
// alas, we cannot check 'count' 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 {
|
||||
|
|
@ -700,12 +605,221 @@ public class CqlPreparedResult implements org.apache.thrift.TBase<CqlPreparedRes
|
|||
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 CqlPreparedResultStandardSchemeFactory implements SchemeFactory {
|
||||
public CqlPreparedResultStandardScheme getScheme() {
|
||||
return new CqlPreparedResultStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class CqlPreparedResultStandardScheme extends StandardScheme<CqlPreparedResult> {
|
||||
|
||||
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<String>(_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<String>(_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<CqlPreparedResult> {
|
||||
|
||||
@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<String>(_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<String>(_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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<CqlResult, CqlResult._
|
|||
private static final org.apache.thrift.protocol.TField NUM_FIELD_DESC = new org.apache.thrift.protocol.TField("num", org.apache.thrift.protocol.TType.I32, (short)3);
|
||||
private static final org.apache.thrift.protocol.TField SCHEMA_FIELD_DESC = new org.apache.thrift.protocol.TField("schema", org.apache.thrift.protocol.TType.STRUCT, (short)4);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new CqlResultStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new CqlResultTupleSchemeFactory());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see CqlResultType
|
||||
*/
|
||||
public CqlResultType type; // required
|
||||
public List<CqlRow> rows; // required
|
||||
public int num; // required
|
||||
public CqlMetadata schema; // required
|
||||
public List<CqlRow> 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<CqlResult, CqlResult._
|
|||
|
||||
// isset id assignments
|
||||
private static final int __NUM_ISSET_ID = 0;
|
||||
private BitSet __isset_bit_vector = new BitSet(1);
|
||||
|
||||
private byte __isset_bitfield = 0;
|
||||
private _Fields optionals[] = {_Fields.ROWS,_Fields.NUM,_Fields.SCHEMA};
|
||||
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);
|
||||
|
|
@ -164,8 +180,7 @@ public class CqlResult implements org.apache.thrift.TBase<CqlResult, CqlResult._
|
|||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
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<CqlResult, CqlResult._
|
|||
}
|
||||
|
||||
public void unsetNum() {
|
||||
__isset_bit_vector.clear(__NUM_ISSET_ID);
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field num is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetNum() {
|
||||
return __isset_bit_vector.get(__NUM_ISSET_ID);
|
||||
return EncodingUtils.testBit(__isset_bitfield, __NUM_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setNumIsSet(boolean value) {
|
||||
__isset_bit_vector.set(__NUM_ISSET_ID, value);
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public CqlMetadata getSchema() {
|
||||
|
|
@ -522,104 +537,11 @@ public class CqlResult implements org.apache.thrift.TBase<CqlResult, CqlResult._
|
|||
}
|
||||
|
||||
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: // TYPE
|
||||
if (field.type == org.apache.thrift.protocol.TType.I32) {
|
||||
this.type = CqlResultType.findByValue(iprot.readI32());
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 2: // ROWS
|
||||
if (field.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list83 = iprot.readListBegin();
|
||||
this.rows = new ArrayList<CqlRow>(_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<CqlResult, CqlResult._
|
|||
if (type == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' was not present! Struct: " + toString());
|
||||
}
|
||||
// check for sub-struct validity
|
||||
if (schema != null) {
|
||||
schema.validate();
|
||||
}
|
||||
}
|
||||
|
||||
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
||||
|
|
@ -682,12 +608,198 @@ public class CqlResult implements org.apache.thrift.TBase<CqlResult, CqlResult._
|
|||
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 CqlResultStandardSchemeFactory implements SchemeFactory {
|
||||
public CqlResultStandardScheme getScheme() {
|
||||
return new CqlResultStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class CqlResultStandardScheme extends StandardScheme<CqlResult> {
|
||||
|
||||
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<CqlRow>(_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<CqlResult> {
|
||||
|
||||
@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<CqlRow>(_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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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<CqlRow, CqlRow._Fields>,
|
|||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new CqlRowStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new CqlRowTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public ByteBuffer key; // required
|
||||
public List<Column> columns; // required
|
||||
|
||||
|
|
@ -116,7 +132,6 @@ public class CqlRow implements org.apache.thrift.TBase<CqlRow, CqlRow._Fields>,
|
|||
}
|
||||
|
||||
// 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<CqlRow, CqlRow._Fields>,
|
|||
}
|
||||
|
||||
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<Column>(_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<CqlRow, CqlRow._Fields>,
|
|||
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<CqlRow, CqlRow._Fields>,
|
|||
}
|
||||
}
|
||||
|
||||
private static class CqlRowStandardSchemeFactory implements SchemeFactory {
|
||||
public CqlRowStandardScheme getScheme() {
|
||||
return new CqlRowStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class CqlRowStandardScheme extends StandardScheme<CqlRow> {
|
||||
|
||||
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<Column>(_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<CqlRow> {
|
||||
|
||||
@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<Column>(_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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<Deletion, Deletion._Fie
|
|||
private static final org.apache.thrift.protocol.TField SUPER_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("super_column", org.apache.thrift.protocol.TType.STRING, (short)2);
|
||||
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);
|
||||
|
||||
public long timestamp; // required
|
||||
public ByteBuffer super_column; // required
|
||||
public SlicePredicate predicate; // required
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<Deletion, Deletion._Fie
|
|||
|
||||
// isset id assignments
|
||||
private static final int __TIMESTAMP_ISSET_ID = 0;
|
||||
private BitSet __isset_bit_vector = new BitSet(1);
|
||||
|
||||
private byte __isset_bitfield = 0;
|
||||
private _Fields optionals[] = {_Fields.TIMESTAMP,_Fields.SUPER_COLUMN,_Fields.PREDICATE};
|
||||
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);
|
||||
|
|
@ -144,8 +160,7 @@ public class Deletion implements org.apache.thrift.TBase<Deletion, Deletion._Fie
|
|||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
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<Deletion, Deletion._Fie
|
|||
}
|
||||
|
||||
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 byte[] getSuper_column() {
|
||||
|
|
@ -421,74 +436,11 @@ public class Deletion implements org.apache.thrift.TBase<Deletion, Deletion._Fie
|
|||
}
|
||||
|
||||
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: // 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 2: // SUPER_COLUMN
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
this.super_column = iprot.readBinary();
|
||||
} 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;
|
||||
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 (isSetTimestamp()) {
|
||||
oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
|
||||
oprot.writeI64(this.timestamp);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (this.super_column != null) {
|
||||
if (isSetSuper_column()) {
|
||||
oprot.writeFieldBegin(SUPER_COLUMN_FIELD_DESC);
|
||||
oprot.writeBinary(this.super_column);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
if (this.predicate != null) {
|
||||
if (isSetPredicate()) {
|
||||
oprot.writeFieldBegin(PREDICATE_FIELD_DESC);
|
||||
this.predicate.write(oprot);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -527,6 +479,10 @@ public class Deletion implements org.apache.thrift.TBase<Deletion, Deletion._Fie
|
|||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
// check for sub-struct validity
|
||||
if (predicate != null) {
|
||||
predicate.validate();
|
||||
}
|
||||
}
|
||||
|
||||
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
||||
|
|
@ -540,12 +496,148 @@ public class Deletion implements org.apache.thrift.TBase<Deletion, Deletion._Fie
|
|||
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 DeletionStandardSchemeFactory implements SchemeFactory {
|
||||
public DeletionStandardScheme getScheme() {
|
||||
return new DeletionStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class DeletionStandardScheme extends StandardScheme<Deletion> {
|
||||
|
||||
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<Deletion> {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<EndpointDetails,
|
|||
private static final org.apache.thrift.protocol.TField DATACENTER_FIELD_DESC = new org.apache.thrift.protocol.TField("datacenter", org.apache.thrift.protocol.TType.STRING, (short)2);
|
||||
private static final org.apache.thrift.protocol.TField RACK_FIELD_DESC = new org.apache.thrift.protocol.TField("rack", org.apache.thrift.protocol.TType.STRING, (short)3);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<EndpointDetails,
|
|||
}
|
||||
|
||||
// isset id assignments
|
||||
|
||||
private _Fields optionals[] = {_Fields.RACK};
|
||||
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);
|
||||
|
|
@ -414,70 +430,11 @@ public class EndpointDetails implements org.apache.thrift.TBase<EndpointDetails,
|
|||
}
|
||||
|
||||
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: // HOST
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
this.host = iprot.readString();
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 2: // DATACENTER
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
this.datacenter = iprot.readString();
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 3: // RACK
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
this.rack = 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.host != null) {
|
||||
oprot.writeFieldBegin(HOST_FIELD_DESC);
|
||||
oprot.writeString(this.host);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (this.datacenter != null) {
|
||||
oprot.writeFieldBegin(DATACENTER_FIELD_DESC);
|
||||
oprot.writeString(this.datacenter);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (this.rack != null) {
|
||||
if (isSetRack()) {
|
||||
oprot.writeFieldBegin(RACK_FIELD_DESC);
|
||||
oprot.writeString(this.rack);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -516,6 +473,7 @@ public class EndpointDetails implements org.apache.thrift.TBase<EndpointDetails,
|
|||
|
||||
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 {
|
||||
|
|
@ -534,5 +492,137 @@ public class EndpointDetails implements org.apache.thrift.TBase<EndpointDetails,
|
|||
}
|
||||
}
|
||||
|
||||
private static class EndpointDetailsStandardSchemeFactory implements SchemeFactory {
|
||||
public EndpointDetailsStandardScheme getScheme() {
|
||||
return new EndpointDetailsStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class EndpointDetailsStandardScheme extends StandardScheme<EndpointDetails> {
|
||||
|
||||
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<EndpointDetails> {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<IndexClause, IndexCl
|
|||
private static final org.apache.thrift.protocol.TField START_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("start_key", org.apache.thrift.protocol.TType.STRING, (short)2);
|
||||
private static final org.apache.thrift.protocol.TField COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("count", org.apache.thrift.protocol.TType.I32, (short)3);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new IndexClauseStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new IndexClauseTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public List<IndexExpression> expressions; // required
|
||||
public ByteBuffer start_key; // required
|
||||
public int count; // required
|
||||
|
|
@ -122,8 +138,7 @@ public class IndexClause implements org.apache.thrift.TBase<IndexClause, IndexCl
|
|||
|
||||
// isset id assignments
|
||||
private static final int __COUNT_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);
|
||||
|
|
@ -159,8 +174,7 @@ public class IndexClause implements org.apache.thrift.TBase<IndexClause, IndexCl
|
|||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
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<IndexExpression> __this__expressions = new ArrayList<IndexExpression>();
|
||||
for (IndexExpression other_element : other.expressions) {
|
||||
|
|
@ -271,16 +285,16 @@ public class IndexClause implements org.apache.thrift.TBase<IndexClause, IndexCl
|
|||
}
|
||||
|
||||
public void unsetCount() {
|
||||
__isset_bit_vector.clear(__COUNT_ISSET_ID);
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field count is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetCount() {
|
||||
return __isset_bit_vector.get(__COUNT_ISSET_ID);
|
||||
return EncodingUtils.testBit(__isset_bitfield, __COUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setCountIsSet(boolean value) {
|
||||
__isset_bit_vector.set(__COUNT_ISSET_ID, value);
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COUNT_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
|
|
@ -455,88 +469,11 @@ public class IndexClause implements org.apache.thrift.TBase<IndexClause, IndexCl
|
|||
}
|
||||
|
||||
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: // EXPRESSIONS
|
||||
if (field.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
|
||||
this.expressions = new ArrayList<IndexExpression>(_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<IndexClause, IndexCl
|
|||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'start_key' was not present! Struct: " + toString());
|
||||
}
|
||||
// alas, we cannot check 'count' 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 {
|
||||
|
|
@ -589,12 +527,153 @@ public class IndexClause implements org.apache.thrift.TBase<IndexClause, IndexCl
|
|||
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 IndexClauseStandardSchemeFactory implements SchemeFactory {
|
||||
public IndexClauseStandardScheme getScheme() {
|
||||
return new IndexClauseStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class IndexClauseStandardScheme extends StandardScheme<IndexClause> {
|
||||
|
||||
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<IndexExpression>(_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<IndexClause> {
|
||||
|
||||
@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<IndexExpression>(_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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<IndexExpression,
|
|||
private static final org.apache.thrift.protocol.TField OP_FIELD_DESC = new org.apache.thrift.protocol.TField("op", org.apache.thrift.protocol.TType.I32, (short)2);
|
||||
private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)3);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<IndexExpression,
|
|||
}
|
||||
|
||||
// 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);
|
||||
|
|
@ -454,68 +469,11 @@ public class IndexExpression implements org.apache.thrift.TBase<IndexExpression,
|
|||
}
|
||||
|
||||
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_NAME
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
this.column_name = iprot.readBinary();
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 2: // OP
|
||||
if (field.type == org.apache.thrift.protocol.TType.I32) {
|
||||
this.op = IndexOperator.findByValue(iprot.readI32());
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 3: // 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;
|
||||
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_name != null) {
|
||||
oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC);
|
||||
oprot.writeBinary(this.column_name);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (this.op != null) {
|
||||
oprot.writeFieldBegin(OP_FIELD_DESC);
|
||||
oprot.writeI32(this.op.getValue());
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (this.value != null) {
|
||||
oprot.writeFieldBegin(VALUE_FIELD_DESC);
|
||||
oprot.writeBinary(this.value);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -561,6 +519,7 @@ public class IndexExpression implements org.apache.thrift.TBase<IndexExpression,
|
|||
if (value == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'value' was not present! Struct: " + toString());
|
||||
}
|
||||
// check for sub-struct validity
|
||||
}
|
||||
|
||||
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
||||
|
|
@ -579,5 +538,111 @@ public class IndexExpression implements org.apache.thrift.TBase<IndexExpression,
|
|||
}
|
||||
}
|
||||
|
||||
private static class IndexExpressionStandardSchemeFactory implements SchemeFactory {
|
||||
public IndexExpressionStandardScheme getScheme() {
|
||||
return new IndexExpressionStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class IndexExpressionStandardScheme extends StandardScheme<IndexExpression> {
|
||||
|
||||
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<IndexExpression> {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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<InvalidRequestException, InvalidRequestException._Fields>, java.io.Serializable, Cloneable {
|
||||
public class InvalidRequestException extends TException implements org.apache.thrift.TBase<InvalidRequestException, InvalidRequestException._Fields>, 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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<InvalidRequestException> {
|
||||
|
||||
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<InvalidRequestException> {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<KeyCount, KeyCount._Fie
|
|||
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 COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("count", org.apache.thrift.protocol.TType.I32, (short)2);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<KeyCount, KeyCount._Fie
|
|||
|
||||
// isset id assignments
|
||||
private static final int __COUNT_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);
|
||||
|
|
@ -144,8 +159,7 @@ public class KeyCount implements org.apache.thrift.TBase<KeyCount, KeyCount._Fie
|
|||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
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<KeyCount, KeyCount._Fie
|
|||
}
|
||||
|
||||
public void unsetCount() {
|
||||
__isset_bit_vector.clear(__COUNT_ISSET_ID);
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field count is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetCount() {
|
||||
return __isset_bit_vector.get(__COUNT_ISSET_ID);
|
||||
return EncodingUtils.testBit(__isset_bitfield, __COUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setCountIsSet(boolean value) {
|
||||
__isset_bit_vector.set(__COUNT_ISSET_ID, value);
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COUNT_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
|
|
@ -356,58 +370,11 @@ public class KeyCount implements org.apache.thrift.TBase<KeyCount, KeyCount._Fie
|
|||
}
|
||||
|
||||
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: // 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.key != null) {
|
||||
oprot.writeFieldBegin(KEY_FIELD_DESC);
|
||||
oprot.writeBinary(this.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
|
||||
|
|
@ -436,6 +403,7 @@ public class KeyCount implements org.apache.thrift.TBase<KeyCount, KeyCount._Fie
|
|||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'key' was not present! Struct: " + toString());
|
||||
}
|
||||
// alas, we cannot check 'count' 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 {
|
||||
|
|
@ -449,12 +417,103 @@ public class KeyCount implements org.apache.thrift.TBase<KeyCount, KeyCount._Fie
|
|||
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 KeyCountStandardSchemeFactory implements SchemeFactory {
|
||||
public KeyCountStandardScheme getScheme() {
|
||||
return new KeyCountStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class KeyCountStandardScheme extends StandardScheme<KeyCount> {
|
||||
|
||||
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<KeyCount> {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<KeyRange, KeyRange._Fie
|
|||
private static final org.apache.thrift.protocol.TField ROW_FILTER_FIELD_DESC = new org.apache.thrift.protocol.TField("row_filter", org.apache.thrift.protocol.TType.LIST, (short)6);
|
||||
private static final org.apache.thrift.protocol.TField COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("count", org.apache.thrift.protocol.TType.I32, (short)5);
|
||||
|
||||
public ByteBuffer start_key; // required
|
||||
public ByteBuffer end_key; // required
|
||||
public String start_token; // required
|
||||
public String end_token; // required
|
||||
public List<IndexExpression> row_filter; // required
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<IndexExpression> 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<KeyRange, KeyRange._Fie
|
|||
|
||||
// isset id assignments
|
||||
private static final int __COUNT_ISSET_ID = 0;
|
||||
private BitSet __isset_bit_vector = new BitSet(1);
|
||||
|
||||
private byte __isset_bitfield = 0;
|
||||
private _Fields optionals[] = {_Fields.START_KEY,_Fields.END_KEY,_Fields.START_TOKEN,_Fields.END_TOKEN,_Fields.ROW_FILTER};
|
||||
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);
|
||||
|
|
@ -181,8 +197,7 @@ public class KeyRange implements org.apache.thrift.TBase<KeyRange, KeyRange._Fie
|
|||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
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<KeyRange, KeyRange._Fie
|
|||
}
|
||||
|
||||
public void unsetCount() {
|
||||
__isset_bit_vector.clear(__COUNT_ISSET_ID);
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field count is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetCount() {
|
||||
return __isset_bit_vector.get(__COUNT_ISSET_ID);
|
||||
return EncodingUtils.testBit(__isset_bitfield, __COUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setCountIsSet(boolean value) {
|
||||
__isset_bit_vector.set(__COUNT_ISSET_ID, value);
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COUNT_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
|
|
@ -683,134 +698,11 @@ public class KeyRange implements org.apache.thrift.TBase<KeyRange, KeyRange._Fie
|
|||
}
|
||||
|
||||
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: // 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 2: // END_KEY
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
this.end_key = iprot.readBinary();
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 3: // 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 4: // 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 6: // ROW_FILTER
|
||||
if (field.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
|
||||
this.row_filter = new ArrayList<IndexExpression>(_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<KeyRange, KeyRange._Fie
|
|||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
// alas, we cannot check 'count' 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 {
|
||||
|
|
@ -891,12 +784,249 @@ public class KeyRange implements org.apache.thrift.TBase<KeyRange, KeyRange._Fie
|
|||
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 KeyRangeStandardSchemeFactory implements SchemeFactory {
|
||||
public KeyRangeStandardScheme getScheme() {
|
||||
return new KeyRangeStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class KeyRangeStandardScheme extends StandardScheme<KeyRange> {
|
||||
|
||||
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<IndexExpression>(_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<KeyRange> {
|
||||
|
||||
@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<IndexExpression>(_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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<KeySlice, KeySlice._Fie
|
|||
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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new KeySliceStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new KeySliceTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public ByteBuffer key; // required
|
||||
public List<ColumnOrSuperColumn> columns; // required
|
||||
|
||||
|
|
@ -120,7 +136,6 @@ public class KeySlice implements org.apache.thrift.TBase<KeySlice, KeySlice._Fie
|
|||
}
|
||||
|
||||
// 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);
|
||||
|
|
@ -380,74 +395,11 @@ public class KeySlice implements org.apache.thrift.TBase<KeySlice, KeySlice._Fie
|
|||
}
|
||||
|
||||
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 _list20 = iprot.readListBegin();
|
||||
this.columns = new ArrayList<ColumnOrSuperColumn>(_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<KeySlice, KeySlice._Fie
|
|||
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 {
|
||||
|
|
@ -500,5 +453,129 @@ public class KeySlice implements org.apache.thrift.TBase<KeySlice, KeySlice._Fie
|
|||
}
|
||||
}
|
||||
|
||||
private static class KeySliceStandardSchemeFactory implements SchemeFactory {
|
||||
public KeySliceStandardScheme getScheme() {
|
||||
return new KeySliceStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class KeySliceStandardScheme extends StandardScheme<KeySlice> {
|
||||
|
||||
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<ColumnOrSuperColumn>(_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<KeySlice> {
|
||||
|
||||
@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<ColumnOrSuperColumn>(_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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<KsDef, KsDef._Fields>, 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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String,String> strategy_options; // required
|
||||
public Map<String,String> strategy_options; // optional
|
||||
/**
|
||||
* @deprecated ignored
|
||||
*/
|
||||
public int replication_factor; // required
|
||||
public int replication_factor; // optional
|
||||
public List<CfDef> 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<KsDef, KsDef._Fields>, 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<KsDef, KsDef._Fields>, jav
|
|||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
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<KsDef, KsDef._Fields>, 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<KsDef, KsDef._Fields>, 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<KsDef, KsDef._Fields>, 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<String,String>(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<CfDef>(_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<String, String> _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<KsDef, KsDef._Fields>, 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<KsDef, KsDef._Fields>, 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<KsDef> {
|
||||
|
||||
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<String,String>(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<CfDef>(_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<String, String> _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<KsDef> {
|
||||
|
||||
@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<String, String> _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<CfDef>(_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<String,String>(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<Mutation, Mutation._Fie
|
|||
private static final org.apache.thrift.protocol.TField COLUMN_OR_SUPERCOLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column_or_supercolumn", org.apache.thrift.protocol.TType.STRUCT, (short)1);
|
||||
private static final org.apache.thrift.protocol.TField DELETION_FIELD_DESC = new org.apache.thrift.protocol.TField("deletion", org.apache.thrift.protocol.TType.STRUCT, (short)2);
|
||||
|
||||
public ColumnOrSuperColumn column_or_supercolumn; // required
|
||||
public Deletion deletion; // required
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<Mutation, Mutation._Fie
|
|||
}
|
||||
|
||||
// isset id assignments
|
||||
|
||||
private _Fields optionals[] = {_Fields.COLUMN_OR_SUPERCOLUMN,_Fields.DELETION};
|
||||
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);
|
||||
|
|
@ -338,62 +354,11 @@ public class Mutation implements org.apache.thrift.TBase<Mutation, Mutation._Fie
|
|||
}
|
||||
|
||||
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_OR_SUPERCOLUMN
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
|
||||
this.column_or_supercolumn = new ColumnOrSuperColumn();
|
||||
this.column_or_supercolumn.read(iprot);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 2: // DELETION
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
|
||||
this.deletion = new Deletion();
|
||||
this.deletion.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_or_supercolumn != null) {
|
||||
if (isSetColumn_or_supercolumn()) {
|
||||
oprot.writeFieldBegin(COLUMN_OR_SUPERCOLUMN_FIELD_DESC);
|
||||
this.column_or_supercolumn.write(oprot);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
if (this.deletion != null) {
|
||||
if (isSetDeletion()) {
|
||||
oprot.writeFieldBegin(DELETION_FIELD_DESC);
|
||||
this.deletion.write(oprot);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -426,6 +391,13 @@ public class Mutation implements org.apache.thrift.TBase<Mutation, Mutation._Fie
|
|||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
// check for sub-struct validity
|
||||
if (column_or_supercolumn != null) {
|
||||
column_or_supercolumn.validate();
|
||||
}
|
||||
if (deletion != null) {
|
||||
deletion.validate();
|
||||
}
|
||||
}
|
||||
|
||||
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
||||
|
|
@ -444,5 +416,120 @@ public class Mutation implements org.apache.thrift.TBase<Mutation, Mutation._Fie
|
|||
}
|
||||
}
|
||||
|
||||
private static class MutationStandardSchemeFactory implements SchemeFactory {
|
||||
public MutationStandardScheme getScheme() {
|
||||
return new MutationStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class MutationStandardScheme extends StandardScheme<Mutation> {
|
||||
|
||||
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<Mutation> {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<NotFoundException, NotFoundException._Fields>, java.io.Serializable, Cloneable {
|
||||
public class NotFoundException extends TException implements org.apache.thrift.TBase<NotFoundException, NotFoundException._Fields>, 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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<NotFoundException> {
|
||||
|
||||
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<NotFoundException> {
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<SchemaDisagreementException, SchemaDisagreementException._Fields>, java.io.Serializable, Cloneable {
|
||||
public class SchemaDisagreementException extends TException implements org.apache.thrift.TBase<SchemaDisagreementException, SchemaDisagreementException._Fields>, 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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<SchemaDisagreementException> {
|
||||
|
||||
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<SchemaDisagreementException> {
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<SlicePredicate, S
|
|||
private static final org.apache.thrift.protocol.TField COLUMN_NAMES_FIELD_DESC = new org.apache.thrift.protocol.TField("column_names", org.apache.thrift.protocol.TType.LIST, (short)1);
|
||||
private static final org.apache.thrift.protocol.TField SLICE_RANGE_FIELD_DESC = new org.apache.thrift.protocol.TField("slice_range", org.apache.thrift.protocol.TType.STRUCT, (short)2);
|
||||
|
||||
public List<ByteBuffer> column_names; // required
|
||||
public SliceRange slice_range; // required
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new SlicePredicateStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new SlicePredicateTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public List<ByteBuffer> 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<SlicePredicate, S
|
|||
}
|
||||
|
||||
// isset id assignments
|
||||
|
||||
private _Fields optionals[] = {_Fields.COLUMN_NAMES,_Fields.SLICE_RANGE};
|
||||
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);
|
||||
|
|
@ -367,78 +383,11 @@ public class SlicePredicate implements org.apache.thrift.TBase<SlicePredicate, S
|
|||
}
|
||||
|
||||
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_NAMES
|
||||
if (field.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
|
||||
this.column_names = new ArrayList<ByteBuffer>(_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<SlicePredicate, S
|
|||
|
||||
public void validate() throws org.apache.thrift.TException {
|
||||
// check for required fields
|
||||
// check for sub-struct validity
|
||||
if (slice_range != null) {
|
||||
slice_range.validate();
|
||||
}
|
||||
}
|
||||
|
||||
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
||||
|
|
@ -489,5 +442,150 @@ public class SlicePredicate implements org.apache.thrift.TBase<SlicePredicate, S
|
|||
}
|
||||
}
|
||||
|
||||
private static class SlicePredicateStandardSchemeFactory implements SchemeFactory {
|
||||
public SlicePredicateStandardScheme getScheme() {
|
||||
return new SlicePredicateStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class SlicePredicateStandardScheme extends StandardScheme<SlicePredicate> {
|
||||
|
||||
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<ByteBuffer>(_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<SlicePredicate> {
|
||||
|
||||
@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<ByteBuffer>(_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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<SliceRange, SliceRang
|
|||
private static final org.apache.thrift.protocol.TField REVERSED_FIELD_DESC = new org.apache.thrift.protocol.TField("reversed", org.apache.thrift.protocol.TType.BOOL, (short)3);
|
||||
private static final org.apache.thrift.protocol.TField COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("count", org.apache.thrift.protocol.TType.I32, (short)4);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<SliceRange, SliceRang
|
|||
// isset id assignments
|
||||
private static final int __REVERSED_ISSET_ID = 0;
|
||||
private static final int __COUNT_ISSET_ID = 1;
|
||||
private BitSet __isset_bit_vector = new BitSet(2);
|
||||
|
||||
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);
|
||||
|
|
@ -184,8 +199,7 @@ public class SliceRange implements org.apache.thrift.TBase<SliceRange, SliceRang
|
|||
* Performs a deep copy on <i>other</i>.
|
||||
*/
|
||||
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<SliceRange, SliceRang
|
|||
}
|
||||
|
||||
public void unsetReversed() {
|
||||
__isset_bit_vector.clear(__REVERSED_ISSET_ID);
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REVERSED_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field reversed is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetReversed() {
|
||||
return __isset_bit_vector.get(__REVERSED_ISSET_ID);
|
||||
return EncodingUtils.testBit(__isset_bitfield, __REVERSED_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setReversedIsSet(boolean value) {
|
||||
__isset_bit_vector.set(__REVERSED_ISSET_ID, value);
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REVERSED_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
|
|
@ -314,16 +328,16 @@ public class SliceRange implements org.apache.thrift.TBase<SliceRange, SliceRang
|
|||
}
|
||||
|
||||
public void unsetCount() {
|
||||
__isset_bit_vector.clear(__COUNT_ISSET_ID);
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field count is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetCount() {
|
||||
return __isset_bit_vector.get(__COUNT_ISSET_ID);
|
||||
return EncodingUtils.testBit(__isset_bitfield, __COUNT_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setCountIsSet(boolean value) {
|
||||
__isset_bit_vector.set(__COUNT_ISSET_ID, value);
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COUNT_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
|
|
@ -535,84 +549,11 @@ public class SliceRange implements org.apache.thrift.TBase<SliceRange, SliceRang
|
|||
}
|
||||
|
||||
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: // START
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
this.start = iprot.readBinary();
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 2: // FINISH
|
||||
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
||||
this.finish = iprot.readBinary();
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 3: // REVERSED
|
||||
if (field.type == org.apache.thrift.protocol.TType.BOOL) {
|
||||
this.reversed = iprot.readBool();
|
||||
setReversedIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 4: // 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 (!isSetReversed()) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'reversed' 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);
|
||||
if (this.start != null) {
|
||||
oprot.writeFieldBegin(START_FIELD_DESC);
|
||||
oprot.writeBinary(this.start);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (this.finish != null) {
|
||||
oprot.writeFieldBegin(FINISH_FIELD_DESC);
|
||||
oprot.writeBinary(this.finish);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldBegin(REVERSED_FIELD_DESC);
|
||||
oprot.writeBool(this.reversed);
|
||||
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
|
||||
|
|
@ -657,6 +598,7 @@ public class SliceRange implements org.apache.thrift.TBase<SliceRange, SliceRang
|
|||
}
|
||||
// alas, we cannot check 'reversed' because it's a primitive and you chose the non-beans generator.
|
||||
// alas, we cannot check 'count' 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 {
|
||||
|
|
@ -670,12 +612,136 @@ public class SliceRange implements org.apache.thrift.TBase<SliceRange, SliceRang
|
|||
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 SliceRangeStandardSchemeFactory implements SchemeFactory {
|
||||
public SliceRangeStandardScheme getScheme() {
|
||||
return new SliceRangeStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class SliceRangeStandardScheme extends StandardScheme<SliceRange> {
|
||||
|
||||
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<SliceRange> {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<SuperColumn, SuperCo
|
|||
private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
|
||||
private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)2);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
schemes.put(StandardScheme.class, new SuperColumnStandardSchemeFactory());
|
||||
schemes.put(TupleScheme.class, new SuperColumnTupleSchemeFactory());
|
||||
}
|
||||
|
||||
public ByteBuffer name; // required
|
||||
public List<Column> columns; // required
|
||||
|
||||
|
|
@ -119,7 +135,6 @@ public class SuperColumn implements org.apache.thrift.TBase<SuperColumn, SuperCo
|
|||
}
|
||||
|
||||
// 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);
|
||||
|
|
@ -379,74 +394,11 @@ public class SuperColumn implements org.apache.thrift.TBase<SuperColumn, SuperCo
|
|||
}
|
||||
|
||||
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: // COLUMNS
|
||||
if (field.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
|
||||
this.columns = new ArrayList<Column>(_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<SuperColumn, SuperCo
|
|||
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 {
|
||||
|
|
@ -499,5 +452,129 @@ public class SuperColumn implements org.apache.thrift.TBase<SuperColumn, SuperCo
|
|||
}
|
||||
}
|
||||
|
||||
private static class SuperColumnStandardSchemeFactory implements SchemeFactory {
|
||||
public SuperColumnStandardScheme getScheme() {
|
||||
return new SuperColumnStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class SuperColumnStandardScheme extends StandardScheme<SuperColumn> {
|
||||
|
||||
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<Column>(_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<SuperColumn> {
|
||||
|
||||
@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<Column>(_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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<TimedOutException, TimedOutException._Fields>, java.io.Serializable, Cloneable {
|
||||
public class TimedOutException extends TException implements org.apache.thrift.TBase<TimedOutException, TimedOutException._Fields>, 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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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 <i>other</i>.
|
||||
*/
|
||||
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<TimedOutException> {
|
||||
|
||||
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<TimedOutException> {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<TokenRange, TokenRang
|
|||
private static final org.apache.thrift.protocol.TField RPC_ENDPOINTS_FIELD_DESC = new org.apache.thrift.protocol.TField("rpc_endpoints", org.apache.thrift.protocol.TType.LIST, (short)4);
|
||||
private static final org.apache.thrift.protocol.TField ENDPOINT_DETAILS_FIELD_DESC = new org.apache.thrift.protocol.TField("endpoint_details", org.apache.thrift.protocol.TType.LIST, (short)5);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<String> endpoints; // required
|
||||
public List<String> rpc_endpoints; // required
|
||||
public List<EndpointDetails> endpoint_details; // required
|
||||
public List<String> rpc_endpoints; // optional
|
||||
public List<EndpointDetails> 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<TokenRange, TokenRang
|
|||
}
|
||||
|
||||
// isset id assignments
|
||||
|
||||
private _Fields optionals[] = {_Fields.RPC_ENDPOINTS,_Fields.ENDPOINT_DETAILS};
|
||||
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);
|
||||
|
|
@ -628,148 +644,11 @@ public class TokenRange implements org.apache.thrift.TBase<TokenRange, TokenRang
|
|||
}
|
||||
|
||||
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: // 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 2: // 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 3: // ENDPOINTS
|
||||
if (field.type == org.apache.thrift.protocol.TType.LIST) {
|
||||
{
|
||||
org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
|
||||
this.endpoints = new ArrayList<String>(_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<String>(_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<EndpointDetails>(_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<TokenRange, TokenRang
|
|||
if (endpoints == null) {
|
||||
throw new org.apache.thrift.protocol.TProtocolException("Required field 'endpoints' was not present! Struct: " + toString());
|
||||
}
|
||||
// check for sub-struct validity
|
||||
}
|
||||
|
||||
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
||||
|
|
@ -853,5 +733,262 @@ public class TokenRange implements org.apache.thrift.TBase<TokenRange, TokenRang
|
|||
}
|
||||
}
|
||||
|
||||
private static class TokenRangeStandardSchemeFactory implements SchemeFactory {
|
||||
public TokenRangeStandardScheme getScheme() {
|
||||
return new TokenRangeStandardScheme();
|
||||
}
|
||||
}
|
||||
|
||||
private static class TokenRangeStandardScheme extends StandardScheme<TokenRange> {
|
||||
|
||||
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<String>(_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<String>(_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<EndpointDetails>(_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<TokenRange> {
|
||||
|
||||
@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<String>(_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<String>(_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<EndpointDetails>(_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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<UnavailableException, UnavailableException._Fields>, java.io.Serializable, Cloneable {
|
||||
public class UnavailableException extends TException implements org.apache.thrift.TBase<UnavailableException, UnavailableException._Fields>, 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<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, 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<UnavailableException> {
|
||||
|
||||
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<UnavailableException> {
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
|
|
|
|||
|
|
@ -271,11 +271,11 @@ public class ColumnFamilyInputFormat extends InputFormat<ByteBuffer, SortedMap<B
|
|||
{
|
||||
logger.debug("failed connect to endpoint " + host, e);
|
||||
}
|
||||
catch (TException e)
|
||||
catch (InvalidRequestException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
catch (InvalidRequestException e)
|
||||
catch (TException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
@ -302,11 +302,11 @@ public class ColumnFamilyInputFormat extends InputFormat<ByteBuffer, SortedMap<B
|
|||
{
|
||||
map = client.describe_ring(ConfigHelper.getInputKeyspace(conf));
|
||||
}
|
||||
catch (TException e)
|
||||
catch (InvalidRequestException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
catch (InvalidRequestException e)
|
||||
catch (TException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1095,10 +1095,6 @@ public class CassandraStorage extends LoadFunc implements StoreFuncInterface, Lo
|
|||
column_family,
|
||||
keyspace));
|
||||
}
|
||||
catch (TException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
catch (InvalidRequestException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
|
|
@ -1107,6 +1103,10 @@ public class CassandraStorage extends LoadFunc implements StoreFuncInterface, Lo
|
|||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
catch (TException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ import org.apache.cassandra.net.MessagingService;
|
|||
import org.apache.cassandra.net.ResponseVerbHandler;
|
||||
import org.apache.cassandra.service.AntiEntropyService.TreeRequestVerbHandler;
|
||||
import org.apache.cassandra.streaming.*;
|
||||
import org.apache.cassandra.thrift.Constants;
|
||||
import org.apache.cassandra.thrift.cassandraConstants;
|
||||
import org.apache.cassandra.thrift.EndpointDetails;
|
||||
import org.apache.cassandra.thrift.TokenRange;
|
||||
import org.apache.cassandra.tracing.Tracing;
|
||||
|
|
@ -409,7 +409,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
|
|||
public synchronized void initServer(int delay) throws ConfigurationException
|
||||
{
|
||||
logger.info("Cassandra version: " + FBUtilities.getReleaseVersionString());
|
||||
logger.info("Thrift API version: " + Constants.VERSION);
|
||||
logger.info("Thrift API version: " + cassandraConstants.VERSION);
|
||||
logger.info("CQL supported versions: " + StringUtils.join(ClientState.getCQLSupportedVersion(), ",") + " (default: " + ClientState.DEFAULT_CQL_VERSION + ")");
|
||||
|
||||
if (initialized)
|
||||
|
|
|
|||
|
|
@ -1309,7 +1309,7 @@ public class CassandraServer implements Cassandra.Iface
|
|||
|
||||
public String describe_version() throws TException
|
||||
{
|
||||
return Constants.VERSION;
|
||||
return cassandraConstants.VERSION;
|
||||
}
|
||||
|
||||
public List<TokenRange> describe_ring(String keyspace) throws InvalidRequestException
|
||||
|
|
|
|||
|
|
@ -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<SelectorThread> ioThreads = new HashSet<SelectorThread>();
|
||||
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<FrameBuffer> selectInterestChanges = new HashSet<FrameBuffer>();
|
||||
|
||||
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<SelectionKey> 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<Runnable>(),
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue