diff --git a/lib/libthrift.jar b/lib/libthrift.jar index e34bf79a85..101b15de2e 100644 Binary files a/lib/libthrift.jar and b/lib/libthrift.jar differ diff --git a/src/org/apache/cassandra/cli/CliClient.java b/src/org/apache/cassandra/cli/CliClient.java index 40bf888343..dbaaba0277 100644 --- a/src/org/apache/cassandra/cli/CliClient.java +++ b/src/org/apache/cassandra/cli/CliClient.java @@ -17,7 +17,7 @@ */ package org.apache.cassandra.cli; -import com.facebook.thrift.*; +import org.apache.thrift.*; import org.antlr.runtime.tree.*; import org.apache.cassandra.cql.common.Utils; diff --git a/src/org/apache/cassandra/cli/CliMain.java b/src/org/apache/cassandra/cli/CliMain.java index 0e949f048d..d3c2fe74e2 100644 --- a/src/org/apache/cassandra/cli/CliMain.java +++ b/src/org/apache/cassandra/cli/CliMain.java @@ -18,9 +18,9 @@ package org.apache.cassandra.cli; -import com.facebook.thrift.protocol.TBinaryProtocol; -import com.facebook.thrift.transport.TSocket; -import com.facebook.thrift.transport.TTransport; +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.transport.TSocket; +import org.apache.thrift.transport.TTransport; import jline.*; import java.io.*; diff --git a/src/org/apache/cassandra/cql/driver/CqlDriver.java b/src/org/apache/cassandra/cql/driver/CqlDriver.java index b112caeaf2..087e10a1f4 100644 --- a/src/org/apache/cassandra/cql/driver/CqlDriver.java +++ b/src/org/apache/cassandra/cql/driver/CqlDriver.java @@ -21,7 +21,7 @@ import org.apache.cassandra.cql.compiler.common.*; import org.apache.cassandra.cql.compiler.parse.*; import org.apache.cassandra.cql.compiler.sem.*; import org.apache.cassandra.cql.common.*; -import com.facebook.thrift.*; +import org.apache.thrift.*; import org.apache.cassandra.cql.common.CqlResult; import org.apache.cassandra.cql.common.Plan; diff --git a/src/org/apache/cassandra/service/Cassandra.java b/src/org/apache/cassandra/service/Cassandra.java index 9c01ca1b61..b79f169800 100644 --- a/src/org/apache/cassandra/service/Cassandra.java +++ b/src/org/apache/cassandra/service/Cassandra.java @@ -11,10 +11,12 @@ import java.util.Map; import java.util.HashMap; import java.util.Set; import java.util.HashSet; -import com.facebook.thrift.*; +import java.util.Collections; +import org.apache.thrift.*; +import org.apache.thrift.meta_data.*; -import com.facebook.thrift.protocol.*; -import com.facebook.thrift.transport.*; +import org.apache.thrift.protocol.*; +import org.apache.thrift.transport.*; public class Cassandra { @@ -1080,15 +1082,27 @@ public class Cassandra { } - public static class get_slice_args implements TBase, java.io.Serializable { - public String tablename; - public String key; - public String columnFamily_column; - public int start; - public int count; + public static class get_slice_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_slice_args"); + private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)-1); + private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)-2); + private static final TField COLUMN_FAMILY_COLUMN_FIELD_DESC = new TField("columnFamily_column", TType.STRING, (short)-3); + private static final TField START_FIELD_DESC = new TField("start", TType.I32, (short)-4); + private static final TField COUNT_FIELD_DESC = new TField("count", TType.I32, (short)-5); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String tablename; + public static final int TABLENAME = -1; + public String key; + public static final int KEY = -2; + public String columnFamily_column; + public static final int COLUMNFAMILY_COLUMN = -3; + public int start; + public static final int START = -4; + public int count; + public static final int COUNT = -5; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean tablename = false; public boolean key = false; public boolean columnFamily_column = false; @@ -1096,6 +1110,23 @@ public class Cassandra { public boolean count = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(COLUMNFAMILY_COLUMN, new FieldMetaData("columnFamily_column", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(START, new FieldMetaData("start", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); + put(COUNT, new FieldMetaData("count", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_slice_args.class, metaDataMap); + } + public get_slice_args() { this.start = -1; @@ -1112,17 +1143,222 @@ public class Cassandra { { this(); this.tablename = tablename; - this.__isset.tablename = true; + this.__isset.tablename = (tablename != null); this.key = key; - this.__isset.key = true; + this.__isset.key = (key != null); this.columnFamily_column = columnFamily_column; - this.__isset.columnFamily_column = true; + this.__isset.columnFamily_column = (columnFamily_column != null); this.start = start; this.__isset.start = true; this.count = count; this.__isset.count = true; } + /** + * Performs a deep copy on other. + */ + public get_slice_args(get_slice_args other) { + __isset.tablename = other.__isset.tablename; + if (other.tablename != null) { + this.tablename = other.tablename; + } + __isset.key = other.__isset.key; + if (other.key != null) { + this.key = other.key; + } + __isset.columnFamily_column = other.__isset.columnFamily_column; + if (other.columnFamily_column != null) { + this.columnFamily_column = other.columnFamily_column; + } + __isset.start = other.__isset.start; + this.start = other.start; + __isset.count = other.__isset.count; + this.count = other.count; + } + + @Override + public get_slice_args clone() { + return new get_slice_args(this); + } + + public String getTablename() { + return this.tablename; + } + + public void setTablename(String tablename) { + this.tablename = tablename; + this.__isset.tablename = (tablename != null); + } + + public void unsetTablename() { + this.__isset.tablename = false; + } + + // Returns true if field tablename is set (has been asigned a value) and false otherwise + public boolean isSetTablename() { + return this.__isset.tablename; + } + + public void setTablenameIsSet(boolean value) { + this.__isset.tablename = value; + } + + public String getKey() { + return this.key; + } + + public void setKey(String key) { + this.key = key; + this.__isset.key = (key != null); + } + + public void unsetKey() { + this.__isset.key = false; + } + + // Returns true if field key is set (has been asigned a value) and false otherwise + public boolean isSetKey() { + return this.__isset.key; + } + + public void setKeyIsSet(boolean value) { + this.__isset.key = value; + } + + public String getColumnFamily_column() { + return this.columnFamily_column; + } + + public void setColumnFamily_column(String columnFamily_column) { + this.columnFamily_column = columnFamily_column; + this.__isset.columnFamily_column = (columnFamily_column != null); + } + + public void unsetColumnFamily_column() { + this.__isset.columnFamily_column = false; + } + + // Returns true if field columnFamily_column is set (has been asigned a value) and false otherwise + public boolean isSetColumnFamily_column() { + return this.__isset.columnFamily_column; + } + + public void setColumnFamily_columnIsSet(boolean value) { + this.__isset.columnFamily_column = value; + } + + public int getStart() { + return this.start; + } + + public void setStart(int start) { + this.start = start; + this.__isset.start = true; + } + + public void unsetStart() { + this.__isset.start = false; + } + + // Returns true if field start is set (has been asigned a value) and false otherwise + public boolean isSetStart() { + return this.__isset.start; + } + + public void setStartIsSet(boolean value) { + this.__isset.start = value; + } + + public int getCount() { + return this.count; + } + + public void setCount(int count) { + this.count = count; + this.__isset.count = true; + } + + public void unsetCount() { + this.__isset.count = false; + } + + // Returns true if field count is set (has been asigned a value) and false otherwise + public boolean isSetCount() { + return this.__isset.count; + } + + public void setCountIsSet(boolean value) { + this.__isset.count = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TABLENAME: + setTablename((String)value); + break; + + case KEY: + setKey((String)value); + break; + + case COLUMNFAMILY_COLUMN: + setColumnFamily_column((String)value); + break; + + case START: + setStart((Integer)value); + break; + + case COUNT: + setCount((Integer)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TABLENAME: + return getTablename(); + + case KEY: + return getKey(); + + case COLUMNFAMILY_COLUMN: + return getColumnFamily_column(); + + case START: + return new Integer(getStart()); + + case COUNT: + return new Integer(getCount()); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TABLENAME: + return this.__isset.tablename; + case KEY: + return this.__isset.key; + case COLUMNFAMILY_COLUMN: + return this.__isset.columnFamily_column; + case START: + return this.__isset.start; + case COUNT: + return this.__isset.count; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -1183,6 +1419,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -1198,7 +1435,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); this.__isset.tablename = true; @@ -1206,7 +1443,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -2: + case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); this.__isset.key = true; @@ -1214,7 +1451,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -3: + case COLUMNFAMILY_COLUMN: if (field.type == TType.STRING) { this.columnFamily_column = iprot.readString(); this.__isset.columnFamily_column = true; @@ -1222,7 +1459,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -4: + case START: if (field.type == TType.I32) { this.start = iprot.readI32(); this.__isset.start = true; @@ -1230,7 +1467,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -5: + case COUNT: if (field.type == TType.I32) { this.count = iprot.readI32(); this.__isset.count = true; @@ -1245,80 +1482,105 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("get_slice_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { - field.name = "tablename"; - field.type = TType.STRING; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { - field.name = "key"; - field.type = TType.STRING; - field.id = -2; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily_column != null) { - field.name = "columnFamily_column"; - field.type = TType.STRING; - field.id = -3; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(COLUMN_FAMILY_COLUMN_FIELD_DESC); oprot.writeString(this.columnFamily_column); oprot.writeFieldEnd(); } - field.name = "start"; - field.type = TType.I32; - field.id = -4; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(START_FIELD_DESC); oprot.writeI32(this.start); oprot.writeFieldEnd(); - field.name = "count"; - field.type = TType.I32; - field.id = -5; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(COUNT_FIELD_DESC); oprot.writeI32(this.count); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("tablename:"); sb.append(this.tablename); - sb.append(",key:"); + first = false; + if (!first) sb.append(", "); + sb.append("key:"); sb.append(this.key); - sb.append(",columnFamily_column:"); + first = false; + if (!first) sb.append(", "); + sb.append("columnFamily_column:"); sb.append(this.columnFamily_column); - sb.append(",start:"); + first = false; + if (!first) sb.append(", "); + sb.append("start:"); sb.append(this.start); - sb.append(",count:"); + first = false; + if (!first) sb.append(", "); + sb.append("count:"); sb.append(this.count); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class get_slice_result implements TBase, java.io.Serializable { - public List success; - public CassandraException e; + public static class get_slice_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_slice_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField E_FIELD_DESC = new TField("e", TType.STRUCT, (short)1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public List success; + public static final int SUCCESS = 0; + public CassandraException e; + public static final int E = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean success = false; public boolean e = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, column_t.class)))); + put(E, new FieldMetaData("e", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_slice_result.class, metaDataMap); + } + public get_slice_result() { } @@ -1328,11 +1590,137 @@ public class Cassandra { { this(); this.success = success; - this.__isset.success = true; + this.__isset.success = (success != null); this.e = e; - this.__isset.e = true; + this.__isset.e = (e != null); } + /** + * Performs a deep copy on other. + */ + public get_slice_result(get_slice_result other) { + __isset.success = other.__isset.success; + if (other.success != null) { + List __this__success = new ArrayList(); + for (column_t other_element : other.success) { + __this__success.add(new column_t(other_element)); + } + this.success = __this__success; + } + __isset.e = other.__isset.e; + if (other.e != null) { + this.e = new CassandraException(other.e); + } + } + + @Override + public get_slice_result clone() { + return new get_slice_result(this); + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(column_t elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + this.__isset.success = true; + } + + public List getSuccess() { + return this.success; + } + + public void setSuccess(List success) { + this.success = success; + this.__isset.success = (success != null); + } + + public void unsetSuccess() { + this.success = null; + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public void setSuccessIsSet(boolean value) { + this.__isset.success = value; + } + + public CassandraException getE() { + return this.e; + } + + public void setE(CassandraException e) { + this.e = e; + this.__isset.e = (e != null); + } + + public void unsetE() { + this.e = null; + this.__isset.e = false; + } + + // Returns true if field e is set (has been asigned a value) and false otherwise + public boolean isSetE() { + return this.__isset.e; + } + + public void setEIsSet(boolean value) { + this.__isset.e = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + setSuccess((List)value); + break; + + case E: + setE((CassandraException)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case E: + return getE(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return this.__isset.success; + case E: + return this.__isset.e; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -1366,6 +1754,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -1381,14 +1770,14 @@ public class Cassandra { } switch (field.id) { - case 0: + case SUCCESS: if (field.type == TType.LIST) { { TList _list49 = iprot.readListBegin(); this.success = new ArrayList(_list49.size); for (int _i50 = 0; _i50 < _list49.size; ++_i50) { - column_t _elem51 = new column_t(); + column_t _elem51; _elem51 = new column_t(); _elem51.read(iprot); this.success.add(_elem51); @@ -1400,7 +1789,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case 1: + case E: if (field.type == TType.STRUCT) { this.e = new CassandraException(); this.e.read(iprot); @@ -1416,19 +1805,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("get_slice_result"); - oprot.writeStructBegin(struct); - TField field = new TField(); + oprot.writeStructBegin(STRUCT_DESC); if (this.__isset.success) { if (this.success != null) { - field.name = "success"; - field.type = TType.LIST; - field.id = 0; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); for (column_t _iter52 : this.success) { @@ -1440,10 +1828,7 @@ public class Cassandra { } } else if (this.__isset.e) { if (this.e != null) { - field.name = "e"; - field.type = TType.STRUCT; - field.id = 1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(E_FIELD_DESC); this.e.write(oprot); oprot.writeFieldEnd(); } @@ -1452,32 +1837,70 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_result("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("success:"); sb.append(this.success); - sb.append(",e:"); + first = false; + if (!first) sb.append(", "); + sb.append("e:"); sb.append(this.e); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class get_slice_by_names_args implements TBase, java.io.Serializable { - public String tablename; - public String key; - public String columnFamily; - public List columnNames; + public static class get_slice_by_names_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_slice_by_names_args"); + private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)-1); + private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)-2); + private static final TField COLUMN_FAMILY_FIELD_DESC = new TField("columnFamily", TType.STRING, (short)-3); + private static final TField COLUMN_NAMES_FIELD_DESC = new TField("columnNames", TType.LIST, (short)-4); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String tablename; + public static final int TABLENAME = -1; + public String key; + public static final int KEY = -2; + public String columnFamily; + public static final int COLUMNFAMILY = -3; + public List columnNames; + public static final int COLUMNNAMES = -4; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean tablename = false; public boolean key = false; public boolean columnFamily = false; public boolean columnNames = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(COLUMNFAMILY, new FieldMetaData("columnFamily", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(COLUMNNAMES, new FieldMetaData("columnNames", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_slice_by_names_args.class, metaDataMap); + } + public get_slice_by_names_args() { } @@ -1489,15 +1912,210 @@ public class Cassandra { { this(); this.tablename = tablename; - this.__isset.tablename = true; + this.__isset.tablename = (tablename != null); this.key = key; - this.__isset.key = true; + this.__isset.key = (key != null); this.columnFamily = columnFamily; - this.__isset.columnFamily = true; + this.__isset.columnFamily = (columnFamily != null); this.columnNames = columnNames; + this.__isset.columnNames = (columnNames != null); + } + + /** + * Performs a deep copy on other. + */ + public get_slice_by_names_args(get_slice_by_names_args other) { + __isset.tablename = other.__isset.tablename; + if (other.tablename != null) { + this.tablename = other.tablename; + } + __isset.key = other.__isset.key; + if (other.key != null) { + this.key = other.key; + } + __isset.columnFamily = other.__isset.columnFamily; + if (other.columnFamily != null) { + this.columnFamily = other.columnFamily; + } + __isset.columnNames = other.__isset.columnNames; + if (other.columnNames != null) { + List __this__columnNames = new ArrayList(); + for (String other_element : other.columnNames) { + __this__columnNames.add(other_element); + } + this.columnNames = __this__columnNames; + } + } + + @Override + public get_slice_by_names_args clone() { + return new get_slice_by_names_args(this); + } + + public String getTablename() { + return this.tablename; + } + + public void setTablename(String tablename) { + this.tablename = tablename; + this.__isset.tablename = (tablename != null); + } + + public void unsetTablename() { + this.__isset.tablename = false; + } + + // Returns true if field tablename is set (has been asigned a value) and false otherwise + public boolean isSetTablename() { + return this.__isset.tablename; + } + + public void setTablenameIsSet(boolean value) { + this.__isset.tablename = value; + } + + public String getKey() { + return this.key; + } + + public void setKey(String key) { + this.key = key; + this.__isset.key = (key != null); + } + + public void unsetKey() { + this.__isset.key = false; + } + + // Returns true if field key is set (has been asigned a value) and false otherwise + public boolean isSetKey() { + return this.__isset.key; + } + + public void setKeyIsSet(boolean value) { + this.__isset.key = value; + } + + public String getColumnFamily() { + return this.columnFamily; + } + + public void setColumnFamily(String columnFamily) { + this.columnFamily = columnFamily; + this.__isset.columnFamily = (columnFamily != null); + } + + public void unsetColumnFamily() { + this.__isset.columnFamily = false; + } + + // Returns true if field columnFamily is set (has been asigned a value) and false otherwise + public boolean isSetColumnFamily() { + return this.__isset.columnFamily; + } + + public void setColumnFamilyIsSet(boolean value) { + this.__isset.columnFamily = value; + } + + public int getColumnNamesSize() { + return (this.columnNames == null) ? 0 : this.columnNames.size(); + } + + public java.util.Iterator getColumnNamesIterator() { + return (this.columnNames == null) ? null : this.columnNames.iterator(); + } + + public void addToColumnNames(String elem) { + if (this.columnNames == null) { + this.columnNames = new ArrayList(); + } + this.columnNames.add(elem); this.__isset.columnNames = true; } + public List getColumnNames() { + return this.columnNames; + } + + public void setColumnNames(List columnNames) { + this.columnNames = columnNames; + this.__isset.columnNames = (columnNames != null); + } + + public void unsetColumnNames() { + this.columnNames = null; + this.__isset.columnNames = false; + } + + // Returns true if field columnNames is set (has been asigned a value) and false otherwise + public boolean isSetColumnNames() { + return this.__isset.columnNames; + } + + public void setColumnNamesIsSet(boolean value) { + this.__isset.columnNames = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TABLENAME: + setTablename((String)value); + break; + + case KEY: + setKey((String)value); + break; + + case COLUMNFAMILY: + setColumnFamily((String)value); + break; + + case COLUMNNAMES: + setColumnNames((List)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TABLENAME: + return getTablename(); + + case KEY: + return getKey(); + + case COLUMNFAMILY: + return getColumnFamily(); + + case COLUMNNAMES: + return getColumnNames(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TABLENAME: + return this.__isset.tablename; + case KEY: + return this.__isset.key; + case COLUMNFAMILY: + return this.__isset.columnFamily; + case COLUMNNAMES: + return this.__isset.columnNames; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -1549,6 +2167,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -1564,7 +2183,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); this.__isset.tablename = true; @@ -1572,7 +2191,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -2: + case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); this.__isset.key = true; @@ -1580,7 +2199,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -3: + case COLUMNFAMILY: if (field.type == TType.STRING) { this.columnFamily = iprot.readString(); this.__isset.columnFamily = true; @@ -1588,14 +2207,14 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -4: + case COLUMNNAMES: if (field.type == TType.LIST) { { TList _list53 = iprot.readListBegin(); this.columnNames = new ArrayList(_list53.size); for (int _i54 = 0; _i54 < _list53.size; ++_i54) { - String _elem55 = null; + String _elem55; _elem55 = iprot.readString(); this.columnNames.add(_elem55); } @@ -1613,41 +2232,33 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("get_slice_by_names_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { - field.name = "tablename"; - field.type = TType.STRING; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { - field.name = "key"; - field.type = TType.STRING; - field.id = -2; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily != null) { - field.name = "columnFamily"; - field.type = TType.STRING; - field.id = -3; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(COLUMN_FAMILY_FIELD_DESC); oprot.writeString(this.columnFamily); oprot.writeFieldEnd(); } if (this.columnNames != null) { - field.name = "columnNames"; - field.type = TType.LIST; - field.id = -4; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(COLUMN_NAMES_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.columnNames.size())); for (String _iter56 : this.columnNames) { @@ -1661,32 +2272,66 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_by_names_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("tablename:"); sb.append(this.tablename); - sb.append(",key:"); + first = false; + if (!first) sb.append(", "); + sb.append("key:"); sb.append(this.key); - sb.append(",columnFamily:"); + first = false; + if (!first) sb.append(", "); + sb.append("columnFamily:"); sb.append(this.columnFamily); - sb.append(",columnNames:"); + first = false; + if (!first) sb.append(", "); + sb.append("columnNames:"); sb.append(this.columnNames); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class get_slice_by_names_result implements TBase, java.io.Serializable { - public List success; - public CassandraException e; + public static class get_slice_by_names_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_slice_by_names_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField E_FIELD_DESC = new TField("e", TType.STRUCT, (short)1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public List success; + public static final int SUCCESS = 0; + public CassandraException e; + public static final int E = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean success = false; public boolean e = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, column_t.class)))); + put(E, new FieldMetaData("e", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_slice_by_names_result.class, metaDataMap); + } + public get_slice_by_names_result() { } @@ -1696,11 +2341,137 @@ public class Cassandra { { this(); this.success = success; - this.__isset.success = true; + this.__isset.success = (success != null); this.e = e; - this.__isset.e = true; + this.__isset.e = (e != null); } + /** + * Performs a deep copy on other. + */ + public get_slice_by_names_result(get_slice_by_names_result other) { + __isset.success = other.__isset.success; + if (other.success != null) { + List __this__success = new ArrayList(); + for (column_t other_element : other.success) { + __this__success.add(new column_t(other_element)); + } + this.success = __this__success; + } + __isset.e = other.__isset.e; + if (other.e != null) { + this.e = new CassandraException(other.e); + } + } + + @Override + public get_slice_by_names_result clone() { + return new get_slice_by_names_result(this); + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(column_t elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + this.__isset.success = true; + } + + public List getSuccess() { + return this.success; + } + + public void setSuccess(List success) { + this.success = success; + this.__isset.success = (success != null); + } + + public void unsetSuccess() { + this.success = null; + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public void setSuccessIsSet(boolean value) { + this.__isset.success = value; + } + + public CassandraException getE() { + return this.e; + } + + public void setE(CassandraException e) { + this.e = e; + this.__isset.e = (e != null); + } + + public void unsetE() { + this.e = null; + this.__isset.e = false; + } + + // Returns true if field e is set (has been asigned a value) and false otherwise + public boolean isSetE() { + return this.__isset.e; + } + + public void setEIsSet(boolean value) { + this.__isset.e = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + setSuccess((List)value); + break; + + case E: + setE((CassandraException)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case E: + return getE(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return this.__isset.success; + case E: + return this.__isset.e; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -1734,6 +2505,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -1749,14 +2521,14 @@ public class Cassandra { } switch (field.id) { - case 0: + case SUCCESS: if (field.type == TType.LIST) { { TList _list57 = iprot.readListBegin(); this.success = new ArrayList(_list57.size); for (int _i58 = 0; _i58 < _list57.size; ++_i58) { - column_t _elem59 = new column_t(); + column_t _elem59; _elem59 = new column_t(); _elem59.read(iprot); this.success.add(_elem59); @@ -1768,7 +2540,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case 1: + case E: if (field.type == TType.STRUCT) { this.e = new CassandraException(); this.e.read(iprot); @@ -1784,19 +2556,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("get_slice_by_names_result"); - oprot.writeStructBegin(struct); - TField field = new TField(); + oprot.writeStructBegin(STRUCT_DESC); if (this.__isset.success) { if (this.success != null) { - field.name = "success"; - field.type = TType.LIST; - field.id = 0; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); for (column_t _iter60 : this.success) { @@ -1808,10 +2579,7 @@ public class Cassandra { } } else if (this.__isset.e) { if (this.e != null) { - field.name = "e"; - field.type = TType.STRUCT; - field.id = 1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(E_FIELD_DESC); this.e.write(oprot); oprot.writeFieldEnd(); } @@ -1820,30 +2588,63 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_by_names_result("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("success:"); sb.append(this.success); - sb.append(",e:"); + first = false; + if (!first) sb.append(", "); + sb.append("e:"); sb.append(this.e); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class get_column_args implements TBase, java.io.Serializable { - public String tablename; - public String key; - public String columnFamily_column; + public static class get_column_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_column_args"); + private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)-1); + private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)-2); + private static final TField COLUMN_FAMILY_COLUMN_FIELD_DESC = new TField("columnFamily_column", TType.STRING, (short)-3); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String tablename; + public static final int TABLENAME = -1; + public String key; + public static final int KEY = -2; + public String columnFamily_column; + public static final int COLUMNFAMILY_COLUMN = -3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean tablename = false; public boolean key = false; public boolean columnFamily_column = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(COLUMNFAMILY_COLUMN, new FieldMetaData("columnFamily_column", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_column_args.class, metaDataMap); + } + public get_column_args() { } @@ -1854,13 +2655,152 @@ public class Cassandra { { this(); this.tablename = tablename; - this.__isset.tablename = true; + this.__isset.tablename = (tablename != null); this.key = key; - this.__isset.key = true; + this.__isset.key = (key != null); this.columnFamily_column = columnFamily_column; - this.__isset.columnFamily_column = true; + this.__isset.columnFamily_column = (columnFamily_column != null); } + /** + * Performs a deep copy on other. + */ + public get_column_args(get_column_args other) { + __isset.tablename = other.__isset.tablename; + if (other.tablename != null) { + this.tablename = other.tablename; + } + __isset.key = other.__isset.key; + if (other.key != null) { + this.key = other.key; + } + __isset.columnFamily_column = other.__isset.columnFamily_column; + if (other.columnFamily_column != null) { + this.columnFamily_column = other.columnFamily_column; + } + } + + @Override + public get_column_args clone() { + return new get_column_args(this); + } + + public String getTablename() { + return this.tablename; + } + + public void setTablename(String tablename) { + this.tablename = tablename; + this.__isset.tablename = (tablename != null); + } + + public void unsetTablename() { + this.__isset.tablename = false; + } + + // Returns true if field tablename is set (has been asigned a value) and false otherwise + public boolean isSetTablename() { + return this.__isset.tablename; + } + + public void setTablenameIsSet(boolean value) { + this.__isset.tablename = value; + } + + public String getKey() { + return this.key; + } + + public void setKey(String key) { + this.key = key; + this.__isset.key = (key != null); + } + + public void unsetKey() { + this.__isset.key = false; + } + + // Returns true if field key is set (has been asigned a value) and false otherwise + public boolean isSetKey() { + return this.__isset.key; + } + + public void setKeyIsSet(boolean value) { + this.__isset.key = value; + } + + public String getColumnFamily_column() { + return this.columnFamily_column; + } + + public void setColumnFamily_column(String columnFamily_column) { + this.columnFamily_column = columnFamily_column; + this.__isset.columnFamily_column = (columnFamily_column != null); + } + + public void unsetColumnFamily_column() { + this.__isset.columnFamily_column = false; + } + + // Returns true if field columnFamily_column is set (has been asigned a value) and false otherwise + public boolean isSetColumnFamily_column() { + return this.__isset.columnFamily_column; + } + + public void setColumnFamily_columnIsSet(boolean value) { + this.__isset.columnFamily_column = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TABLENAME: + setTablename((String)value); + break; + + case KEY: + setKey((String)value); + break; + + case COLUMNFAMILY_COLUMN: + setColumnFamily_column((String)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TABLENAME: + return getTablename(); + + case KEY: + return getKey(); + + case COLUMNFAMILY_COLUMN: + return getColumnFamily_column(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TABLENAME: + return this.__isset.tablename; + case KEY: + return this.__isset.key; + case COLUMNFAMILY_COLUMN: + return this.__isset.columnFamily_column; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -1903,6 +2843,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -1918,7 +2859,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); this.__isset.tablename = true; @@ -1926,7 +2867,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -2: + case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); this.__isset.key = true; @@ -1934,7 +2875,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -3: + case COLUMNFAMILY_COLUMN: if (field.type == TType.STRING) { this.columnFamily_column = iprot.readString(); this.__isset.columnFamily_column = true; @@ -1949,33 +2890,28 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("get_column_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { - field.name = "tablename"; - field.type = TType.STRING; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { - field.name = "key"; - field.type = TType.STRING; - field.id = -2; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily_column != null) { - field.name = "columnFamily_column"; - field.type = TType.STRING; - field.id = -3; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(COLUMN_FAMILY_COLUMN_FIELD_DESC); oprot.writeString(this.columnFamily_column); oprot.writeFieldEnd(); } @@ -1983,30 +2919,61 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("get_column_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("tablename:"); sb.append(this.tablename); - sb.append(",key:"); + first = false; + if (!first) sb.append(", "); + sb.append("key:"); sb.append(this.key); - sb.append(",columnFamily_column:"); + first = false; + if (!first) sb.append(", "); + sb.append("columnFamily_column:"); sb.append(this.columnFamily_column); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class get_column_result implements TBase, java.io.Serializable { - public column_t success; - public CassandraException e; + public static class get_column_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_column_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); + private static final TField E_FIELD_DESC = new TField("e", TType.STRUCT, (short)1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public column_t success; + public static final int SUCCESS = 0; + public CassandraException e; + public static final int E = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean success = false; public boolean e = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, column_t.class))); + put(E, new FieldMetaData("e", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_column_result.class, metaDataMap); + } + public get_column_result() { } @@ -2016,11 +2983,117 @@ public class Cassandra { { this(); this.success = success; - this.__isset.success = true; + this.__isset.success = (success != null); this.e = e; - this.__isset.e = true; + this.__isset.e = (e != null); } + /** + * Performs a deep copy on other. + */ + public get_column_result(get_column_result other) { + __isset.success = other.__isset.success; + if (other.success != null) { + this.success = new column_t(other.success); + } + __isset.e = other.__isset.e; + if (other.e != null) { + this.e = new CassandraException(other.e); + } + } + + @Override + public get_column_result clone() { + return new get_column_result(this); + } + + public column_t getSuccess() { + return this.success; + } + + public void setSuccess(column_t success) { + this.success = success; + this.__isset.success = (success != null); + } + + public void unsetSuccess() { + this.success = null; + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public void setSuccessIsSet(boolean value) { + this.__isset.success = value; + } + + public CassandraException getE() { + return this.e; + } + + public void setE(CassandraException e) { + this.e = e; + this.__isset.e = (e != null); + } + + public void unsetE() { + this.e = null; + this.__isset.e = false; + } + + // Returns true if field e is set (has been asigned a value) and false otherwise + public boolean isSetE() { + return this.__isset.e; + } + + public void setEIsSet(boolean value) { + this.__isset.e = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + setSuccess((column_t)value); + break; + + case E: + setE((CassandraException)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case E: + return getE(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return this.__isset.success; + case E: + return this.__isset.e; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -2054,6 +3127,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -2069,7 +3143,7 @@ public class Cassandra { } switch (field.id) { - case 0: + case SUCCESS: if (field.type == TType.STRUCT) { this.success = new column_t(); this.success.read(iprot); @@ -2078,7 +3152,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case 1: + case E: if (field.type == TType.STRUCT) { this.e = new CassandraException(); this.e.read(iprot); @@ -2094,28 +3168,24 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("get_column_result"); - oprot.writeStructBegin(struct); - TField field = new TField(); + oprot.writeStructBegin(STRUCT_DESC); if (this.__isset.success) { if (this.success != null) { - field.name = "success"; - field.type = TType.STRUCT; - field.id = 0; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); this.success.write(oprot); oprot.writeFieldEnd(); } } else if (this.__isset.e) { if (this.e != null) { - field.name = "e"; - field.type = TType.STRUCT; - field.id = 1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(E_FIELD_DESC); this.e.write(oprot); oprot.writeFieldEnd(); } @@ -2124,30 +3194,63 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("get_column_result("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("success:"); sb.append(this.success); - sb.append(",e:"); + first = false; + if (!first) sb.append(", "); + sb.append("e:"); sb.append(this.e); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class get_column_count_args implements TBase, java.io.Serializable { - public String tablename; - public String key; - public String columnFamily_column; + public static class get_column_count_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_column_count_args"); + private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)-1); + private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)-2); + private static final TField COLUMN_FAMILY_COLUMN_FIELD_DESC = new TField("columnFamily_column", TType.STRING, (short)-3); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String tablename; + public static final int TABLENAME = -1; + public String key; + public static final int KEY = -2; + public String columnFamily_column; + public static final int COLUMNFAMILY_COLUMN = -3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean tablename = false; public boolean key = false; public boolean columnFamily_column = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(COLUMNFAMILY_COLUMN, new FieldMetaData("columnFamily_column", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_column_count_args.class, metaDataMap); + } + public get_column_count_args() { } @@ -2158,13 +3261,152 @@ public class Cassandra { { this(); this.tablename = tablename; - this.__isset.tablename = true; + this.__isset.tablename = (tablename != null); this.key = key; - this.__isset.key = true; + this.__isset.key = (key != null); this.columnFamily_column = columnFamily_column; - this.__isset.columnFamily_column = true; + this.__isset.columnFamily_column = (columnFamily_column != null); } + /** + * Performs a deep copy on other. + */ + public get_column_count_args(get_column_count_args other) { + __isset.tablename = other.__isset.tablename; + if (other.tablename != null) { + this.tablename = other.tablename; + } + __isset.key = other.__isset.key; + if (other.key != null) { + this.key = other.key; + } + __isset.columnFamily_column = other.__isset.columnFamily_column; + if (other.columnFamily_column != null) { + this.columnFamily_column = other.columnFamily_column; + } + } + + @Override + public get_column_count_args clone() { + return new get_column_count_args(this); + } + + public String getTablename() { + return this.tablename; + } + + public void setTablename(String tablename) { + this.tablename = tablename; + this.__isset.tablename = (tablename != null); + } + + public void unsetTablename() { + this.__isset.tablename = false; + } + + // Returns true if field tablename is set (has been asigned a value) and false otherwise + public boolean isSetTablename() { + return this.__isset.tablename; + } + + public void setTablenameIsSet(boolean value) { + this.__isset.tablename = value; + } + + public String getKey() { + return this.key; + } + + public void setKey(String key) { + this.key = key; + this.__isset.key = (key != null); + } + + public void unsetKey() { + this.__isset.key = false; + } + + // Returns true if field key is set (has been asigned a value) and false otherwise + public boolean isSetKey() { + return this.__isset.key; + } + + public void setKeyIsSet(boolean value) { + this.__isset.key = value; + } + + public String getColumnFamily_column() { + return this.columnFamily_column; + } + + public void setColumnFamily_column(String columnFamily_column) { + this.columnFamily_column = columnFamily_column; + this.__isset.columnFamily_column = (columnFamily_column != null); + } + + public void unsetColumnFamily_column() { + this.__isset.columnFamily_column = false; + } + + // Returns true if field columnFamily_column is set (has been asigned a value) and false otherwise + public boolean isSetColumnFamily_column() { + return this.__isset.columnFamily_column; + } + + public void setColumnFamily_columnIsSet(boolean value) { + this.__isset.columnFamily_column = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TABLENAME: + setTablename((String)value); + break; + + case KEY: + setKey((String)value); + break; + + case COLUMNFAMILY_COLUMN: + setColumnFamily_column((String)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TABLENAME: + return getTablename(); + + case KEY: + return getKey(); + + case COLUMNFAMILY_COLUMN: + return getColumnFamily_column(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TABLENAME: + return this.__isset.tablename; + case KEY: + return this.__isset.key; + case COLUMNFAMILY_COLUMN: + return this.__isset.columnFamily_column; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -2207,6 +3449,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -2222,7 +3465,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); this.__isset.tablename = true; @@ -2230,7 +3473,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -2: + case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); this.__isset.key = true; @@ -2238,7 +3481,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -3: + case COLUMNFAMILY_COLUMN: if (field.type == TType.STRING) { this.columnFamily_column = iprot.readString(); this.__isset.columnFamily_column = true; @@ -2253,33 +3496,28 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("get_column_count_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { - field.name = "tablename"; - field.type = TType.STRING; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { - field.name = "key"; - field.type = TType.STRING; - field.id = -2; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily_column != null) { - field.name = "columnFamily_column"; - field.type = TType.STRING; - field.id = -3; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(COLUMN_FAMILY_COLUMN_FIELD_DESC); oprot.writeString(this.columnFamily_column); oprot.writeFieldEnd(); } @@ -2287,30 +3525,61 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("get_column_count_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("tablename:"); sb.append(this.tablename); - sb.append(",key:"); + first = false; + if (!first) sb.append(", "); + sb.append("key:"); sb.append(this.key); - sb.append(",columnFamily_column:"); + first = false; + if (!first) sb.append(", "); + sb.append("columnFamily_column:"); sb.append(this.columnFamily_column); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class get_column_count_result implements TBase, java.io.Serializable { - public int success; - public CassandraException e; + public static class get_column_count_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_column_count_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I32, (short)0); + private static final TField E_FIELD_DESC = new TField("e", TType.STRUCT, (short)1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public int success; + public static final int SUCCESS = 0; + public CassandraException e; + public static final int E = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean success = false; public boolean e = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); + put(E, new FieldMetaData("e", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_column_count_result.class, metaDataMap); + } + public get_column_count_result() { } @@ -2322,9 +3591,112 @@ public class Cassandra { this.success = success; this.__isset.success = true; this.e = e; - this.__isset.e = true; + this.__isset.e = (e != null); } + /** + * Performs a deep copy on other. + */ + public get_column_count_result(get_column_count_result other) { + __isset.success = other.__isset.success; + this.success = other.success; + __isset.e = other.__isset.e; + if (other.e != null) { + this.e = new CassandraException(other.e); + } + } + + @Override + public get_column_count_result clone() { + return new get_column_count_result(this); + } + + public int getSuccess() { + return this.success; + } + + public void setSuccess(int success) { + this.success = success; + this.__isset.success = true; + } + + public void unsetSuccess() { + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public void setSuccessIsSet(boolean value) { + this.__isset.success = value; + } + + public CassandraException getE() { + return this.e; + } + + public void setE(CassandraException e) { + this.e = e; + this.__isset.e = (e != null); + } + + public void unsetE() { + this.e = null; + this.__isset.e = false; + } + + // Returns true if field e is set (has been asigned a value) and false otherwise + public boolean isSetE() { + return this.__isset.e; + } + + public void setEIsSet(boolean value) { + this.__isset.e = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + setSuccess((Integer)value); + break; + + case E: + setE((CassandraException)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return new Integer(getSuccess()); + + case E: + return getE(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return this.__isset.success; + case E: + return this.__isset.e; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -2358,6 +3730,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -2373,7 +3746,7 @@ public class Cassandra { } switch (field.id) { - case 0: + case SUCCESS: if (field.type == TType.I32) { this.success = iprot.readI32(); this.__isset.success = true; @@ -2381,7 +3754,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case 1: + case E: if (field.type == TType.STRUCT) { this.e = new CassandraException(); this.e.read(iprot); @@ -2397,26 +3770,22 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("get_column_count_result"); - oprot.writeStructBegin(struct); - TField field = new TField(); + oprot.writeStructBegin(STRUCT_DESC); if (this.__isset.success) { - field.name = "success"; - field.type = TType.I32; - field.id = 0; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI32(this.success); oprot.writeFieldEnd(); } else if (this.__isset.e) { if (this.e != null) { - field.name = "e"; - field.type = TType.STRUCT; - field.id = 1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(E_FIELD_DESC); this.e.write(oprot); oprot.writeFieldEnd(); } @@ -2425,27 +3794,51 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("get_column_count_result("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("success:"); sb.append(this.success); - sb.append(",e:"); + first = false; + if (!first) sb.append(", "); + sb.append("e:"); sb.append(this.e); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class insert_args implements TBase, java.io.Serializable { - public String tablename; - public String key; - public String columnFamily_column; - public String cellData; - public long timestamp; + public static class insert_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("insert_args"); + private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)-1); + private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)-2); + private static final TField COLUMN_FAMILY_COLUMN_FIELD_DESC = new TField("columnFamily_column", TType.STRING, (short)-3); + private static final TField CELL_DATA_FIELD_DESC = new TField("cellData", TType.STRING, (short)-4); + private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)-5); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String tablename; + public static final int TABLENAME = -1; + public String key; + public static final int KEY = -2; + public String columnFamily_column; + public static final int COLUMNFAMILY_COLUMN = -3; + public String cellData; + public static final int CELLDATA = -4; + public long timestamp; + public static final int TIMESTAMP = -5; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean tablename = false; public boolean key = false; public boolean columnFamily_column = false; @@ -2453,6 +3846,23 @@ public class Cassandra { public boolean timestamp = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(COLUMNFAMILY_COLUMN, new FieldMetaData("columnFamily_column", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(CELLDATA, new FieldMetaData("cellData", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I64))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(insert_args.class, metaDataMap); + } + public insert_args() { } @@ -2465,17 +3875,224 @@ public class Cassandra { { this(); this.tablename = tablename; - this.__isset.tablename = true; + this.__isset.tablename = (tablename != null); this.key = key; - this.__isset.key = true; + this.__isset.key = (key != null); this.columnFamily_column = columnFamily_column; - this.__isset.columnFamily_column = true; + this.__isset.columnFamily_column = (columnFamily_column != null); this.cellData = cellData; - this.__isset.cellData = true; + this.__isset.cellData = (cellData != null); this.timestamp = timestamp; this.__isset.timestamp = true; } + /** + * Performs a deep copy on other. + */ + public insert_args(insert_args other) { + __isset.tablename = other.__isset.tablename; + if (other.tablename != null) { + this.tablename = other.tablename; + } + __isset.key = other.__isset.key; + if (other.key != null) { + this.key = other.key; + } + __isset.columnFamily_column = other.__isset.columnFamily_column; + if (other.columnFamily_column != null) { + this.columnFamily_column = other.columnFamily_column; + } + __isset.cellData = other.__isset.cellData; + if (other.cellData != null) { + this.cellData = other.cellData; + } + __isset.timestamp = other.__isset.timestamp; + this.timestamp = other.timestamp; + } + + @Override + public insert_args clone() { + return new insert_args(this); + } + + public String getTablename() { + return this.tablename; + } + + public void setTablename(String tablename) { + this.tablename = tablename; + this.__isset.tablename = (tablename != null); + } + + public void unsetTablename() { + this.__isset.tablename = false; + } + + // Returns true if field tablename is set (has been asigned a value) and false otherwise + public boolean isSetTablename() { + return this.__isset.tablename; + } + + public void setTablenameIsSet(boolean value) { + this.__isset.tablename = value; + } + + public String getKey() { + return this.key; + } + + public void setKey(String key) { + this.key = key; + this.__isset.key = (key != null); + } + + public void unsetKey() { + this.__isset.key = false; + } + + // Returns true if field key is set (has been asigned a value) and false otherwise + public boolean isSetKey() { + return this.__isset.key; + } + + public void setKeyIsSet(boolean value) { + this.__isset.key = value; + } + + public String getColumnFamily_column() { + return this.columnFamily_column; + } + + public void setColumnFamily_column(String columnFamily_column) { + this.columnFamily_column = columnFamily_column; + this.__isset.columnFamily_column = (columnFamily_column != null); + } + + public void unsetColumnFamily_column() { + this.__isset.columnFamily_column = false; + } + + // Returns true if field columnFamily_column is set (has been asigned a value) and false otherwise + public boolean isSetColumnFamily_column() { + return this.__isset.columnFamily_column; + } + + public void setColumnFamily_columnIsSet(boolean value) { + this.__isset.columnFamily_column = value; + } + + public String getCellData() { + return this.cellData; + } + + public void setCellData(String cellData) { + this.cellData = cellData; + this.__isset.cellData = (cellData != null); + } + + public void unsetCellData() { + this.__isset.cellData = false; + } + + // Returns true if field cellData is set (has been asigned a value) and false otherwise + public boolean isSetCellData() { + return this.__isset.cellData; + } + + public void setCellDataIsSet(boolean value) { + this.__isset.cellData = value; + } + + public long getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + this.__isset.timestamp = true; + } + + public void unsetTimestamp() { + this.__isset.timestamp = false; + } + + // Returns true if field timestamp is set (has been asigned a value) and false otherwise + public boolean isSetTimestamp() { + return this.__isset.timestamp; + } + + public void setTimestampIsSet(boolean value) { + this.__isset.timestamp = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TABLENAME: + setTablename((String)value); + break; + + case KEY: + setKey((String)value); + break; + + case COLUMNFAMILY_COLUMN: + setColumnFamily_column((String)value); + break; + + case CELLDATA: + setCellData((String)value); + break; + + case TIMESTAMP: + setTimestamp((Long)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TABLENAME: + return getTablename(); + + case KEY: + return getKey(); + + case COLUMNFAMILY_COLUMN: + return getColumnFamily_column(); + + case CELLDATA: + return getCellData(); + + case TIMESTAMP: + return new Long(getTimestamp()); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TABLENAME: + return this.__isset.tablename; + case KEY: + return this.__isset.key; + case COLUMNFAMILY_COLUMN: + return this.__isset.columnFamily_column; + case CELLDATA: + return this.__isset.cellData; + case TIMESTAMP: + return this.__isset.timestamp; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -2536,6 +4153,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -2551,7 +4169,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); this.__isset.tablename = true; @@ -2559,7 +4177,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -2: + case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); this.__isset.key = true; @@ -2567,7 +4185,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -3: + case COLUMNFAMILY_COLUMN: if (field.type == TType.STRING) { this.columnFamily_column = iprot.readString(); this.__isset.columnFamily_column = true; @@ -2575,7 +4193,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -4: + case CELLDATA: if (field.type == TType.STRING) { this.cellData = iprot.readString(); this.__isset.cellData = true; @@ -2583,7 +4201,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -5: + case TIMESTAMP: if (field.type == TType.I64) { this.timestamp = iprot.readI64(); this.__isset.timestamp = true; @@ -2598,80 +4216,100 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("insert_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { - field.name = "tablename"; - field.type = TType.STRING; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { - field.name = "key"; - field.type = TType.STRING; - field.id = -2; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily_column != null) { - field.name = "columnFamily_column"; - field.type = TType.STRING; - field.id = -3; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(COLUMN_FAMILY_COLUMN_FIELD_DESC); oprot.writeString(this.columnFamily_column); oprot.writeFieldEnd(); } if (this.cellData != null) { - field.name = "cellData"; - field.type = TType.STRING; - field.id = -4; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(CELL_DATA_FIELD_DESC); oprot.writeString(this.cellData); oprot.writeFieldEnd(); } - field.name = "timestamp"; - field.type = TType.I64; - field.id = -5; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); oprot.writeI64(this.timestamp); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("insert_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("tablename:"); sb.append(this.tablename); - sb.append(",key:"); + first = false; + if (!first) sb.append(", "); + sb.append("key:"); sb.append(this.key); - sb.append(",columnFamily_column:"); + first = false; + if (!first) sb.append(", "); + sb.append("columnFamily_column:"); sb.append(this.columnFamily_column); - sb.append(",cellData:"); + first = false; + if (!first) sb.append(", "); + sb.append("cellData:"); sb.append(this.cellData); - sb.append(",timestamp:"); + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); sb.append(this.timestamp); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class batch_insert_args implements TBase, java.io.Serializable { - public batch_mutation_t batchMutation; + public static class batch_insert_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("batch_insert_args"); + private static final TField BATCH_MUTATION_FIELD_DESC = new TField("batchMutation", TType.STRUCT, (short)-1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public batch_mutation_t batchMutation; + public static final int BATCHMUTATION = -1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean batchMutation = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(BATCHMUTATION, new FieldMetaData("batchMutation", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, batch_mutation_t.class))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(batch_insert_args.class, metaDataMap); + } + public batch_insert_args() { } @@ -2680,9 +4318,79 @@ public class Cassandra { { this(); this.batchMutation = batchMutation; - this.__isset.batchMutation = true; + this.__isset.batchMutation = (batchMutation != null); } + /** + * Performs a deep copy on other. + */ + public batch_insert_args(batch_insert_args other) { + __isset.batchMutation = other.__isset.batchMutation; + if (other.batchMutation != null) { + this.batchMutation = new batch_mutation_t(other.batchMutation); + } + } + + @Override + public batch_insert_args clone() { + return new batch_insert_args(this); + } + + public batch_mutation_t getBatchMutation() { + return this.batchMutation; + } + + public void setBatchMutation(batch_mutation_t batchMutation) { + this.batchMutation = batchMutation; + this.__isset.batchMutation = (batchMutation != null); + } + + public void unsetBatchMutation() { + this.batchMutation = null; + this.__isset.batchMutation = false; + } + + // Returns true if field batchMutation is set (has been asigned a value) and false otherwise + public boolean isSetBatchMutation() { + return this.__isset.batchMutation; + } + + public void setBatchMutationIsSet(boolean value) { + this.__isset.batchMutation = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case BATCHMUTATION: + setBatchMutation((batch_mutation_t)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case BATCHMUTATION: + return getBatchMutation(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case BATCHMUTATION: + return this.__isset.batchMutation; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -2707,6 +4415,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -2722,7 +4431,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case BATCHMUTATION: if (field.type == TType.STRUCT) { this.batchMutation = new batch_mutation_t(); this.batchMutation.read(iprot); @@ -2738,17 +4447,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("batch_insert_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.batchMutation != null) { - field.name = "batchMutation"; - field.type = TType.STRUCT; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(BATCH_MUTATION_FIELD_DESC); this.batchMutation.write(oprot); oprot.writeFieldEnd(); } @@ -2756,24 +4466,47 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("batch_insert_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("batchMutation:"); sb.append(this.batchMutation); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class batch_insert_blocking_args implements TBase, java.io.Serializable { - public batch_mutation_t batchMutation; + public static class batch_insert_blocking_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("batch_insert_blocking_args"); + private static final TField BATCH_MUTATION_FIELD_DESC = new TField("batchMutation", TType.STRUCT, (short)-1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public batch_mutation_t batchMutation; + public static final int BATCHMUTATION = -1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean batchMutation = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(BATCHMUTATION, new FieldMetaData("batchMutation", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, batch_mutation_t.class))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(batch_insert_blocking_args.class, metaDataMap); + } + public batch_insert_blocking_args() { } @@ -2782,9 +4515,79 @@ public class Cassandra { { this(); this.batchMutation = batchMutation; - this.__isset.batchMutation = true; + this.__isset.batchMutation = (batchMutation != null); } + /** + * Performs a deep copy on other. + */ + public batch_insert_blocking_args(batch_insert_blocking_args other) { + __isset.batchMutation = other.__isset.batchMutation; + if (other.batchMutation != null) { + this.batchMutation = new batch_mutation_t(other.batchMutation); + } + } + + @Override + public batch_insert_blocking_args clone() { + return new batch_insert_blocking_args(this); + } + + public batch_mutation_t getBatchMutation() { + return this.batchMutation; + } + + public void setBatchMutation(batch_mutation_t batchMutation) { + this.batchMutation = batchMutation; + this.__isset.batchMutation = (batchMutation != null); + } + + public void unsetBatchMutation() { + this.batchMutation = null; + this.__isset.batchMutation = false; + } + + // Returns true if field batchMutation is set (has been asigned a value) and false otherwise + public boolean isSetBatchMutation() { + return this.__isset.batchMutation; + } + + public void setBatchMutationIsSet(boolean value) { + this.__isset.batchMutation = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case BATCHMUTATION: + setBatchMutation((batch_mutation_t)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case BATCHMUTATION: + return getBatchMutation(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case BATCHMUTATION: + return this.__isset.batchMutation; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -2809,6 +4612,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -2824,7 +4628,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case BATCHMUTATION: if (field.type == TType.STRUCT) { this.batchMutation = new batch_mutation_t(); this.batchMutation.read(iprot); @@ -2840,17 +4644,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("batch_insert_blocking_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.batchMutation != null) { - field.name = "batchMutation"; - field.type = TType.STRUCT; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(BATCH_MUTATION_FIELD_DESC); this.batchMutation.write(oprot); oprot.writeFieldEnd(); } @@ -2858,26 +4663,53 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("batch_insert_blocking_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("batchMutation:"); sb.append(this.batchMutation); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class batch_insert_blocking_result implements TBase, java.io.Serializable { - public boolean success; - public CassandraException e; + public static class batch_insert_blocking_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("batch_insert_blocking_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); + private static final TField E_FIELD_DESC = new TField("e", TType.STRUCT, (short)1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public boolean success; + public static final int SUCCESS = 0; + public CassandraException e; + public static final int E = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean success = false; public boolean e = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(E, new FieldMetaData("e", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(batch_insert_blocking_result.class, metaDataMap); + } + public batch_insert_blocking_result() { } @@ -2889,9 +4721,112 @@ public class Cassandra { this.success = success; this.__isset.success = true; this.e = e; - this.__isset.e = true; + this.__isset.e = (e != null); } + /** + * Performs a deep copy on other. + */ + public batch_insert_blocking_result(batch_insert_blocking_result other) { + __isset.success = other.__isset.success; + this.success = other.success; + __isset.e = other.__isset.e; + if (other.e != null) { + this.e = new CassandraException(other.e); + } + } + + @Override + public batch_insert_blocking_result clone() { + return new batch_insert_blocking_result(this); + } + + public boolean isSuccess() { + return this.success; + } + + public void setSuccess(boolean success) { + this.success = success; + this.__isset.success = true; + } + + public void unsetSuccess() { + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public void setSuccessIsSet(boolean value) { + this.__isset.success = value; + } + + public CassandraException getE() { + return this.e; + } + + public void setE(CassandraException e) { + this.e = e; + this.__isset.e = (e != null); + } + + public void unsetE() { + this.e = null; + this.__isset.e = false; + } + + // Returns true if field e is set (has been asigned a value) and false otherwise + public boolean isSetE() { + return this.__isset.e; + } + + public void setEIsSet(boolean value) { + this.__isset.e = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + setSuccess((Boolean)value); + break; + + case E: + setE((CassandraException)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return new Boolean(isSuccess()); + + case E: + return getE(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return this.__isset.success; + case E: + return this.__isset.e; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -2925,6 +4860,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -2940,7 +4876,7 @@ public class Cassandra { } switch (field.id) { - case 0: + case SUCCESS: if (field.type == TType.BOOL) { this.success = iprot.readBool(); this.__isset.success = true; @@ -2948,7 +4884,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case 1: + case E: if (field.type == TType.STRUCT) { this.e = new CassandraException(); this.e.read(iprot); @@ -2964,26 +4900,22 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("batch_insert_blocking_result"); - oprot.writeStructBegin(struct); - TField field = new TField(); + oprot.writeStructBegin(STRUCT_DESC); if (this.__isset.success) { - field.name = "success"; - field.type = TType.BOOL; - field.id = 0; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeBool(this.success); oprot.writeFieldEnd(); } else if (this.__isset.e) { if (this.e != null) { - field.name = "e"; - field.type = TType.STRUCT; - field.id = 1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(E_FIELD_DESC); this.e.write(oprot); oprot.writeFieldEnd(); } @@ -2992,30 +4924,63 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("batch_insert_blocking_result("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("success:"); sb.append(this.success); - sb.append(",e:"); + first = false; + if (!first) sb.append(", "); + sb.append("e:"); sb.append(this.e); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class remove_args implements TBase, java.io.Serializable { - public String tablename; - public String key; - public String columnFamily_column; + public static class remove_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("remove_args"); + private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)-1); + private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)-2); + private static final TField COLUMN_FAMILY_COLUMN_FIELD_DESC = new TField("columnFamily_column", TType.STRING, (short)-3); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String tablename; + public static final int TABLENAME = -1; + public String key; + public static final int KEY = -2; + public String columnFamily_column; + public static final int COLUMNFAMILY_COLUMN = -3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean tablename = false; public boolean key = false; public boolean columnFamily_column = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(COLUMNFAMILY_COLUMN, new FieldMetaData("columnFamily_column", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(remove_args.class, metaDataMap); + } + public remove_args() { } @@ -3026,13 +4991,152 @@ public class Cassandra { { this(); this.tablename = tablename; - this.__isset.tablename = true; + this.__isset.tablename = (tablename != null); this.key = key; - this.__isset.key = true; + this.__isset.key = (key != null); this.columnFamily_column = columnFamily_column; - this.__isset.columnFamily_column = true; + this.__isset.columnFamily_column = (columnFamily_column != null); } + /** + * Performs a deep copy on other. + */ + public remove_args(remove_args other) { + __isset.tablename = other.__isset.tablename; + if (other.tablename != null) { + this.tablename = other.tablename; + } + __isset.key = other.__isset.key; + if (other.key != null) { + this.key = other.key; + } + __isset.columnFamily_column = other.__isset.columnFamily_column; + if (other.columnFamily_column != null) { + this.columnFamily_column = other.columnFamily_column; + } + } + + @Override + public remove_args clone() { + return new remove_args(this); + } + + public String getTablename() { + return this.tablename; + } + + public void setTablename(String tablename) { + this.tablename = tablename; + this.__isset.tablename = (tablename != null); + } + + public void unsetTablename() { + this.__isset.tablename = false; + } + + // Returns true if field tablename is set (has been asigned a value) and false otherwise + public boolean isSetTablename() { + return this.__isset.tablename; + } + + public void setTablenameIsSet(boolean value) { + this.__isset.tablename = value; + } + + public String getKey() { + return this.key; + } + + public void setKey(String key) { + this.key = key; + this.__isset.key = (key != null); + } + + public void unsetKey() { + this.__isset.key = false; + } + + // Returns true if field key is set (has been asigned a value) and false otherwise + public boolean isSetKey() { + return this.__isset.key; + } + + public void setKeyIsSet(boolean value) { + this.__isset.key = value; + } + + public String getColumnFamily_column() { + return this.columnFamily_column; + } + + public void setColumnFamily_column(String columnFamily_column) { + this.columnFamily_column = columnFamily_column; + this.__isset.columnFamily_column = (columnFamily_column != null); + } + + public void unsetColumnFamily_column() { + this.__isset.columnFamily_column = false; + } + + // Returns true if field columnFamily_column is set (has been asigned a value) and false otherwise + public boolean isSetColumnFamily_column() { + return this.__isset.columnFamily_column; + } + + public void setColumnFamily_columnIsSet(boolean value) { + this.__isset.columnFamily_column = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TABLENAME: + setTablename((String)value); + break; + + case KEY: + setKey((String)value); + break; + + case COLUMNFAMILY_COLUMN: + setColumnFamily_column((String)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TABLENAME: + return getTablename(); + + case KEY: + return getKey(); + + case COLUMNFAMILY_COLUMN: + return getColumnFamily_column(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TABLENAME: + return this.__isset.tablename; + case KEY: + return this.__isset.key; + case COLUMNFAMILY_COLUMN: + return this.__isset.columnFamily_column; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -3075,6 +5179,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -3090,7 +5195,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); this.__isset.tablename = true; @@ -3098,7 +5203,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -2: + case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); this.__isset.key = true; @@ -3106,7 +5211,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -3: + case COLUMNFAMILY_COLUMN: if (field.type == TType.STRING) { this.columnFamily_column = iprot.readString(); this.__isset.columnFamily_column = true; @@ -3121,33 +5226,28 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("remove_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { - field.name = "tablename"; - field.type = TType.STRING; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { - field.name = "key"; - field.type = TType.STRING; - field.id = -2; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily_column != null) { - field.name = "columnFamily_column"; - field.type = TType.STRING; - field.id = -3; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(COLUMN_FAMILY_COLUMN_FIELD_DESC); oprot.writeString(this.columnFamily_column); oprot.writeFieldEnd(); } @@ -3155,34 +5255,73 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("remove_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("tablename:"); sb.append(this.tablename); - sb.append(",key:"); + first = false; + if (!first) sb.append(", "); + sb.append("key:"); sb.append(this.key); - sb.append(",columnFamily_column:"); + first = false; + if (!first) sb.append(", "); + sb.append("columnFamily_column:"); sb.append(this.columnFamily_column); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class get_columns_since_args implements TBase, java.io.Serializable { - public String tablename; - public String key; - public String columnFamily_column; - public long timeStamp; + public static class get_columns_since_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_columns_since_args"); + private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)-1); + private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)-2); + private static final TField COLUMN_FAMILY_COLUMN_FIELD_DESC = new TField("columnFamily_column", TType.STRING, (short)-3); + private static final TField TIME_STAMP_FIELD_DESC = new TField("timeStamp", TType.I64, (short)-4); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String tablename; + public static final int TABLENAME = -1; + public String key; + public static final int KEY = -2; + public String columnFamily_column; + public static final int COLUMNFAMILY_COLUMN = -3; + public long timeStamp; + public static final int TIMESTAMP = -4; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean tablename = false; public boolean key = false; public boolean columnFamily_column = false; public boolean timeStamp = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(COLUMNFAMILY_COLUMN, new FieldMetaData("columnFamily_column", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TIMESTAMP, new FieldMetaData("timeStamp", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I64))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_columns_since_args.class, metaDataMap); + } + public get_columns_since_args() { } @@ -3194,15 +5333,187 @@ public class Cassandra { { this(); this.tablename = tablename; - this.__isset.tablename = true; + this.__isset.tablename = (tablename != null); this.key = key; - this.__isset.key = true; + this.__isset.key = (key != null); this.columnFamily_column = columnFamily_column; - this.__isset.columnFamily_column = true; + this.__isset.columnFamily_column = (columnFamily_column != null); this.timeStamp = timeStamp; this.__isset.timeStamp = true; } + /** + * Performs a deep copy on other. + */ + public get_columns_since_args(get_columns_since_args other) { + __isset.tablename = other.__isset.tablename; + if (other.tablename != null) { + this.tablename = other.tablename; + } + __isset.key = other.__isset.key; + if (other.key != null) { + this.key = other.key; + } + __isset.columnFamily_column = other.__isset.columnFamily_column; + if (other.columnFamily_column != null) { + this.columnFamily_column = other.columnFamily_column; + } + __isset.timeStamp = other.__isset.timeStamp; + this.timeStamp = other.timeStamp; + } + + @Override + public get_columns_since_args clone() { + return new get_columns_since_args(this); + } + + public String getTablename() { + return this.tablename; + } + + public void setTablename(String tablename) { + this.tablename = tablename; + this.__isset.tablename = (tablename != null); + } + + public void unsetTablename() { + this.__isset.tablename = false; + } + + // Returns true if field tablename is set (has been asigned a value) and false otherwise + public boolean isSetTablename() { + return this.__isset.tablename; + } + + public void setTablenameIsSet(boolean value) { + this.__isset.tablename = value; + } + + public String getKey() { + return this.key; + } + + public void setKey(String key) { + this.key = key; + this.__isset.key = (key != null); + } + + public void unsetKey() { + this.__isset.key = false; + } + + // Returns true if field key is set (has been asigned a value) and false otherwise + public boolean isSetKey() { + return this.__isset.key; + } + + public void setKeyIsSet(boolean value) { + this.__isset.key = value; + } + + public String getColumnFamily_column() { + return this.columnFamily_column; + } + + public void setColumnFamily_column(String columnFamily_column) { + this.columnFamily_column = columnFamily_column; + this.__isset.columnFamily_column = (columnFamily_column != null); + } + + public void unsetColumnFamily_column() { + this.__isset.columnFamily_column = false; + } + + // Returns true if field columnFamily_column is set (has been asigned a value) and false otherwise + public boolean isSetColumnFamily_column() { + return this.__isset.columnFamily_column; + } + + public void setColumnFamily_columnIsSet(boolean value) { + this.__isset.columnFamily_column = value; + } + + public long getTimeStamp() { + return this.timeStamp; + } + + public void setTimeStamp(long timeStamp) { + this.timeStamp = timeStamp; + this.__isset.timeStamp = true; + } + + public void unsetTimeStamp() { + this.__isset.timeStamp = false; + } + + // Returns true if field timeStamp is set (has been asigned a value) and false otherwise + public boolean isSetTimeStamp() { + return this.__isset.timeStamp; + } + + public void setTimeStampIsSet(boolean value) { + this.__isset.timeStamp = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TABLENAME: + setTablename((String)value); + break; + + case KEY: + setKey((String)value); + break; + + case COLUMNFAMILY_COLUMN: + setColumnFamily_column((String)value); + break; + + case TIMESTAMP: + setTimeStamp((Long)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TABLENAME: + return getTablename(); + + case KEY: + return getKey(); + + case COLUMNFAMILY_COLUMN: + return getColumnFamily_column(); + + case TIMESTAMP: + return new Long(getTimeStamp()); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TABLENAME: + return this.__isset.tablename; + case KEY: + return this.__isset.key; + case COLUMNFAMILY_COLUMN: + return this.__isset.columnFamily_column; + case TIMESTAMP: + return this.__isset.timeStamp; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -3254,6 +5565,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -3269,7 +5581,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); this.__isset.tablename = true; @@ -3277,7 +5589,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -2: + case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); this.__isset.key = true; @@ -3285,7 +5597,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -3: + case COLUMNFAMILY_COLUMN: if (field.type == TType.STRING) { this.columnFamily_column = iprot.readString(); this.__isset.columnFamily_column = true; @@ -3293,7 +5605,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -4: + case TIMESTAMP: if (field.type == TType.I64) { this.timeStamp = iprot.readI64(); this.__isset.timeStamp = true; @@ -3308,72 +5620,98 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("get_columns_since_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { - field.name = "tablename"; - field.type = TType.STRING; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { - field.name = "key"; - field.type = TType.STRING; - field.id = -2; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily_column != null) { - field.name = "columnFamily_column"; - field.type = TType.STRING; - field.id = -3; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(COLUMN_FAMILY_COLUMN_FIELD_DESC); oprot.writeString(this.columnFamily_column); oprot.writeFieldEnd(); } - field.name = "timeStamp"; - field.type = TType.I64; - field.id = -4; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(TIME_STAMP_FIELD_DESC); oprot.writeI64(this.timeStamp); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("get_columns_since_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("tablename:"); sb.append(this.tablename); - sb.append(",key:"); + first = false; + if (!first) sb.append(", "); + sb.append("key:"); sb.append(this.key); - sb.append(",columnFamily_column:"); + first = false; + if (!first) sb.append(", "); + sb.append("columnFamily_column:"); sb.append(this.columnFamily_column); - sb.append(",timeStamp:"); + first = false; + if (!first) sb.append(", "); + sb.append("timeStamp:"); sb.append(this.timeStamp); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class get_columns_since_result implements TBase, java.io.Serializable { - public List success; - public CassandraException e; + public static class get_columns_since_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_columns_since_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField E_FIELD_DESC = new TField("e", TType.STRUCT, (short)1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public List success; + public static final int SUCCESS = 0; + public CassandraException e; + public static final int E = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean success = false; public boolean e = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, column_t.class)))); + put(E, new FieldMetaData("e", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_columns_since_result.class, metaDataMap); + } + public get_columns_since_result() { } @@ -3383,11 +5721,137 @@ public class Cassandra { { this(); this.success = success; - this.__isset.success = true; + this.__isset.success = (success != null); this.e = e; - this.__isset.e = true; + this.__isset.e = (e != null); } + /** + * Performs a deep copy on other. + */ + public get_columns_since_result(get_columns_since_result other) { + __isset.success = other.__isset.success; + if (other.success != null) { + List __this__success = new ArrayList(); + for (column_t other_element : other.success) { + __this__success.add(new column_t(other_element)); + } + this.success = __this__success; + } + __isset.e = other.__isset.e; + if (other.e != null) { + this.e = new CassandraException(other.e); + } + } + + @Override + public get_columns_since_result clone() { + return new get_columns_since_result(this); + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(column_t elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + this.__isset.success = true; + } + + public List getSuccess() { + return this.success; + } + + public void setSuccess(List success) { + this.success = success; + this.__isset.success = (success != null); + } + + public void unsetSuccess() { + this.success = null; + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public void setSuccessIsSet(boolean value) { + this.__isset.success = value; + } + + public CassandraException getE() { + return this.e; + } + + public void setE(CassandraException e) { + this.e = e; + this.__isset.e = (e != null); + } + + public void unsetE() { + this.e = null; + this.__isset.e = false; + } + + // Returns true if field e is set (has been asigned a value) and false otherwise + public boolean isSetE() { + return this.__isset.e; + } + + public void setEIsSet(boolean value) { + this.__isset.e = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + setSuccess((List)value); + break; + + case E: + setE((CassandraException)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case E: + return getE(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return this.__isset.success; + case E: + return this.__isset.e; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -3421,6 +5885,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -3436,14 +5901,14 @@ public class Cassandra { } switch (field.id) { - case 0: + case SUCCESS: if (field.type == TType.LIST) { { TList _list61 = iprot.readListBegin(); this.success = new ArrayList(_list61.size); for (int _i62 = 0; _i62 < _list61.size; ++_i62) { - column_t _elem63 = new column_t(); + column_t _elem63; _elem63 = new column_t(); _elem63.read(iprot); this.success.add(_elem63); @@ -3455,7 +5920,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case 1: + case E: if (field.type == TType.STRUCT) { this.e = new CassandraException(); this.e.read(iprot); @@ -3471,19 +5936,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("get_columns_since_result"); - oprot.writeStructBegin(struct); - TField field = new TField(); + oprot.writeStructBegin(STRUCT_DESC); if (this.__isset.success) { if (this.success != null) { - field.name = "success"; - field.type = TType.LIST; - field.id = 0; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); for (column_t _iter64 : this.success) { @@ -3495,10 +5959,7 @@ public class Cassandra { } } else if (this.__isset.e) { if (this.e != null) { - field.name = "e"; - field.type = TType.STRUCT; - field.id = 1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(E_FIELD_DESC); this.e.write(oprot); oprot.writeFieldEnd(); } @@ -3507,27 +5968,51 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("get_columns_since_result("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("success:"); sb.append(this.success); - sb.append(",e:"); + first = false; + if (!first) sb.append(", "); + sb.append("e:"); sb.append(this.e); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class get_slice_super_args implements TBase, java.io.Serializable { - public String tablename; - public String key; - public String columnFamily_superColumnName; - public int start; - public int count; + public static class get_slice_super_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_slice_super_args"); + private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)-1); + private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)-2); + private static final TField COLUMN_FAMILY_SUPER_COLUMN_NAME_FIELD_DESC = new TField("columnFamily_superColumnName", TType.STRING, (short)-3); + private static final TField START_FIELD_DESC = new TField("start", TType.I32, (short)-4); + private static final TField COUNT_FIELD_DESC = new TField("count", TType.I32, (short)-5); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String tablename; + public static final int TABLENAME = -1; + public String key; + public static final int KEY = -2; + public String columnFamily_superColumnName; + public static final int COLUMNFAMILY_SUPERCOLUMNNAME = -3; + public int start; + public static final int START = -4; + public int count; + public static final int COUNT = -5; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean tablename = false; public boolean key = false; public boolean columnFamily_superColumnName = false; @@ -3535,6 +6020,23 @@ public class Cassandra { public boolean count = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(COLUMNFAMILY_SUPERCOLUMNNAME, new FieldMetaData("columnFamily_superColumnName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(START, new FieldMetaData("start", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); + put(COUNT, new FieldMetaData("count", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_slice_super_args.class, metaDataMap); + } + public get_slice_super_args() { this.start = -1; @@ -3551,17 +6053,222 @@ public class Cassandra { { this(); this.tablename = tablename; - this.__isset.tablename = true; + this.__isset.tablename = (tablename != null); this.key = key; - this.__isset.key = true; + this.__isset.key = (key != null); this.columnFamily_superColumnName = columnFamily_superColumnName; - this.__isset.columnFamily_superColumnName = true; + this.__isset.columnFamily_superColumnName = (columnFamily_superColumnName != null); this.start = start; this.__isset.start = true; this.count = count; this.__isset.count = true; } + /** + * Performs a deep copy on other. + */ + public get_slice_super_args(get_slice_super_args other) { + __isset.tablename = other.__isset.tablename; + if (other.tablename != null) { + this.tablename = other.tablename; + } + __isset.key = other.__isset.key; + if (other.key != null) { + this.key = other.key; + } + __isset.columnFamily_superColumnName = other.__isset.columnFamily_superColumnName; + if (other.columnFamily_superColumnName != null) { + this.columnFamily_superColumnName = other.columnFamily_superColumnName; + } + __isset.start = other.__isset.start; + this.start = other.start; + __isset.count = other.__isset.count; + this.count = other.count; + } + + @Override + public get_slice_super_args clone() { + return new get_slice_super_args(this); + } + + public String getTablename() { + return this.tablename; + } + + public void setTablename(String tablename) { + this.tablename = tablename; + this.__isset.tablename = (tablename != null); + } + + public void unsetTablename() { + this.__isset.tablename = false; + } + + // Returns true if field tablename is set (has been asigned a value) and false otherwise + public boolean isSetTablename() { + return this.__isset.tablename; + } + + public void setTablenameIsSet(boolean value) { + this.__isset.tablename = value; + } + + public String getKey() { + return this.key; + } + + public void setKey(String key) { + this.key = key; + this.__isset.key = (key != null); + } + + public void unsetKey() { + this.__isset.key = false; + } + + // Returns true if field key is set (has been asigned a value) and false otherwise + public boolean isSetKey() { + return this.__isset.key; + } + + public void setKeyIsSet(boolean value) { + this.__isset.key = value; + } + + public String getColumnFamily_superColumnName() { + return this.columnFamily_superColumnName; + } + + public void setColumnFamily_superColumnName(String columnFamily_superColumnName) { + this.columnFamily_superColumnName = columnFamily_superColumnName; + this.__isset.columnFamily_superColumnName = (columnFamily_superColumnName != null); + } + + public void unsetColumnFamily_superColumnName() { + this.__isset.columnFamily_superColumnName = false; + } + + // Returns true if field columnFamily_superColumnName is set (has been asigned a value) and false otherwise + public boolean isSetColumnFamily_superColumnName() { + return this.__isset.columnFamily_superColumnName; + } + + public void setColumnFamily_superColumnNameIsSet(boolean value) { + this.__isset.columnFamily_superColumnName = value; + } + + public int getStart() { + return this.start; + } + + public void setStart(int start) { + this.start = start; + this.__isset.start = true; + } + + public void unsetStart() { + this.__isset.start = false; + } + + // Returns true if field start is set (has been asigned a value) and false otherwise + public boolean isSetStart() { + return this.__isset.start; + } + + public void setStartIsSet(boolean value) { + this.__isset.start = value; + } + + public int getCount() { + return this.count; + } + + public void setCount(int count) { + this.count = count; + this.__isset.count = true; + } + + public void unsetCount() { + this.__isset.count = false; + } + + // Returns true if field count is set (has been asigned a value) and false otherwise + public boolean isSetCount() { + return this.__isset.count; + } + + public void setCountIsSet(boolean value) { + this.__isset.count = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TABLENAME: + setTablename((String)value); + break; + + case KEY: + setKey((String)value); + break; + + case COLUMNFAMILY_SUPERCOLUMNNAME: + setColumnFamily_superColumnName((String)value); + break; + + case START: + setStart((Integer)value); + break; + + case COUNT: + setCount((Integer)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TABLENAME: + return getTablename(); + + case KEY: + return getKey(); + + case COLUMNFAMILY_SUPERCOLUMNNAME: + return getColumnFamily_superColumnName(); + + case START: + return new Integer(getStart()); + + case COUNT: + return new Integer(getCount()); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TABLENAME: + return this.__isset.tablename; + case KEY: + return this.__isset.key; + case COLUMNFAMILY_SUPERCOLUMNNAME: + return this.__isset.columnFamily_superColumnName; + case START: + return this.__isset.start; + case COUNT: + return this.__isset.count; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -3622,6 +6329,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -3637,7 +6345,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); this.__isset.tablename = true; @@ -3645,7 +6353,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -2: + case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); this.__isset.key = true; @@ -3653,7 +6361,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -3: + case COLUMNFAMILY_SUPERCOLUMNNAME: if (field.type == TType.STRING) { this.columnFamily_superColumnName = iprot.readString(); this.__isset.columnFamily_superColumnName = true; @@ -3661,7 +6369,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -4: + case START: if (field.type == TType.I32) { this.start = iprot.readI32(); this.__isset.start = true; @@ -3669,7 +6377,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -5: + case COUNT: if (field.type == TType.I32) { this.count = iprot.readI32(); this.__isset.count = true; @@ -3684,80 +6392,105 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("get_slice_super_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { - field.name = "tablename"; - field.type = TType.STRING; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { - field.name = "key"; - field.type = TType.STRING; - field.id = -2; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily_superColumnName != null) { - field.name = "columnFamily_superColumnName"; - field.type = TType.STRING; - field.id = -3; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(COLUMN_FAMILY_SUPER_COLUMN_NAME_FIELD_DESC); oprot.writeString(this.columnFamily_superColumnName); oprot.writeFieldEnd(); } - field.name = "start"; - field.type = TType.I32; - field.id = -4; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(START_FIELD_DESC); oprot.writeI32(this.start); oprot.writeFieldEnd(); - field.name = "count"; - field.type = TType.I32; - field.id = -5; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(COUNT_FIELD_DESC); oprot.writeI32(this.count); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_super_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("tablename:"); sb.append(this.tablename); - sb.append(",key:"); + first = false; + if (!first) sb.append(", "); + sb.append("key:"); sb.append(this.key); - sb.append(",columnFamily_superColumnName:"); + first = false; + if (!first) sb.append(", "); + sb.append("columnFamily_superColumnName:"); sb.append(this.columnFamily_superColumnName); - sb.append(",start:"); + first = false; + if (!first) sb.append(", "); + sb.append("start:"); sb.append(this.start); - sb.append(",count:"); + first = false; + if (!first) sb.append(", "); + sb.append("count:"); sb.append(this.count); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class get_slice_super_result implements TBase, java.io.Serializable { - public List success; - public CassandraException e; + public static class get_slice_super_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_slice_super_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField E_FIELD_DESC = new TField("e", TType.STRUCT, (short)1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public List success; + public static final int SUCCESS = 0; + public CassandraException e; + public static final int E = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean success = false; public boolean e = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, superColumn_t.class)))); + put(E, new FieldMetaData("e", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_slice_super_result.class, metaDataMap); + } + public get_slice_super_result() { } @@ -3767,11 +6500,137 @@ public class Cassandra { { this(); this.success = success; - this.__isset.success = true; + this.__isset.success = (success != null); this.e = e; - this.__isset.e = true; + this.__isset.e = (e != null); } + /** + * Performs a deep copy on other. + */ + public get_slice_super_result(get_slice_super_result other) { + __isset.success = other.__isset.success; + if (other.success != null) { + List __this__success = new ArrayList(); + for (superColumn_t other_element : other.success) { + __this__success.add(new superColumn_t(other_element)); + } + this.success = __this__success; + } + __isset.e = other.__isset.e; + if (other.e != null) { + this.e = new CassandraException(other.e); + } + } + + @Override + public get_slice_super_result clone() { + return new get_slice_super_result(this); + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(superColumn_t elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + this.__isset.success = true; + } + + public List getSuccess() { + return this.success; + } + + public void setSuccess(List success) { + this.success = success; + this.__isset.success = (success != null); + } + + public void unsetSuccess() { + this.success = null; + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public void setSuccessIsSet(boolean value) { + this.__isset.success = value; + } + + public CassandraException getE() { + return this.e; + } + + public void setE(CassandraException e) { + this.e = e; + this.__isset.e = (e != null); + } + + public void unsetE() { + this.e = null; + this.__isset.e = false; + } + + // Returns true if field e is set (has been asigned a value) and false otherwise + public boolean isSetE() { + return this.__isset.e; + } + + public void setEIsSet(boolean value) { + this.__isset.e = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + setSuccess((List)value); + break; + + case E: + setE((CassandraException)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case E: + return getE(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return this.__isset.success; + case E: + return this.__isset.e; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -3805,6 +6664,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -3820,14 +6680,14 @@ public class Cassandra { } switch (field.id) { - case 0: + case SUCCESS: if (field.type == TType.LIST) { { TList _list65 = iprot.readListBegin(); this.success = new ArrayList(_list65.size); for (int _i66 = 0; _i66 < _list65.size; ++_i66) { - superColumn_t _elem67 = new superColumn_t(); + superColumn_t _elem67; _elem67 = new superColumn_t(); _elem67.read(iprot); this.success.add(_elem67); @@ -3839,7 +6699,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case 1: + case E: if (field.type == TType.STRUCT) { this.e = new CassandraException(); this.e.read(iprot); @@ -3855,19 +6715,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("get_slice_super_result"); - oprot.writeStructBegin(struct); - TField field = new TField(); + oprot.writeStructBegin(STRUCT_DESC); if (this.__isset.success) { if (this.success != null) { - field.name = "success"; - field.type = TType.LIST; - field.id = 0; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); for (superColumn_t _iter68 : this.success) { @@ -3879,10 +6738,7 @@ public class Cassandra { } } else if (this.__isset.e) { if (this.e != null) { - field.name = "e"; - field.type = TType.STRUCT; - field.id = 1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(E_FIELD_DESC); this.e.write(oprot); oprot.writeFieldEnd(); } @@ -3891,32 +6747,70 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_super_result("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("success:"); sb.append(this.success); - sb.append(",e:"); + first = false; + if (!first) sb.append(", "); + sb.append("e:"); sb.append(this.e); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class get_slice_super_by_names_args implements TBase, java.io.Serializable { - public String tablename; - public String key; - public String columnFamily; - public List superColumnNames; + public static class get_slice_super_by_names_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_slice_super_by_names_args"); + private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)-1); + private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)-2); + private static final TField COLUMN_FAMILY_FIELD_DESC = new TField("columnFamily", TType.STRING, (short)-3); + private static final TField SUPER_COLUMN_NAMES_FIELD_DESC = new TField("superColumnNames", TType.LIST, (short)-4); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String tablename; + public static final int TABLENAME = -1; + public String key; + public static final int KEY = -2; + public String columnFamily; + public static final int COLUMNFAMILY = -3; + public List superColumnNames; + public static final int SUPERCOLUMNNAMES = -4; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean tablename = false; public boolean key = false; public boolean columnFamily = false; public boolean superColumnNames = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(COLUMNFAMILY, new FieldMetaData("columnFamily", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(SUPERCOLUMNNAMES, new FieldMetaData("superColumnNames", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_slice_super_by_names_args.class, metaDataMap); + } + public get_slice_super_by_names_args() { } @@ -3928,15 +6822,210 @@ public class Cassandra { { this(); this.tablename = tablename; - this.__isset.tablename = true; + this.__isset.tablename = (tablename != null); this.key = key; - this.__isset.key = true; + this.__isset.key = (key != null); this.columnFamily = columnFamily; - this.__isset.columnFamily = true; + this.__isset.columnFamily = (columnFamily != null); this.superColumnNames = superColumnNames; + this.__isset.superColumnNames = (superColumnNames != null); + } + + /** + * Performs a deep copy on other. + */ + public get_slice_super_by_names_args(get_slice_super_by_names_args other) { + __isset.tablename = other.__isset.tablename; + if (other.tablename != null) { + this.tablename = other.tablename; + } + __isset.key = other.__isset.key; + if (other.key != null) { + this.key = other.key; + } + __isset.columnFamily = other.__isset.columnFamily; + if (other.columnFamily != null) { + this.columnFamily = other.columnFamily; + } + __isset.superColumnNames = other.__isset.superColumnNames; + if (other.superColumnNames != null) { + List __this__superColumnNames = new ArrayList(); + for (String other_element : other.superColumnNames) { + __this__superColumnNames.add(other_element); + } + this.superColumnNames = __this__superColumnNames; + } + } + + @Override + public get_slice_super_by_names_args clone() { + return new get_slice_super_by_names_args(this); + } + + public String getTablename() { + return this.tablename; + } + + public void setTablename(String tablename) { + this.tablename = tablename; + this.__isset.tablename = (tablename != null); + } + + public void unsetTablename() { + this.__isset.tablename = false; + } + + // Returns true if field tablename is set (has been asigned a value) and false otherwise + public boolean isSetTablename() { + return this.__isset.tablename; + } + + public void setTablenameIsSet(boolean value) { + this.__isset.tablename = value; + } + + public String getKey() { + return this.key; + } + + public void setKey(String key) { + this.key = key; + this.__isset.key = (key != null); + } + + public void unsetKey() { + this.__isset.key = false; + } + + // Returns true if field key is set (has been asigned a value) and false otherwise + public boolean isSetKey() { + return this.__isset.key; + } + + public void setKeyIsSet(boolean value) { + this.__isset.key = value; + } + + public String getColumnFamily() { + return this.columnFamily; + } + + public void setColumnFamily(String columnFamily) { + this.columnFamily = columnFamily; + this.__isset.columnFamily = (columnFamily != null); + } + + public void unsetColumnFamily() { + this.__isset.columnFamily = false; + } + + // Returns true if field columnFamily is set (has been asigned a value) and false otherwise + public boolean isSetColumnFamily() { + return this.__isset.columnFamily; + } + + public void setColumnFamilyIsSet(boolean value) { + this.__isset.columnFamily = value; + } + + public int getSuperColumnNamesSize() { + return (this.superColumnNames == null) ? 0 : this.superColumnNames.size(); + } + + public java.util.Iterator getSuperColumnNamesIterator() { + return (this.superColumnNames == null) ? null : this.superColumnNames.iterator(); + } + + public void addToSuperColumnNames(String elem) { + if (this.superColumnNames == null) { + this.superColumnNames = new ArrayList(); + } + this.superColumnNames.add(elem); this.__isset.superColumnNames = true; } + public List getSuperColumnNames() { + return this.superColumnNames; + } + + public void setSuperColumnNames(List superColumnNames) { + this.superColumnNames = superColumnNames; + this.__isset.superColumnNames = (superColumnNames != null); + } + + public void unsetSuperColumnNames() { + this.superColumnNames = null; + this.__isset.superColumnNames = false; + } + + // Returns true if field superColumnNames is set (has been asigned a value) and false otherwise + public boolean isSetSuperColumnNames() { + return this.__isset.superColumnNames; + } + + public void setSuperColumnNamesIsSet(boolean value) { + this.__isset.superColumnNames = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TABLENAME: + setTablename((String)value); + break; + + case KEY: + setKey((String)value); + break; + + case COLUMNFAMILY: + setColumnFamily((String)value); + break; + + case SUPERCOLUMNNAMES: + setSuperColumnNames((List)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TABLENAME: + return getTablename(); + + case KEY: + return getKey(); + + case COLUMNFAMILY: + return getColumnFamily(); + + case SUPERCOLUMNNAMES: + return getSuperColumnNames(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TABLENAME: + return this.__isset.tablename; + case KEY: + return this.__isset.key; + case COLUMNFAMILY: + return this.__isset.columnFamily; + case SUPERCOLUMNNAMES: + return this.__isset.superColumnNames; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -3988,6 +7077,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -4003,7 +7093,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); this.__isset.tablename = true; @@ -4011,7 +7101,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -2: + case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); this.__isset.key = true; @@ -4019,7 +7109,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -3: + case COLUMNFAMILY: if (field.type == TType.STRING) { this.columnFamily = iprot.readString(); this.__isset.columnFamily = true; @@ -4027,14 +7117,14 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -4: + case SUPERCOLUMNNAMES: if (field.type == TType.LIST) { { TList _list69 = iprot.readListBegin(); this.superColumnNames = new ArrayList(_list69.size); for (int _i70 = 0; _i70 < _list69.size; ++_i70) { - String _elem71 = null; + String _elem71; _elem71 = iprot.readString(); this.superColumnNames.add(_elem71); } @@ -4052,41 +7142,33 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("get_slice_super_by_names_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { - field.name = "tablename"; - field.type = TType.STRING; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { - field.name = "key"; - field.type = TType.STRING; - field.id = -2; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily != null) { - field.name = "columnFamily"; - field.type = TType.STRING; - field.id = -3; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(COLUMN_FAMILY_FIELD_DESC); oprot.writeString(this.columnFamily); oprot.writeFieldEnd(); } if (this.superColumnNames != null) { - field.name = "superColumnNames"; - field.type = TType.LIST; - field.id = -4; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(SUPER_COLUMN_NAMES_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.superColumnNames.size())); for (String _iter72 : this.superColumnNames) { @@ -4100,32 +7182,66 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_super_by_names_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("tablename:"); sb.append(this.tablename); - sb.append(",key:"); + first = false; + if (!first) sb.append(", "); + sb.append("key:"); sb.append(this.key); - sb.append(",columnFamily:"); + first = false; + if (!first) sb.append(", "); + sb.append("columnFamily:"); sb.append(this.columnFamily); - sb.append(",superColumnNames:"); + first = false; + if (!first) sb.append(", "); + sb.append("superColumnNames:"); sb.append(this.superColumnNames); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class get_slice_super_by_names_result implements TBase, java.io.Serializable { - public List success; - public CassandraException e; + public static class get_slice_super_by_names_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_slice_super_by_names_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); + private static final TField E_FIELD_DESC = new TField("e", TType.STRUCT, (short)1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public List success; + public static final int SUCCESS = 0; + public CassandraException e; + public static final int E = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean success = false; public boolean e = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, superColumn_t.class)))); + put(E, new FieldMetaData("e", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_slice_super_by_names_result.class, metaDataMap); + } + public get_slice_super_by_names_result() { } @@ -4135,11 +7251,137 @@ public class Cassandra { { this(); this.success = success; - this.__isset.success = true; + this.__isset.success = (success != null); this.e = e; - this.__isset.e = true; + this.__isset.e = (e != null); } + /** + * Performs a deep copy on other. + */ + public get_slice_super_by_names_result(get_slice_super_by_names_result other) { + __isset.success = other.__isset.success; + if (other.success != null) { + List __this__success = new ArrayList(); + for (superColumn_t other_element : other.success) { + __this__success.add(new superColumn_t(other_element)); + } + this.success = __this__success; + } + __isset.e = other.__isset.e; + if (other.e != null) { + this.e = new CassandraException(other.e); + } + } + + @Override + public get_slice_super_by_names_result clone() { + return new get_slice_super_by_names_result(this); + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(superColumn_t elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + this.__isset.success = true; + } + + public List getSuccess() { + return this.success; + } + + public void setSuccess(List success) { + this.success = success; + this.__isset.success = (success != null); + } + + public void unsetSuccess() { + this.success = null; + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public void setSuccessIsSet(boolean value) { + this.__isset.success = value; + } + + public CassandraException getE() { + return this.e; + } + + public void setE(CassandraException e) { + this.e = e; + this.__isset.e = (e != null); + } + + public void unsetE() { + this.e = null; + this.__isset.e = false; + } + + // Returns true if field e is set (has been asigned a value) and false otherwise + public boolean isSetE() { + return this.__isset.e; + } + + public void setEIsSet(boolean value) { + this.__isset.e = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + setSuccess((List)value); + break; + + case E: + setE((CassandraException)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case E: + return getE(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return this.__isset.success; + case E: + return this.__isset.e; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -4173,6 +7415,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -4188,14 +7431,14 @@ public class Cassandra { } switch (field.id) { - case 0: + case SUCCESS: if (field.type == TType.LIST) { { TList _list73 = iprot.readListBegin(); this.success = new ArrayList(_list73.size); for (int _i74 = 0; _i74 < _list73.size; ++_i74) { - superColumn_t _elem75 = new superColumn_t(); + superColumn_t _elem75; _elem75 = new superColumn_t(); _elem75.read(iprot); this.success.add(_elem75); @@ -4207,7 +7450,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case 1: + case E: if (field.type == TType.STRUCT) { this.e = new CassandraException(); this.e.read(iprot); @@ -4223,19 +7466,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("get_slice_super_by_names_result"); - oprot.writeStructBegin(struct); - TField field = new TField(); + oprot.writeStructBegin(STRUCT_DESC); if (this.__isset.success) { if (this.success != null) { - field.name = "success"; - field.type = TType.LIST; - field.id = 0; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.success.size())); for (superColumn_t _iter76 : this.success) { @@ -4247,10 +7489,7 @@ public class Cassandra { } } else if (this.__isset.e) { if (this.e != null) { - field.name = "e"; - field.type = TType.STRUCT; - field.id = 1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(E_FIELD_DESC); this.e.write(oprot); oprot.writeFieldEnd(); } @@ -4259,30 +7498,63 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("get_slice_super_by_names_result("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("success:"); sb.append(this.success); - sb.append(",e:"); + first = false; + if (!first) sb.append(", "); + sb.append("e:"); sb.append(this.e); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class get_superColumn_args implements TBase, java.io.Serializable { - public String tablename; - public String key; - public String columnFamily; + public static class get_superColumn_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_superColumn_args"); + private static final TField TABLENAME_FIELD_DESC = new TField("tablename", TType.STRING, (short)-1); + private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)-2); + private static final TField COLUMN_FAMILY_FIELD_DESC = new TField("columnFamily", TType.STRING, (short)-3); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String tablename; + public static final int TABLENAME = -1; + public String key; + public static final int KEY = -2; + public String columnFamily; + public static final int COLUMNFAMILY = -3; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean tablename = false; public boolean key = false; public boolean columnFamily = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(TABLENAME, new FieldMetaData("tablename", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(COLUMNFAMILY, new FieldMetaData("columnFamily", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_superColumn_args.class, metaDataMap); + } + public get_superColumn_args() { } @@ -4293,13 +7565,152 @@ public class Cassandra { { this(); this.tablename = tablename; - this.__isset.tablename = true; + this.__isset.tablename = (tablename != null); this.key = key; - this.__isset.key = true; + this.__isset.key = (key != null); this.columnFamily = columnFamily; - this.__isset.columnFamily = true; + this.__isset.columnFamily = (columnFamily != null); } + /** + * Performs a deep copy on other. + */ + public get_superColumn_args(get_superColumn_args other) { + __isset.tablename = other.__isset.tablename; + if (other.tablename != null) { + this.tablename = other.tablename; + } + __isset.key = other.__isset.key; + if (other.key != null) { + this.key = other.key; + } + __isset.columnFamily = other.__isset.columnFamily; + if (other.columnFamily != null) { + this.columnFamily = other.columnFamily; + } + } + + @Override + public get_superColumn_args clone() { + return new get_superColumn_args(this); + } + + public String getTablename() { + return this.tablename; + } + + public void setTablename(String tablename) { + this.tablename = tablename; + this.__isset.tablename = (tablename != null); + } + + public void unsetTablename() { + this.__isset.tablename = false; + } + + // Returns true if field tablename is set (has been asigned a value) and false otherwise + public boolean isSetTablename() { + return this.__isset.tablename; + } + + public void setTablenameIsSet(boolean value) { + this.__isset.tablename = value; + } + + public String getKey() { + return this.key; + } + + public void setKey(String key) { + this.key = key; + this.__isset.key = (key != null); + } + + public void unsetKey() { + this.__isset.key = false; + } + + // Returns true if field key is set (has been asigned a value) and false otherwise + public boolean isSetKey() { + return this.__isset.key; + } + + public void setKeyIsSet(boolean value) { + this.__isset.key = value; + } + + public String getColumnFamily() { + return this.columnFamily; + } + + public void setColumnFamily(String columnFamily) { + this.columnFamily = columnFamily; + this.__isset.columnFamily = (columnFamily != null); + } + + public void unsetColumnFamily() { + this.__isset.columnFamily = false; + } + + // Returns true if field columnFamily is set (has been asigned a value) and false otherwise + public boolean isSetColumnFamily() { + return this.__isset.columnFamily; + } + + public void setColumnFamilyIsSet(boolean value) { + this.__isset.columnFamily = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TABLENAME: + setTablename((String)value); + break; + + case KEY: + setKey((String)value); + break; + + case COLUMNFAMILY: + setColumnFamily((String)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TABLENAME: + return getTablename(); + + case KEY: + return getKey(); + + case COLUMNFAMILY: + return getColumnFamily(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TABLENAME: + return this.__isset.tablename; + case KEY: + return this.__isset.key; + case COLUMNFAMILY: + return this.__isset.columnFamily; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -4342,6 +7753,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -4357,7 +7769,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case TABLENAME: if (field.type == TType.STRING) { this.tablename = iprot.readString(); this.__isset.tablename = true; @@ -4365,7 +7777,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -2: + case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); this.__isset.key = true; @@ -4373,7 +7785,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -3: + case COLUMNFAMILY: if (field.type == TType.STRING) { this.columnFamily = iprot.readString(); this.__isset.columnFamily = true; @@ -4388,33 +7800,28 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("get_superColumn_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.tablename != null) { - field.name = "tablename"; - field.type = TType.STRING; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(TABLENAME_FIELD_DESC); oprot.writeString(this.tablename); oprot.writeFieldEnd(); } if (this.key != null) { - field.name = "key"; - field.type = TType.STRING; - field.id = -2; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.columnFamily != null) { - field.name = "columnFamily"; - field.type = TType.STRING; - field.id = -3; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(COLUMN_FAMILY_FIELD_DESC); oprot.writeString(this.columnFamily); oprot.writeFieldEnd(); } @@ -4422,30 +7829,61 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("get_superColumn_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("tablename:"); sb.append(this.tablename); - sb.append(",key:"); + first = false; + if (!first) sb.append(", "); + sb.append("key:"); sb.append(this.key); - sb.append(",columnFamily:"); + first = false; + if (!first) sb.append(", "); + sb.append("columnFamily:"); sb.append(this.columnFamily); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class get_superColumn_result implements TBase, java.io.Serializable { - public superColumn_t success; - public CassandraException e; + public static class get_superColumn_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("get_superColumn_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); + private static final TField E_FIELD_DESC = new TField("e", TType.STRUCT, (short)1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public superColumn_t success; + public static final int SUCCESS = 0; + public CassandraException e; + public static final int E = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean success = false; public boolean e = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, superColumn_t.class))); + put(E, new FieldMetaData("e", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(get_superColumn_result.class, metaDataMap); + } + public get_superColumn_result() { } @@ -4455,11 +7893,117 @@ public class Cassandra { { this(); this.success = success; - this.__isset.success = true; + this.__isset.success = (success != null); this.e = e; - this.__isset.e = true; + this.__isset.e = (e != null); } + /** + * Performs a deep copy on other. + */ + public get_superColumn_result(get_superColumn_result other) { + __isset.success = other.__isset.success; + if (other.success != null) { + this.success = new superColumn_t(other.success); + } + __isset.e = other.__isset.e; + if (other.e != null) { + this.e = new CassandraException(other.e); + } + } + + @Override + public get_superColumn_result clone() { + return new get_superColumn_result(this); + } + + public superColumn_t getSuccess() { + return this.success; + } + + public void setSuccess(superColumn_t success) { + this.success = success; + this.__isset.success = (success != null); + } + + public void unsetSuccess() { + this.success = null; + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public void setSuccessIsSet(boolean value) { + this.__isset.success = value; + } + + public CassandraException getE() { + return this.e; + } + + public void setE(CassandraException e) { + this.e = e; + this.__isset.e = (e != null); + } + + public void unsetE() { + this.e = null; + this.__isset.e = false; + } + + // Returns true if field e is set (has been asigned a value) and false otherwise + public boolean isSetE() { + return this.__isset.e; + } + + public void setEIsSet(boolean value) { + this.__isset.e = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + setSuccess((superColumn_t)value); + break; + + case E: + setE((CassandraException)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + case E: + return getE(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return this.__isset.success; + case E: + return this.__isset.e; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -4493,6 +8037,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -4508,7 +8053,7 @@ public class Cassandra { } switch (field.id) { - case 0: + case SUCCESS: if (field.type == TType.STRUCT) { this.success = new superColumn_t(); this.success.read(iprot); @@ -4517,7 +8062,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case 1: + case E: if (field.type == TType.STRUCT) { this.e = new CassandraException(); this.e.read(iprot); @@ -4533,28 +8078,24 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("get_superColumn_result"); - oprot.writeStructBegin(struct); - TField field = new TField(); + oprot.writeStructBegin(STRUCT_DESC); if (this.__isset.success) { if (this.success != null) { - field.name = "success"; - field.type = TType.STRUCT; - field.id = 0; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); this.success.write(oprot); oprot.writeFieldEnd(); } } else if (this.__isset.e) { if (this.e != null) { - field.name = "e"; - field.type = TType.STRUCT; - field.id = 1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(E_FIELD_DESC); this.e.write(oprot); oprot.writeFieldEnd(); } @@ -4563,26 +8104,51 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("get_superColumn_result("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("success:"); sb.append(this.success); - sb.append(",e:"); + first = false; + if (!first) sb.append(", "); + sb.append("e:"); sb.append(this.e); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class batch_insert_superColumn_args implements TBase, java.io.Serializable { - public batch_mutation_super_t batchMutationSuper; + public static class batch_insert_superColumn_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("batch_insert_superColumn_args"); + private static final TField BATCH_MUTATION_SUPER_FIELD_DESC = new TField("batchMutationSuper", TType.STRUCT, (short)-1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public batch_mutation_super_t batchMutationSuper; + public static final int BATCHMUTATIONSUPER = -1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean batchMutationSuper = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(BATCHMUTATIONSUPER, new FieldMetaData("batchMutationSuper", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, batch_mutation_super_t.class))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(batch_insert_superColumn_args.class, metaDataMap); + } + public batch_insert_superColumn_args() { } @@ -4591,9 +8157,79 @@ public class Cassandra { { this(); this.batchMutationSuper = batchMutationSuper; - this.__isset.batchMutationSuper = true; + this.__isset.batchMutationSuper = (batchMutationSuper != null); } + /** + * Performs a deep copy on other. + */ + public batch_insert_superColumn_args(batch_insert_superColumn_args other) { + __isset.batchMutationSuper = other.__isset.batchMutationSuper; + if (other.batchMutationSuper != null) { + this.batchMutationSuper = new batch_mutation_super_t(other.batchMutationSuper); + } + } + + @Override + public batch_insert_superColumn_args clone() { + return new batch_insert_superColumn_args(this); + } + + public batch_mutation_super_t getBatchMutationSuper() { + return this.batchMutationSuper; + } + + public void setBatchMutationSuper(batch_mutation_super_t batchMutationSuper) { + this.batchMutationSuper = batchMutationSuper; + this.__isset.batchMutationSuper = (batchMutationSuper != null); + } + + public void unsetBatchMutationSuper() { + this.batchMutationSuper = null; + this.__isset.batchMutationSuper = false; + } + + // Returns true if field batchMutationSuper is set (has been asigned a value) and false otherwise + public boolean isSetBatchMutationSuper() { + return this.__isset.batchMutationSuper; + } + + public void setBatchMutationSuperIsSet(boolean value) { + this.__isset.batchMutationSuper = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case BATCHMUTATIONSUPER: + setBatchMutationSuper((batch_mutation_super_t)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case BATCHMUTATIONSUPER: + return getBatchMutationSuper(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case BATCHMUTATIONSUPER: + return this.__isset.batchMutationSuper; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -4618,6 +8254,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -4633,7 +8270,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case BATCHMUTATIONSUPER: if (field.type == TType.STRUCT) { this.batchMutationSuper = new batch_mutation_super_t(); this.batchMutationSuper.read(iprot); @@ -4649,17 +8286,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("batch_insert_superColumn_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.batchMutationSuper != null) { - field.name = "batchMutationSuper"; - field.type = TType.STRUCT; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(BATCH_MUTATION_SUPER_FIELD_DESC); this.batchMutationSuper.write(oprot); oprot.writeFieldEnd(); } @@ -4667,24 +8305,47 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("batch_insert_superColumn_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("batchMutationSuper:"); sb.append(this.batchMutationSuper); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class batch_insert_superColumn_blocking_args implements TBase, java.io.Serializable { - public batch_mutation_super_t batchMutationSuper; + public static class batch_insert_superColumn_blocking_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("batch_insert_superColumn_blocking_args"); + private static final TField BATCH_MUTATION_SUPER_FIELD_DESC = new TField("batchMutationSuper", TType.STRUCT, (short)-1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public batch_mutation_super_t batchMutationSuper; + public static final int BATCHMUTATIONSUPER = -1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean batchMutationSuper = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(BATCHMUTATIONSUPER, new FieldMetaData("batchMutationSuper", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, batch_mutation_super_t.class))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(batch_insert_superColumn_blocking_args.class, metaDataMap); + } + public batch_insert_superColumn_blocking_args() { } @@ -4693,9 +8354,79 @@ public class Cassandra { { this(); this.batchMutationSuper = batchMutationSuper; - this.__isset.batchMutationSuper = true; + this.__isset.batchMutationSuper = (batchMutationSuper != null); } + /** + * Performs a deep copy on other. + */ + public batch_insert_superColumn_blocking_args(batch_insert_superColumn_blocking_args other) { + __isset.batchMutationSuper = other.__isset.batchMutationSuper; + if (other.batchMutationSuper != null) { + this.batchMutationSuper = new batch_mutation_super_t(other.batchMutationSuper); + } + } + + @Override + public batch_insert_superColumn_blocking_args clone() { + return new batch_insert_superColumn_blocking_args(this); + } + + public batch_mutation_super_t getBatchMutationSuper() { + return this.batchMutationSuper; + } + + public void setBatchMutationSuper(batch_mutation_super_t batchMutationSuper) { + this.batchMutationSuper = batchMutationSuper; + this.__isset.batchMutationSuper = (batchMutationSuper != null); + } + + public void unsetBatchMutationSuper() { + this.batchMutationSuper = null; + this.__isset.batchMutationSuper = false; + } + + // Returns true if field batchMutationSuper is set (has been asigned a value) and false otherwise + public boolean isSetBatchMutationSuper() { + return this.__isset.batchMutationSuper; + } + + public void setBatchMutationSuperIsSet(boolean value) { + this.__isset.batchMutationSuper = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case BATCHMUTATIONSUPER: + setBatchMutationSuper((batch_mutation_super_t)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case BATCHMUTATIONSUPER: + return getBatchMutationSuper(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case BATCHMUTATIONSUPER: + return this.__isset.batchMutationSuper; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -4720,6 +8451,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -4735,7 +8467,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case BATCHMUTATIONSUPER: if (field.type == TType.STRUCT) { this.batchMutationSuper = new batch_mutation_super_t(); this.batchMutationSuper.read(iprot); @@ -4751,17 +8483,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("batch_insert_superColumn_blocking_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.batchMutationSuper != null) { - field.name = "batchMutationSuper"; - field.type = TType.STRUCT; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(BATCH_MUTATION_SUPER_FIELD_DESC); this.batchMutationSuper.write(oprot); oprot.writeFieldEnd(); } @@ -4769,26 +8502,53 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("batch_insert_superColumn_blocking_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("batchMutationSuper:"); sb.append(this.batchMutationSuper); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class batch_insert_superColumn_blocking_result implements TBase, java.io.Serializable { - public boolean success; - public CassandraException e; + public static class batch_insert_superColumn_blocking_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("batch_insert_superColumn_blocking_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0); + private static final TField E_FIELD_DESC = new TField("e", TType.STRUCT, (short)1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public boolean success; + public static final int SUCCESS = 0; + public CassandraException e; + public static final int E = 1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean success = false; public boolean e = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + put(E, new FieldMetaData("e", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRUCT))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(batch_insert_superColumn_blocking_result.class, metaDataMap); + } + public batch_insert_superColumn_blocking_result() { } @@ -4800,9 +8560,112 @@ public class Cassandra { this.success = success; this.__isset.success = true; this.e = e; - this.__isset.e = true; + this.__isset.e = (e != null); } + /** + * Performs a deep copy on other. + */ + public batch_insert_superColumn_blocking_result(batch_insert_superColumn_blocking_result other) { + __isset.success = other.__isset.success; + this.success = other.success; + __isset.e = other.__isset.e; + if (other.e != null) { + this.e = new CassandraException(other.e); + } + } + + @Override + public batch_insert_superColumn_blocking_result clone() { + return new batch_insert_superColumn_blocking_result(this); + } + + public boolean isSuccess() { + return this.success; + } + + public void setSuccess(boolean success) { + this.success = success; + this.__isset.success = true; + } + + public void unsetSuccess() { + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public void setSuccessIsSet(boolean value) { + this.__isset.success = value; + } + + public CassandraException getE() { + return this.e; + } + + public void setE(CassandraException e) { + this.e = e; + this.__isset.e = (e != null); + } + + public void unsetE() { + this.e = null; + this.__isset.e = false; + } + + // Returns true if field e is set (has been asigned a value) and false otherwise + public boolean isSetE() { + return this.__isset.e; + } + + public void setEIsSet(boolean value) { + this.__isset.e = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + setSuccess((Boolean)value); + break; + + case E: + setE((CassandraException)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return new Boolean(isSuccess()); + + case E: + return getE(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return this.__isset.success; + case E: + return this.__isset.e; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -4836,6 +8699,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -4851,7 +8715,7 @@ public class Cassandra { } switch (field.id) { - case 0: + case SUCCESS: if (field.type == TType.BOOL) { this.success = iprot.readBool(); this.__isset.success = true; @@ -4859,7 +8723,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case 1: + case E: if (field.type == TType.STRUCT) { this.e = new CassandraException(); this.e.read(iprot); @@ -4875,26 +8739,22 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("batch_insert_superColumn_blocking_result"); - oprot.writeStructBegin(struct); - TField field = new TField(); + oprot.writeStructBegin(STRUCT_DESC); if (this.__isset.success) { - field.name = "success"; - field.type = TType.BOOL; - field.id = 0; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeBool(this.success); oprot.writeFieldEnd(); } else if (this.__isset.e) { if (this.e != null) { - field.name = "e"; - field.type = TType.STRUCT; - field.id = 1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(E_FIELD_DESC); this.e.write(oprot); oprot.writeFieldEnd(); } @@ -4903,28 +8763,57 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("batch_insert_superColumn_blocking_result("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("success:"); sb.append(this.success); - sb.append(",e:"); + first = false; + if (!first) sb.append(", "); + sb.append("e:"); sb.append(this.e); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class touch_args implements TBase, java.io.Serializable { - public String key; - public boolean fData; + public static class touch_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("touch_args"); + private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)-1); + private static final TField F_DATA_FIELD_DESC = new TField("fData", TType.BOOL, (short)-2); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String key; + public static final int KEY = -1; + public boolean fData; + public static final int FDATA = -2; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean key = false; public boolean fData = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(FDATA, new FieldMetaData("fData", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(touch_args.class, metaDataMap); + } + public touch_args() { } @@ -4934,11 +8823,113 @@ public class Cassandra { { this(); this.key = key; - this.__isset.key = true; + this.__isset.key = (key != null); this.fData = fData; this.__isset.fData = true; } + /** + * Performs a deep copy on other. + */ + public touch_args(touch_args other) { + __isset.key = other.__isset.key; + if (other.key != null) { + this.key = other.key; + } + __isset.fData = other.__isset.fData; + this.fData = other.fData; + } + + @Override + public touch_args clone() { + return new touch_args(this); + } + + public String getKey() { + return this.key; + } + + public void setKey(String key) { + this.key = key; + this.__isset.key = (key != null); + } + + public void unsetKey() { + this.__isset.key = false; + } + + // Returns true if field key is set (has been asigned a value) and false otherwise + public boolean isSetKey() { + return this.__isset.key; + } + + public void setKeyIsSet(boolean value) { + this.__isset.key = value; + } + + public boolean isFData() { + return this.fData; + } + + public void setFData(boolean fData) { + this.fData = fData; + this.__isset.fData = true; + } + + public void unsetFData() { + this.__isset.fData = false; + } + + // Returns true if field fData is set (has been asigned a value) and false otherwise + public boolean isSetFData() { + return this.__isset.fData; + } + + public void setFDataIsSet(boolean value) { + this.__isset.fData = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case KEY: + setKey((String)value); + break; + + case FDATA: + setFData((Boolean)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case KEY: + return getKey(); + + case FDATA: + return new Boolean(isFData()); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case KEY: + return this.__isset.key; + case FDATA: + return this.__isset.fData; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -4972,6 +8963,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -4987,7 +8979,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); this.__isset.key = true; @@ -4995,7 +8987,7 @@ public class Cassandra { TProtocolUtil.skip(iprot, field.type); } break; - case -2: + case FDATA: if (field.type == TType.BOOL) { this.fData = iprot.readBool(); this.__isset.fData = true; @@ -5010,50 +9002,73 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("touch_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.key != null) { - field.name = "key"; - field.type = TType.STRING; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } - field.name = "fData"; - field.type = TType.BOOL; - field.id = -2; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(F_DATA_FIELD_DESC); oprot.writeBool(this.fData); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("touch_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("key:"); sb.append(this.key); - sb.append(",fData:"); + first = false; + if (!first) sb.append(", "); + sb.append("fData:"); sb.append(this.fData); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class getStringProperty_args implements TBase, java.io.Serializable { - public String propertyName; + public static class getStringProperty_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("getStringProperty_args"); + private static final TField PROPERTY_NAME_FIELD_DESC = new TField("propertyName", TType.STRING, (short)-1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String propertyName; + public static final int PROPERTYNAME = -1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean propertyName = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(PROPERTYNAME, new FieldMetaData("propertyName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(getStringProperty_args.class, metaDataMap); + } + public getStringProperty_args() { } @@ -5062,9 +9077,78 @@ public class Cassandra { { this(); this.propertyName = propertyName; - this.__isset.propertyName = true; + this.__isset.propertyName = (propertyName != null); } + /** + * Performs a deep copy on other. + */ + public getStringProperty_args(getStringProperty_args other) { + __isset.propertyName = other.__isset.propertyName; + if (other.propertyName != null) { + this.propertyName = other.propertyName; + } + } + + @Override + public getStringProperty_args clone() { + return new getStringProperty_args(this); + } + + public String getPropertyName() { + return this.propertyName; + } + + public void setPropertyName(String propertyName) { + this.propertyName = propertyName; + this.__isset.propertyName = (propertyName != null); + } + + public void unsetPropertyName() { + this.__isset.propertyName = false; + } + + // Returns true if field propertyName is set (has been asigned a value) and false otherwise + public boolean isSetPropertyName() { + return this.__isset.propertyName; + } + + public void setPropertyNameIsSet(boolean value) { + this.__isset.propertyName = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case PROPERTYNAME: + setPropertyName((String)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case PROPERTYNAME: + return getPropertyName(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case PROPERTYNAME: + return this.__isset.propertyName; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -5089,6 +9173,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -5104,7 +9189,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case PROPERTYNAME: if (field.type == TType.STRING) { this.propertyName = iprot.readString(); this.__isset.propertyName = true; @@ -5119,17 +9204,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("getStringProperty_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.propertyName != null) { - field.name = "propertyName"; - field.type = TType.STRING; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(PROPERTY_NAME_FIELD_DESC); oprot.writeString(this.propertyName); oprot.writeFieldEnd(); } @@ -5137,24 +9223,47 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("getStringProperty_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("propertyName:"); sb.append(this.propertyName); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class getStringProperty_result implements TBase, java.io.Serializable { - public String success; + public static class getStringProperty_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("getStringProperty_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String success; + public static final int SUCCESS = 0; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean success = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(getStringProperty_result.class, metaDataMap); + } + public getStringProperty_result() { } @@ -5163,9 +9272,78 @@ public class Cassandra { { this(); this.success = success; - this.__isset.success = true; + this.__isset.success = (success != null); } + /** + * Performs a deep copy on other. + */ + public getStringProperty_result(getStringProperty_result other) { + __isset.success = other.__isset.success; + if (other.success != null) { + this.success = other.success; + } + } + + @Override + public getStringProperty_result clone() { + return new getStringProperty_result(this); + } + + public String getSuccess() { + return this.success; + } + + public void setSuccess(String success) { + this.success = success; + this.__isset.success = (success != null); + } + + public void unsetSuccess() { + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public void setSuccessIsSet(boolean value) { + this.__isset.success = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + setSuccess((String)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return this.__isset.success; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -5190,6 +9368,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -5205,7 +9384,7 @@ public class Cassandra { } switch (field.id) { - case 0: + case SUCCESS: if (field.type == TType.STRING) { this.success = iprot.readString(); this.__isset.success = true; @@ -5220,19 +9399,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("getStringProperty_result"); - oprot.writeStructBegin(struct); - TField field = new TField(); + oprot.writeStructBegin(STRUCT_DESC); if (this.__isset.success) { if (this.success != null) { - field.name = "success"; - field.type = TType.STRING; - field.id = 0; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeString(this.success); oprot.writeFieldEnd(); } @@ -5241,24 +9419,47 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("getStringProperty_result("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("success:"); sb.append(this.success); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class getStringListProperty_args implements TBase, java.io.Serializable { - public String propertyName; + public static class getStringListProperty_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("getStringListProperty_args"); + private static final TField PROPERTY_NAME_FIELD_DESC = new TField("propertyName", TType.STRING, (short)-1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String propertyName; + public static final int PROPERTYNAME = -1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean propertyName = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(PROPERTYNAME, new FieldMetaData("propertyName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(getStringListProperty_args.class, metaDataMap); + } + public getStringListProperty_args() { } @@ -5267,9 +9468,78 @@ public class Cassandra { { this(); this.propertyName = propertyName; - this.__isset.propertyName = true; + this.__isset.propertyName = (propertyName != null); } + /** + * Performs a deep copy on other. + */ + public getStringListProperty_args(getStringListProperty_args other) { + __isset.propertyName = other.__isset.propertyName; + if (other.propertyName != null) { + this.propertyName = other.propertyName; + } + } + + @Override + public getStringListProperty_args clone() { + return new getStringListProperty_args(this); + } + + public String getPropertyName() { + return this.propertyName; + } + + public void setPropertyName(String propertyName) { + this.propertyName = propertyName; + this.__isset.propertyName = (propertyName != null); + } + + public void unsetPropertyName() { + this.__isset.propertyName = false; + } + + // Returns true if field propertyName is set (has been asigned a value) and false otherwise + public boolean isSetPropertyName() { + return this.__isset.propertyName; + } + + public void setPropertyNameIsSet(boolean value) { + this.__isset.propertyName = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case PROPERTYNAME: + setPropertyName((String)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case PROPERTYNAME: + return getPropertyName(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case PROPERTYNAME: + return this.__isset.propertyName; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -5294,6 +9564,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -5309,7 +9580,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case PROPERTYNAME: if (field.type == TType.STRING) { this.propertyName = iprot.readString(); this.__isset.propertyName = true; @@ -5324,17 +9595,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("getStringListProperty_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.propertyName != null) { - field.name = "propertyName"; - field.type = TType.STRING; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(PROPERTY_NAME_FIELD_DESC); oprot.writeString(this.propertyName); oprot.writeFieldEnd(); } @@ -5342,24 +9614,48 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("getStringListProperty_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("propertyName:"); sb.append(this.propertyName); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class getStringListProperty_result implements TBase, java.io.Serializable { - public List success; + public static class getStringListProperty_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("getStringListProperty_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public List success; + public static final int SUCCESS = 0; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean success = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(getStringListProperty_result.class, metaDataMap); + } + public getStringListProperty_result() { } @@ -5368,9 +9664,99 @@ public class Cassandra { { this(); this.success = success; + this.__isset.success = (success != null); + } + + /** + * Performs a deep copy on other. + */ + public getStringListProperty_result(getStringListProperty_result other) { + __isset.success = other.__isset.success; + if (other.success != null) { + List __this__success = new ArrayList(); + for (String other_element : other.success) { + __this__success.add(other_element); + } + this.success = __this__success; + } + } + + @Override + public getStringListProperty_result clone() { + return new getStringListProperty_result(this); + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(String elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); this.__isset.success = true; } + public List getSuccess() { + return this.success; + } + + public void setSuccess(List success) { + this.success = success; + this.__isset.success = (success != null); + } + + public void unsetSuccess() { + this.success = null; + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public void setSuccessIsSet(boolean value) { + this.__isset.success = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + setSuccess((List)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return this.__isset.success; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -5395,6 +9781,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -5410,14 +9797,14 @@ public class Cassandra { } switch (field.id) { - case 0: + case SUCCESS: if (field.type == TType.LIST) { { TList _list77 = iprot.readListBegin(); this.success = new ArrayList(_list77.size); for (int _i78 = 0; _i78 < _list77.size; ++_i78) { - String _elem79 = null; + String _elem79; _elem79 = iprot.readString(); this.success.add(_elem79); } @@ -5435,19 +9822,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("getStringListProperty_result"); - oprot.writeStructBegin(struct); - TField field = new TField(); + oprot.writeStructBegin(STRUCT_DESC); if (this.__isset.success) { if (this.success != null) { - field.name = "success"; - field.type = TType.LIST; - field.id = 0; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRING, this.success.size())); for (String _iter80 : this.success) { @@ -5462,24 +9848,47 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("getStringListProperty_result("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("success:"); sb.append(this.success); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class describeTable_args implements TBase, java.io.Serializable { - public String tableName; + public static class describeTable_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("describeTable_args"); + private static final TField TABLE_NAME_FIELD_DESC = new TField("tableName", TType.STRING, (short)-1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String tableName; + public static final int TABLENAME = -1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean tableName = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(TABLENAME, new FieldMetaData("tableName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(describeTable_args.class, metaDataMap); + } + public describeTable_args() { } @@ -5488,9 +9897,78 @@ public class Cassandra { { this(); this.tableName = tableName; - this.__isset.tableName = true; + this.__isset.tableName = (tableName != null); } + /** + * Performs a deep copy on other. + */ + public describeTable_args(describeTable_args other) { + __isset.tableName = other.__isset.tableName; + if (other.tableName != null) { + this.tableName = other.tableName; + } + } + + @Override + public describeTable_args clone() { + return new describeTable_args(this); + } + + public String getTableName() { + return this.tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + this.__isset.tableName = (tableName != null); + } + + public void unsetTableName() { + this.__isset.tableName = false; + } + + // Returns true if field tableName is set (has been asigned a value) and false otherwise + public boolean isSetTableName() { + return this.__isset.tableName; + } + + public void setTableNameIsSet(boolean value) { + this.__isset.tableName = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TABLENAME: + setTableName((String)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TABLENAME: + return getTableName(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TABLENAME: + return this.__isset.tableName; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -5515,6 +9993,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -5530,7 +10009,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case TABLENAME: if (field.type == TType.STRING) { this.tableName = iprot.readString(); this.__isset.tableName = true; @@ -5545,17 +10024,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("describeTable_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.tableName != null) { - field.name = "tableName"; - field.type = TType.STRING; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); oprot.writeString(this.tableName); oprot.writeFieldEnd(); } @@ -5563,24 +10043,47 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("describeTable_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("tableName:"); sb.append(this.tableName); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class describeTable_result implements TBase, java.io.Serializable { - public String success; + public static class describeTable_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("describeTable_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String success; + public static final int SUCCESS = 0; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean success = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(describeTable_result.class, metaDataMap); + } + public describeTable_result() { } @@ -5589,9 +10092,78 @@ public class Cassandra { { this(); this.success = success; - this.__isset.success = true; + this.__isset.success = (success != null); } + /** + * Performs a deep copy on other. + */ + public describeTable_result(describeTable_result other) { + __isset.success = other.__isset.success; + if (other.success != null) { + this.success = other.success; + } + } + + @Override + public describeTable_result clone() { + return new describeTable_result(this); + } + + public String getSuccess() { + return this.success; + } + + public void setSuccess(String success) { + this.success = success; + this.__isset.success = (success != null); + } + + public void unsetSuccess() { + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public void setSuccessIsSet(boolean value) { + this.__isset.success = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + setSuccess((String)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return this.__isset.success; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -5616,6 +10188,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -5631,7 +10204,7 @@ public class Cassandra { } switch (field.id) { - case 0: + case SUCCESS: if (field.type == TType.STRING) { this.success = iprot.readString(); this.__isset.success = true; @@ -5646,19 +10219,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("describeTable_result"); - oprot.writeStructBegin(struct); - TField field = new TField(); + oprot.writeStructBegin(STRUCT_DESC); if (this.__isset.success) { if (this.success != null) { - field.name = "success"; - field.type = TType.STRING; - field.id = 0; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeString(this.success); oprot.writeFieldEnd(); } @@ -5667,24 +10239,47 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("describeTable_result("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("success:"); sb.append(this.success); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class executeQuery_args implements TBase, java.io.Serializable { - public String query; + public static class executeQuery_args implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("executeQuery_args"); + private static final TField QUERY_FIELD_DESC = new TField("query", TType.STRING, (short)-1); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public String query; + public static final int QUERY = -1; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean query = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(QUERY, new FieldMetaData("query", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(executeQuery_args.class, metaDataMap); + } + public executeQuery_args() { } @@ -5693,9 +10288,78 @@ public class Cassandra { { this(); this.query = query; - this.__isset.query = true; + this.__isset.query = (query != null); } + /** + * Performs a deep copy on other. + */ + public executeQuery_args(executeQuery_args other) { + __isset.query = other.__isset.query; + if (other.query != null) { + this.query = other.query; + } + } + + @Override + public executeQuery_args clone() { + return new executeQuery_args(this); + } + + public String getQuery() { + return this.query; + } + + public void setQuery(String query) { + this.query = query; + this.__isset.query = (query != null); + } + + public void unsetQuery() { + this.__isset.query = false; + } + + // Returns true if field query is set (has been asigned a value) and false otherwise + public boolean isSetQuery() { + return this.__isset.query; + } + + public void setQueryIsSet(boolean value) { + this.__isset.query = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case QUERY: + setQuery((String)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case QUERY: + return getQuery(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case QUERY: + return this.__isset.query; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -5720,6 +10384,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -5735,7 +10400,7 @@ public class Cassandra { } switch (field.id) { - case -1: + case QUERY: if (field.type == TType.STRING) { this.query = iprot.readString(); this.__isset.query = true; @@ -5750,17 +10415,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("executeQuery_args"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.query != null) { - field.name = "query"; - field.type = TType.STRING; - field.id = -1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(QUERY_FIELD_DESC); oprot.writeString(this.query); oprot.writeFieldEnd(); } @@ -5768,24 +10434,47 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("executeQuery_args("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("query:"); sb.append(this.query); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } - public static class executeQuery_result implements TBase, java.io.Serializable { - public CqlResult_t success; + public static class executeQuery_result implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("executeQuery_result"); + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + public CqlResult_t success; + public static final int SUCCESS = 0; + + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean success = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, CqlResult_t.class))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(executeQuery_result.class, metaDataMap); + } + public executeQuery_result() { } @@ -5794,9 +10483,79 @@ public class Cassandra { { this(); this.success = success; - this.__isset.success = true; + this.__isset.success = (success != null); } + /** + * Performs a deep copy on other. + */ + public executeQuery_result(executeQuery_result other) { + __isset.success = other.__isset.success; + if (other.success != null) { + this.success = new CqlResult_t(other.success); + } + } + + @Override + public executeQuery_result clone() { + return new executeQuery_result(this); + } + + public CqlResult_t getSuccess() { + return this.success; + } + + public void setSuccess(CqlResult_t success) { + this.success = success; + this.__isset.success = (success != null); + } + + public void unsetSuccess() { + this.success = null; + this.__isset.success = false; + } + + // Returns true if field success is set (has been asigned a value) and false otherwise + public boolean isSetSuccess() { + return this.__isset.success; + } + + public void setSuccessIsSet(boolean value) { + this.__isset.success = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case SUCCESS: + setSuccess((CqlResult_t)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case SUCCESS: + return getSuccess(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case SUCCESS: + return this.__isset.success; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -5821,6 +10580,7 @@ public class Cassandra { return true; } + @Override public int hashCode() { return 0; } @@ -5836,7 +10596,7 @@ public class Cassandra { } switch (field.id) { - case 0: + case SUCCESS: if (field.type == TType.STRUCT) { this.success = new CqlResult_t(); this.success.read(iprot); @@ -5852,19 +10612,18 @@ public class Cassandra { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("executeQuery_result"); - oprot.writeStructBegin(struct); - TField field = new TField(); + oprot.writeStructBegin(STRUCT_DESC); if (this.__isset.success) { if (this.success != null) { - field.name = "success"; - field.type = TType.STRUCT; - field.id = 0; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); this.success.write(oprot); oprot.writeFieldEnd(); } @@ -5873,14 +10632,24 @@ public class Cassandra { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("executeQuery_result("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("success:"); sb.append(this.success); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } } diff --git a/src/org/apache/cassandra/service/CassandraDaemon.java b/src/org/apache/cassandra/service/CassandraDaemon.java index bae8e45441..7de19674d9 100644 --- a/src/org/apache/cassandra/service/CassandraDaemon.java +++ b/src/org/apache/cassandra/service/CassandraDaemon.java @@ -22,13 +22,13 @@ import java.io.File; import java.io.IOException; import org.apache.log4j.Logger; -import com.facebook.thrift.protocol.TBinaryProtocol; -import com.facebook.thrift.protocol.TProtocolFactory; -import com.facebook.thrift.server.TThreadPoolServer; -import com.facebook.thrift.transport.TServerSocket; -import com.facebook.thrift.transport.TTransportException; -import com.facebook.thrift.transport.TTransportFactory; -import com.facebook.thrift.TProcessorFactory; +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.protocol.TProtocolFactory; +import org.apache.thrift.server.TThreadPoolServer; +import org.apache.thrift.transport.TServerSocket; +import org.apache.thrift.transport.TTransportException; +import org.apache.thrift.transport.TTransportFactory; +import org.apache.thrift.TProcessorFactory; import org.apache.cassandra.config.DatabaseDescriptor; /** diff --git a/src/org/apache/cassandra/service/CassandraException.java b/src/org/apache/cassandra/service/CassandraException.java index 5e329b2859..68536fff20 100644 --- a/src/org/apache/cassandra/service/CassandraException.java +++ b/src/org/apache/cassandra/service/CassandraException.java @@ -11,19 +11,34 @@ import java.util.Map; import java.util.HashMap; import java.util.Set; import java.util.HashSet; -import com.facebook.thrift.*; +import java.util.Collections; +import org.apache.thrift.*; +import org.apache.thrift.meta_data.*; -import com.facebook.thrift.protocol.*; -import com.facebook.thrift.transport.*; +import org.apache.thrift.protocol.*; +import org.apache.thrift.transport.*; + +public class CassandraException extends Exception implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("CassandraException"); + private static final TField ERROR_FIELD_DESC = new TField("error", TType.STRING, (short)1); -public class CassandraException extends Exception implements TBase, java.io.Serializable { public String error; + public static final int ERROR = 1; - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean error = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(ERROR, new FieldMetaData("error", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(CassandraException.class, metaDataMap); + } + public CassandraException() { } @@ -32,9 +47,78 @@ public class CassandraException extends Exception implements TBase, java.io.Seri { this(); this.error = error; - this.__isset.error = true; + this.__isset.error = (error != null); } + /** + * Performs a deep copy on other. + */ + public CassandraException(CassandraException other) { + __isset.error = other.__isset.error; + if (other.error != null) { + this.error = other.error; + } + } + + @Override + public CassandraException clone() { + return new CassandraException(this); + } + + public String getError() { + return this.error; + } + + public void setError(String error) { + this.error = error; + this.__isset.error = (error != null); + } + + public void unsetError() { + this.__isset.error = false; + } + + // Returns true if field error is set (has been asigned a value) and false otherwise + public boolean isSetError() { + return this.__isset.error; + } + + public void setErrorIsSet(boolean value) { + this.__isset.error = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case ERROR: + setError((String)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case ERROR: + return getError(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case ERROR: + return this.__isset.error; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -59,6 +143,7 @@ public class CassandraException extends Exception implements TBase, java.io.Seri return true; } + @Override public int hashCode() { return 0; } @@ -74,7 +159,7 @@ public class CassandraException extends Exception implements TBase, java.io.Seri } switch (field.id) { - case 1: + case ERROR: if (field.type == TType.STRING) { this.error = iprot.readString(); this.__isset.error = true; @@ -89,17 +174,18 @@ public class CassandraException extends Exception implements TBase, java.io.Seri iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("CassandraException"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.error != null) { - field.name = "error"; - field.type = TType.STRING; - field.id = 1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(ERROR_FIELD_DESC); oprot.writeString(this.error); oprot.writeFieldEnd(); } @@ -107,13 +193,23 @@ public class CassandraException extends Exception implements TBase, java.io.Seri oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("CassandraException("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("error:"); sb.append(this.error); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } diff --git a/src/org/apache/cassandra/service/CassandraServer.java b/src/org/apache/cassandra/service/CassandraServer.java index 3bf83a1a43..9bea0d54ff 100644 --- a/src/org/apache/cassandra/service/CassandraServer.java +++ b/src/org/apache/cassandra/service/CassandraServer.java @@ -35,12 +35,6 @@ import org.apache.log4j.Logger; import com.facebook.fb303.FacebookBase; import com.facebook.fb303.fb_status; -import com.facebook.thrift.TException; -import com.facebook.thrift.protocol.TBinaryProtocol; -import com.facebook.thrift.protocol.TProtocolFactory; -import com.facebook.thrift.server.TThreadPoolServer; -import com.facebook.thrift.server.TThreadPoolServer.Options; -import com.facebook.thrift.transport.TServerSocket; import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.DatabaseDescriptor; import org.apache.cassandra.cql.common.CqlResult; @@ -57,6 +51,7 @@ import org.apache.cassandra.net.IAsyncResult; import org.apache.cassandra.utils.LogUtil; import org.apache.cassandra.io.DataInputBuffer; import org.apache.cassandra.io.DataOutputBuffer; +import org.apache.thrift.TException; /** * Author : Avinash Lakshman ( alakshman@facebook.com) & Prashant Malik ( pmalik@facebook.com ) diff --git a/src/org/apache/cassandra/service/Constants.java b/src/org/apache/cassandra/service/Constants.java index 1227e86651..1171df7633 100644 --- a/src/org/apache/cassandra/service/Constants.java +++ b/src/org/apache/cassandra/service/Constants.java @@ -11,7 +11,7 @@ import java.util.Map; import java.util.HashMap; import java.util.Set; import java.util.HashSet; -import com.facebook.thrift.*; +import org.apache.thrift.*; public class Constants { diff --git a/src/org/apache/cassandra/service/CqlResult_t.java b/src/org/apache/cassandra/service/CqlResult_t.java index 5670fa9784..11f8e6d1c9 100644 --- a/src/org/apache/cassandra/service/CqlResult_t.java +++ b/src/org/apache/cassandra/service/CqlResult_t.java @@ -11,23 +11,46 @@ import java.util.Map; import java.util.HashMap; import java.util.Set; import java.util.HashSet; -import com.facebook.thrift.*; +import java.util.Collections; +import org.apache.thrift.*; +import org.apache.thrift.meta_data.*; -import com.facebook.thrift.protocol.*; -import com.facebook.thrift.transport.*; +import org.apache.thrift.protocol.*; +import org.apache.thrift.transport.*; + +public class CqlResult_t implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("CqlResult_t"); + private static final TField ERROR_CODE_FIELD_DESC = new TField("errorCode", TType.I32, (short)1); + private static final TField ERROR_TXT_FIELD_DESC = new TField("errorTxt", TType.STRING, (short)2); + private static final TField RESULT_SET_FIELD_DESC = new TField("resultSet", TType.LIST, (short)3); -public class CqlResult_t implements TBase, java.io.Serializable { public int errorCode; + public static final int ERRORCODE = 1; public String errorTxt; + public static final int ERRORTXT = 2; public List> resultSet; + public static final int RESULTSET = 3; - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean errorCode = false; public boolean errorTxt = false; public boolean resultSet = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(ERRORCODE, new FieldMetaData("errorCode", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); + put(ERRORTXT, new FieldMetaData("errorTxt", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(RESULTSET, new FieldMetaData("resultSet", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.LIST))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(CqlResult_t.class, metaDataMap); + } + public CqlResult_t() { } @@ -40,11 +63,165 @@ public class CqlResult_t implements TBase, java.io.Serializable { this.errorCode = errorCode; this.__isset.errorCode = true; this.errorTxt = errorTxt; - this.__isset.errorTxt = true; + this.__isset.errorTxt = (errorTxt != null); this.resultSet = resultSet; + this.__isset.resultSet = (resultSet != null); + } + + /** + * Performs a deep copy on other. + */ + public CqlResult_t(CqlResult_t other) { + __isset.errorCode = other.__isset.errorCode; + this.errorCode = other.errorCode; + __isset.errorTxt = other.__isset.errorTxt; + if (other.errorTxt != null) { + this.errorTxt = other.errorTxt; + } + __isset.resultSet = other.__isset.resultSet; + if (other.resultSet != null) { + this.resultSet = other.resultSet; + } + } + + @Override + public CqlResult_t clone() { + return new CqlResult_t(this); + } + + public int getErrorCode() { + return this.errorCode; + } + + public void setErrorCode(int errorCode) { + this.errorCode = errorCode; + this.__isset.errorCode = true; + } + + public void unsetErrorCode() { + this.__isset.errorCode = false; + } + + // Returns true if field errorCode is set (has been asigned a value) and false otherwise + public boolean isSetErrorCode() { + return this.__isset.errorCode; + } + + public void setErrorCodeIsSet(boolean value) { + this.__isset.errorCode = value; + } + + public String getErrorTxt() { + return this.errorTxt; + } + + public void setErrorTxt(String errorTxt) { + this.errorTxt = errorTxt; + this.__isset.errorTxt = (errorTxt != null); + } + + public void unsetErrorTxt() { + this.__isset.errorTxt = false; + } + + // Returns true if field errorTxt is set (has been asigned a value) and false otherwise + public boolean isSetErrorTxt() { + return this.__isset.errorTxt; + } + + public void setErrorTxtIsSet(boolean value) { + this.__isset.errorTxt = value; + } + + public int getResultSetSize() { + return (this.resultSet == null) ? 0 : this.resultSet.size(); + } + + public java.util.Iterator> getResultSetIterator() { + return (this.resultSet == null) ? null : this.resultSet.iterator(); + } + + public void addToResultSet(Map elem) { + if (this.resultSet == null) { + this.resultSet = new ArrayList>(); + } + this.resultSet.add(elem); this.__isset.resultSet = true; } + public List> getResultSet() { + return this.resultSet; + } + + public void setResultSet(List> resultSet) { + this.resultSet = resultSet; + this.__isset.resultSet = (resultSet != null); + } + + public void unsetResultSet() { + this.resultSet = null; + this.__isset.resultSet = false; + } + + // Returns true if field resultSet is set (has been asigned a value) and false otherwise + public boolean isSetResultSet() { + return this.__isset.resultSet; + } + + public void setResultSetIsSet(boolean value) { + this.__isset.resultSet = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case ERRORCODE: + setErrorCode((Integer)value); + break; + + case ERRORTXT: + setErrorTxt((String)value); + break; + + case RESULTSET: + setResultSet((List>)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case ERRORCODE: + return new Integer(getErrorCode()); + + case ERRORTXT: + return getErrorTxt(); + + case RESULTSET: + return getResultSet(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case ERRORCODE: + return this.__isset.errorCode; + case ERRORTXT: + return this.__isset.errorTxt; + case RESULTSET: + return this.__isset.resultSet; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -87,6 +264,7 @@ public class CqlResult_t implements TBase, java.io.Serializable { return true; } + @Override public int hashCode() { return 0; } @@ -102,7 +280,7 @@ public class CqlResult_t implements TBase, java.io.Serializable { } switch (field.id) { - case 1: + case ERRORCODE: if (field.type == TType.I32) { this.errorCode = iprot.readI32(); this.__isset.errorCode = true; @@ -110,7 +288,7 @@ public class CqlResult_t implements TBase, java.io.Serializable { TProtocolUtil.skip(iprot, field.type); } break; - case 2: + case ERRORTXT: if (field.type == TType.STRING) { this.errorTxt = iprot.readString(); this.__isset.errorTxt = true; @@ -118,14 +296,14 @@ public class CqlResult_t implements TBase, java.io.Serializable { TProtocolUtil.skip(iprot, field.type); } break; - case 3: + case RESULTSET: if (field.type == TType.LIST) { { TList _list40 = iprot.readListBegin(); this.resultSet = new ArrayList>(_list40.size); for (int _i41 = 0; _i41 < _list40.size; ++_i41) { - Map _elem42 = new HashMap(); + Map _elem42; { TMap _map43 = iprot.readMapBegin(); _elem42 = new HashMap(2*_map43.size); @@ -155,39 +333,34 @@ public class CqlResult_t implements TBase, java.io.Serializable { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("CqlResult_t"); - oprot.writeStructBegin(struct); - TField field = new TField(); - field.name = "errorCode"; - field.type = TType.I32; - field.id = 1; - oprot.writeFieldBegin(field); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); oprot.writeI32(this.errorCode); oprot.writeFieldEnd(); if (this.errorTxt != null) { - field.name = "errorTxt"; - field.type = TType.STRING; - field.id = 2; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(ERROR_TXT_FIELD_DESC); oprot.writeString(this.errorTxt); oprot.writeFieldEnd(); } if (this.resultSet != null) { - field.name = "resultSet"; - field.type = TType.LIST; - field.id = 3; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(RESULT_SET_FIELD_DESC); { oprot.writeListBegin(new TList(TType.MAP, this.resultSet.size())); for (Map _iter47 : this.resultSet) { { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, _iter47.size())); - for (String _iter48 : _iter47.keySet()) { - oprot.writeString(_iter48); - oprot.writeString(_iter47.get(_iter48)); + for (Map.Entry _iter48 : _iter47.entrySet()) { + oprot.writeString(_iter48.getKey()); + oprot.writeString(_iter48.getValue()); } oprot.writeMapEnd(); } @@ -200,17 +373,31 @@ public class CqlResult_t implements TBase, java.io.Serializable { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("CqlResult_t("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("errorCode:"); sb.append(this.errorCode); - sb.append(",errorTxt:"); + first = false; + if (!first) sb.append(", "); + sb.append("errorTxt:"); sb.append(this.errorTxt); - sb.append(",resultSet:"); + first = false; + if (!first) sb.append(", "); + sb.append("resultSet:"); sb.append(this.resultSet); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } diff --git a/src/org/apache/cassandra/service/batch_mutation_super_t.java b/src/org/apache/cassandra/service/batch_mutation_super_t.java index 80857454c5..03501cb642 100644 --- a/src/org/apache/cassandra/service/batch_mutation_super_t.java +++ b/src/org/apache/cassandra/service/batch_mutation_super_t.java @@ -11,25 +11,52 @@ import java.util.Map; import java.util.HashMap; import java.util.Set; import java.util.HashSet; -import com.facebook.thrift.*; +import java.util.Collections; +import org.apache.thrift.*; +import org.apache.thrift.meta_data.*; -import com.facebook.thrift.protocol.*; -import com.facebook.thrift.transport.*; +import org.apache.thrift.protocol.*; +import org.apache.thrift.transport.*; + +public class batch_mutation_super_t implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("batch_mutation_super_t"); + private static final TField TABLE_FIELD_DESC = new TField("table", TType.STRING, (short)1); + private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)2); + private static final TField CFMAP_FIELD_DESC = new TField("cfmap", TType.MAP, (short)3); + private static final TField CFMAPDEL_FIELD_DESC = new TField("cfmapdel", TType.MAP, (short)4); -public class batch_mutation_super_t implements TBase, java.io.Serializable { public String table; + public static final int TABLE = 1; public String key; + public static final int KEY = 2; public Map> cfmap; + public static final int CFMAP = 3; public Map> cfmapdel; + public static final int CFMAPDEL = 4; - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean table = false; public boolean key = false; public boolean cfmap = false; public boolean cfmapdel = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(TABLE, new FieldMetaData("table", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(CFMAP, new FieldMetaData("cfmap", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.MAP))); + put(CFMAPDEL, new FieldMetaData("cfmapdel", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.MAP))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(batch_mutation_super_t.class, metaDataMap); + } + public batch_mutation_super_t() { } @@ -41,15 +68,215 @@ public class batch_mutation_super_t implements TBase, java.io.Serializable { { this(); this.table = table; - this.__isset.table = true; + this.__isset.table = (table != null); this.key = key; - this.__isset.key = true; + this.__isset.key = (key != null); this.cfmap = cfmap; - this.__isset.cfmap = true; + this.__isset.cfmap = (cfmap != null); this.cfmapdel = cfmapdel; + this.__isset.cfmapdel = (cfmapdel != null); + } + + /** + * Performs a deep copy on other. + */ + public batch_mutation_super_t(batch_mutation_super_t other) { + __isset.table = other.__isset.table; + if (other.table != null) { + this.table = other.table; + } + __isset.key = other.__isset.key; + if (other.key != null) { + this.key = other.key; + } + __isset.cfmap = other.__isset.cfmap; + if (other.cfmap != null) { + this.cfmap = other.cfmap; + } + __isset.cfmapdel = other.__isset.cfmapdel; + if (other.cfmapdel != null) { + this.cfmapdel = other.cfmapdel; + } + } + + @Override + public batch_mutation_super_t clone() { + return new batch_mutation_super_t(this); + } + + public String getTable() { + return this.table; + } + + public void setTable(String table) { + this.table = table; + this.__isset.table = (table != null); + } + + public void unsetTable() { + this.__isset.table = false; + } + + // Returns true if field table is set (has been asigned a value) and false otherwise + public boolean isSetTable() { + return this.__isset.table; + } + + public void setTableIsSet(boolean value) { + this.__isset.table = value; + } + + public String getKey() { + return this.key; + } + + public void setKey(String key) { + this.key = key; + this.__isset.key = (key != null); + } + + public void unsetKey() { + this.__isset.key = false; + } + + // Returns true if field key is set (has been asigned a value) and false otherwise + public boolean isSetKey() { + return this.__isset.key; + } + + public void setKeyIsSet(boolean value) { + this.__isset.key = value; + } + + public int getCfmapSize() { + return (this.cfmap == null) ? 0 : this.cfmap.size(); + } + + public void putToCfmap(String key, List val) { + if (this.cfmap == null) { + this.cfmap = new HashMap>(); + } + this.cfmap.put(key, val); + this.__isset.cfmap = true; + } + + public Map> getCfmap() { + return this.cfmap; + } + + public void setCfmap(Map> cfmap) { + this.cfmap = cfmap; + this.__isset.cfmap = (cfmap != null); + } + + public void unsetCfmap() { + this.cfmap = null; + this.__isset.cfmap = false; + } + + // Returns true if field cfmap is set (has been asigned a value) and false otherwise + public boolean isSetCfmap() { + return this.__isset.cfmap; + } + + public void setCfmapIsSet(boolean value) { + this.__isset.cfmap = value; + } + + public int getCfmapdelSize() { + return (this.cfmapdel == null) ? 0 : this.cfmapdel.size(); + } + + public void putToCfmapdel(String key, List val) { + if (this.cfmapdel == null) { + this.cfmapdel = new HashMap>(); + } + this.cfmapdel.put(key, val); this.__isset.cfmapdel = true; } + public Map> getCfmapdel() { + return this.cfmapdel; + } + + public void setCfmapdel(Map> cfmapdel) { + this.cfmapdel = cfmapdel; + this.__isset.cfmapdel = (cfmapdel != null); + } + + public void unsetCfmapdel() { + this.cfmapdel = null; + this.__isset.cfmapdel = false; + } + + // Returns true if field cfmapdel is set (has been asigned a value) and false otherwise + public boolean isSetCfmapdel() { + return this.__isset.cfmapdel; + } + + public void setCfmapdelIsSet(boolean value) { + this.__isset.cfmapdel = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TABLE: + setTable((String)value); + break; + + case KEY: + setKey((String)value); + break; + + case CFMAP: + setCfmap((Map>)value); + break; + + case CFMAPDEL: + setCfmapdel((Map>)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TABLE: + return getTable(); + + case KEY: + return getKey(); + + case CFMAP: + return getCfmap(); + + case CFMAPDEL: + return getCfmapdel(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TABLE: + return this.__isset.table; + case KEY: + return this.__isset.key; + case CFMAP: + return this.__isset.cfmap; + case CFMAPDEL: + return this.__isset.cfmapdel; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -101,6 +328,7 @@ public class batch_mutation_super_t implements TBase, java.io.Serializable { return true; } + @Override public int hashCode() { return 0; } @@ -116,7 +344,7 @@ public class batch_mutation_super_t implements TBase, java.io.Serializable { } switch (field.id) { - case 1: + case TABLE: if (field.type == TType.STRING) { this.table = iprot.readString(); this.__isset.table = true; @@ -124,7 +352,7 @@ public class batch_mutation_super_t implements TBase, java.io.Serializable { TProtocolUtil.skip(iprot, field.type); } break; - case 2: + case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); this.__isset.key = true; @@ -132,7 +360,7 @@ public class batch_mutation_super_t implements TBase, java.io.Serializable { TProtocolUtil.skip(iprot, field.type); } break; - case 3: + case CFMAP: if (field.type == TType.MAP) { { TMap _map22 = iprot.readMapBegin(); @@ -147,7 +375,7 @@ public class batch_mutation_super_t implements TBase, java.io.Serializable { _val25 = new ArrayList(_list26.size); for (int _i27 = 0; _i27 < _list26.size; ++_i27) { - superColumn_t _elem28 = new superColumn_t(); + superColumn_t _elem28; _elem28 = new superColumn_t(); _elem28.read(iprot); _val25.add(_elem28); @@ -163,7 +391,7 @@ public class batch_mutation_super_t implements TBase, java.io.Serializable { TProtocolUtil.skip(iprot, field.type); } break; - case 4: + case CFMAPDEL: if (field.type == TType.MAP) { { TMap _map29 = iprot.readMapBegin(); @@ -178,7 +406,7 @@ public class batch_mutation_super_t implements TBase, java.io.Serializable { _val32 = new ArrayList(_list33.size); for (int _i34 = 0; _i34 < _list33.size; ++_i34) { - superColumn_t _elem35 = new superColumn_t(); + superColumn_t _elem35; _elem35 = new superColumn_t(); _elem35.read(iprot); _val32.add(_elem35); @@ -201,40 +429,35 @@ public class batch_mutation_super_t implements TBase, java.io.Serializable { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("batch_mutation_super_t"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.table != null) { - field.name = "table"; - field.type = TType.STRING; - field.id = 1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(TABLE_FIELD_DESC); oprot.writeString(this.table); oprot.writeFieldEnd(); } if (this.key != null) { - field.name = "key"; - field.type = TType.STRING; - field.id = 2; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.cfmap != null) { - field.name = "cfmap"; - field.type = TType.MAP; - field.id = 3; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(CFMAP_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.LIST, this.cfmap.size())); - for (String _iter36 : this.cfmap.keySet()) { - oprot.writeString(_iter36); + for (Map.Entry> _iter36 : this.cfmap.entrySet()) { + oprot.writeString(_iter36.getKey()); { - oprot.writeListBegin(new TList(TType.STRUCT, this.cfmap.get(_iter36).size())); - for (superColumn_t _iter37 : this.cfmap.get(_iter36)) { + oprot.writeListBegin(new TList(TType.STRUCT, _iter36.getValue().size())); + for (superColumn_t _iter37 : _iter36.getValue()) { _iter37.write(oprot); } oprot.writeListEnd(); @@ -245,17 +468,14 @@ public class batch_mutation_super_t implements TBase, java.io.Serializable { oprot.writeFieldEnd(); } if (this.cfmapdel != null) { - field.name = "cfmapdel"; - field.type = TType.MAP; - field.id = 4; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(CFMAPDEL_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.LIST, this.cfmapdel.size())); - for (String _iter38 : this.cfmapdel.keySet()) { - oprot.writeString(_iter38); + for (Map.Entry> _iter38 : this.cfmapdel.entrySet()) { + oprot.writeString(_iter38.getKey()); { - oprot.writeListBegin(new TList(TType.STRUCT, this.cfmapdel.get(_iter38).size())); - for (superColumn_t _iter39 : this.cfmapdel.get(_iter38)) { + oprot.writeListBegin(new TList(TType.STRUCT, _iter38.getValue().size())); + for (superColumn_t _iter39 : _iter38.getValue()) { _iter39.write(oprot); } oprot.writeListEnd(); @@ -269,19 +489,35 @@ public class batch_mutation_super_t implements TBase, java.io.Serializable { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("batch_mutation_super_t("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("table:"); sb.append(this.table); - sb.append(",key:"); + first = false; + if (!first) sb.append(", "); + sb.append("key:"); sb.append(this.key); - sb.append(",cfmap:"); + first = false; + if (!first) sb.append(", "); + sb.append("cfmap:"); sb.append(this.cfmap); - sb.append(",cfmapdel:"); + first = false; + if (!first) sb.append(", "); + sb.append("cfmapdel:"); sb.append(this.cfmapdel); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } diff --git a/src/org/apache/cassandra/service/batch_mutation_t.java b/src/org/apache/cassandra/service/batch_mutation_t.java index fff8c817ce..6477224ff2 100644 --- a/src/org/apache/cassandra/service/batch_mutation_t.java +++ b/src/org/apache/cassandra/service/batch_mutation_t.java @@ -11,25 +11,52 @@ import java.util.Map; import java.util.HashMap; import java.util.Set; import java.util.HashSet; -import com.facebook.thrift.*; +import java.util.Collections; +import org.apache.thrift.*; +import org.apache.thrift.meta_data.*; -import com.facebook.thrift.protocol.*; -import com.facebook.thrift.transport.*; +import org.apache.thrift.protocol.*; +import org.apache.thrift.transport.*; + +public class batch_mutation_t implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("batch_mutation_t"); + private static final TField TABLE_FIELD_DESC = new TField("table", TType.STRING, (short)1); + private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)2); + private static final TField CFMAP_FIELD_DESC = new TField("cfmap", TType.MAP, (short)3); + private static final TField CFMAPDEL_FIELD_DESC = new TField("cfmapdel", TType.MAP, (short)4); -public class batch_mutation_t implements TBase, java.io.Serializable { public String table; + public static final int TABLE = 1; public String key; + public static final int KEY = 2; public Map> cfmap; + public static final int CFMAP = 3; public Map> cfmapdel; + public static final int CFMAPDEL = 4; - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean table = false; public boolean key = false; public boolean cfmap = false; public boolean cfmapdel = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(TABLE, new FieldMetaData("table", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(CFMAP, new FieldMetaData("cfmap", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.MAP))); + put(CFMAPDEL, new FieldMetaData("cfmapdel", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.MAP))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(batch_mutation_t.class, metaDataMap); + } + public batch_mutation_t() { } @@ -41,15 +68,215 @@ public class batch_mutation_t implements TBase, java.io.Serializable { { this(); this.table = table; - this.__isset.table = true; + this.__isset.table = (table != null); this.key = key; - this.__isset.key = true; + this.__isset.key = (key != null); this.cfmap = cfmap; - this.__isset.cfmap = true; + this.__isset.cfmap = (cfmap != null); this.cfmapdel = cfmapdel; + this.__isset.cfmapdel = (cfmapdel != null); + } + + /** + * Performs a deep copy on other. + */ + public batch_mutation_t(batch_mutation_t other) { + __isset.table = other.__isset.table; + if (other.table != null) { + this.table = other.table; + } + __isset.key = other.__isset.key; + if (other.key != null) { + this.key = other.key; + } + __isset.cfmap = other.__isset.cfmap; + if (other.cfmap != null) { + this.cfmap = other.cfmap; + } + __isset.cfmapdel = other.__isset.cfmapdel; + if (other.cfmapdel != null) { + this.cfmapdel = other.cfmapdel; + } + } + + @Override + public batch_mutation_t clone() { + return new batch_mutation_t(this); + } + + public String getTable() { + return this.table; + } + + public void setTable(String table) { + this.table = table; + this.__isset.table = (table != null); + } + + public void unsetTable() { + this.__isset.table = false; + } + + // Returns true if field table is set (has been asigned a value) and false otherwise + public boolean isSetTable() { + return this.__isset.table; + } + + public void setTableIsSet(boolean value) { + this.__isset.table = value; + } + + public String getKey() { + return this.key; + } + + public void setKey(String key) { + this.key = key; + this.__isset.key = (key != null); + } + + public void unsetKey() { + this.__isset.key = false; + } + + // Returns true if field key is set (has been asigned a value) and false otherwise + public boolean isSetKey() { + return this.__isset.key; + } + + public void setKeyIsSet(boolean value) { + this.__isset.key = value; + } + + public int getCfmapSize() { + return (this.cfmap == null) ? 0 : this.cfmap.size(); + } + + public void putToCfmap(String key, List val) { + if (this.cfmap == null) { + this.cfmap = new HashMap>(); + } + this.cfmap.put(key, val); + this.__isset.cfmap = true; + } + + public Map> getCfmap() { + return this.cfmap; + } + + public void setCfmap(Map> cfmap) { + this.cfmap = cfmap; + this.__isset.cfmap = (cfmap != null); + } + + public void unsetCfmap() { + this.cfmap = null; + this.__isset.cfmap = false; + } + + // Returns true if field cfmap is set (has been asigned a value) and false otherwise + public boolean isSetCfmap() { + return this.__isset.cfmap; + } + + public void setCfmapIsSet(boolean value) { + this.__isset.cfmap = value; + } + + public int getCfmapdelSize() { + return (this.cfmapdel == null) ? 0 : this.cfmapdel.size(); + } + + public void putToCfmapdel(String key, List val) { + if (this.cfmapdel == null) { + this.cfmapdel = new HashMap>(); + } + this.cfmapdel.put(key, val); this.__isset.cfmapdel = true; } + public Map> getCfmapdel() { + return this.cfmapdel; + } + + public void setCfmapdel(Map> cfmapdel) { + this.cfmapdel = cfmapdel; + this.__isset.cfmapdel = (cfmapdel != null); + } + + public void unsetCfmapdel() { + this.cfmapdel = null; + this.__isset.cfmapdel = false; + } + + // Returns true if field cfmapdel is set (has been asigned a value) and false otherwise + public boolean isSetCfmapdel() { + return this.__isset.cfmapdel; + } + + public void setCfmapdelIsSet(boolean value) { + this.__isset.cfmapdel = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case TABLE: + setTable((String)value); + break; + + case KEY: + setKey((String)value); + break; + + case CFMAP: + setCfmap((Map>)value); + break; + + case CFMAPDEL: + setCfmapdel((Map>)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case TABLE: + return getTable(); + + case KEY: + return getKey(); + + case CFMAP: + return getCfmap(); + + case CFMAPDEL: + return getCfmapdel(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case TABLE: + return this.__isset.table; + case KEY: + return this.__isset.key; + case CFMAP: + return this.__isset.cfmap; + case CFMAPDEL: + return this.__isset.cfmapdel; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -101,6 +328,7 @@ public class batch_mutation_t implements TBase, java.io.Serializable { return true; } + @Override public int hashCode() { return 0; } @@ -116,7 +344,7 @@ public class batch_mutation_t implements TBase, java.io.Serializable { } switch (field.id) { - case 1: + case TABLE: if (field.type == TType.STRING) { this.table = iprot.readString(); this.__isset.table = true; @@ -124,7 +352,7 @@ public class batch_mutation_t implements TBase, java.io.Serializable { TProtocolUtil.skip(iprot, field.type); } break; - case 2: + case KEY: if (field.type == TType.STRING) { this.key = iprot.readString(); this.__isset.key = true; @@ -132,7 +360,7 @@ public class batch_mutation_t implements TBase, java.io.Serializable { TProtocolUtil.skip(iprot, field.type); } break; - case 3: + case CFMAP: if (field.type == TType.MAP) { { TMap _map0 = iprot.readMapBegin(); @@ -147,7 +375,7 @@ public class batch_mutation_t implements TBase, java.io.Serializable { _val3 = new ArrayList(_list4.size); for (int _i5 = 0; _i5 < _list4.size; ++_i5) { - column_t _elem6 = new column_t(); + column_t _elem6; _elem6 = new column_t(); _elem6.read(iprot); _val3.add(_elem6); @@ -163,7 +391,7 @@ public class batch_mutation_t implements TBase, java.io.Serializable { TProtocolUtil.skip(iprot, field.type); } break; - case 4: + case CFMAPDEL: if (field.type == TType.MAP) { { TMap _map7 = iprot.readMapBegin(); @@ -178,7 +406,7 @@ public class batch_mutation_t implements TBase, java.io.Serializable { _val10 = new ArrayList(_list11.size); for (int _i12 = 0; _i12 < _list11.size; ++_i12) { - column_t _elem13 = new column_t(); + column_t _elem13; _elem13 = new column_t(); _elem13.read(iprot); _val10.add(_elem13); @@ -201,40 +429,35 @@ public class batch_mutation_t implements TBase, java.io.Serializable { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("batch_mutation_t"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.table != null) { - field.name = "table"; - field.type = TType.STRING; - field.id = 1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(TABLE_FIELD_DESC); oprot.writeString(this.table); oprot.writeFieldEnd(); } if (this.key != null) { - field.name = "key"; - field.type = TType.STRING; - field.id = 2; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(this.key); oprot.writeFieldEnd(); } if (this.cfmap != null) { - field.name = "cfmap"; - field.type = TType.MAP; - field.id = 3; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(CFMAP_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.LIST, this.cfmap.size())); - for (String _iter14 : this.cfmap.keySet()) { - oprot.writeString(_iter14); + for (Map.Entry> _iter14 : this.cfmap.entrySet()) { + oprot.writeString(_iter14.getKey()); { - oprot.writeListBegin(new TList(TType.STRUCT, this.cfmap.get(_iter14).size())); - for (column_t _iter15 : this.cfmap.get(_iter14)) { + oprot.writeListBegin(new TList(TType.STRUCT, _iter14.getValue().size())); + for (column_t _iter15 : _iter14.getValue()) { _iter15.write(oprot); } oprot.writeListEnd(); @@ -245,17 +468,14 @@ public class batch_mutation_t implements TBase, java.io.Serializable { oprot.writeFieldEnd(); } if (this.cfmapdel != null) { - field.name = "cfmapdel"; - field.type = TType.MAP; - field.id = 4; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(CFMAPDEL_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.LIST, this.cfmapdel.size())); - for (String _iter16 : this.cfmapdel.keySet()) { - oprot.writeString(_iter16); + for (Map.Entry> _iter16 : this.cfmapdel.entrySet()) { + oprot.writeString(_iter16.getKey()); { - oprot.writeListBegin(new TList(TType.STRUCT, this.cfmapdel.get(_iter16).size())); - for (column_t _iter17 : this.cfmapdel.get(_iter16)) { + oprot.writeListBegin(new TList(TType.STRUCT, _iter16.getValue().size())); + for (column_t _iter17 : _iter16.getValue()) { _iter17.write(oprot); } oprot.writeListEnd(); @@ -269,19 +489,35 @@ public class batch_mutation_t implements TBase, java.io.Serializable { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("batch_mutation_t("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("table:"); sb.append(this.table); - sb.append(",key:"); + first = false; + if (!first) sb.append(", "); + sb.append("key:"); sb.append(this.key); - sb.append(",cfmap:"); + first = false; + if (!first) sb.append(", "); + sb.append("cfmap:"); sb.append(this.cfmap); - sb.append(",cfmapdel:"); + first = false; + if (!first) sb.append(", "); + sb.append("cfmapdel:"); sb.append(this.cfmapdel); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } diff --git a/src/org/apache/cassandra/service/column_t.java b/src/org/apache/cassandra/service/column_t.java index da2c2123ac..dbe0cd372b 100644 --- a/src/org/apache/cassandra/service/column_t.java +++ b/src/org/apache/cassandra/service/column_t.java @@ -11,23 +11,46 @@ import java.util.Map; import java.util.HashMap; import java.util.Set; import java.util.HashSet; -import com.facebook.thrift.*; +import java.util.Collections; +import org.apache.thrift.*; +import org.apache.thrift.meta_data.*; -import com.facebook.thrift.protocol.*; -import com.facebook.thrift.transport.*; +import org.apache.thrift.protocol.*; +import org.apache.thrift.transport.*; + +public class column_t implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("column_t"); + private static final TField COLUMN_NAME_FIELD_DESC = new TField("columnName", TType.STRING, (short)1); + private static final TField VALUE_FIELD_DESC = new TField("value", TType.STRING, (short)2); + private static final TField TIMESTAMP_FIELD_DESC = new TField("timestamp", TType.I64, (short)3); -public class column_t implements TBase, java.io.Serializable { public String columnName; + public static final int COLUMNNAME = 1; public String value; + public static final int VALUE = 2; public long timestamp; + public static final int TIMESTAMP = 3; - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean columnName = false; public boolean value = false; public boolean timestamp = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(COLUMNNAME, new FieldMetaData("columnName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(VALUE, new FieldMetaData("value", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(TIMESTAMP, new FieldMetaData("timestamp", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I64))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(column_t.class, metaDataMap); + } + public column_t() { } @@ -38,13 +61,150 @@ public class column_t implements TBase, java.io.Serializable { { this(); this.columnName = columnName; - this.__isset.columnName = true; + this.__isset.columnName = (columnName != null); this.value = value; - this.__isset.value = true; + this.__isset.value = (value != null); this.timestamp = timestamp; this.__isset.timestamp = true; } + /** + * Performs a deep copy on other. + */ + public column_t(column_t other) { + __isset.columnName = other.__isset.columnName; + if (other.columnName != null) { + this.columnName = other.columnName; + } + __isset.value = other.__isset.value; + if (other.value != null) { + this.value = other.value; + } + __isset.timestamp = other.__isset.timestamp; + this.timestamp = other.timestamp; + } + + @Override + public column_t clone() { + return new column_t(this); + } + + public String getColumnName() { + return this.columnName; + } + + public void setColumnName(String columnName) { + this.columnName = columnName; + this.__isset.columnName = (columnName != null); + } + + public void unsetColumnName() { + this.__isset.columnName = false; + } + + // Returns true if field columnName is set (has been asigned a value) and false otherwise + public boolean isSetColumnName() { + return this.__isset.columnName; + } + + public void setColumnNameIsSet(boolean value) { + this.__isset.columnName = value; + } + + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + this.__isset.value = (value != null); + } + + public void unsetValue() { + this.__isset.value = false; + } + + // Returns true if field value is set (has been asigned a value) and false otherwise + public boolean isSetValue() { + return this.__isset.value; + } + + public void setValueIsSet(boolean value) { + this.__isset.value = value; + } + + public long getTimestamp() { + return this.timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + this.__isset.timestamp = true; + } + + public void unsetTimestamp() { + this.__isset.timestamp = false; + } + + // Returns true if field timestamp is set (has been asigned a value) and false otherwise + public boolean isSetTimestamp() { + return this.__isset.timestamp; + } + + public void setTimestampIsSet(boolean value) { + this.__isset.timestamp = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case COLUMNNAME: + setColumnName((String)value); + break; + + case VALUE: + setValue((String)value); + break; + + case TIMESTAMP: + setTimestamp((Long)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case COLUMNNAME: + return getColumnName(); + + case VALUE: + return getValue(); + + case TIMESTAMP: + return new Long(getTimestamp()); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case COLUMNNAME: + return this.__isset.columnName; + case VALUE: + return this.__isset.value; + case TIMESTAMP: + return this.__isset.timestamp; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -87,6 +247,7 @@ public class column_t implements TBase, java.io.Serializable { return true; } + @Override public int hashCode() { return 0; } @@ -102,7 +263,7 @@ public class column_t implements TBase, java.io.Serializable { } switch (field.id) { - case 1: + case COLUMNNAME: if (field.type == TType.STRING) { this.columnName = iprot.readString(); this.__isset.columnName = true; @@ -110,7 +271,7 @@ public class column_t implements TBase, java.io.Serializable { TProtocolUtil.skip(iprot, field.type); } break; - case 2: + case VALUE: if (field.type == TType.STRING) { this.value = iprot.readString(); this.__isset.value = true; @@ -118,7 +279,7 @@ public class column_t implements TBase, java.io.Serializable { TProtocolUtil.skip(iprot, field.type); } break; - case 3: + case TIMESTAMP: if (field.type == TType.I64) { this.timestamp = iprot.readI64(); this.__isset.timestamp = true; @@ -133,49 +294,58 @@ public class column_t implements TBase, java.io.Serializable { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("column_t"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.columnName != null) { - field.name = "columnName"; - field.type = TType.STRING; - field.id = 1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); oprot.writeString(this.columnName); oprot.writeFieldEnd(); } if (this.value != null) { - field.name = "value"; - field.type = TType.STRING; - field.id = 2; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(VALUE_FIELD_DESC); oprot.writeString(this.value); oprot.writeFieldEnd(); } - field.name = "timestamp"; - field.type = TType.I64; - field.id = 3; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC); oprot.writeI64(this.timestamp); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("column_t("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("columnName:"); sb.append(this.columnName); - sb.append(",value:"); + first = false; + if (!first) sb.append(", "); + sb.append("value:"); sb.append(this.value); - sb.append(",timestamp:"); + first = false; + if (!first) sb.append(", "); + sb.append("timestamp:"); sb.append(this.timestamp); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } diff --git a/src/org/apache/cassandra/service/superColumn_t.java b/src/org/apache/cassandra/service/superColumn_t.java index 188dab0e32..d5f4e91b52 100644 --- a/src/org/apache/cassandra/service/superColumn_t.java +++ b/src/org/apache/cassandra/service/superColumn_t.java @@ -11,21 +11,41 @@ import java.util.Map; import java.util.HashMap; import java.util.Set; import java.util.HashSet; -import com.facebook.thrift.*; +import java.util.Collections; +import org.apache.thrift.*; +import org.apache.thrift.meta_data.*; -import com.facebook.thrift.protocol.*; -import com.facebook.thrift.transport.*; +import org.apache.thrift.protocol.*; +import org.apache.thrift.transport.*; + +public class superColumn_t implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("superColumn_t"); + 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); -public class superColumn_t implements TBase, java.io.Serializable { public String name; + public static final int NAME = 1; public List columns; + public static final int COLUMNS = 2; - public final Isset __isset = new Isset(); - public static final class Isset implements java.io.Serializable { + private final Isset __isset = new Isset(); + private static final class Isset implements java.io.Serializable { public boolean name = false; public boolean columns = false; } + public static final Map metaDataMap = Collections.unmodifiableMap(new HashMap() {{ + put(NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, column_t.class)))); + }}); + + static { + FieldMetaData.addStructMetaDataMap(superColumn_t.class, metaDataMap); + } + public superColumn_t() { } @@ -35,11 +55,136 @@ public class superColumn_t implements TBase, java.io.Serializable { { this(); this.name = name; - this.__isset.name = true; + this.__isset.name = (name != null); this.columns = columns; + this.__isset.columns = (columns != null); + } + + /** + * Performs a deep copy on other. + */ + public superColumn_t(superColumn_t other) { + __isset.name = other.__isset.name; + if (other.name != null) { + this.name = other.name; + } + __isset.columns = other.__isset.columns; + if (other.columns != null) { + List __this__columns = new ArrayList(); + for (column_t other_element : other.columns) { + __this__columns.add(new column_t(other_element)); + } + this.columns = __this__columns; + } + } + + @Override + public superColumn_t clone() { + return new superColumn_t(this); + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + this.__isset.name = (name != null); + } + + public void unsetName() { + this.__isset.name = false; + } + + // Returns true if field name is set (has been asigned a value) and false otherwise + public boolean isSetName() { + return this.__isset.name; + } + + public void setNameIsSet(boolean value) { + this.__isset.name = value; + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(column_t elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); this.__isset.columns = true; } + public List getColumns() { + return this.columns; + } + + public void setColumns(List columns) { + this.columns = columns; + this.__isset.columns = (columns != null); + } + + public void unsetColumns() { + this.columns = null; + this.__isset.columns = false; + } + + // Returns true if field columns is set (has been asigned a value) and false otherwise + public boolean isSetColumns() { + return this.__isset.columns; + } + + public void setColumnsIsSet(boolean value) { + this.__isset.columns = value; + } + + public void setFieldValue(int fieldID, Object value) { + switch (fieldID) { + case NAME: + setName((String)value); + break; + + case COLUMNS: + setColumns((List)value); + break; + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + public Object getFieldValue(int fieldID) { + switch (fieldID) { + case NAME: + return getName(); + + case COLUMNS: + return getColumns(); + + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise + public boolean isSet(int fieldID) { + switch (fieldID) { + case NAME: + return this.__isset.name; + case COLUMNS: + return this.__isset.columns; + default: + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); + } + } + + @Override public boolean equals(Object that) { if (that == null) return false; @@ -73,6 +218,7 @@ public class superColumn_t implements TBase, java.io.Serializable { return true; } + @Override public int hashCode() { return 0; } @@ -88,7 +234,7 @@ public class superColumn_t implements TBase, java.io.Serializable { } switch (field.id) { - case 1: + case NAME: if (field.type == TType.STRING) { this.name = iprot.readString(); this.__isset.name = true; @@ -96,14 +242,14 @@ public class superColumn_t implements TBase, java.io.Serializable { TProtocolUtil.skip(iprot, field.type); } break; - case 2: + case COLUMNS: if (field.type == TType.LIST) { { TList _list18 = iprot.readListBegin(); this.columns = new ArrayList(_list18.size); for (int _i19 = 0; _i19 < _list18.size; ++_i19) { - column_t _elem20 = new column_t(); + column_t _elem20; _elem20 = new column_t(); _elem20.read(iprot); this.columns.add(_elem20); @@ -122,25 +268,23 @@ public class superColumn_t implements TBase, java.io.Serializable { iprot.readFieldEnd(); } iprot.readStructEnd(); + + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); } public void write(TProtocol oprot) throws TException { - TStruct struct = new TStruct("superColumn_t"); - oprot.writeStructBegin(struct); - TField field = new TField(); + validate(); + + oprot.writeStructBegin(STRUCT_DESC); if (this.name != null) { - field.name = "name"; - field.type = TType.STRING; - field.id = 1; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(NAME_FIELD_DESC); oprot.writeString(this.name); oprot.writeFieldEnd(); } if (this.columns != null) { - field.name = "columns"; - field.type = TType.LIST; - field.id = 2; - oprot.writeFieldBegin(field); + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.columns.size())); for (column_t _iter21 : this.columns) { @@ -154,15 +298,27 @@ public class superColumn_t implements TBase, java.io.Serializable { oprot.writeStructEnd(); } + @Override public String toString() { StringBuilder sb = new StringBuilder("superColumn_t("); + boolean first = true; + + if (!first) sb.append(", "); sb.append("name:"); sb.append(this.name); - sb.append(",columns:"); + first = false; + if (!first) sb.append(", "); + sb.append("columns:"); sb.append(this.columns); + first = false; sb.append(")"); return sb.toString(); } + public void validate() throws TException { + // check for required fields + // check that fields of type enum have valid values + } + } diff --git a/src/org/apache/cassandra/test/DataImporter.java b/src/org/apache/cassandra/test/DataImporter.java index 4e9803425f..bb079bdf64 100644 --- a/src/org/apache/cassandra/test/DataImporter.java +++ b/src/org/apache/cassandra/test/DataImporter.java @@ -18,9 +18,9 @@ package org.apache.cassandra.test; -import com.facebook.thrift.transport.TTransport; -import com.facebook.thrift.transport.TSocket; -import com.facebook.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.transport.TTransport; +import org.apache.thrift.transport.TSocket; +import org.apache.thrift.protocol.TBinaryProtocol; import java.io.BufferedReader; import java.io.File; diff --git a/src/org/apache/cassandra/test/StressTest.java b/src/org/apache/cassandra/test/StressTest.java index e30534ed9b..c22fa166e7 100644 --- a/src/org/apache/cassandra/test/StressTest.java +++ b/src/org/apache/cassandra/test/StressTest.java @@ -55,9 +55,9 @@ import org.apache.cassandra.service.superColumn_t; import org.apache.cassandra.utils.FBUtilities; import org.apache.cassandra.utils.LogUtil; import org.apache.log4j.Logger; -import com.facebook.thrift.protocol.TBinaryProtocol; -import com.facebook.thrift.transport.TSocket; -import com.facebook.thrift.transport.TTransport; +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.transport.TSocket; +import org.apache.thrift.transport.TTransport; import com.martiansoftware.jsap.*; /**