update to thrift trunk and rename jar after the svn revision (806014). inline our map typedef to work around regression introduced in THRIFT-144. add slf4j dependencies (required since THRIFT-558). regenerate thrift structs with new version.

patch by jbellis for CASSANDRA-308, CASSANDRA-387

git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@808559 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2009-08-27 18:11:58 +00:00
parent ba88f55d1f
commit 0f56a25553
19 changed files with 1367 additions and 239 deletions

View File

@ -1,3 +1,4 @@
#!/usr/local/bin/thrift --java --php --py
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
@ -106,11 +107,9 @@ struct SlicePredicate {
2: optional SliceRange slice_range,
}
typedef map<string, list<ColumnOrSuperColumn>> column_family_map
struct BatchMutation {
1: string key,
2: column_family_map cfmap,
1: string key,
2: map<string, list<ColumnOrSuperColumn>> cfmap,
}

View File

@ -33,7 +33,9 @@ import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import org.apache.log4j.Logger;
import java.util.BitSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
@ -49,15 +51,16 @@ public class BatchMutation implements TBase, java.io.Serializable, Cloneable {
public Map<String,List<ColumnOrSuperColumn>> cfmap;
public static final int CFMAP = 2;
private final Isset __isset = new Isset();
private static final class Isset implements java.io.Serializable {
}
// isset id assignments
public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.STRING)));
put(CFMAP, new FieldMetaData("cfmap", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.MAP)));
new MapMetaData(TType.MAP,
new FieldValueMetaData(TType.STRING),
new ListMetaData(TType.LIST,
new StructMetaData(TType.STRUCT, ColumnOrSuperColumn.class)))));
}});
static {
@ -84,7 +87,22 @@ public class BatchMutation implements TBase, java.io.Serializable, Cloneable {
this.key = other.key;
}
if (other.isSetCfmap()) {
this.cfmap = other.cfmap;
Map<String,List<ColumnOrSuperColumn>> __this__cfmap = new HashMap<String,List<ColumnOrSuperColumn>>();
for (Map.Entry<String, List<ColumnOrSuperColumn>> other_element : other.cfmap.entrySet()) {
String other_element_key = other_element.getKey();
List<ColumnOrSuperColumn> other_element_value = other_element.getValue();
String __this__cfmap_copy_key = other_element_key;
List<ColumnOrSuperColumn> __this__cfmap_copy_value = new ArrayList<ColumnOrSuperColumn>();
for (ColumnOrSuperColumn other_element_value_element : other_element_value) {
__this__cfmap_copy_value.add(new ColumnOrSuperColumn(other_element_value_element));
}
__this__cfmap.put(__this__cfmap_copy_key, __this__cfmap_copy_value);
}
this.cfmap = __this__cfmap;
}
}
@ -346,6 +364,12 @@ public class BatchMutation implements TBase, java.io.Serializable, Cloneable {
public void validate() throws TException {
// check for required fields
if (key == null) {
throw new TProtocolException("Required field 'key' was not present! Struct: " + toString());
}
if (cfmap == null) {
throw new TProtocolException("Required field 'cfmap' was not present! Struct: " + toString());
}
// check that fields of type enum have valid values
}

File diff suppressed because it is too large Load Diff

View File

@ -33,13 +33,15 @@ import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import org.apache.log4j.Logger;
import java.util.BitSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
public class Column implements TBase, java.io.Serializable, Cloneable {
public class Column implements TBase, java.io.Serializable, Cloneable, Comparable<Column> {
private static final TStruct STRUCT_DESC = new TStruct("Column");
private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1);
private static final TField VALUE_FIELD_DESC = new TField("value", TType.STRING, (short)2);
@ -52,10 +54,9 @@ public class Column implements TBase, java.io.Serializable, Cloneable {
public long timestamp;
public static final int TIMESTAMP = 3;
private final Isset __isset = new Isset();
private static final class Isset implements java.io.Serializable {
public boolean timestamp = false;
}
// isset id assignments
private static final int __TIMESTAMP_ISSET_ID = 0;
private BitSet __isset_bit_vector = new BitSet(1);
public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT,
@ -82,13 +83,15 @@ public class Column implements TBase, java.io.Serializable, Cloneable {
this.name = name;
this.value = value;
this.timestamp = timestamp;
this.__isset.timestamp = true;
setTimestampIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public Column(Column other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
if (other.isSetName()) {
this.name = new byte[other.name.length];
System.arraycopy(other.name, 0, name, 0, other.name.length);
@ -97,7 +100,6 @@ public class Column implements TBase, java.io.Serializable, Cloneable {
this.value = new byte[other.value.length];
System.arraycopy(other.value, 0, value, 0, other.value.length);
}
__isset.timestamp = other.__isset.timestamp;
this.timestamp = other.timestamp;
}
@ -160,21 +162,21 @@ public class Column implements TBase, java.io.Serializable, Cloneable {
public Column setTimestamp(long timestamp) {
this.timestamp = timestamp;
this.__isset.timestamp = true;
setTimestampIsSet(true);
return this;
}
public void unsetTimestamp() {
this.__isset.timestamp = false;
__isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
}
// Returns true if field timestamp is set (has been asigned a value) and false otherwise
public boolean isSetTimestamp() {
return this.__isset.timestamp;
return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
}
public void setTimestampIsSet(boolean value) {
this.__isset.timestamp = value;
__isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
}
public void setFieldValue(int fieldID, Object value) {
@ -286,6 +288,41 @@ public class Column implements TBase, java.io.Serializable, Cloneable {
return 0;
}
public int compareTo(Column other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
Column typedOther = (Column)other;
lastComparison = Boolean.valueOf(isSetName()).compareTo(isSetName());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(name, typedOther.name);
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = Boolean.valueOf(isSetValue()).compareTo(isSetValue());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(value, typedOther.value);
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(isSetTimestamp());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(timestamp, typedOther.timestamp);
if (lastComparison != 0) {
return lastComparison;
}
return 0;
}
public void read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();
@ -314,7 +351,7 @@ public class Column implements TBase, java.io.Serializable, Cloneable {
case TIMESTAMP:
if (field.type == TType.I64) {
this.timestamp = iprot.readI64();
this.__isset.timestamp = true;
setTimestampIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
@ -329,6 +366,9 @@ public class Column implements TBase, java.io.Serializable, Cloneable {
// check for required fields of primitive type, which can't be checked in the validate method
if (!isSetTimestamp()) {
throw new TProtocolException("Required field 'timestamp' was not found in serialized data! Struct: " + toString());
}
validate();
}
@ -393,6 +433,13 @@ public class Column implements TBase, java.io.Serializable, Cloneable {
public void validate() throws TException {
// check for required fields
if (name == null) {
throw new TProtocolException("Required field 'name' was not present! Struct: " + toString());
}
if (value == null) {
throw new TProtocolException("Required field 'value' was not present! Struct: " + toString());
}
// 'timestamp' is only checked in read() because it's a primitive and you chose the non-beans generator.
// check that fields of type enum have valid values
}

View File

@ -33,13 +33,15 @@ import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import org.apache.log4j.Logger;
import java.util.BitSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
public class ColumnOrSuperColumn implements TBase, java.io.Serializable, Cloneable {
public class ColumnOrSuperColumn implements TBase, java.io.Serializable, Cloneable, Comparable<ColumnOrSuperColumn> {
private static final TStruct STRUCT_DESC = new TStruct("ColumnOrSuperColumn");
private static final TField COLUMN_FIELD_DESC = new TField("column", TType.STRUCT, (short)1);
private static final TField SUPER_COLUMN_FIELD_DESC = new TField("super_column", TType.STRUCT, (short)2);
@ -49,9 +51,7 @@ public class ColumnOrSuperColumn implements TBase, java.io.Serializable, Cloneab
public SuperColumn super_column;
public static final int SUPER_COLUMN = 2;
private final Isset __isset = new Isset();
private static final class Isset implements java.io.Serializable {
}
// isset id assignments
public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
put(COLUMN, new FieldMetaData("column", TFieldRequirementType.OPTIONAL,
@ -228,6 +228,33 @@ public class ColumnOrSuperColumn implements TBase, java.io.Serializable, Cloneab
return 0;
}
public int compareTo(ColumnOrSuperColumn other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
ColumnOrSuperColumn typedOther = (ColumnOrSuperColumn)other;
lastComparison = Boolean.valueOf(isSetColumn()).compareTo(isSetColumn());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(column, typedOther.column);
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = Boolean.valueOf(isSetSuper_column()).compareTo(isSetSuper_column());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(super_column, typedOther.super_column);
if (lastComparison != 0) {
return lastComparison;
}
return 0;
}
public void read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();

View File

@ -33,13 +33,15 @@ import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import org.apache.log4j.Logger;
import java.util.BitSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
public class ColumnParent implements TBase, java.io.Serializable, Cloneable {
public class ColumnParent implements TBase, java.io.Serializable, Cloneable, Comparable<ColumnParent> {
private static final TStruct STRUCT_DESC = new TStruct("ColumnParent");
private static final TField COLUMN_FAMILY_FIELD_DESC = new TField("column_family", TType.STRING, (short)3);
private static final TField SUPER_COLUMN_FIELD_DESC = new TField("super_column", TType.STRING, (short)4);
@ -49,9 +51,7 @@ public class ColumnParent implements TBase, java.io.Serializable, Cloneable {
public byte[] super_column;
public static final int SUPER_COLUMN = 4;
private final Isset __isset = new Isset();
private static final class Isset implements java.io.Serializable {
}
// isset id assignments
public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
put(COLUMN_FAMILY, new FieldMetaData("column_family", TFieldRequirementType.DEFAULT,
@ -229,6 +229,33 @@ public class ColumnParent implements TBase, java.io.Serializable, Cloneable {
return 0;
}
public int compareTo(ColumnParent other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
ColumnParent typedOther = (ColumnParent)other;
lastComparison = Boolean.valueOf(isSetColumn_family()).compareTo(isSetColumn_family());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(column_family, typedOther.column_family);
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = Boolean.valueOf(isSetSuper_column()).compareTo(isSetSuper_column());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(super_column, typedOther.super_column);
if (lastComparison != 0) {
return lastComparison;
}
return 0;
}
public void read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();
@ -320,6 +347,9 @@ public class ColumnParent implements TBase, java.io.Serializable, Cloneable {
public void validate() throws TException {
// check for required fields
if (column_family == null) {
throw new TProtocolException("Required field 'column_family' was not present! Struct: " + toString());
}
// check that fields of type enum have valid values
}

View File

@ -33,13 +33,15 @@ import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import org.apache.log4j.Logger;
import java.util.BitSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
public class ColumnPath implements TBase, java.io.Serializable, Cloneable {
public class ColumnPath implements TBase, java.io.Serializable, Cloneable, Comparable<ColumnPath> {
private static final TStruct STRUCT_DESC = new TStruct("ColumnPath");
private static final TField COLUMN_FAMILY_FIELD_DESC = new TField("column_family", TType.STRING, (short)3);
private static final TField SUPER_COLUMN_FIELD_DESC = new TField("super_column", TType.STRING, (short)4);
@ -52,9 +54,7 @@ public class ColumnPath implements TBase, java.io.Serializable, Cloneable {
public byte[] column;
public static final int COLUMN = 5;
private final Isset __isset = new Isset();
private static final class Isset implements java.io.Serializable {
}
// isset id assignments
public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
put(COLUMN_FAMILY, new FieldMetaData("column_family", TFieldRequirementType.DEFAULT,
@ -286,6 +286,41 @@ public class ColumnPath implements TBase, java.io.Serializable, Cloneable {
return 0;
}
public int compareTo(ColumnPath other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
ColumnPath typedOther = (ColumnPath)other;
lastComparison = Boolean.valueOf(isSetColumn_family()).compareTo(isSetColumn_family());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(column_family, typedOther.column_family);
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = Boolean.valueOf(isSetSuper_column()).compareTo(isSetSuper_column());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(super_column, typedOther.super_column);
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = Boolean.valueOf(isSetColumn()).compareTo(isSetColumn());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(column, typedOther.column);
if (lastComparison != 0) {
return lastComparison;
}
return 0;
}
public void read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();
@ -406,6 +441,9 @@ public class ColumnPath implements TBase, java.io.Serializable, Cloneable {
public void validate() throws TException {
// check for required fields
if (column_family == null) {
throw new TProtocolException("Required field 'column_family' was not present! Struct: " + toString());
}
// check that fields of type enum have valid values
}

View File

@ -33,22 +33,22 @@ import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import org.apache.log4j.Logger;
import java.util.BitSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
public class InvalidRequestException extends Exception implements TBase, java.io.Serializable, Cloneable {
public class InvalidRequestException extends Exception implements TBase, java.io.Serializable, Cloneable, Comparable<InvalidRequestException> {
private static final TStruct STRUCT_DESC = new TStruct("InvalidRequestException");
private static final TField WHY_FIELD_DESC = new TField("why", TType.STRING, (short)1);
public String why;
public static final int WHY = 1;
private final Isset __isset = new Isset();
private static final class Isset implements java.io.Serializable {
}
// isset id assignments
public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
put(WHY, new FieldMetaData("why", TFieldRequirementType.DEFAULT,
@ -172,6 +172,25 @@ public class InvalidRequestException extends Exception implements TBase, java.io
return 0;
}
public int compareTo(InvalidRequestException other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
InvalidRequestException typedOther = (InvalidRequestException)other;
lastComparison = Boolean.valueOf(isSetWhy()).compareTo(isSetWhy());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(why, typedOther.why);
if (lastComparison != 0) {
return lastComparison;
}
return 0;
}
public void read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();
@ -234,6 +253,9 @@ public class InvalidRequestException extends Exception implements TBase, java.io
public void validate() throws TException {
// check for required fields
if (why == null) {
throw new TProtocolException("Required field 'why' was not present! Struct: " + toString());
}
// check that fields of type enum have valid values
}

View File

@ -33,13 +33,15 @@ import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import org.apache.log4j.Logger;
import java.util.BitSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
public class NotFoundException extends Exception implements TBase, java.io.Serializable, Cloneable {
public class NotFoundException extends Exception implements TBase, java.io.Serializable, Cloneable, Comparable<NotFoundException> {
private static final TStruct STRUCT_DESC = new TStruct("NotFoundException");
public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
@ -106,6 +108,17 @@ public class NotFoundException extends Exception implements TBase, java.io.Seria
return 0;
}
public int compareTo(NotFoundException other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
NotFoundException typedOther = (NotFoundException)other;
return 0;
}
public void read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();

View File

@ -33,13 +33,15 @@ import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import org.apache.log4j.Logger;
import java.util.BitSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
public class SlicePredicate implements TBase, java.io.Serializable, Cloneable {
public class SlicePredicate implements TBase, java.io.Serializable, Cloneable, Comparable<SlicePredicate> {
private static final TStruct STRUCT_DESC = new TStruct("SlicePredicate");
private static final TField COLUMN_NAMES_FIELD_DESC = new TField("column_names", TType.LIST, (short)1);
private static final TField SLICE_RANGE_FIELD_DESC = new TField("slice_range", TType.STRUCT, (short)2);
@ -49,9 +51,7 @@ public class SlicePredicate implements TBase, java.io.Serializable, Cloneable {
public SliceRange slice_range;
public static final int SLICE_RANGE = 2;
private final Isset __isset = new Isset();
private static final class Isset implements java.io.Serializable {
}
// isset id assignments
public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
put(COLUMN_NAMES, new FieldMetaData("column_names", TFieldRequirementType.OPTIONAL,
@ -235,6 +235,33 @@ public class SlicePredicate implements TBase, java.io.Serializable, Cloneable {
return 0;
}
public int compareTo(SlicePredicate other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
SlicePredicate typedOther = (SlicePredicate)other;
lastComparison = Boolean.valueOf(isSetColumn_names()).compareTo(isSetColumn_names());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(column_names, typedOther.column_names);
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = Boolean.valueOf(isSetSlice_range()).compareTo(isSetSlice_range());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(slice_range, typedOther.slice_range);
if (lastComparison != 0) {
return lastComparison;
}
return 0;
}
public void read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();

View File

@ -33,13 +33,15 @@ import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import org.apache.log4j.Logger;
import java.util.BitSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
public class SliceRange implements TBase, java.io.Serializable, Cloneable {
public class SliceRange implements TBase, java.io.Serializable, Cloneable, Comparable<SliceRange> {
private static final TStruct STRUCT_DESC = new TStruct("SliceRange");
private static final TField START_FIELD_DESC = new TField("start", TType.STRING, (short)1);
private static final TField FINISH_FIELD_DESC = new TField("finish", TType.STRING, (short)2);
@ -55,11 +57,10 @@ public class SliceRange implements TBase, java.io.Serializable, Cloneable {
public int count;
public static final int COUNT = 4;
private final Isset __isset = new Isset();
private static final class Isset implements java.io.Serializable {
public boolean reversed = false;
public boolean count = false;
}
// 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);
public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
put(START, new FieldMetaData("start", TFieldRequirementType.DEFAULT,
@ -93,15 +94,17 @@ public class SliceRange implements TBase, java.io.Serializable, Cloneable {
this.start = start;
this.finish = finish;
this.reversed = reversed;
this.__isset.reversed = true;
setReversedIsSet(true);
this.count = count;
this.__isset.count = true;
setCountIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public SliceRange(SliceRange other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
if (other.isSetStart()) {
this.start = new byte[other.start.length];
System.arraycopy(other.start, 0, start, 0, other.start.length);
@ -110,9 +113,7 @@ public class SliceRange implements TBase, java.io.Serializable, Cloneable {
this.finish = new byte[other.finish.length];
System.arraycopy(other.finish, 0, finish, 0, other.finish.length);
}
__isset.reversed = other.__isset.reversed;
this.reversed = other.reversed;
__isset.count = other.__isset.count;
this.count = other.count;
}
@ -175,21 +176,21 @@ public class SliceRange implements TBase, java.io.Serializable, Cloneable {
public SliceRange setReversed(boolean reversed) {
this.reversed = reversed;
this.__isset.reversed = true;
setReversedIsSet(true);
return this;
}
public void unsetReversed() {
this.__isset.reversed = false;
__isset_bit_vector.clear(__REVERSED_ISSET_ID);
}
// Returns true if field reversed is set (has been asigned a value) and false otherwise
public boolean isSetReversed() {
return this.__isset.reversed;
return __isset_bit_vector.get(__REVERSED_ISSET_ID);
}
public void setReversedIsSet(boolean value) {
this.__isset.reversed = value;
__isset_bit_vector.set(__REVERSED_ISSET_ID, value);
}
public int getCount() {
@ -198,21 +199,21 @@ public class SliceRange implements TBase, java.io.Serializable, Cloneable {
public SliceRange setCount(int count) {
this.count = count;
this.__isset.count = true;
setCountIsSet(true);
return this;
}
public void unsetCount() {
this.__isset.count = false;
__isset_bit_vector.clear(__COUNT_ISSET_ID);
}
// Returns true if field count is set (has been asigned a value) and false otherwise
public boolean isSetCount() {
return this.__isset.count;
return __isset_bit_vector.get(__COUNT_ISSET_ID);
}
public void setCountIsSet(boolean value) {
this.__isset.count = value;
__isset_bit_vector.set(__COUNT_ISSET_ID, value);
}
public void setFieldValue(int fieldID, Object value) {
@ -346,6 +347,49 @@ public class SliceRange implements TBase, java.io.Serializable, Cloneable {
return 0;
}
public int compareTo(SliceRange other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
SliceRange typedOther = (SliceRange)other;
lastComparison = Boolean.valueOf(isSetStart()).compareTo(isSetStart());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(start, typedOther.start);
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = Boolean.valueOf(isSetFinish()).compareTo(isSetFinish());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(finish, typedOther.finish);
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = Boolean.valueOf(isSetReversed()).compareTo(isSetReversed());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(reversed, typedOther.reversed);
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = Boolean.valueOf(isSetCount()).compareTo(isSetCount());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(count, typedOther.count);
if (lastComparison != 0) {
return lastComparison;
}
return 0;
}
public void read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();
@ -374,7 +418,7 @@ public class SliceRange implements TBase, java.io.Serializable, Cloneable {
case REVERSED:
if (field.type == TType.BOOL) {
this.reversed = iprot.readBool();
this.__isset.reversed = true;
setReversedIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
@ -382,7 +426,7 @@ public class SliceRange implements TBase, java.io.Serializable, Cloneable {
case COUNT:
if (field.type == TType.I32) {
this.count = iprot.readI32();
this.__isset.count = true;
setCountIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
@ -397,6 +441,12 @@ public class SliceRange implements TBase, java.io.Serializable, Cloneable {
// check for required fields of primitive type, which can't be checked in the validate method
if (!isSetReversed()) {
throw new TProtocolException("Required field 'reversed' was not found in serialized data! Struct: " + toString());
}
if (!isSetCount()) {
throw new TProtocolException("Required field 'count' was not found in serialized data! Struct: " + toString());
}
validate();
}
@ -468,6 +518,14 @@ public class SliceRange implements TBase, java.io.Serializable, Cloneable {
public void validate() throws TException {
// check for required fields
if (start == null) {
throw new TProtocolException("Required field 'start' was not present! Struct: " + toString());
}
if (finish == null) {
throw new TProtocolException("Required field 'finish' was not present! Struct: " + toString());
}
// 'reversed' is only checked in read() because it's a primitive and you chose the non-beans generator.
// 'count' is only checked in read() because it's a primitive and you chose the non-beans generator.
// check that fields of type enum have valid values
}

View File

@ -33,13 +33,15 @@ import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import org.apache.log4j.Logger;
import java.util.BitSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
public class SuperColumn implements TBase, java.io.Serializable, Cloneable {
public class SuperColumn implements TBase, java.io.Serializable, Cloneable, Comparable<SuperColumn> {
private static final TStruct STRUCT_DESC = new TStruct("SuperColumn");
private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1);
private static final TField COLUMNS_FIELD_DESC = new TField("columns", TType.LIST, (short)2);
@ -49,9 +51,7 @@ public class SuperColumn implements TBase, java.io.Serializable, Cloneable {
public List<Column> columns;
public static final int COLUMNS = 2;
private final Isset __isset = new Isset();
private static final class Isset implements java.io.Serializable {
}
// isset id assignments
public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT,
@ -234,6 +234,33 @@ public class SuperColumn implements TBase, java.io.Serializable, Cloneable {
return 0;
}
public int compareTo(SuperColumn other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
SuperColumn typedOther = (SuperColumn)other;
lastComparison = Boolean.valueOf(isSetName()).compareTo(isSetName());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(name, typedOther.name);
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = Boolean.valueOf(isSetColumns()).compareTo(isSetColumns());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(columns, typedOther.columns);
if (lastComparison != 0) {
return lastComparison;
}
return 0;
}
public void read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();
@ -338,6 +365,12 @@ public class SuperColumn implements TBase, java.io.Serializable, Cloneable {
public void validate() throws TException {
// check for required fields
if (name == null) {
throw new TProtocolException("Required field 'name' was not present! Struct: " + toString());
}
if (columns == null) {
throw new TProtocolException("Required field 'columns' was not present! Struct: " + toString());
}
// check that fields of type enum have valid values
}

View File

@ -33,13 +33,15 @@ import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import org.apache.log4j.Logger;
import java.util.BitSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
public class UnavailableException extends Exception implements TBase, java.io.Serializable, Cloneable {
public class UnavailableException extends Exception implements TBase, java.io.Serializable, Cloneable, Comparable<UnavailableException> {
private static final TStruct STRUCT_DESC = new TStruct("UnavailableException");
public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
@ -106,6 +108,17 @@ public class UnavailableException extends Exception implements TBase, java.io.Se
return 0;
}
public int compareTo(UnavailableException other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
UnavailableException typedOther = (UnavailableException)other;
return 0;
}
public void read(TProtocol iprot) throws TException {
TField field;
iprot.readStructBegin();

BIN
lib/libthrift-r806014.jar Normal file

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,24 @@
Copyright (c) 2004-2008 QOS.ch
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,24 @@
Copyright (c) 2004-2008 QOS.ch
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

BIN
lib/slf4j-api-1.5.8.jar Normal file

Binary file not shown.

BIN
lib/slf4j-log4j12-1.5.8.jar Normal file

Binary file not shown.