diff --git a/interface/cassandra.thrift b/interface/cassandra.thrift index b932db47ac..fe93d54a33 100644 --- a/interface/cassandra.thrift +++ b/interface/cassandra.thrift @@ -76,6 +76,16 @@ struct SuperColumn { 2: required list columns, } +struct CounterColumn { + 1: required binary name, + 2: required i64 value +} + +struct CounterSuperColumn { + 1: required binary name, + 2: required list columns +} + /** Methods for fetching rows/records from Cassandra will return either a single instance of ColumnOrSuperColumn or a list of ColumnOrSuperColumns (get_slice()). If you're looking up a SuperColumn (or list of SuperColumns) then the resulting @@ -83,12 +93,19 @@ struct SuperColumn { in Columns, those values will be in the attribute column. This change was made between 0.3 and 0.4 to standardize on single query methods that may return either a SuperColumn or Column. + If the query was on a counter column family, you will either get a counter_column (instead of a column) or a + counter_super_column (instead of a super_column) + @param column. The Column returned by get() or get_slice(). @param super_column. The SuperColumn returned by get() or get_slice(). + @param counter_column. The Counterolumn returned by get() or get_slice(). + @param counter_super_column. The CounterSuperColumn returned by get() or get_slice(). */ struct ColumnOrSuperColumn { 1: optional Column column, 2: optional SuperColumn super_column, + 3: optional CounterColumn counter_column, + 4: optional CounterSuperColumn counter_super_column } @@ -213,21 +230,6 @@ struct ColumnPath { 5: optional binary column, } -struct CounterColumn { - 1: required binary name, - 2: required i64 value -} - -struct CounterSuperColumn { - 1: required binary name, - 2: required list columns -} - -struct Counter { - 1: optional CounterColumn column, - 2: optional CounterSuperColumn super_column -} - /** A slice range is a structure that stores basic range, ordering and limit information for a query that will return multiple columns. It could be thought of as Cassandra's version of LIMIT and ORDER BY @@ -331,15 +333,13 @@ struct Deletion { } /** - A Mutation is either an insert (represented by filling column_or_supercolumn), a deletion (represented by filling the deletion attribute), - a counter addition (represented by filling counter), or a counter deletion (represented by filling counter_deletion). - @param column_or_supercolumn. An insert to a column or supercolumn + A Mutation is either an insert (represented by filling column_or_supercolumn) or a deletion (represented by filling the deletion attribute). + @param column_or_supercolumn. An insert to a column or supercolumn (possibly counter column or supercolumn) @param deletion. A deletion of a column or supercolumn */ struct Mutation { 1: optional ColumnOrSuperColumn column_or_supercolumn, 2: optional Deletion deletion, - 3: optional Counter counter, } struct TokenRange { @@ -390,7 +390,7 @@ struct CfDef { 21: optional i32 memtable_flush_after_mins, 22: optional i32 memtable_throughput_in_mb, 23: optional double memtable_operations_in_millions, - 24: optional bool replicate_on_write=0, + 24: optional bool replicate_on_write, 25: optional double merge_shards_chance, 26: optional string key_validation_class, 27: optional string row_cache_provider="org.apache.cassandra.cache.ConcurrentLinkedHashCacheProvider", @@ -512,15 +512,19 @@ service Cassandra { 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + /** + * Increment or decrement a counter. + */ + void add(1:required binary key, + 2:required ColumnParent column_parent, + 3:required CounterColumn column, + 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + /** Remove data from the row specified by key at the granularity specified by column_path, and the given timestamp. Note that all the values in column_path besides column_path.column_family are truly optional: you can remove the entire row by just specifying the ColumnFamily, or you can remove a SuperColumn or a single Column by specifying those levels too. - - Note that counters have limited support for deletes: if you remove - a counter, you must wait to issue any following update until the - delete has reached all the nodes and all of them have been fully - compacted. */ void remove(1:required binary key, 2:required ColumnPath column_path, @@ -528,6 +532,17 @@ service Cassandra { 4:ConsistencyLevel consistency_level=ConsistencyLevel.ONE) throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + /** + * Remove a counter at the specified location. + * Note that counters have limited support for deletes: if you remove a counter, you must wait to issue any following update + * until the delete has reached all the nodes and all of them have been fully compacted. + */ + void remove_counter(1:required binary key, + 2:required ColumnPath path, + 3:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** Mutate many columns or super columns for many row keys. See also: Mutation. @@ -549,51 +564,6 @@ service Cassandra { throws (1: InvalidRequestException ire, 2: UnavailableException ue), - # counter methods - - /** - * Increment or decrement a counter. - */ - void add(1:required binary key, - 2:required ColumnParent column_parent, - 3:required CounterColumn column, - 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) - throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), - - /** - * Return the counter at the specified column path. - */ - Counter get_counter(1:required binary key, - 2:required ColumnPath path, - 3:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) - throws (1:InvalidRequestException ire, 2:NotFoundException nfe, 3:UnavailableException ue, 4:TimedOutException te), - - /** - * Get a list of counters from the specified columns. - */ - list get_counter_slice(1:required binary key, - 2:required ColumnParent column_parent, - 3:required SlicePredicate predicate, - 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) - throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), - - /** - * Get counter slices from multiple keys. - */ - map> multiget_counter_slice(1:required list keys, - 2:required ColumnParent column_parent, - 3:required SlicePredicate predicate, - 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) - throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), - - /** - * Remove a counter at the specified location. - */ - void remove_counter(1:required binary key, - 2:required ColumnPath path, - 3:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) - throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), - // Meta-APIs -- APIs to get information about the node or cluster, // rather than user data. The nodeprobe program provides usage examples. diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java index a0cc62c36b..8067c0c30e 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java @@ -132,16 +132,21 @@ public class Cassandra { */ public void insert(ByteBuffer key, ColumnParent column_parent, Column column, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException; + /** + * Increment or decrement a counter. + * + * @param key + * @param column_parent + * @param column + * @param consistency_level + */ + public void add(ByteBuffer key, ColumnParent column_parent, CounterColumn column, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException; + /** * Remove data from the row specified by key at the granularity specified by column_path, and the given timestamp. Note * that all the values in column_path besides column_path.column_family are truly optional: you can remove the entire * row by just specifying the ColumnFamily, or you can remove a SuperColumn or a single Column by specifying those levels too. * - * Note that counters have limited support for deletes: if you remove - * a counter, you must wait to issue any following update until the - * delete has reached all the nodes and all of them have been fully - * compacted. - * * @param key * @param column_path * @param timestamp @@ -149,6 +154,17 @@ public class Cassandra { */ public void remove(ByteBuffer key, ColumnPath column_path, long timestamp, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException; + /** + * Remove a counter at the specified location. + * Note that counters have limited support for deletes: if you remove a counter, you must wait to issue any following update + * until the delete has reached all the nodes and all of them have been fully compacted. + * + * @param key + * @param path + * @param consistency_level + */ + public void remove_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException; + /** * Mutate many columns or super columns for many row keys. See also: Mutation. * @@ -172,54 +188,6 @@ public class Cassandra { */ public void truncate(String cfname) throws InvalidRequestException, UnavailableException, org.apache.thrift.TException; - /** - * Increment or decrement a counter. - * - * @param key - * @param column_parent - * @param column - * @param consistency_level - */ - public void add(ByteBuffer key, ColumnParent column_parent, CounterColumn column, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException; - - /** - * Return the counter at the specified column path. - * - * @param key - * @param path - * @param consistency_level - */ - public Counter get_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level) throws InvalidRequestException, NotFoundException, UnavailableException, TimedOutException, org.apache.thrift.TException; - - /** - * Get a list of counters from the specified columns. - * - * @param key - * @param column_parent - * @param predicate - * @param consistency_level - */ - public List get_counter_slice(ByteBuffer key, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException; - - /** - * Get counter slices from multiple keys. - * - * @param keys - * @param column_parent - * @param predicate - * @param consistency_level - */ - public Map> multiget_counter_slice(List keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException; - - /** - * Remove a counter at the specified location. - * - * @param key - * @param path - * @param consistency_level - */ - public void remove_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException; - /** * for each schema version present in the cluster, returns a list of nodes at that version. * hosts that do not respond will be under the key DatabaseDescriptor.INITIAL_VERSION. @@ -362,22 +330,16 @@ public class Cassandra { public void insert(ByteBuffer key, ColumnParent column_parent, Column column, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void add(ByteBuffer key, ColumnParent column_parent, CounterColumn column, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void remove(ByteBuffer key, ColumnPath column_path, long timestamp, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void remove_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void batch_mutate(Map>> mutation_map, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void truncate(String cfname, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void add(ByteBuffer key, ColumnParent column_parent, CounterColumn column, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void get_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void get_counter_slice(ByteBuffer key, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void multiget_counter_slice(List keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void remove_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void describe_schema_versions(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void describe_keyspaces(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -907,6 +869,51 @@ public class Cassandra { return; } + public void add(ByteBuffer key, ColumnParent column_parent, CounterColumn column, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException + { + send_add(key, column_parent, column, consistency_level); + recv_add(); + } + + public void send_add(ByteBuffer key, ColumnParent column_parent, CounterColumn column, ConsistencyLevel consistency_level) throws org.apache.thrift.TException + { + oprot_.writeMessageBegin(new org.apache.thrift.protocol.TMessage("add", org.apache.thrift.protocol.TMessageType.CALL, ++seqid_)); + add_args args = new add_args(); + args.setKey(key); + args.setColumn_parent(column_parent); + args.setColumn(column); + args.setConsistency_level(consistency_level); + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public void recv_add() throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException + { + org.apache.thrift.protocol.TMessage msg = iprot_.readMessageBegin(); + if (msg.type == org.apache.thrift.protocol.TMessageType.EXCEPTION) { + org.apache.thrift.TApplicationException x = org.apache.thrift.TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + if (msg.seqid != seqid_) { + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.BAD_SEQUENCE_ID, "add failed: out of sequence response"); + } + add_result result = new add_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.ire != null) { + throw result.ire; + } + if (result.ue != null) { + throw result.ue; + } + if (result.te != null) { + throw result.te; + } + return; + } + public void remove(ByteBuffer key, ColumnPath column_path, long timestamp, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException { send_remove(key, column_path, timestamp, consistency_level); @@ -952,6 +959,50 @@ public class Cassandra { return; } + public void remove_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException + { + send_remove_counter(key, path, consistency_level); + recv_remove_counter(); + } + + public void send_remove_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level) throws org.apache.thrift.TException + { + oprot_.writeMessageBegin(new org.apache.thrift.protocol.TMessage("remove_counter", org.apache.thrift.protocol.TMessageType.CALL, ++seqid_)); + remove_counter_args args = new remove_counter_args(); + args.setKey(key); + args.setPath(path); + args.setConsistency_level(consistency_level); + args.write(oprot_); + oprot_.writeMessageEnd(); + oprot_.getTransport().flush(); + } + + public void recv_remove_counter() throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException + { + org.apache.thrift.protocol.TMessage msg = iprot_.readMessageBegin(); + if (msg.type == org.apache.thrift.protocol.TMessageType.EXCEPTION) { + org.apache.thrift.TApplicationException x = org.apache.thrift.TApplicationException.read(iprot_); + iprot_.readMessageEnd(); + throw x; + } + if (msg.seqid != seqid_) { + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.BAD_SEQUENCE_ID, "remove_counter failed: out of sequence response"); + } + remove_counter_result result = new remove_counter_result(); + result.read(iprot_); + iprot_.readMessageEnd(); + if (result.ire != null) { + throw result.ire; + } + if (result.ue != null) { + throw result.ue; + } + if (result.te != null) { + throw result.te; + } + return; + } + public void batch_mutate(Map>> mutation_map, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException { send_batch_mutate(mutation_map, consistency_level); @@ -1034,241 +1085,6 @@ public class Cassandra { return; } - public void add(ByteBuffer key, ColumnParent column_parent, CounterColumn column, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException - { - send_add(key, column_parent, column, consistency_level); - recv_add(); - } - - public void send_add(ByteBuffer key, ColumnParent column_parent, CounterColumn column, ConsistencyLevel consistency_level) throws org.apache.thrift.TException - { - oprot_.writeMessageBegin(new org.apache.thrift.protocol.TMessage("add", org.apache.thrift.protocol.TMessageType.CALL, ++seqid_)); - add_args args = new add_args(); - args.setKey(key); - args.setColumn_parent(column_parent); - args.setColumn(column); - args.setConsistency_level(consistency_level); - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public void recv_add() throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException - { - org.apache.thrift.protocol.TMessage msg = iprot_.readMessageBegin(); - if (msg.type == org.apache.thrift.protocol.TMessageType.EXCEPTION) { - org.apache.thrift.TApplicationException x = org.apache.thrift.TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - if (msg.seqid != seqid_) { - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.BAD_SEQUENCE_ID, "add failed: out of sequence response"); - } - add_result result = new add_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.ire != null) { - throw result.ire; - } - if (result.ue != null) { - throw result.ue; - } - if (result.te != null) { - throw result.te; - } - return; - } - - public Counter get_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level) throws InvalidRequestException, NotFoundException, UnavailableException, TimedOutException, org.apache.thrift.TException - { - send_get_counter(key, path, consistency_level); - return recv_get_counter(); - } - - public void send_get_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level) throws org.apache.thrift.TException - { - oprot_.writeMessageBegin(new org.apache.thrift.protocol.TMessage("get_counter", org.apache.thrift.protocol.TMessageType.CALL, ++seqid_)); - get_counter_args args = new get_counter_args(); - args.setKey(key); - args.setPath(path); - args.setConsistency_level(consistency_level); - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public Counter recv_get_counter() throws InvalidRequestException, NotFoundException, UnavailableException, TimedOutException, org.apache.thrift.TException - { - org.apache.thrift.protocol.TMessage msg = iprot_.readMessageBegin(); - if (msg.type == org.apache.thrift.protocol.TMessageType.EXCEPTION) { - org.apache.thrift.TApplicationException x = org.apache.thrift.TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - if (msg.seqid != seqid_) { - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.BAD_SEQUENCE_ID, "get_counter failed: out of sequence response"); - } - get_counter_result result = new get_counter_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; - } - if (result.ire != null) { - throw result.ire; - } - if (result.nfe != null) { - throw result.nfe; - } - if (result.ue != null) { - throw result.ue; - } - if (result.te != null) { - throw result.te; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "get_counter failed: unknown result"); - } - - public List get_counter_slice(ByteBuffer key, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException - { - send_get_counter_slice(key, column_parent, predicate, consistency_level); - return recv_get_counter_slice(); - } - - public void send_get_counter_slice(ByteBuffer key, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws org.apache.thrift.TException - { - oprot_.writeMessageBegin(new org.apache.thrift.protocol.TMessage("get_counter_slice", org.apache.thrift.protocol.TMessageType.CALL, ++seqid_)); - get_counter_slice_args args = new get_counter_slice_args(); - args.setKey(key); - args.setColumn_parent(column_parent); - args.setPredicate(predicate); - args.setConsistency_level(consistency_level); - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public List recv_get_counter_slice() throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException - { - org.apache.thrift.protocol.TMessage msg = iprot_.readMessageBegin(); - if (msg.type == org.apache.thrift.protocol.TMessageType.EXCEPTION) { - org.apache.thrift.TApplicationException x = org.apache.thrift.TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - if (msg.seqid != seqid_) { - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.BAD_SEQUENCE_ID, "get_counter_slice failed: out of sequence response"); - } - get_counter_slice_result result = new get_counter_slice_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; - } - if (result.ire != null) { - throw result.ire; - } - if (result.ue != null) { - throw result.ue; - } - if (result.te != null) { - throw result.te; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "get_counter_slice failed: unknown result"); - } - - public Map> multiget_counter_slice(List keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException - { - send_multiget_counter_slice(keys, column_parent, predicate, consistency_level); - return recv_multiget_counter_slice(); - } - - public void send_multiget_counter_slice(List keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws org.apache.thrift.TException - { - oprot_.writeMessageBegin(new org.apache.thrift.protocol.TMessage("multiget_counter_slice", org.apache.thrift.protocol.TMessageType.CALL, ++seqid_)); - multiget_counter_slice_args args = new multiget_counter_slice_args(); - args.setKeys(keys); - args.setColumn_parent(column_parent); - args.setPredicate(predicate); - args.setConsistency_level(consistency_level); - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public Map> recv_multiget_counter_slice() throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException - { - org.apache.thrift.protocol.TMessage msg = iprot_.readMessageBegin(); - if (msg.type == org.apache.thrift.protocol.TMessageType.EXCEPTION) { - org.apache.thrift.TApplicationException x = org.apache.thrift.TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - if (msg.seqid != seqid_) { - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.BAD_SEQUENCE_ID, "multiget_counter_slice failed: out of sequence response"); - } - multiget_counter_slice_result result = new multiget_counter_slice_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; - } - if (result.ire != null) { - throw result.ire; - } - if (result.ue != null) { - throw result.ue; - } - if (result.te != null) { - throw result.te; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "multiget_counter_slice failed: unknown result"); - } - - public void remove_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException - { - send_remove_counter(key, path, consistency_level); - recv_remove_counter(); - } - - public void send_remove_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level) throws org.apache.thrift.TException - { - oprot_.writeMessageBegin(new org.apache.thrift.protocol.TMessage("remove_counter", org.apache.thrift.protocol.TMessageType.CALL, ++seqid_)); - remove_counter_args args = new remove_counter_args(); - args.setKey(key); - args.setPath(path); - args.setConsistency_level(consistency_level); - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public void recv_remove_counter() throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException - { - org.apache.thrift.protocol.TMessage msg = iprot_.readMessageBegin(); - if (msg.type == org.apache.thrift.protocol.TMessageType.EXCEPTION) { - org.apache.thrift.TApplicationException x = org.apache.thrift.TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - if (msg.seqid != seqid_) { - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.BAD_SEQUENCE_ID, "remove_counter failed: out of sequence response"); - } - remove_counter_result result = new remove_counter_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.ire != null) { - throw result.ire; - } - if (result.ue != null) { - throw result.ue; - } - if (result.te != null) { - throw result.te; - } - return; - } - public Map> describe_schema_versions() throws InvalidRequestException, org.apache.thrift.TException { send_describe_schema_versions(); @@ -2316,6 +2132,47 @@ public class Cassandra { } } + public void add(ByteBuffer key, ColumnParent column_parent, CounterColumn column, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + add_call method_call = new add_call(key, column_parent, column, consistency_level, resultHandler, this, protocolFactory, transport); + this.currentMethod = method_call; + manager.call(method_call); + } + + public static class add_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer key; + private ColumnParent column_parent; + private CounterColumn column; + private ConsistencyLevel consistency_level; + public add_call(ByteBuffer key, ColumnParent column_parent, CounterColumn column, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.key = key; + this.column_parent = column_parent; + this.column = column; + this.consistency_level = consistency_level; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("add", org.apache.thrift.protocol.TMessageType.CALL, 0)); + add_args args = new add_args(); + args.setKey(key); + args.setColumn_parent(column_parent); + args.setColumn(column); + args.setConsistency_level(consistency_level); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_add(); + } + } + public void remove(ByteBuffer key, ColumnPath column_path, long timestamp, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); remove_call method_call = new remove_call(key, column_path, timestamp, consistency_level, resultHandler, this, protocolFactory, transport); @@ -2357,6 +2214,44 @@ public class Cassandra { } } + public void remove_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + remove_counter_call method_call = new remove_counter_call(key, path, consistency_level, resultHandler, this, protocolFactory, transport); + this.currentMethod = method_call; + manager.call(method_call); + } + + public static class remove_counter_call extends org.apache.thrift.async.TAsyncMethodCall { + private ByteBuffer key; + private ColumnPath path; + private ConsistencyLevel consistency_level; + public remove_counter_call(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.key = key; + this.path = path; + this.consistency_level = consistency_level; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("remove_counter", org.apache.thrift.protocol.TMessageType.CALL, 0)); + remove_counter_args args = new remove_counter_args(); + args.setKey(key); + args.setPath(path); + args.setConsistency_level(consistency_level); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + (new Client(prot)).recv_remove_counter(); + } + } + public void batch_mutate(Map>> mutation_map, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); batch_mutate_call method_call = new batch_mutate_call(mutation_map, consistency_level, resultHandler, this, protocolFactory, transport); @@ -2424,205 +2319,6 @@ public class Cassandra { } } - public void add(ByteBuffer key, ColumnParent column_parent, CounterColumn column, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - add_call method_call = new add_call(key, column_parent, column, consistency_level, resultHandler, this, protocolFactory, transport); - this.currentMethod = method_call; - manager.call(method_call); - } - - public static class add_call extends org.apache.thrift.async.TAsyncMethodCall { - private ByteBuffer key; - private ColumnParent column_parent; - private CounterColumn column; - private ConsistencyLevel consistency_level; - public add_call(ByteBuffer key, ColumnParent column_parent, CounterColumn column, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.key = key; - this.column_parent = column_parent; - this.column = column; - this.consistency_level = consistency_level; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("add", org.apache.thrift.protocol.TMessageType.CALL, 0)); - add_args args = new add_args(); - args.setKey(key); - args.setColumn_parent(column_parent); - args.setColumn(column); - args.setConsistency_level(consistency_level); - args.write(prot); - prot.writeMessageEnd(); - } - - public void getResult() throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - (new Client(prot)).recv_add(); - } - } - - public void get_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - get_counter_call method_call = new get_counter_call(key, path, consistency_level, resultHandler, this, protocolFactory, transport); - this.currentMethod = method_call; - manager.call(method_call); - } - - public static class get_counter_call extends org.apache.thrift.async.TAsyncMethodCall { - private ByteBuffer key; - private ColumnPath path; - private ConsistencyLevel consistency_level; - public get_counter_call(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.key = key; - this.path = path; - this.consistency_level = consistency_level; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("get_counter", org.apache.thrift.protocol.TMessageType.CALL, 0)); - get_counter_args args = new get_counter_args(); - args.setKey(key); - args.setPath(path); - args.setConsistency_level(consistency_level); - args.write(prot); - prot.writeMessageEnd(); - } - - public Counter getResult() throws InvalidRequestException, NotFoundException, UnavailableException, TimedOutException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_get_counter(); - } - } - - public void get_counter_slice(ByteBuffer key, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - get_counter_slice_call method_call = new get_counter_slice_call(key, column_parent, predicate, consistency_level, resultHandler, this, protocolFactory, transport); - this.currentMethod = method_call; - manager.call(method_call); - } - - public static class get_counter_slice_call extends org.apache.thrift.async.TAsyncMethodCall { - private ByteBuffer key; - private ColumnParent column_parent; - private SlicePredicate predicate; - private ConsistencyLevel consistency_level; - public get_counter_slice_call(ByteBuffer key, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.key = key; - this.column_parent = column_parent; - this.predicate = predicate; - this.consistency_level = consistency_level; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("get_counter_slice", org.apache.thrift.protocol.TMessageType.CALL, 0)); - get_counter_slice_args args = new get_counter_slice_args(); - args.setKey(key); - args.setColumn_parent(column_parent); - args.setPredicate(predicate); - args.setConsistency_level(consistency_level); - args.write(prot); - prot.writeMessageEnd(); - } - - public List getResult() throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_get_counter_slice(); - } - } - - public void multiget_counter_slice(List keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - multiget_counter_slice_call method_call = new multiget_counter_slice_call(keys, column_parent, predicate, consistency_level, resultHandler, this, protocolFactory, transport); - this.currentMethod = method_call; - manager.call(method_call); - } - - public static class multiget_counter_slice_call extends org.apache.thrift.async.TAsyncMethodCall { - private List keys; - private ColumnParent column_parent; - private SlicePredicate predicate; - private ConsistencyLevel consistency_level; - public multiget_counter_slice_call(List keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.keys = keys; - this.column_parent = column_parent; - this.predicate = predicate; - this.consistency_level = consistency_level; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("multiget_counter_slice", org.apache.thrift.protocol.TMessageType.CALL, 0)); - multiget_counter_slice_args args = new multiget_counter_slice_args(); - args.setKeys(keys); - args.setColumn_parent(column_parent); - args.setPredicate(predicate); - args.setConsistency_level(consistency_level); - args.write(prot); - prot.writeMessageEnd(); - } - - public Map> getResult() throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_multiget_counter_slice(); - } - } - - public void remove_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - remove_counter_call method_call = new remove_counter_call(key, path, consistency_level, resultHandler, this, protocolFactory, transport); - this.currentMethod = method_call; - manager.call(method_call); - } - - public static class remove_counter_call extends org.apache.thrift.async.TAsyncMethodCall { - private ByteBuffer key; - private ColumnPath path; - private ConsistencyLevel consistency_level; - public remove_counter_call(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.key = key; - this.path = path; - this.consistency_level = consistency_level; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("remove_counter", org.apache.thrift.protocol.TMessageType.CALL, 0)); - remove_counter_args args = new remove_counter_args(); - args.setKey(key); - args.setPath(path); - args.setConsistency_level(consistency_level); - args.write(prot); - prot.writeMessageEnd(); - } - - public void getResult() throws InvalidRequestException, UnavailableException, TimedOutException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - (new Client(prot)).recv_remove_counter(); - } - } - public void describe_schema_versions(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); describe_schema_versions_call method_call = new describe_schema_versions_call(resultHandler, this, protocolFactory, transport); @@ -3146,14 +2842,11 @@ public class Cassandra { processMap_.put("get_range_slices", new get_range_slices()); processMap_.put("get_indexed_slices", new get_indexed_slices()); processMap_.put("insert", new insert()); + processMap_.put("add", new add()); processMap_.put("remove", new remove()); + processMap_.put("remove_counter", new remove_counter()); processMap_.put("batch_mutate", new batch_mutate()); processMap_.put("truncate", new truncate()); - processMap_.put("add", new add()); - processMap_.put("get_counter", new get_counter()); - processMap_.put("get_counter_slice", new get_counter_slice()); - processMap_.put("multiget_counter_slice", new multiget_counter_slice()); - processMap_.put("remove_counter", new remove_counter()); processMap_.put("describe_schema_versions", new describe_schema_versions()); processMap_.put("describe_keyspaces", new describe_keyspaces()); processMap_.put("describe_cluster_name", new describe_cluster_name()); @@ -3614,6 +3307,48 @@ public class Cassandra { } + private class add implements ProcessFunction { + public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException + { + add_args args = new add_args(); + try { + args.read(iprot); + } catch (org.apache.thrift.protocol.TProtocolException e) { + iprot.readMessageEnd(); + org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("add", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + iprot.readMessageEnd(); + add_result result = new add_result(); + try { + iface_.add(args.key, args.column_parent, args.column, args.consistency_level); + } catch (InvalidRequestException ire) { + result.ire = ire; + } catch (UnavailableException ue) { + result.ue = ue; + } catch (TimedOutException te) { + result.te = te; + } catch (Throwable th) { + LOGGER.error("Internal error processing add", th); + org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, "Internal error processing add"); + oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("add", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("add", org.apache.thrift.protocol.TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + private class remove implements ProcessFunction { public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { @@ -3656,6 +3391,48 @@ public class Cassandra { } + private class remove_counter implements ProcessFunction { + public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException + { + remove_counter_args args = new remove_counter_args(); + try { + args.read(iprot); + } catch (org.apache.thrift.protocol.TProtocolException e) { + iprot.readMessageEnd(); + org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.PROTOCOL_ERROR, e.getMessage()); + oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("remove_counter", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + iprot.readMessageEnd(); + remove_counter_result result = new remove_counter_result(); + try { + iface_.remove_counter(args.key, args.path, args.consistency_level); + } catch (InvalidRequestException ire) { + result.ire = ire; + } catch (UnavailableException ue) { + result.ue = ue; + } catch (TimedOutException te) { + result.te = te; + } catch (Throwable th) { + LOGGER.error("Internal error processing remove_counter", th); + org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, "Internal error processing remove_counter"); + oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("remove_counter", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid)); + x.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + return; + } + oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("remove_counter", org.apache.thrift.protocol.TMessageType.REPLY, seqid)); + result.write(oprot); + oprot.writeMessageEnd(); + oprot.getTransport().flush(); + } + + } + private class batch_mutate implements ProcessFunction { public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { @@ -3738,218 +3515,6 @@ public class Cassandra { } - private class add implements ProcessFunction { - public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException - { - add_args args = new add_args(); - try { - args.read(iprot); - } catch (org.apache.thrift.protocol.TProtocolException e) { - iprot.readMessageEnd(); - org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.PROTOCOL_ERROR, e.getMessage()); - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("add", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - iprot.readMessageEnd(); - add_result result = new add_result(); - try { - iface_.add(args.key, args.column_parent, args.column, args.consistency_level); - } catch (InvalidRequestException ire) { - result.ire = ire; - } catch (UnavailableException ue) { - result.ue = ue; - } catch (TimedOutException te) { - result.te = te; - } catch (Throwable th) { - LOGGER.error("Internal error processing add", th); - org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, "Internal error processing add"); - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("add", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("add", org.apache.thrift.protocol.TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - - private class get_counter implements ProcessFunction { - public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException - { - get_counter_args args = new get_counter_args(); - try { - args.read(iprot); - } catch (org.apache.thrift.protocol.TProtocolException e) { - iprot.readMessageEnd(); - org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.PROTOCOL_ERROR, e.getMessage()); - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("get_counter", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - iprot.readMessageEnd(); - get_counter_result result = new get_counter_result(); - try { - result.success = iface_.get_counter(args.key, args.path, args.consistency_level); - } catch (InvalidRequestException ire) { - result.ire = ire; - } catch (NotFoundException nfe) { - result.nfe = nfe; - } catch (UnavailableException ue) { - result.ue = ue; - } catch (TimedOutException te) { - result.te = te; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_counter", th); - org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, "Internal error processing get_counter"); - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("get_counter", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("get_counter", org.apache.thrift.protocol.TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - - private class get_counter_slice implements ProcessFunction { - public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException - { - get_counter_slice_args args = new get_counter_slice_args(); - try { - args.read(iprot); - } catch (org.apache.thrift.protocol.TProtocolException e) { - iprot.readMessageEnd(); - org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.PROTOCOL_ERROR, e.getMessage()); - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("get_counter_slice", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - iprot.readMessageEnd(); - get_counter_slice_result result = new get_counter_slice_result(); - try { - result.success = iface_.get_counter_slice(args.key, args.column_parent, args.predicate, args.consistency_level); - } catch (InvalidRequestException ire) { - result.ire = ire; - } catch (UnavailableException ue) { - result.ue = ue; - } catch (TimedOutException te) { - result.te = te; - } catch (Throwable th) { - LOGGER.error("Internal error processing get_counter_slice", th); - org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, "Internal error processing get_counter_slice"); - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("get_counter_slice", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("get_counter_slice", org.apache.thrift.protocol.TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - - private class multiget_counter_slice implements ProcessFunction { - public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException - { - multiget_counter_slice_args args = new multiget_counter_slice_args(); - try { - args.read(iprot); - } catch (org.apache.thrift.protocol.TProtocolException e) { - iprot.readMessageEnd(); - org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.PROTOCOL_ERROR, e.getMessage()); - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("multiget_counter_slice", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - iprot.readMessageEnd(); - multiget_counter_slice_result result = new multiget_counter_slice_result(); - try { - result.success = iface_.multiget_counter_slice(args.keys, args.column_parent, args.predicate, args.consistency_level); - } catch (InvalidRequestException ire) { - result.ire = ire; - } catch (UnavailableException ue) { - result.ue = ue; - } catch (TimedOutException te) { - result.te = te; - } catch (Throwable th) { - LOGGER.error("Internal error processing multiget_counter_slice", th); - org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, "Internal error processing multiget_counter_slice"); - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("multiget_counter_slice", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("multiget_counter_slice", org.apache.thrift.protocol.TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - - private class remove_counter implements ProcessFunction { - public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException - { - remove_counter_args args = new remove_counter_args(); - try { - args.read(iprot); - } catch (org.apache.thrift.protocol.TProtocolException e) { - iprot.readMessageEnd(); - org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.PROTOCOL_ERROR, e.getMessage()); - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("remove_counter", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - iprot.readMessageEnd(); - remove_counter_result result = new remove_counter_result(); - try { - iface_.remove_counter(args.key, args.path, args.consistency_level); - } catch (InvalidRequestException ire) { - result.ire = ire; - } catch (UnavailableException ue) { - result.ue = ue; - } catch (TimedOutException te) { - result.te = te; - } catch (Throwable th) { - LOGGER.error("Internal error processing remove_counter", th); - org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, "Internal error processing remove_counter"); - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("remove_counter", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("remove_counter", org.apache.thrift.protocol.TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - private class describe_schema_versions implements ProcessFunction { public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { @@ -15737,6 +15302,1128 @@ public class Cassandra { } + public static class add_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("add_args"); + + private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField COLUMN_PARENT_FIELD_DESC = new org.apache.thrift.protocol.TField("column_parent", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)4); + + public ByteBuffer key; + public ColumnParent column_parent; + public CounterColumn column; + /** + * + * @see ConsistencyLevel + */ + public ConsistencyLevel consistency_level; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + KEY((short)1, "key"), + COLUMN_PARENT((short)2, "column_parent"), + COLUMN((short)3, "column"), + /** + * + * @see ConsistencyLevel + */ + CONSISTENCY_LEVEL((short)4, "consistency_level"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // KEY + return KEY; + case 2: // COLUMN_PARENT + return COLUMN_PARENT; + case 3: // COLUMN + return COLUMN; + case 4: // CONSISTENCY_LEVEL + return CONSISTENCY_LEVEL; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.COLUMN_PARENT, new org.apache.thrift.meta_data.FieldMetaData("column_parent", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ColumnParent.class))); + tmpMap.put(_Fields.COLUMN, new org.apache.thrift.meta_data.FieldMetaData("column", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CounterColumn.class))); + tmpMap.put(_Fields.CONSISTENCY_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("consistency_level", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ConsistencyLevel.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(add_args.class, metaDataMap); + } + + public add_args() { + this.consistency_level = org.apache.cassandra.thrift.ConsistencyLevel.ONE; + + } + + public add_args( + ByteBuffer key, + ColumnParent column_parent, + CounterColumn column, + ConsistencyLevel consistency_level) + { + this(); + this.key = key; + this.column_parent = column_parent; + this.column = column; + this.consistency_level = consistency_level; + } + + /** + * Performs a deep copy on other. + */ + public add_args(add_args other) { + if (other.isSetKey()) { + this.key = org.apache.thrift.TBaseHelper.copyBinary(other.key); +; + } + if (other.isSetColumn_parent()) { + this.column_parent = new ColumnParent(other.column_parent); + } + if (other.isSetColumn()) { + this.column = new CounterColumn(other.column); + } + if (other.isSetConsistency_level()) { + this.consistency_level = other.consistency_level; + } + } + + public add_args deepCopy() { + return new add_args(this); + } + + @Override + public void clear() { + this.key = null; + this.column_parent = null; + this.column = null; + this.consistency_level = org.apache.cassandra.thrift.ConsistencyLevel.ONE; + + } + + public byte[] getKey() { + setKey(org.apache.thrift.TBaseHelper.rightSize(key)); + return key == null ? null : key.array(); + } + + public ByteBuffer bufferForKey() { + return key; + } + + public add_args setKey(byte[] key) { + setKey(key == null ? (ByteBuffer)null : ByteBuffer.wrap(key)); + return this; + } + + public add_args setKey(ByteBuffer key) { + this.key = key; + return this; + } + + public void unsetKey() { + this.key = null; + } + + /** Returns true if field key is set (has been assigned a value) and false otherwise */ + public boolean isSetKey() { + return this.key != null; + } + + public void setKeyIsSet(boolean value) { + if (!value) { + this.key = null; + } + } + + public ColumnParent getColumn_parent() { + return this.column_parent; + } + + public add_args setColumn_parent(ColumnParent column_parent) { + this.column_parent = column_parent; + return this; + } + + public void unsetColumn_parent() { + this.column_parent = null; + } + + /** Returns true if field column_parent is set (has been assigned a value) and false otherwise */ + public boolean isSetColumn_parent() { + return this.column_parent != null; + } + + public void setColumn_parentIsSet(boolean value) { + if (!value) { + this.column_parent = null; + } + } + + public CounterColumn getColumn() { + return this.column; + } + + public add_args setColumn(CounterColumn column) { + this.column = column; + return this; + } + + public void unsetColumn() { + this.column = null; + } + + /** Returns true if field column is set (has been assigned a value) and false otherwise */ + public boolean isSetColumn() { + return this.column != null; + } + + public void setColumnIsSet(boolean value) { + if (!value) { + this.column = null; + } + } + + /** + * + * @see ConsistencyLevel + */ + public ConsistencyLevel getConsistency_level() { + return this.consistency_level; + } + + /** + * + * @see ConsistencyLevel + */ + public add_args setConsistency_level(ConsistencyLevel consistency_level) { + this.consistency_level = consistency_level; + return this; + } + + public void unsetConsistency_level() { + this.consistency_level = null; + } + + /** Returns true if field consistency_level is set (has been assigned a value) and false otherwise */ + public boolean isSetConsistency_level() { + return this.consistency_level != null; + } + + public void setConsistency_levelIsSet(boolean value) { + if (!value) { + this.consistency_level = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case KEY: + if (value == null) { + unsetKey(); + } else { + setKey((ByteBuffer)value); + } + break; + + case COLUMN_PARENT: + if (value == null) { + unsetColumn_parent(); + } else { + setColumn_parent((ColumnParent)value); + } + break; + + case COLUMN: + if (value == null) { + unsetColumn(); + } else { + setColumn((CounterColumn)value); + } + break; + + case CONSISTENCY_LEVEL: + if (value == null) { + unsetConsistency_level(); + } else { + setConsistency_level((ConsistencyLevel)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case KEY: + return getKey(); + + case COLUMN_PARENT: + return getColumn_parent(); + + case COLUMN: + return getColumn(); + + case CONSISTENCY_LEVEL: + return getConsistency_level(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case KEY: + return isSetKey(); + case COLUMN_PARENT: + return isSetColumn_parent(); + case COLUMN: + return isSetColumn(); + case CONSISTENCY_LEVEL: + return isSetConsistency_level(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof add_args) + return this.equals((add_args)that); + return false; + } + + public boolean equals(add_args that) { + if (that == null) + return false; + + boolean this_present_key = true && this.isSetKey(); + boolean that_present_key = true && that.isSetKey(); + if (this_present_key || that_present_key) { + if (!(this_present_key && that_present_key)) + return false; + if (!this.key.equals(that.key)) + return false; + } + + boolean this_present_column_parent = true && this.isSetColumn_parent(); + boolean that_present_column_parent = true && that.isSetColumn_parent(); + if (this_present_column_parent || that_present_column_parent) { + if (!(this_present_column_parent && that_present_column_parent)) + return false; + if (!this.column_parent.equals(that.column_parent)) + return false; + } + + boolean this_present_column = true && this.isSetColumn(); + boolean that_present_column = true && that.isSetColumn(); + if (this_present_column || that_present_column) { + if (!(this_present_column && that_present_column)) + return false; + if (!this.column.equals(that.column)) + return false; + } + + boolean this_present_consistency_level = true && this.isSetConsistency_level(); + boolean that_present_consistency_level = true && that.isSetConsistency_level(); + if (this_present_consistency_level || that_present_consistency_level) { + if (!(this_present_consistency_level && that_present_consistency_level)) + return false; + if (!this.consistency_level.equals(that.consistency_level)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_key = true && (isSetKey()); + builder.append(present_key); + if (present_key) + builder.append(key); + + boolean present_column_parent = true && (isSetColumn_parent()); + builder.append(present_column_parent); + if (present_column_parent) + builder.append(column_parent); + + boolean present_column = true && (isSetColumn()); + builder.append(present_column); + if (present_column) + builder.append(column); + + boolean present_consistency_level = true && (isSetConsistency_level()); + builder.append(present_consistency_level); + if (present_consistency_level) + builder.append(consistency_level.getValue()); + + return builder.toHashCode(); + } + + public int compareTo(add_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + add_args typedOther = (add_args)other; + + lastComparison = Boolean.valueOf(isSetKey()).compareTo(typedOther.isSetKey()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKey()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, typedOther.key); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumn_parent()).compareTo(typedOther.isSetColumn_parent()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumn_parent()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column_parent, typedOther.column_parent); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumn()).compareTo(typedOther.isSetColumn()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumn()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column, typedOther.column); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetConsistency_level()).compareTo(typedOther.isSetConsistency_level()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetConsistency_level()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.consistency_level, typedOther.consistency_level); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (field.id) { + case 1: // KEY + if (field.type == org.apache.thrift.protocol.TType.STRING) { + this.key = iprot.readBinary(); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // COLUMN_PARENT + if (field.type == org.apache.thrift.protocol.TType.STRUCT) { + this.column_parent = new ColumnParent(); + this.column_parent.read(iprot); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // COLUMN + if (field.type == org.apache.thrift.protocol.TType.STRUCT) { + this.column = new CounterColumn(); + this.column.read(iprot); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // CONSISTENCY_LEVEL + if (field.type == org.apache.thrift.protocol.TType.I32) { + this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.key != null) { + oprot.writeFieldBegin(KEY_FIELD_DESC); + oprot.writeBinary(this.key); + oprot.writeFieldEnd(); + } + if (this.column_parent != null) { + oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); + this.column_parent.write(oprot); + oprot.writeFieldEnd(); + } + if (this.column != null) { + oprot.writeFieldBegin(COLUMN_FIELD_DESC); + this.column.write(oprot); + oprot.writeFieldEnd(); + } + if (this.consistency_level != null) { + oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); + oprot.writeI32(this.consistency_level.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("add_args("); + boolean first = true; + + sb.append("key:"); + if (this.key == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.key, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("column_parent:"); + if (this.column_parent == null) { + sb.append("null"); + } else { + sb.append(this.column_parent); + } + first = false; + if (!first) sb.append(", "); + sb.append("column:"); + if (this.column == null) { + sb.append("null"); + } else { + sb.append(this.column); + } + first = false; + if (!first) sb.append(", "); + sb.append("consistency_level:"); + if (this.consistency_level == null) { + sb.append("null"); + } else { + sb.append(this.consistency_level); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (key == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'key' was not present! Struct: " + toString()); + } + if (column_parent == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'column_parent' was not present! Struct: " + toString()); + } + if (column == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'column' was not present! Struct: " + toString()); + } + if (consistency_level == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + } + + public static class add_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("add_result"); + + private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); + + public InvalidRequestException ire; + public UnavailableException ue; + public TimedOutException te; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + IRE((short)1, "ire"), + UE((short)2, "ue"), + TE((short)3, "te"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // IRE + return IRE; + case 2: // UE + return UE; + case 3: // TE + return TE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IRE, new org.apache.thrift.meta_data.FieldMetaData("ire", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.UE, new org.apache.thrift.meta_data.FieldMetaData("ue", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.TE, new org.apache.thrift.meta_data.FieldMetaData("te", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(add_result.class, metaDataMap); + } + + public add_result() { + } + + public add_result( + InvalidRequestException ire, + UnavailableException ue, + TimedOutException te) + { + this(); + this.ire = ire; + this.ue = ue; + this.te = te; + } + + /** + * Performs a deep copy on other. + */ + public add_result(add_result other) { + if (other.isSetIre()) { + this.ire = new InvalidRequestException(other.ire); + } + if (other.isSetUe()) { + this.ue = new UnavailableException(other.ue); + } + if (other.isSetTe()) { + this.te = new TimedOutException(other.te); + } + } + + public add_result deepCopy() { + return new add_result(this); + } + + @Override + public void clear() { + this.ire = null; + this.ue = null; + this.te = null; + } + + public InvalidRequestException getIre() { + return this.ire; + } + + public add_result setIre(InvalidRequestException ire) { + this.ire = ire; + return this; + } + + public void unsetIre() { + this.ire = null; + } + + /** Returns true if field ire is set (has been assigned a value) and false otherwise */ + public boolean isSetIre() { + return this.ire != null; + } + + public void setIreIsSet(boolean value) { + if (!value) { + this.ire = null; + } + } + + public UnavailableException getUe() { + return this.ue; + } + + public add_result setUe(UnavailableException ue) { + this.ue = ue; + return this; + } + + public void unsetUe() { + this.ue = null; + } + + /** Returns true if field ue is set (has been assigned a value) and false otherwise */ + public boolean isSetUe() { + return this.ue != null; + } + + public void setUeIsSet(boolean value) { + if (!value) { + this.ue = null; + } + } + + public TimedOutException getTe() { + return this.te; + } + + public add_result setTe(TimedOutException te) { + this.te = te; + return this; + } + + public void unsetTe() { + this.te = null; + } + + /** Returns true if field te is set (has been assigned a value) and false otherwise */ + public boolean isSetTe() { + return this.te != null; + } + + public void setTeIsSet(boolean value) { + if (!value) { + this.te = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IRE: + if (value == null) { + unsetIre(); + } else { + setIre((InvalidRequestException)value); + } + break; + + case UE: + if (value == null) { + unsetUe(); + } else { + setUe((UnavailableException)value); + } + break; + + case TE: + if (value == null) { + unsetTe(); + } else { + setTe((TimedOutException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IRE: + return getIre(); + + case UE: + return getUe(); + + case TE: + return getTe(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case IRE: + return isSetIre(); + case UE: + return isSetUe(); + case TE: + return isSetTe(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof add_result) + return this.equals((add_result)that); + return false; + } + + public boolean equals(add_result that) { + if (that == null) + return false; + + boolean this_present_ire = true && this.isSetIre(); + boolean that_present_ire = true && that.isSetIre(); + if (this_present_ire || that_present_ire) { + if (!(this_present_ire && that_present_ire)) + return false; + if (!this.ire.equals(that.ire)) + return false; + } + + boolean this_present_ue = true && this.isSetUe(); + boolean that_present_ue = true && that.isSetUe(); + if (this_present_ue || that_present_ue) { + if (!(this_present_ue && that_present_ue)) + return false; + if (!this.ue.equals(that.ue)) + return false; + } + + boolean this_present_te = true && this.isSetTe(); + boolean that_present_te = true && that.isSetTe(); + if (this_present_te || that_present_te) { + if (!(this_present_te && that_present_te)) + return false; + if (!this.te.equals(that.te)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_ire = true && (isSetIre()); + builder.append(present_ire); + if (present_ire) + builder.append(ire); + + boolean present_ue = true && (isSetUe()); + builder.append(present_ue); + if (present_ue) + builder.append(ue); + + boolean present_te = true && (isSetTe()); + builder.append(present_te); + if (present_te) + builder.append(te); + + return builder.toHashCode(); + } + + public int compareTo(add_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + add_result typedOther = (add_result)other; + + lastComparison = Boolean.valueOf(isSetIre()).compareTo(typedOther.isSetIre()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIre()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ire, typedOther.ire); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUe()).compareTo(typedOther.isSetUe()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUe()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ue, typedOther.ue); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTe()).compareTo(typedOther.isSetTe()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTe()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.te, typedOther.te); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (field.id) { + case 1: // IRE + if (field.type == org.apache.thrift.protocol.TType.STRUCT) { + this.ire = new InvalidRequestException(); + this.ire.read(iprot); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // UE + if (field.type == org.apache.thrift.protocol.TType.STRUCT) { + this.ue = new UnavailableException(); + this.ue.read(iprot); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // TE + if (field.type == org.apache.thrift.protocol.TType.STRUCT) { + this.te = new TimedOutException(); + this.te.read(iprot); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetIre()) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + this.ire.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetUe()) { + oprot.writeFieldBegin(UE_FIELD_DESC); + this.ue.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetTe()) { + oprot.writeFieldBegin(TE_FIELD_DESC); + this.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("add_result("); + boolean first = true; + + sb.append("ire:"); + if (this.ire == null) { + sb.append("null"); + } else { + sb.append(this.ire); + } + first = false; + if (!first) sb.append(", "); + sb.append("ue:"); + if (this.ue == null) { + sb.append("null"); + } else { + sb.append(this.ue); + } + first = false; + if (!first) sb.append(", "); + sb.append("te:"); + if (this.te == null) { + sb.append("null"); + } else { + sb.append(this.te); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + } + public static class remove_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("remove_args"); @@ -16354,6 +17041,8 @@ public class Cassandra { private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bit_vector = new BitSet(1); read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); @@ -16854,6 +17543,1030 @@ public class Cassandra { } + public static class remove_counter_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("remove_counter_args"); + + private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)3); + + public ByteBuffer key; + public ColumnPath path; + /** + * + * @see ConsistencyLevel + */ + public ConsistencyLevel consistency_level; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + KEY((short)1, "key"), + PATH((short)2, "path"), + /** + * + * @see ConsistencyLevel + */ + CONSISTENCY_LEVEL((short)3, "consistency_level"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // KEY + return KEY; + case 2: // PATH + return PATH; + case 3: // CONSISTENCY_LEVEL + return CONSISTENCY_LEVEL; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ColumnPath.class))); + tmpMap.put(_Fields.CONSISTENCY_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("consistency_level", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ConsistencyLevel.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(remove_counter_args.class, metaDataMap); + } + + public remove_counter_args() { + this.consistency_level = org.apache.cassandra.thrift.ConsistencyLevel.ONE; + + } + + public remove_counter_args( + ByteBuffer key, + ColumnPath path, + ConsistencyLevel consistency_level) + { + this(); + this.key = key; + this.path = path; + this.consistency_level = consistency_level; + } + + /** + * Performs a deep copy on other. + */ + public remove_counter_args(remove_counter_args other) { + if (other.isSetKey()) { + this.key = org.apache.thrift.TBaseHelper.copyBinary(other.key); +; + } + if (other.isSetPath()) { + this.path = new ColumnPath(other.path); + } + if (other.isSetConsistency_level()) { + this.consistency_level = other.consistency_level; + } + } + + public remove_counter_args deepCopy() { + return new remove_counter_args(this); + } + + @Override + public void clear() { + this.key = null; + this.path = null; + this.consistency_level = org.apache.cassandra.thrift.ConsistencyLevel.ONE; + + } + + public byte[] getKey() { + setKey(org.apache.thrift.TBaseHelper.rightSize(key)); + return key == null ? null : key.array(); + } + + public ByteBuffer bufferForKey() { + return key; + } + + public remove_counter_args setKey(byte[] key) { + setKey(key == null ? (ByteBuffer)null : ByteBuffer.wrap(key)); + return this; + } + + public remove_counter_args setKey(ByteBuffer key) { + this.key = key; + return this; + } + + public void unsetKey() { + this.key = null; + } + + /** Returns true if field key is set (has been assigned a value) and false otherwise */ + public boolean isSetKey() { + return this.key != null; + } + + public void setKeyIsSet(boolean value) { + if (!value) { + this.key = null; + } + } + + public ColumnPath getPath() { + return this.path; + } + + public remove_counter_args setPath(ColumnPath path) { + this.path = path; + return this; + } + + public void unsetPath() { + this.path = null; + } + + /** Returns true if field path is set (has been assigned a value) and false otherwise */ + public boolean isSetPath() { + return this.path != null; + } + + public void setPathIsSet(boolean value) { + if (!value) { + this.path = null; + } + } + + /** + * + * @see ConsistencyLevel + */ + public ConsistencyLevel getConsistency_level() { + return this.consistency_level; + } + + /** + * + * @see ConsistencyLevel + */ + public remove_counter_args setConsistency_level(ConsistencyLevel consistency_level) { + this.consistency_level = consistency_level; + return this; + } + + public void unsetConsistency_level() { + this.consistency_level = null; + } + + /** Returns true if field consistency_level is set (has been assigned a value) and false otherwise */ + public boolean isSetConsistency_level() { + return this.consistency_level != null; + } + + public void setConsistency_levelIsSet(boolean value) { + if (!value) { + this.consistency_level = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case KEY: + if (value == null) { + unsetKey(); + } else { + setKey((ByteBuffer)value); + } + break; + + case PATH: + if (value == null) { + unsetPath(); + } else { + setPath((ColumnPath)value); + } + break; + + case CONSISTENCY_LEVEL: + if (value == null) { + unsetConsistency_level(); + } else { + setConsistency_level((ConsistencyLevel)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case KEY: + return getKey(); + + case PATH: + return getPath(); + + case CONSISTENCY_LEVEL: + return getConsistency_level(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case KEY: + return isSetKey(); + case PATH: + return isSetPath(); + case CONSISTENCY_LEVEL: + return isSetConsistency_level(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof remove_counter_args) + return this.equals((remove_counter_args)that); + return false; + } + + public boolean equals(remove_counter_args that) { + if (that == null) + return false; + + boolean this_present_key = true && this.isSetKey(); + boolean that_present_key = true && that.isSetKey(); + if (this_present_key || that_present_key) { + if (!(this_present_key && that_present_key)) + return false; + if (!this.key.equals(that.key)) + return false; + } + + boolean this_present_path = true && this.isSetPath(); + boolean that_present_path = true && that.isSetPath(); + if (this_present_path || that_present_path) { + if (!(this_present_path && that_present_path)) + return false; + if (!this.path.equals(that.path)) + return false; + } + + boolean this_present_consistency_level = true && this.isSetConsistency_level(); + boolean that_present_consistency_level = true && that.isSetConsistency_level(); + if (this_present_consistency_level || that_present_consistency_level) { + if (!(this_present_consistency_level && that_present_consistency_level)) + return false; + if (!this.consistency_level.equals(that.consistency_level)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_key = true && (isSetKey()); + builder.append(present_key); + if (present_key) + builder.append(key); + + boolean present_path = true && (isSetPath()); + builder.append(present_path); + if (present_path) + builder.append(path); + + boolean present_consistency_level = true && (isSetConsistency_level()); + builder.append(present_consistency_level); + if (present_consistency_level) + builder.append(consistency_level.getValue()); + + return builder.toHashCode(); + } + + public int compareTo(remove_counter_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + remove_counter_args typedOther = (remove_counter_args)other; + + lastComparison = Boolean.valueOf(isSetKey()).compareTo(typedOther.isSetKey()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKey()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, typedOther.key); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPath()).compareTo(typedOther.isSetPath()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPath()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, typedOther.path); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetConsistency_level()).compareTo(typedOther.isSetConsistency_level()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetConsistency_level()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.consistency_level, typedOther.consistency_level); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (field.id) { + case 1: // KEY + if (field.type == org.apache.thrift.protocol.TType.STRING) { + this.key = iprot.readBinary(); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // PATH + if (field.type == org.apache.thrift.protocol.TType.STRUCT) { + this.path = new ColumnPath(); + this.path.read(iprot); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // CONSISTENCY_LEVEL + if (field.type == org.apache.thrift.protocol.TType.I32) { + this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.key != null) { + oprot.writeFieldBegin(KEY_FIELD_DESC); + oprot.writeBinary(this.key); + oprot.writeFieldEnd(); + } + if (this.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + this.path.write(oprot); + oprot.writeFieldEnd(); + } + if (this.consistency_level != null) { + oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); + oprot.writeI32(this.consistency_level.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("remove_counter_args("); + boolean first = true; + + sb.append("key:"); + if (this.key == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.key, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("path:"); + if (this.path == null) { + sb.append("null"); + } else { + sb.append(this.path); + } + first = false; + if (!first) sb.append(", "); + sb.append("consistency_level:"); + if (this.consistency_level == null) { + sb.append("null"); + } else { + sb.append(this.consistency_level); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (key == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'key' was not present! Struct: " + toString()); + } + if (path == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'path' was not present! Struct: " + toString()); + } + if (consistency_level == null) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + } + + public static class remove_counter_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("remove_counter_result"); + + private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); + + public InvalidRequestException ire; + public UnavailableException ue; + public TimedOutException te; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + IRE((short)1, "ire"), + UE((short)2, "ue"), + TE((short)3, "te"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // IRE + return IRE; + case 2: // UE + return UE; + case 3: // TE + return TE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.IRE, new org.apache.thrift.meta_data.FieldMetaData("ire", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.UE, new org.apache.thrift.meta_data.FieldMetaData("ue", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.TE, new org.apache.thrift.meta_data.FieldMetaData("te", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(remove_counter_result.class, metaDataMap); + } + + public remove_counter_result() { + } + + public remove_counter_result( + InvalidRequestException ire, + UnavailableException ue, + TimedOutException te) + { + this(); + this.ire = ire; + this.ue = ue; + this.te = te; + } + + /** + * Performs a deep copy on other. + */ + public remove_counter_result(remove_counter_result other) { + if (other.isSetIre()) { + this.ire = new InvalidRequestException(other.ire); + } + if (other.isSetUe()) { + this.ue = new UnavailableException(other.ue); + } + if (other.isSetTe()) { + this.te = new TimedOutException(other.te); + } + } + + public remove_counter_result deepCopy() { + return new remove_counter_result(this); + } + + @Override + public void clear() { + this.ire = null; + this.ue = null; + this.te = null; + } + + public InvalidRequestException getIre() { + return this.ire; + } + + public remove_counter_result setIre(InvalidRequestException ire) { + this.ire = ire; + return this; + } + + public void unsetIre() { + this.ire = null; + } + + /** Returns true if field ire is set (has been assigned a value) and false otherwise */ + public boolean isSetIre() { + return this.ire != null; + } + + public void setIreIsSet(boolean value) { + if (!value) { + this.ire = null; + } + } + + public UnavailableException getUe() { + return this.ue; + } + + public remove_counter_result setUe(UnavailableException ue) { + this.ue = ue; + return this; + } + + public void unsetUe() { + this.ue = null; + } + + /** Returns true if field ue is set (has been assigned a value) and false otherwise */ + public boolean isSetUe() { + return this.ue != null; + } + + public void setUeIsSet(boolean value) { + if (!value) { + this.ue = null; + } + } + + public TimedOutException getTe() { + return this.te; + } + + public remove_counter_result setTe(TimedOutException te) { + this.te = te; + return this; + } + + public void unsetTe() { + this.te = null; + } + + /** Returns true if field te is set (has been assigned a value) and false otherwise */ + public boolean isSetTe() { + return this.te != null; + } + + public void setTeIsSet(boolean value) { + if (!value) { + this.te = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case IRE: + if (value == null) { + unsetIre(); + } else { + setIre((InvalidRequestException)value); + } + break; + + case UE: + if (value == null) { + unsetUe(); + } else { + setUe((UnavailableException)value); + } + break; + + case TE: + if (value == null) { + unsetTe(); + } else { + setTe((TimedOutException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case IRE: + return getIre(); + + case UE: + return getUe(); + + case TE: + return getTe(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case IRE: + return isSetIre(); + case UE: + return isSetUe(); + case TE: + return isSetTe(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof remove_counter_result) + return this.equals((remove_counter_result)that); + return false; + } + + public boolean equals(remove_counter_result that) { + if (that == null) + return false; + + boolean this_present_ire = true && this.isSetIre(); + boolean that_present_ire = true && that.isSetIre(); + if (this_present_ire || that_present_ire) { + if (!(this_present_ire && that_present_ire)) + return false; + if (!this.ire.equals(that.ire)) + return false; + } + + boolean this_present_ue = true && this.isSetUe(); + boolean that_present_ue = true && that.isSetUe(); + if (this_present_ue || that_present_ue) { + if (!(this_present_ue && that_present_ue)) + return false; + if (!this.ue.equals(that.ue)) + return false; + } + + boolean this_present_te = true && this.isSetTe(); + boolean that_present_te = true && that.isSetTe(); + if (this_present_te || that_present_te) { + if (!(this_present_te && that_present_te)) + return false; + if (!this.te.equals(that.te)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_ire = true && (isSetIre()); + builder.append(present_ire); + if (present_ire) + builder.append(ire); + + boolean present_ue = true && (isSetUe()); + builder.append(present_ue); + if (present_ue) + builder.append(ue); + + boolean present_te = true && (isSetTe()); + builder.append(present_te); + if (present_te) + builder.append(te); + + return builder.toHashCode(); + } + + public int compareTo(remove_counter_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + remove_counter_result typedOther = (remove_counter_result)other; + + lastComparison = Boolean.valueOf(isSetIre()).compareTo(typedOther.isSetIre()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIre()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ire, typedOther.ire); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUe()).compareTo(typedOther.isSetUe()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUe()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ue, typedOther.ue); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTe()).compareTo(typedOther.isSetTe()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTe()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.te, typedOther.te); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (field.id) { + case 1: // IRE + if (field.type == org.apache.thrift.protocol.TType.STRUCT) { + this.ire = new InvalidRequestException(); + this.ire.read(iprot); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // UE + if (field.type == org.apache.thrift.protocol.TType.STRUCT) { + this.ue = new UnavailableException(); + this.ue.read(iprot); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // TE + if (field.type == org.apache.thrift.protocol.TType.STRUCT) { + this.te = new TimedOutException(); + this.te.read(iprot); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + oprot.writeStructBegin(STRUCT_DESC); + + if (this.isSetIre()) { + oprot.writeFieldBegin(IRE_FIELD_DESC); + this.ire.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetUe()) { + oprot.writeFieldBegin(UE_FIELD_DESC); + this.ue.write(oprot); + oprot.writeFieldEnd(); + } else if (this.isSetTe()) { + oprot.writeFieldBegin(TE_FIELD_DESC); + this.te.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("remove_counter_result("); + boolean first = true; + + sb.append("ire:"); + if (this.ire == null) { + sb.append("null"); + } else { + sb.append(this.ire); + } + first = false; + if (!first) sb.append(", "); + sb.append("ue:"); + if (this.ue == null) { + sb.append("null"); + } else { + sb.append(this.ue); + } + first = false; + if (!first) sb.append(", "); + sb.append("te:"); + if (this.te == null) { + sb.append("null"); + } else { + sb.append(this.te); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + } + public static class batch_mutate_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("batch_mutate_args"); @@ -18575,5928 +20288,6 @@ public class Cassandra { } - public static class add_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("add_args"); - - private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField COLUMN_PARENT_FIELD_DESC = new org.apache.thrift.protocol.TField("column_parent", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)4); - - public ByteBuffer key; - public ColumnParent column_parent; - public CounterColumn column; - /** - * - * @see ConsistencyLevel - */ - public ConsistencyLevel consistency_level; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - KEY((short)1, "key"), - COLUMN_PARENT((short)2, "column_parent"), - COLUMN((short)3, "column"), - /** - * - * @see ConsistencyLevel - */ - CONSISTENCY_LEVEL((short)4, "consistency_level"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // KEY - return KEY; - case 2: // COLUMN_PARENT - return COLUMN_PARENT; - case 3: // COLUMN - return COLUMN; - case 4: // CONSISTENCY_LEVEL - return CONSISTENCY_LEVEL; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - tmpMap.put(_Fields.COLUMN_PARENT, new org.apache.thrift.meta_data.FieldMetaData("column_parent", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ColumnParent.class))); - tmpMap.put(_Fields.COLUMN, new org.apache.thrift.meta_data.FieldMetaData("column", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CounterColumn.class))); - tmpMap.put(_Fields.CONSISTENCY_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("consistency_level", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ConsistencyLevel.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(add_args.class, metaDataMap); - } - - public add_args() { - this.consistency_level = org.apache.cassandra.thrift.ConsistencyLevel.ONE; - - } - - public add_args( - ByteBuffer key, - ColumnParent column_parent, - CounterColumn column, - ConsistencyLevel consistency_level) - { - this(); - this.key = key; - this.column_parent = column_parent; - this.column = column; - this.consistency_level = consistency_level; - } - - /** - * Performs a deep copy on other. - */ - public add_args(add_args other) { - if (other.isSetKey()) { - this.key = org.apache.thrift.TBaseHelper.copyBinary(other.key); -; - } - if (other.isSetColumn_parent()) { - this.column_parent = new ColumnParent(other.column_parent); - } - if (other.isSetColumn()) { - this.column = new CounterColumn(other.column); - } - if (other.isSetConsistency_level()) { - this.consistency_level = other.consistency_level; - } - } - - public add_args deepCopy() { - return new add_args(this); - } - - @Override - public void clear() { - this.key = null; - this.column_parent = null; - this.column = null; - this.consistency_level = org.apache.cassandra.thrift.ConsistencyLevel.ONE; - - } - - public byte[] getKey() { - setKey(org.apache.thrift.TBaseHelper.rightSize(key)); - return key == null ? null : key.array(); - } - - public ByteBuffer bufferForKey() { - return key; - } - - public add_args setKey(byte[] key) { - setKey(key == null ? (ByteBuffer)null : ByteBuffer.wrap(key)); - return this; - } - - public add_args setKey(ByteBuffer key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - /** Returns true if field key is set (has been assigned a value) and false otherwise */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - public ColumnParent getColumn_parent() { - return this.column_parent; - } - - public add_args setColumn_parent(ColumnParent column_parent) { - this.column_parent = column_parent; - return this; - } - - public void unsetColumn_parent() { - this.column_parent = null; - } - - /** Returns true if field column_parent is set (has been assigned a value) and false otherwise */ - public boolean isSetColumn_parent() { - return this.column_parent != null; - } - - public void setColumn_parentIsSet(boolean value) { - if (!value) { - this.column_parent = null; - } - } - - public CounterColumn getColumn() { - return this.column; - } - - public add_args setColumn(CounterColumn column) { - this.column = column; - return this; - } - - public void unsetColumn() { - this.column = null; - } - - /** Returns true if field column is set (has been assigned a value) and false otherwise */ - public boolean isSetColumn() { - return this.column != null; - } - - public void setColumnIsSet(boolean value) { - if (!value) { - this.column = null; - } - } - - /** - * - * @see ConsistencyLevel - */ - public ConsistencyLevel getConsistency_level() { - return this.consistency_level; - } - - /** - * - * @see ConsistencyLevel - */ - public add_args setConsistency_level(ConsistencyLevel consistency_level) { - this.consistency_level = consistency_level; - return this; - } - - public void unsetConsistency_level() { - this.consistency_level = null; - } - - /** Returns true if field consistency_level is set (has been assigned a value) and false otherwise */ - public boolean isSetConsistency_level() { - return this.consistency_level != null; - } - - public void setConsistency_levelIsSet(boolean value) { - if (!value) { - this.consistency_level = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case KEY: - if (value == null) { - unsetKey(); - } else { - setKey((ByteBuffer)value); - } - break; - - case COLUMN_PARENT: - if (value == null) { - unsetColumn_parent(); - } else { - setColumn_parent((ColumnParent)value); - } - break; - - case COLUMN: - if (value == null) { - unsetColumn(); - } else { - setColumn((CounterColumn)value); - } - break; - - case CONSISTENCY_LEVEL: - if (value == null) { - unsetConsistency_level(); - } else { - setConsistency_level((ConsistencyLevel)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case KEY: - return getKey(); - - case COLUMN_PARENT: - return getColumn_parent(); - - case COLUMN: - return getColumn(); - - case CONSISTENCY_LEVEL: - return getConsistency_level(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case KEY: - return isSetKey(); - case COLUMN_PARENT: - return isSetColumn_parent(); - case COLUMN: - return isSetColumn(); - case CONSISTENCY_LEVEL: - return isSetConsistency_level(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof add_args) - return this.equals((add_args)that); - return false; - } - - public boolean equals(add_args that) { - if (that == null) - return false; - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) - return false; - if (!this.key.equals(that.key)) - return false; - } - - boolean this_present_column_parent = true && this.isSetColumn_parent(); - boolean that_present_column_parent = true && that.isSetColumn_parent(); - if (this_present_column_parent || that_present_column_parent) { - if (!(this_present_column_parent && that_present_column_parent)) - return false; - if (!this.column_parent.equals(that.column_parent)) - return false; - } - - boolean this_present_column = true && this.isSetColumn(); - boolean that_present_column = true && that.isSetColumn(); - if (this_present_column || that_present_column) { - if (!(this_present_column && that_present_column)) - return false; - if (!this.column.equals(that.column)) - return false; - } - - boolean this_present_consistency_level = true && this.isSetConsistency_level(); - boolean that_present_consistency_level = true && that.isSetConsistency_level(); - if (this_present_consistency_level || that_present_consistency_level) { - if (!(this_present_consistency_level && that_present_consistency_level)) - return false; - if (!this.consistency_level.equals(that.consistency_level)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_key = true && (isSetKey()); - builder.append(present_key); - if (present_key) - builder.append(key); - - boolean present_column_parent = true && (isSetColumn_parent()); - builder.append(present_column_parent); - if (present_column_parent) - builder.append(column_parent); - - boolean present_column = true && (isSetColumn()); - builder.append(present_column); - if (present_column) - builder.append(column); - - boolean present_consistency_level = true && (isSetConsistency_level()); - builder.append(present_consistency_level); - if (present_consistency_level) - builder.append(consistency_level.getValue()); - - return builder.toHashCode(); - } - - public int compareTo(add_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - add_args typedOther = (add_args)other; - - lastComparison = Boolean.valueOf(isSetKey()).compareTo(typedOther.isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, typedOther.key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetColumn_parent()).compareTo(typedOther.isSetColumn_parent()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumn_parent()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column_parent, typedOther.column_parent); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetColumn()).compareTo(typedOther.isSetColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column, typedOther.column); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetConsistency_level()).compareTo(typedOther.isSetConsistency_level()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetConsistency_level()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.consistency_level, typedOther.consistency_level); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.key = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COLUMN_PARENT - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column_parent = new ColumnParent(); - this.column_parent.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // COLUMN - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column = new CounterColumn(); - this.column.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeBinary(this.key); - oprot.writeFieldEnd(); - } - if (this.column_parent != null) { - oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); - this.column_parent.write(oprot); - oprot.writeFieldEnd(); - } - if (this.column != null) { - oprot.writeFieldBegin(COLUMN_FIELD_DESC); - this.column.write(oprot); - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("add_args("); - boolean first = true; - - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.key, sb); - } - first = false; - if (!first) sb.append(", "); - sb.append("column_parent:"); - if (this.column_parent == null) { - sb.append("null"); - } else { - sb.append(this.column_parent); - } - first = false; - if (!first) sb.append(", "); - sb.append("column:"); - if (this.column == null) { - sb.append("null"); - } else { - sb.append(this.column); - } - first = false; - if (!first) sb.append(", "); - sb.append("consistency_level:"); - if (this.consistency_level == null) { - sb.append("null"); - } else { - sb.append(this.consistency_level); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (key == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'key' was not present! Struct: " + toString()); - } - if (column_parent == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'column_parent' was not present! Struct: " + toString()); - } - if (column == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'column' was not present! Struct: " + toString()); - } - if (consistency_level == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - } - - public static class add_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("add_result"); - - private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); - - public InvalidRequestException ire; - public UnavailableException ue; - public TimedOutException te; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - IRE((short)1, "ire"), - UE((short)2, "ue"), - TE((short)3, "te"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // IRE - return IRE; - case 2: // UE - return UE; - case 3: // TE - return TE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.IRE, new org.apache.thrift.meta_data.FieldMetaData("ire", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - tmpMap.put(_Fields.UE, new org.apache.thrift.meta_data.FieldMetaData("ue", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - tmpMap.put(_Fields.TE, new org.apache.thrift.meta_data.FieldMetaData("te", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(add_result.class, metaDataMap); - } - - public add_result() { - } - - public add_result( - InvalidRequestException ire, - UnavailableException ue, - TimedOutException te) - { - this(); - this.ire = ire; - this.ue = ue; - this.te = te; - } - - /** - * Performs a deep copy on other. - */ - public add_result(add_result other) { - if (other.isSetIre()) { - this.ire = new InvalidRequestException(other.ire); - } - if (other.isSetUe()) { - this.ue = new UnavailableException(other.ue); - } - if (other.isSetTe()) { - this.te = new TimedOutException(other.te); - } - } - - public add_result deepCopy() { - return new add_result(this); - } - - @Override - public void clear() { - this.ire = null; - this.ue = null; - this.te = null; - } - - public InvalidRequestException getIre() { - return this.ire; - } - - public add_result setIre(InvalidRequestException ire) { - this.ire = ire; - return this; - } - - public void unsetIre() { - this.ire = null; - } - - /** Returns true if field ire is set (has been assigned a value) and false otherwise */ - public boolean isSetIre() { - return this.ire != null; - } - - public void setIreIsSet(boolean value) { - if (!value) { - this.ire = null; - } - } - - public UnavailableException getUe() { - return this.ue; - } - - public add_result setUe(UnavailableException ue) { - this.ue = ue; - return this; - } - - public void unsetUe() { - this.ue = null; - } - - /** Returns true if field ue is set (has been assigned a value) and false otherwise */ - public boolean isSetUe() { - return this.ue != null; - } - - public void setUeIsSet(boolean value) { - if (!value) { - this.ue = null; - } - } - - public TimedOutException getTe() { - return this.te; - } - - public add_result setTe(TimedOutException te) { - this.te = te; - return this; - } - - public void unsetTe() { - this.te = null; - } - - /** Returns true if field te is set (has been assigned a value) and false otherwise */ - public boolean isSetTe() { - return this.te != null; - } - - public void setTeIsSet(boolean value) { - if (!value) { - this.te = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case IRE: - if (value == null) { - unsetIre(); - } else { - setIre((InvalidRequestException)value); - } - break; - - case UE: - if (value == null) { - unsetUe(); - } else { - setUe((UnavailableException)value); - } - break; - - case TE: - if (value == null) { - unsetTe(); - } else { - setTe((TimedOutException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case IRE: - return getIre(); - - case UE: - return getUe(); - - case TE: - return getTe(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case IRE: - return isSetIre(); - case UE: - return isSetUe(); - case TE: - return isSetTe(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof add_result) - return this.equals((add_result)that); - return false; - } - - public boolean equals(add_result that) { - if (that == null) - return false; - - boolean this_present_ire = true && this.isSetIre(); - boolean that_present_ire = true && that.isSetIre(); - if (this_present_ire || that_present_ire) { - if (!(this_present_ire && that_present_ire)) - return false; - if (!this.ire.equals(that.ire)) - return false; - } - - boolean this_present_ue = true && this.isSetUe(); - boolean that_present_ue = true && that.isSetUe(); - if (this_present_ue || that_present_ue) { - if (!(this_present_ue && that_present_ue)) - return false; - if (!this.ue.equals(that.ue)) - return false; - } - - boolean this_present_te = true && this.isSetTe(); - boolean that_present_te = true && that.isSetTe(); - if (this_present_te || that_present_te) { - if (!(this_present_te && that_present_te)) - return false; - if (!this.te.equals(that.te)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_ire = true && (isSetIre()); - builder.append(present_ire); - if (present_ire) - builder.append(ire); - - boolean present_ue = true && (isSetUe()); - builder.append(present_ue); - if (present_ue) - builder.append(ue); - - boolean present_te = true && (isSetTe()); - builder.append(present_te); - if (present_te) - builder.append(te); - - return builder.toHashCode(); - } - - public int compareTo(add_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - add_result typedOther = (add_result)other; - - lastComparison = Boolean.valueOf(isSetIre()).compareTo(typedOther.isSetIre()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIre()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ire, typedOther.ire); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUe()).compareTo(typedOther.isSetUe()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUe()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ue, typedOther.ue); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTe()).compareTo(typedOther.isSetTe()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTe()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.te, typedOther.te); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("add_result("); - boolean first = true; - - sb.append("ire:"); - if (this.ire == null) { - sb.append("null"); - } else { - sb.append(this.ire); - } - first = false; - if (!first) sb.append(", "); - sb.append("ue:"); - if (this.ue == null) { - sb.append("null"); - } else { - sb.append(this.ue); - } - first = false; - if (!first) sb.append(", "); - sb.append("te:"); - if (this.te == null) { - sb.append("null"); - } else { - sb.append(this.te); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - } - - public static class get_counter_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("get_counter_args"); - - private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)3); - - public ByteBuffer key; - public ColumnPath path; - /** - * - * @see ConsistencyLevel - */ - public ConsistencyLevel consistency_level; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - KEY((short)1, "key"), - PATH((short)2, "path"), - /** - * - * @see ConsistencyLevel - */ - CONSISTENCY_LEVEL((short)3, "consistency_level"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // KEY - return KEY; - case 2: // PATH - return PATH; - case 3: // CONSISTENCY_LEVEL - return CONSISTENCY_LEVEL; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ColumnPath.class))); - tmpMap.put(_Fields.CONSISTENCY_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("consistency_level", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ConsistencyLevel.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_counter_args.class, metaDataMap); - } - - public get_counter_args() { - this.consistency_level = org.apache.cassandra.thrift.ConsistencyLevel.ONE; - - } - - public get_counter_args( - ByteBuffer key, - ColumnPath path, - ConsistencyLevel consistency_level) - { - this(); - this.key = key; - this.path = path; - this.consistency_level = consistency_level; - } - - /** - * Performs a deep copy on other. - */ - public get_counter_args(get_counter_args other) { - if (other.isSetKey()) { - this.key = org.apache.thrift.TBaseHelper.copyBinary(other.key); -; - } - if (other.isSetPath()) { - this.path = new ColumnPath(other.path); - } - if (other.isSetConsistency_level()) { - this.consistency_level = other.consistency_level; - } - } - - public get_counter_args deepCopy() { - return new get_counter_args(this); - } - - @Override - public void clear() { - this.key = null; - this.path = null; - this.consistency_level = org.apache.cassandra.thrift.ConsistencyLevel.ONE; - - } - - public byte[] getKey() { - setKey(org.apache.thrift.TBaseHelper.rightSize(key)); - return key == null ? null : key.array(); - } - - public ByteBuffer bufferForKey() { - return key; - } - - public get_counter_args setKey(byte[] key) { - setKey(key == null ? (ByteBuffer)null : ByteBuffer.wrap(key)); - return this; - } - - public get_counter_args setKey(ByteBuffer key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - /** Returns true if field key is set (has been assigned a value) and false otherwise */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - public ColumnPath getPath() { - return this.path; - } - - public get_counter_args setPath(ColumnPath path) { - this.path = path; - return this; - } - - public void unsetPath() { - this.path = null; - } - - /** Returns true if field path is set (has been assigned a value) and false otherwise */ - public boolean isSetPath() { - return this.path != null; - } - - public void setPathIsSet(boolean value) { - if (!value) { - this.path = null; - } - } - - /** - * - * @see ConsistencyLevel - */ - public ConsistencyLevel getConsistency_level() { - return this.consistency_level; - } - - /** - * - * @see ConsistencyLevel - */ - public get_counter_args setConsistency_level(ConsistencyLevel consistency_level) { - this.consistency_level = consistency_level; - return this; - } - - public void unsetConsistency_level() { - this.consistency_level = null; - } - - /** Returns true if field consistency_level is set (has been assigned a value) and false otherwise */ - public boolean isSetConsistency_level() { - return this.consistency_level != null; - } - - public void setConsistency_levelIsSet(boolean value) { - if (!value) { - this.consistency_level = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case KEY: - if (value == null) { - unsetKey(); - } else { - setKey((ByteBuffer)value); - } - break; - - case PATH: - if (value == null) { - unsetPath(); - } else { - setPath((ColumnPath)value); - } - break; - - case CONSISTENCY_LEVEL: - if (value == null) { - unsetConsistency_level(); - } else { - setConsistency_level((ConsistencyLevel)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case KEY: - return getKey(); - - case PATH: - return getPath(); - - case CONSISTENCY_LEVEL: - return getConsistency_level(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case KEY: - return isSetKey(); - case PATH: - return isSetPath(); - case CONSISTENCY_LEVEL: - return isSetConsistency_level(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof get_counter_args) - return this.equals((get_counter_args)that); - return false; - } - - public boolean equals(get_counter_args that) { - if (that == null) - return false; - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) - return false; - if (!this.key.equals(that.key)) - return false; - } - - boolean this_present_path = true && this.isSetPath(); - boolean that_present_path = true && that.isSetPath(); - if (this_present_path || that_present_path) { - if (!(this_present_path && that_present_path)) - return false; - if (!this.path.equals(that.path)) - return false; - } - - boolean this_present_consistency_level = true && this.isSetConsistency_level(); - boolean that_present_consistency_level = true && that.isSetConsistency_level(); - if (this_present_consistency_level || that_present_consistency_level) { - if (!(this_present_consistency_level && that_present_consistency_level)) - return false; - if (!this.consistency_level.equals(that.consistency_level)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_key = true && (isSetKey()); - builder.append(present_key); - if (present_key) - builder.append(key); - - boolean present_path = true && (isSetPath()); - builder.append(present_path); - if (present_path) - builder.append(path); - - boolean present_consistency_level = true && (isSetConsistency_level()); - builder.append(present_consistency_level); - if (present_consistency_level) - builder.append(consistency_level.getValue()); - - return builder.toHashCode(); - } - - public int compareTo(get_counter_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - get_counter_args typedOther = (get_counter_args)other; - - lastComparison = Boolean.valueOf(isSetKey()).compareTo(typedOther.isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, typedOther.key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPath()).compareTo(typedOther.isSetPath()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPath()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, typedOther.path); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetConsistency_level()).compareTo(typedOther.isSetConsistency_level()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetConsistency_level()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.consistency_level, typedOther.consistency_level); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.key = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.path = new ColumnPath(); - this.path.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeBinary(this.key); - oprot.writeFieldEnd(); - } - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - this.path.write(oprot); - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("get_counter_args("); - boolean first = true; - - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.key, sb); - } - first = false; - if (!first) sb.append(", "); - sb.append("path:"); - if (this.path == null) { - sb.append("null"); - } else { - sb.append(this.path); - } - first = false; - if (!first) sb.append(", "); - sb.append("consistency_level:"); - if (this.consistency_level == null) { - sb.append("null"); - } else { - sb.append(this.consistency_level); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (key == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'key' was not present! Struct: " + toString()); - } - if (path == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'path' was not present! Struct: " + toString()); - } - if (consistency_level == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - } - - public static class get_counter_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("get_counter_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField NFE_FIELD_DESC = new org.apache.thrift.protocol.TField("nfe", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)4); - - public Counter success; - public InvalidRequestException ire; - public NotFoundException nfe; - public UnavailableException ue; - public TimedOutException te; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"), - IRE((short)1, "ire"), - NFE((short)2, "nfe"), - UE((short)3, "ue"), - TE((short)4, "te"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - case 1: // IRE - return IRE; - case 2: // NFE - return NFE; - case 3: // UE - return UE; - case 4: // TE - return TE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Counter.class))); - tmpMap.put(_Fields.IRE, new org.apache.thrift.meta_data.FieldMetaData("ire", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - tmpMap.put(_Fields.NFE, new org.apache.thrift.meta_data.FieldMetaData("nfe", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - tmpMap.put(_Fields.UE, new org.apache.thrift.meta_data.FieldMetaData("ue", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - tmpMap.put(_Fields.TE, new org.apache.thrift.meta_data.FieldMetaData("te", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_counter_result.class, metaDataMap); - } - - public get_counter_result() { - } - - public get_counter_result( - Counter success, - InvalidRequestException ire, - NotFoundException nfe, - UnavailableException ue, - TimedOutException te) - { - this(); - this.success = success; - this.ire = ire; - this.nfe = nfe; - this.ue = ue; - this.te = te; - } - - /** - * Performs a deep copy on other. - */ - public get_counter_result(get_counter_result other) { - if (other.isSetSuccess()) { - this.success = new Counter(other.success); - } - if (other.isSetIre()) { - this.ire = new InvalidRequestException(other.ire); - } - if (other.isSetNfe()) { - this.nfe = new NotFoundException(other.nfe); - } - if (other.isSetUe()) { - this.ue = new UnavailableException(other.ue); - } - if (other.isSetTe()) { - this.te = new TimedOutException(other.te); - } - } - - public get_counter_result deepCopy() { - return new get_counter_result(this); - } - - @Override - public void clear() { - this.success = null; - this.ire = null; - this.nfe = null; - this.ue = null; - this.te = null; - } - - public Counter getSuccess() { - return this.success; - } - - public get_counter_result setSuccess(Counter success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public InvalidRequestException getIre() { - return this.ire; - } - - public get_counter_result setIre(InvalidRequestException ire) { - this.ire = ire; - return this; - } - - public void unsetIre() { - this.ire = null; - } - - /** Returns true if field ire is set (has been assigned a value) and false otherwise */ - public boolean isSetIre() { - return this.ire != null; - } - - public void setIreIsSet(boolean value) { - if (!value) { - this.ire = null; - } - } - - public NotFoundException getNfe() { - return this.nfe; - } - - public get_counter_result setNfe(NotFoundException nfe) { - this.nfe = nfe; - return this; - } - - public void unsetNfe() { - this.nfe = null; - } - - /** Returns true if field nfe is set (has been assigned a value) and false otherwise */ - public boolean isSetNfe() { - return this.nfe != null; - } - - public void setNfeIsSet(boolean value) { - if (!value) { - this.nfe = null; - } - } - - public UnavailableException getUe() { - return this.ue; - } - - public get_counter_result setUe(UnavailableException ue) { - this.ue = ue; - return this; - } - - public void unsetUe() { - this.ue = null; - } - - /** Returns true if field ue is set (has been assigned a value) and false otherwise */ - public boolean isSetUe() { - return this.ue != null; - } - - public void setUeIsSet(boolean value) { - if (!value) { - this.ue = null; - } - } - - public TimedOutException getTe() { - return this.te; - } - - public get_counter_result setTe(TimedOutException te) { - this.te = te; - return this; - } - - public void unsetTe() { - this.te = null; - } - - /** Returns true if field te is set (has been assigned a value) and false otherwise */ - public boolean isSetTe() { - return this.te != null; - } - - public void setTeIsSet(boolean value) { - if (!value) { - this.te = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Counter)value); - } - break; - - case IRE: - if (value == null) { - unsetIre(); - } else { - setIre((InvalidRequestException)value); - } - break; - - case NFE: - if (value == null) { - unsetNfe(); - } else { - setNfe((NotFoundException)value); - } - break; - - case UE: - if (value == null) { - unsetUe(); - } else { - setUe((UnavailableException)value); - } - break; - - case TE: - if (value == null) { - unsetTe(); - } else { - setTe((TimedOutException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - case IRE: - return getIre(); - - case NFE: - return getNfe(); - - case UE: - return getUe(); - - case TE: - return getTe(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - case IRE: - return isSetIre(); - case NFE: - return isSetNfe(); - case UE: - return isSetUe(); - case TE: - return isSetTe(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof get_counter_result) - return this.equals((get_counter_result)that); - return false; - } - - public boolean equals(get_counter_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - boolean this_present_ire = true && this.isSetIre(); - boolean that_present_ire = true && that.isSetIre(); - if (this_present_ire || that_present_ire) { - if (!(this_present_ire && that_present_ire)) - return false; - if (!this.ire.equals(that.ire)) - return false; - } - - boolean this_present_nfe = true && this.isSetNfe(); - boolean that_present_nfe = true && that.isSetNfe(); - if (this_present_nfe || that_present_nfe) { - if (!(this_present_nfe && that_present_nfe)) - return false; - if (!this.nfe.equals(that.nfe)) - return false; - } - - boolean this_present_ue = true && this.isSetUe(); - boolean that_present_ue = true && that.isSetUe(); - if (this_present_ue || that_present_ue) { - if (!(this_present_ue && that_present_ue)) - return false; - if (!this.ue.equals(that.ue)) - return false; - } - - boolean this_present_te = true && this.isSetTe(); - boolean that_present_te = true && that.isSetTe(); - if (this_present_te || that_present_te) { - if (!(this_present_te && that_present_te)) - return false; - if (!this.te.equals(that.te)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - boolean present_ire = true && (isSetIre()); - builder.append(present_ire); - if (present_ire) - builder.append(ire); - - boolean present_nfe = true && (isSetNfe()); - builder.append(present_nfe); - if (present_nfe) - builder.append(nfe); - - boolean present_ue = true && (isSetUe()); - builder.append(present_ue); - if (present_ue) - builder.append(ue); - - boolean present_te = true && (isSetTe()); - builder.append(present_te); - if (present_te) - builder.append(te); - - return builder.toHashCode(); - } - - public int compareTo(get_counter_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - get_counter_result typedOther = (get_counter_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIre()).compareTo(typedOther.isSetIre()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIre()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ire, typedOther.ire); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNfe()).compareTo(typedOther.isSetNfe()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNfe()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nfe, typedOther.nfe); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUe()).compareTo(typedOther.isSetUe()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUe()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ue, typedOther.ue); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTe()).compareTo(typedOther.isSetTe()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTe()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.te, typedOther.te); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new Counter(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // NFE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.nfe = new NotFoundException(); - this.nfe.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetNfe()) { - oprot.writeFieldBegin(NFE_FIELD_DESC); - this.nfe.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("get_counter_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - if (!first) sb.append(", "); - sb.append("ire:"); - if (this.ire == null) { - sb.append("null"); - } else { - sb.append(this.ire); - } - first = false; - if (!first) sb.append(", "); - sb.append("nfe:"); - if (this.nfe == null) { - sb.append("null"); - } else { - sb.append(this.nfe); - } - first = false; - if (!first) sb.append(", "); - sb.append("ue:"); - if (this.ue == null) { - sb.append("null"); - } else { - sb.append(this.ue); - } - first = false; - if (!first) sb.append(", "); - sb.append("te:"); - if (this.te == null) { - sb.append("null"); - } else { - sb.append(this.te); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - } - - public static class get_counter_slice_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("get_counter_slice_args"); - - private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField COLUMN_PARENT_FIELD_DESC = new org.apache.thrift.protocol.TField("column_parent", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField PREDICATE_FIELD_DESC = new org.apache.thrift.protocol.TField("predicate", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)4); - - public ByteBuffer key; - public ColumnParent column_parent; - public SlicePredicate predicate; - /** - * - * @see ConsistencyLevel - */ - public ConsistencyLevel consistency_level; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - KEY((short)1, "key"), - COLUMN_PARENT((short)2, "column_parent"), - PREDICATE((short)3, "predicate"), - /** - * - * @see ConsistencyLevel - */ - CONSISTENCY_LEVEL((short)4, "consistency_level"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // KEY - return KEY; - case 2: // COLUMN_PARENT - return COLUMN_PARENT; - case 3: // PREDICATE - return PREDICATE; - case 4: // CONSISTENCY_LEVEL - return CONSISTENCY_LEVEL; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - tmpMap.put(_Fields.COLUMN_PARENT, new org.apache.thrift.meta_data.FieldMetaData("column_parent", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ColumnParent.class))); - tmpMap.put(_Fields.PREDICATE, new org.apache.thrift.meta_data.FieldMetaData("predicate", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SlicePredicate.class))); - tmpMap.put(_Fields.CONSISTENCY_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("consistency_level", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ConsistencyLevel.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_counter_slice_args.class, metaDataMap); - } - - public get_counter_slice_args() { - this.consistency_level = org.apache.cassandra.thrift.ConsistencyLevel.ONE; - - } - - public get_counter_slice_args( - ByteBuffer key, - ColumnParent column_parent, - SlicePredicate predicate, - ConsistencyLevel consistency_level) - { - this(); - this.key = key; - this.column_parent = column_parent; - this.predicate = predicate; - this.consistency_level = consistency_level; - } - - /** - * Performs a deep copy on other. - */ - public get_counter_slice_args(get_counter_slice_args other) { - if (other.isSetKey()) { - this.key = org.apache.thrift.TBaseHelper.copyBinary(other.key); -; - } - if (other.isSetColumn_parent()) { - this.column_parent = new ColumnParent(other.column_parent); - } - if (other.isSetPredicate()) { - this.predicate = new SlicePredicate(other.predicate); - } - if (other.isSetConsistency_level()) { - this.consistency_level = other.consistency_level; - } - } - - public get_counter_slice_args deepCopy() { - return new get_counter_slice_args(this); - } - - @Override - public void clear() { - this.key = null; - this.column_parent = null; - this.predicate = null; - this.consistency_level = org.apache.cassandra.thrift.ConsistencyLevel.ONE; - - } - - public byte[] getKey() { - setKey(org.apache.thrift.TBaseHelper.rightSize(key)); - return key == null ? null : key.array(); - } - - public ByteBuffer bufferForKey() { - return key; - } - - public get_counter_slice_args setKey(byte[] key) { - setKey(key == null ? (ByteBuffer)null : ByteBuffer.wrap(key)); - return this; - } - - public get_counter_slice_args setKey(ByteBuffer key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - /** Returns true if field key is set (has been assigned a value) and false otherwise */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - public ColumnParent getColumn_parent() { - return this.column_parent; - } - - public get_counter_slice_args setColumn_parent(ColumnParent column_parent) { - this.column_parent = column_parent; - return this; - } - - public void unsetColumn_parent() { - this.column_parent = null; - } - - /** Returns true if field column_parent is set (has been assigned a value) and false otherwise */ - public boolean isSetColumn_parent() { - return this.column_parent != null; - } - - public void setColumn_parentIsSet(boolean value) { - if (!value) { - this.column_parent = null; - } - } - - public SlicePredicate getPredicate() { - return this.predicate; - } - - public get_counter_slice_args setPredicate(SlicePredicate predicate) { - this.predicate = predicate; - return this; - } - - public void unsetPredicate() { - this.predicate = null; - } - - /** Returns true if field predicate is set (has been assigned a value) and false otherwise */ - public boolean isSetPredicate() { - return this.predicate != null; - } - - public void setPredicateIsSet(boolean value) { - if (!value) { - this.predicate = null; - } - } - - /** - * - * @see ConsistencyLevel - */ - public ConsistencyLevel getConsistency_level() { - return this.consistency_level; - } - - /** - * - * @see ConsistencyLevel - */ - public get_counter_slice_args setConsistency_level(ConsistencyLevel consistency_level) { - this.consistency_level = consistency_level; - return this; - } - - public void unsetConsistency_level() { - this.consistency_level = null; - } - - /** Returns true if field consistency_level is set (has been assigned a value) and false otherwise */ - public boolean isSetConsistency_level() { - return this.consistency_level != null; - } - - public void setConsistency_levelIsSet(boolean value) { - if (!value) { - this.consistency_level = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case KEY: - if (value == null) { - unsetKey(); - } else { - setKey((ByteBuffer)value); - } - break; - - case COLUMN_PARENT: - if (value == null) { - unsetColumn_parent(); - } else { - setColumn_parent((ColumnParent)value); - } - break; - - case PREDICATE: - if (value == null) { - unsetPredicate(); - } else { - setPredicate((SlicePredicate)value); - } - break; - - case CONSISTENCY_LEVEL: - if (value == null) { - unsetConsistency_level(); - } else { - setConsistency_level((ConsistencyLevel)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case KEY: - return getKey(); - - case COLUMN_PARENT: - return getColumn_parent(); - - case PREDICATE: - return getPredicate(); - - case CONSISTENCY_LEVEL: - return getConsistency_level(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case KEY: - return isSetKey(); - case COLUMN_PARENT: - return isSetColumn_parent(); - case PREDICATE: - return isSetPredicate(); - case CONSISTENCY_LEVEL: - return isSetConsistency_level(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof get_counter_slice_args) - return this.equals((get_counter_slice_args)that); - return false; - } - - public boolean equals(get_counter_slice_args that) { - if (that == null) - return false; - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) - return false; - if (!this.key.equals(that.key)) - return false; - } - - boolean this_present_column_parent = true && this.isSetColumn_parent(); - boolean that_present_column_parent = true && that.isSetColumn_parent(); - if (this_present_column_parent || that_present_column_parent) { - if (!(this_present_column_parent && that_present_column_parent)) - return false; - if (!this.column_parent.equals(that.column_parent)) - return false; - } - - boolean this_present_predicate = true && this.isSetPredicate(); - boolean that_present_predicate = true && that.isSetPredicate(); - if (this_present_predicate || that_present_predicate) { - if (!(this_present_predicate && that_present_predicate)) - return false; - if (!this.predicate.equals(that.predicate)) - return false; - } - - boolean this_present_consistency_level = true && this.isSetConsistency_level(); - boolean that_present_consistency_level = true && that.isSetConsistency_level(); - if (this_present_consistency_level || that_present_consistency_level) { - if (!(this_present_consistency_level && that_present_consistency_level)) - return false; - if (!this.consistency_level.equals(that.consistency_level)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_key = true && (isSetKey()); - builder.append(present_key); - if (present_key) - builder.append(key); - - boolean present_column_parent = true && (isSetColumn_parent()); - builder.append(present_column_parent); - if (present_column_parent) - builder.append(column_parent); - - boolean present_predicate = true && (isSetPredicate()); - builder.append(present_predicate); - if (present_predicate) - builder.append(predicate); - - boolean present_consistency_level = true && (isSetConsistency_level()); - builder.append(present_consistency_level); - if (present_consistency_level) - builder.append(consistency_level.getValue()); - - return builder.toHashCode(); - } - - public int compareTo(get_counter_slice_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - get_counter_slice_args typedOther = (get_counter_slice_args)other; - - lastComparison = Boolean.valueOf(isSetKey()).compareTo(typedOther.isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, typedOther.key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetColumn_parent()).compareTo(typedOther.isSetColumn_parent()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumn_parent()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column_parent, typedOther.column_parent); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPredicate()).compareTo(typedOther.isSetPredicate()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPredicate()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.predicate, typedOther.predicate); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetConsistency_level()).compareTo(typedOther.isSetConsistency_level()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetConsistency_level()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.consistency_level, typedOther.consistency_level); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.key = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COLUMN_PARENT - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column_parent = new ColumnParent(); - this.column_parent.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // PREDICATE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.predicate = new SlicePredicate(); - this.predicate.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeBinary(this.key); - oprot.writeFieldEnd(); - } - if (this.column_parent != null) { - oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); - this.column_parent.write(oprot); - oprot.writeFieldEnd(); - } - if (this.predicate != null) { - oprot.writeFieldBegin(PREDICATE_FIELD_DESC); - this.predicate.write(oprot); - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("get_counter_slice_args("); - boolean first = true; - - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.key, sb); - } - first = false; - if (!first) sb.append(", "); - sb.append("column_parent:"); - if (this.column_parent == null) { - sb.append("null"); - } else { - sb.append(this.column_parent); - } - first = false; - if (!first) sb.append(", "); - sb.append("predicate:"); - if (this.predicate == null) { - sb.append("null"); - } else { - sb.append(this.predicate); - } - first = false; - if (!first) sb.append(", "); - sb.append("consistency_level:"); - if (this.consistency_level == null) { - sb.append("null"); - } else { - sb.append(this.consistency_level); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (key == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'key' was not present! Struct: " + toString()); - } - if (column_parent == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'column_parent' was not present! Struct: " + toString()); - } - if (predicate == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'predicate' was not present! Struct: " + toString()); - } - if (consistency_level == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - } - - public static class get_counter_slice_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("get_counter_slice_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); - private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); - - public List success; - public InvalidRequestException ire; - public UnavailableException ue; - public TimedOutException te; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"), - IRE((short)1, "ire"), - UE((short)2, "ue"), - TE((short)3, "te"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - case 1: // IRE - return IRE; - case 2: // UE - return UE; - case 3: // TE - return TE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Counter.class)))); - tmpMap.put(_Fields.IRE, new org.apache.thrift.meta_data.FieldMetaData("ire", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - tmpMap.put(_Fields.UE, new org.apache.thrift.meta_data.FieldMetaData("ue", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - tmpMap.put(_Fields.TE, new org.apache.thrift.meta_data.FieldMetaData("te", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_counter_slice_result.class, metaDataMap); - } - - public get_counter_slice_result() { - } - - public get_counter_slice_result( - List success, - InvalidRequestException ire, - UnavailableException ue, - TimedOutException te) - { - this(); - this.success = success; - this.ire = ire; - this.ue = ue; - this.te = te; - } - - /** - * Performs a deep copy on other. - */ - public get_counter_slice_result(get_counter_slice_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (Counter other_element : other.success) { - __this__success.add(new Counter(other_element)); - } - this.success = __this__success; - } - if (other.isSetIre()) { - this.ire = new InvalidRequestException(other.ire); - } - if (other.isSetUe()) { - this.ue = new UnavailableException(other.ue); - } - if (other.isSetTe()) { - this.te = new TimedOutException(other.te); - } - } - - public get_counter_slice_result deepCopy() { - return new get_counter_slice_result(this); - } - - @Override - public void clear() { - this.success = null; - this.ire = null; - this.ue = null; - this.te = null; - } - - 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(Counter elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); - } - - public List getSuccess() { - return this.success; - } - - public get_counter_slice_result setSuccess(List success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public InvalidRequestException getIre() { - return this.ire; - } - - public get_counter_slice_result setIre(InvalidRequestException ire) { - this.ire = ire; - return this; - } - - public void unsetIre() { - this.ire = null; - } - - /** Returns true if field ire is set (has been assigned a value) and false otherwise */ - public boolean isSetIre() { - return this.ire != null; - } - - public void setIreIsSet(boolean value) { - if (!value) { - this.ire = null; - } - } - - public UnavailableException getUe() { - return this.ue; - } - - public get_counter_slice_result setUe(UnavailableException ue) { - this.ue = ue; - return this; - } - - public void unsetUe() { - this.ue = null; - } - - /** Returns true if field ue is set (has been assigned a value) and false otherwise */ - public boolean isSetUe() { - return this.ue != null; - } - - public void setUeIsSet(boolean value) { - if (!value) { - this.ue = null; - } - } - - public TimedOutException getTe() { - return this.te; - } - - public get_counter_slice_result setTe(TimedOutException te) { - this.te = te; - return this; - } - - public void unsetTe() { - this.te = null; - } - - /** Returns true if field te is set (has been assigned a value) and false otherwise */ - public boolean isSetTe() { - return this.te != null; - } - - public void setTeIsSet(boolean value) { - if (!value) { - this.te = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((List)value); - } - break; - - case IRE: - if (value == null) { - unsetIre(); - } else { - setIre((InvalidRequestException)value); - } - break; - - case UE: - if (value == null) { - unsetUe(); - } else { - setUe((UnavailableException)value); - } - break; - - case TE: - if (value == null) { - unsetTe(); - } else { - setTe((TimedOutException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - case IRE: - return getIre(); - - case UE: - return getUe(); - - case TE: - return getTe(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - case IRE: - return isSetIre(); - case UE: - return isSetUe(); - case TE: - return isSetTe(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof get_counter_slice_result) - return this.equals((get_counter_slice_result)that); - return false; - } - - public boolean equals(get_counter_slice_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - boolean this_present_ire = true && this.isSetIre(); - boolean that_present_ire = true && that.isSetIre(); - if (this_present_ire || that_present_ire) { - if (!(this_present_ire && that_present_ire)) - return false; - if (!this.ire.equals(that.ire)) - return false; - } - - boolean this_present_ue = true && this.isSetUe(); - boolean that_present_ue = true && that.isSetUe(); - if (this_present_ue || that_present_ue) { - if (!(this_present_ue && that_present_ue)) - return false; - if (!this.ue.equals(that.ue)) - return false; - } - - boolean this_present_te = true && this.isSetTe(); - boolean that_present_te = true && that.isSetTe(); - if (this_present_te || that_present_te) { - if (!(this_present_te && that_present_te)) - return false; - if (!this.te.equals(that.te)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - boolean present_ire = true && (isSetIre()); - builder.append(present_ire); - if (present_ire) - builder.append(ire); - - boolean present_ue = true && (isSetUe()); - builder.append(present_ue); - if (present_ue) - builder.append(ue); - - boolean present_te = true && (isSetTe()); - builder.append(present_te); - if (present_te) - builder.append(te); - - return builder.toHashCode(); - } - - public int compareTo(get_counter_slice_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - get_counter_slice_result typedOther = (get_counter_slice_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIre()).compareTo(typedOther.isSetIre()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIre()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ire, typedOther.ire); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUe()).compareTo(typedOther.isSetUe()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUe()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ue, typedOther.ue); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTe()).compareTo(typedOther.isSetTe()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTe()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.te, typedOther.te); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list98 = iprot.readListBegin(); - this.success = new ArrayList(_list98.size); - for (int _i99 = 0; _i99 < _list98.size; ++_i99) - { - Counter _elem100; - _elem100 = new Counter(); - _elem100.read(iprot); - this.success.add(_elem100); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (Counter _iter101 : this.success) - { - _iter101.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("get_counter_slice_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - if (!first) sb.append(", "); - sb.append("ire:"); - if (this.ire == null) { - sb.append("null"); - } else { - sb.append(this.ire); - } - first = false; - if (!first) sb.append(", "); - sb.append("ue:"); - if (this.ue == null) { - sb.append("null"); - } else { - sb.append(this.ue); - } - first = false; - if (!first) sb.append(", "); - sb.append("te:"); - if (this.te == null) { - sb.append("null"); - } else { - sb.append(this.te); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - } - - public static class multiget_counter_slice_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("multiget_counter_slice_args"); - - private static final org.apache.thrift.protocol.TField KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("keys", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField COLUMN_PARENT_FIELD_DESC = new org.apache.thrift.protocol.TField("column_parent", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField PREDICATE_FIELD_DESC = new org.apache.thrift.protocol.TField("predicate", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)4); - - public List keys; - public ColumnParent column_parent; - public SlicePredicate predicate; - /** - * - * @see ConsistencyLevel - */ - public ConsistencyLevel consistency_level; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - KEYS((short)1, "keys"), - COLUMN_PARENT((short)2, "column_parent"), - PREDICATE((short)3, "predicate"), - /** - * - * @see ConsistencyLevel - */ - CONSISTENCY_LEVEL((short)4, "consistency_level"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // KEYS - return KEYS; - case 2: // COLUMN_PARENT - return COLUMN_PARENT; - case 3: // PREDICATE - return PREDICATE; - case 4: // CONSISTENCY_LEVEL - return CONSISTENCY_LEVEL; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.KEYS, new org.apache.thrift.meta_data.FieldMetaData("keys", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); - tmpMap.put(_Fields.COLUMN_PARENT, new org.apache.thrift.meta_data.FieldMetaData("column_parent", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ColumnParent.class))); - tmpMap.put(_Fields.PREDICATE, new org.apache.thrift.meta_data.FieldMetaData("predicate", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SlicePredicate.class))); - tmpMap.put(_Fields.CONSISTENCY_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("consistency_level", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ConsistencyLevel.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(multiget_counter_slice_args.class, metaDataMap); - } - - public multiget_counter_slice_args() { - this.consistency_level = org.apache.cassandra.thrift.ConsistencyLevel.ONE; - - } - - public multiget_counter_slice_args( - List keys, - ColumnParent column_parent, - SlicePredicate predicate, - ConsistencyLevel consistency_level) - { - this(); - this.keys = keys; - this.column_parent = column_parent; - this.predicate = predicate; - this.consistency_level = consistency_level; - } - - /** - * Performs a deep copy on other. - */ - public multiget_counter_slice_args(multiget_counter_slice_args other) { - if (other.isSetKeys()) { - List __this__keys = new ArrayList(); - for (ByteBuffer other_element : other.keys) { - ByteBuffer temp_binary_element = org.apache.thrift.TBaseHelper.copyBinary(other_element); -; - __this__keys.add(temp_binary_element); - } - this.keys = __this__keys; - } - if (other.isSetColumn_parent()) { - this.column_parent = new ColumnParent(other.column_parent); - } - if (other.isSetPredicate()) { - this.predicate = new SlicePredicate(other.predicate); - } - if (other.isSetConsistency_level()) { - this.consistency_level = other.consistency_level; - } - } - - public multiget_counter_slice_args deepCopy() { - return new multiget_counter_slice_args(this); - } - - @Override - public void clear() { - this.keys = null; - this.column_parent = null; - this.predicate = null; - this.consistency_level = org.apache.cassandra.thrift.ConsistencyLevel.ONE; - - } - - public int getKeysSize() { - return (this.keys == null) ? 0 : this.keys.size(); - } - - public java.util.Iterator getKeysIterator() { - return (this.keys == null) ? null : this.keys.iterator(); - } - - public void addToKeys(ByteBuffer elem) { - if (this.keys == null) { - this.keys = new ArrayList(); - } - this.keys.add(elem); - } - - public List getKeys() { - return this.keys; - } - - public multiget_counter_slice_args setKeys(List keys) { - this.keys = keys; - return this; - } - - public void unsetKeys() { - this.keys = null; - } - - /** Returns true if field keys is set (has been assigned a value) and false otherwise */ - public boolean isSetKeys() { - return this.keys != null; - } - - public void setKeysIsSet(boolean value) { - if (!value) { - this.keys = null; - } - } - - public ColumnParent getColumn_parent() { - return this.column_parent; - } - - public multiget_counter_slice_args setColumn_parent(ColumnParent column_parent) { - this.column_parent = column_parent; - return this; - } - - public void unsetColumn_parent() { - this.column_parent = null; - } - - /** Returns true if field column_parent is set (has been assigned a value) and false otherwise */ - public boolean isSetColumn_parent() { - return this.column_parent != null; - } - - public void setColumn_parentIsSet(boolean value) { - if (!value) { - this.column_parent = null; - } - } - - public SlicePredicate getPredicate() { - return this.predicate; - } - - public multiget_counter_slice_args setPredicate(SlicePredicate predicate) { - this.predicate = predicate; - return this; - } - - public void unsetPredicate() { - this.predicate = null; - } - - /** Returns true if field predicate is set (has been assigned a value) and false otherwise */ - public boolean isSetPredicate() { - return this.predicate != null; - } - - public void setPredicateIsSet(boolean value) { - if (!value) { - this.predicate = null; - } - } - - /** - * - * @see ConsistencyLevel - */ - public ConsistencyLevel getConsistency_level() { - return this.consistency_level; - } - - /** - * - * @see ConsistencyLevel - */ - public multiget_counter_slice_args setConsistency_level(ConsistencyLevel consistency_level) { - this.consistency_level = consistency_level; - return this; - } - - public void unsetConsistency_level() { - this.consistency_level = null; - } - - /** Returns true if field consistency_level is set (has been assigned a value) and false otherwise */ - public boolean isSetConsistency_level() { - return this.consistency_level != null; - } - - public void setConsistency_levelIsSet(boolean value) { - if (!value) { - this.consistency_level = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case KEYS: - if (value == null) { - unsetKeys(); - } else { - setKeys((List)value); - } - break; - - case COLUMN_PARENT: - if (value == null) { - unsetColumn_parent(); - } else { - setColumn_parent((ColumnParent)value); - } - break; - - case PREDICATE: - if (value == null) { - unsetPredicate(); - } else { - setPredicate((SlicePredicate)value); - } - break; - - case CONSISTENCY_LEVEL: - if (value == null) { - unsetConsistency_level(); - } else { - setConsistency_level((ConsistencyLevel)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case KEYS: - return getKeys(); - - case COLUMN_PARENT: - return getColumn_parent(); - - case PREDICATE: - return getPredicate(); - - case CONSISTENCY_LEVEL: - return getConsistency_level(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case KEYS: - return isSetKeys(); - case COLUMN_PARENT: - return isSetColumn_parent(); - case PREDICATE: - return isSetPredicate(); - case CONSISTENCY_LEVEL: - return isSetConsistency_level(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof multiget_counter_slice_args) - return this.equals((multiget_counter_slice_args)that); - return false; - } - - public boolean equals(multiget_counter_slice_args that) { - if (that == null) - return false; - - boolean this_present_keys = true && this.isSetKeys(); - boolean that_present_keys = true && that.isSetKeys(); - if (this_present_keys || that_present_keys) { - if (!(this_present_keys && that_present_keys)) - return false; - if (!this.keys.equals(that.keys)) - return false; - } - - boolean this_present_column_parent = true && this.isSetColumn_parent(); - boolean that_present_column_parent = true && that.isSetColumn_parent(); - if (this_present_column_parent || that_present_column_parent) { - if (!(this_present_column_parent && that_present_column_parent)) - return false; - if (!this.column_parent.equals(that.column_parent)) - return false; - } - - boolean this_present_predicate = true && this.isSetPredicate(); - boolean that_present_predicate = true && that.isSetPredicate(); - if (this_present_predicate || that_present_predicate) { - if (!(this_present_predicate && that_present_predicate)) - return false; - if (!this.predicate.equals(that.predicate)) - return false; - } - - boolean this_present_consistency_level = true && this.isSetConsistency_level(); - boolean that_present_consistency_level = true && that.isSetConsistency_level(); - if (this_present_consistency_level || that_present_consistency_level) { - if (!(this_present_consistency_level && that_present_consistency_level)) - return false; - if (!this.consistency_level.equals(that.consistency_level)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_keys = true && (isSetKeys()); - builder.append(present_keys); - if (present_keys) - builder.append(keys); - - boolean present_column_parent = true && (isSetColumn_parent()); - builder.append(present_column_parent); - if (present_column_parent) - builder.append(column_parent); - - boolean present_predicate = true && (isSetPredicate()); - builder.append(present_predicate); - if (present_predicate) - builder.append(predicate); - - boolean present_consistency_level = true && (isSetConsistency_level()); - builder.append(present_consistency_level); - if (present_consistency_level) - builder.append(consistency_level.getValue()); - - return builder.toHashCode(); - } - - public int compareTo(multiget_counter_slice_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - multiget_counter_slice_args typedOther = (multiget_counter_slice_args)other; - - lastComparison = Boolean.valueOf(isSetKeys()).compareTo(typedOther.isSetKeys()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKeys()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keys, typedOther.keys); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetColumn_parent()).compareTo(typedOther.isSetColumn_parent()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumn_parent()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column_parent, typedOther.column_parent); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPredicate()).compareTo(typedOther.isSetPredicate()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPredicate()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.predicate, typedOther.predicate); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetConsistency_level()).compareTo(typedOther.isSetConsistency_level()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetConsistency_level()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.consistency_level, typedOther.consistency_level); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEYS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list102 = iprot.readListBegin(); - this.keys = new ArrayList(_list102.size); - for (int _i103 = 0; _i103 < _list102.size; ++_i103) - { - ByteBuffer _elem104; - _elem104 = iprot.readBinary(); - this.keys.add(_elem104); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COLUMN_PARENT - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column_parent = new ColumnParent(); - this.column_parent.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // PREDICATE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.predicate = new SlicePredicate(); - this.predicate.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.keys != null) { - oprot.writeFieldBegin(KEYS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.keys.size())); - for (ByteBuffer _iter105 : this.keys) - { - oprot.writeBinary(_iter105); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (this.column_parent != null) { - oprot.writeFieldBegin(COLUMN_PARENT_FIELD_DESC); - this.column_parent.write(oprot); - oprot.writeFieldEnd(); - } - if (this.predicate != null) { - oprot.writeFieldBegin(PREDICATE_FIELD_DESC); - this.predicate.write(oprot); - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("multiget_counter_slice_args("); - boolean first = true; - - sb.append("keys:"); - if (this.keys == null) { - sb.append("null"); - } else { - sb.append(this.keys); - } - first = false; - if (!first) sb.append(", "); - sb.append("column_parent:"); - if (this.column_parent == null) { - sb.append("null"); - } else { - sb.append(this.column_parent); - } - first = false; - if (!first) sb.append(", "); - sb.append("predicate:"); - if (this.predicate == null) { - sb.append("null"); - } else { - sb.append(this.predicate); - } - first = false; - if (!first) sb.append(", "); - sb.append("consistency_level:"); - if (this.consistency_level == null) { - sb.append("null"); - } else { - sb.append(this.consistency_level); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (keys == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'keys' was not present! Struct: " + toString()); - } - if (column_parent == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'column_parent' was not present! Struct: " + toString()); - } - if (predicate == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'predicate' was not present! Struct: " + toString()); - } - if (consistency_level == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - } - - public static class multiget_counter_slice_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("multiget_counter_slice_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); - private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); - - public Map> success; - public InvalidRequestException ire; - public UnavailableException ue; - public TimedOutException te; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"), - IRE((short)1, "ire"), - UE((short)2, "ue"), - TE((short)3, "te"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - case 1: // IRE - return IRE; - case 2: // UE - return UE; - case 3: // TE - return TE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true), - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Counter.class))))); - tmpMap.put(_Fields.IRE, new org.apache.thrift.meta_data.FieldMetaData("ire", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - tmpMap.put(_Fields.UE, new org.apache.thrift.meta_data.FieldMetaData("ue", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - tmpMap.put(_Fields.TE, new org.apache.thrift.meta_data.FieldMetaData("te", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(multiget_counter_slice_result.class, metaDataMap); - } - - public multiget_counter_slice_result() { - } - - public multiget_counter_slice_result( - Map> success, - InvalidRequestException ire, - UnavailableException ue, - TimedOutException te) - { - this(); - this.success = success; - this.ire = ire; - this.ue = ue; - this.te = te; - } - - /** - * Performs a deep copy on other. - */ - public multiget_counter_slice_result(multiget_counter_slice_result other) { - if (other.isSetSuccess()) { - Map> __this__success = new HashMap>(); - for (Map.Entry> other_element : other.success.entrySet()) { - - ByteBuffer other_element_key = other_element.getKey(); - List other_element_value = other_element.getValue(); - - ByteBuffer __this__success_copy_key = org.apache.thrift.TBaseHelper.copyBinary(other_element_key); -; - - List __this__success_copy_value = new ArrayList(); - for (Counter other_element_value_element : other_element_value) { - __this__success_copy_value.add(new Counter(other_element_value_element)); - } - - __this__success.put(__this__success_copy_key, __this__success_copy_value); - } - this.success = __this__success; - } - if (other.isSetIre()) { - this.ire = new InvalidRequestException(other.ire); - } - if (other.isSetUe()) { - this.ue = new UnavailableException(other.ue); - } - if (other.isSetTe()) { - this.te = new TimedOutException(other.te); - } - } - - public multiget_counter_slice_result deepCopy() { - return new multiget_counter_slice_result(this); - } - - @Override - public void clear() { - this.success = null; - this.ire = null; - this.ue = null; - this.te = null; - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public void putToSuccess(ByteBuffer key, List val) { - if (this.success == null) { - this.success = new HashMap>(); - } - this.success.put(key, val); - } - - public Map> getSuccess() { - return this.success; - } - - public multiget_counter_slice_result setSuccess(Map> success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public InvalidRequestException getIre() { - return this.ire; - } - - public multiget_counter_slice_result setIre(InvalidRequestException ire) { - this.ire = ire; - return this; - } - - public void unsetIre() { - this.ire = null; - } - - /** Returns true if field ire is set (has been assigned a value) and false otherwise */ - public boolean isSetIre() { - return this.ire != null; - } - - public void setIreIsSet(boolean value) { - if (!value) { - this.ire = null; - } - } - - public UnavailableException getUe() { - return this.ue; - } - - public multiget_counter_slice_result setUe(UnavailableException ue) { - this.ue = ue; - return this; - } - - public void unsetUe() { - this.ue = null; - } - - /** Returns true if field ue is set (has been assigned a value) and false otherwise */ - public boolean isSetUe() { - return this.ue != null; - } - - public void setUeIsSet(boolean value) { - if (!value) { - this.ue = null; - } - } - - public TimedOutException getTe() { - return this.te; - } - - public multiget_counter_slice_result setTe(TimedOutException te) { - this.te = te; - return this; - } - - public void unsetTe() { - this.te = null; - } - - /** Returns true if field te is set (has been assigned a value) and false otherwise */ - public boolean isSetTe() { - return this.te != null; - } - - public void setTeIsSet(boolean value) { - if (!value) { - this.te = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Map>)value); - } - break; - - case IRE: - if (value == null) { - unsetIre(); - } else { - setIre((InvalidRequestException)value); - } - break; - - case UE: - if (value == null) { - unsetUe(); - } else { - setUe((UnavailableException)value); - } - break; - - case TE: - if (value == null) { - unsetTe(); - } else { - setTe((TimedOutException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - case IRE: - return getIre(); - - case UE: - return getUe(); - - case TE: - return getTe(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - case IRE: - return isSetIre(); - case UE: - return isSetUe(); - case TE: - return isSetTe(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof multiget_counter_slice_result) - return this.equals((multiget_counter_slice_result)that); - return false; - } - - public boolean equals(multiget_counter_slice_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - boolean this_present_ire = true && this.isSetIre(); - boolean that_present_ire = true && that.isSetIre(); - if (this_present_ire || that_present_ire) { - if (!(this_present_ire && that_present_ire)) - return false; - if (!this.ire.equals(that.ire)) - return false; - } - - boolean this_present_ue = true && this.isSetUe(); - boolean that_present_ue = true && that.isSetUe(); - if (this_present_ue || that_present_ue) { - if (!(this_present_ue && that_present_ue)) - return false; - if (!this.ue.equals(that.ue)) - return false; - } - - boolean this_present_te = true && this.isSetTe(); - boolean that_present_te = true && that.isSetTe(); - if (this_present_te || that_present_te) { - if (!(this_present_te && that_present_te)) - return false; - if (!this.te.equals(that.te)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - boolean present_ire = true && (isSetIre()); - builder.append(present_ire); - if (present_ire) - builder.append(ire); - - boolean present_ue = true && (isSetUe()); - builder.append(present_ue); - if (present_ue) - builder.append(ue); - - boolean present_te = true && (isSetTe()); - builder.append(present_te); - if (present_te) - builder.append(te); - - return builder.toHashCode(); - } - - public int compareTo(multiget_counter_slice_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - multiget_counter_slice_result typedOther = (multiget_counter_slice_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIre()).compareTo(typedOther.isSetIre()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIre()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ire, typedOther.ire); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUe()).compareTo(typedOther.isSetUe()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUe()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ue, typedOther.ue); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTe()).compareTo(typedOther.isSetTe()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTe()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.te, typedOther.te); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map106 = iprot.readMapBegin(); - this.success = new HashMap>(2*_map106.size); - for (int _i107 = 0; _i107 < _map106.size; ++_i107) - { - ByteBuffer _key108; - List _val109; - _key108 = iprot.readBinary(); - { - org.apache.thrift.protocol.TList _list110 = iprot.readListBegin(); - _val109 = new ArrayList(_list110.size); - for (int _i111 = 0; _i111 < _list110.size; ++_i111) - { - Counter _elem112; - _elem112 = new Counter(); - _elem112.read(iprot); - _val109.add(_elem112); - } - iprot.readListEnd(); - } - this.success.put(_key108, _val109); - } - iprot.readMapEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, this.success.size())); - for (Map.Entry> _iter113 : this.success.entrySet()) - { - oprot.writeBinary(_iter113.getKey()); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter113.getValue().size())); - for (Counter _iter114 : _iter113.getValue()) - { - _iter114.write(oprot); - } - oprot.writeListEnd(); - } - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("multiget_counter_slice_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - if (!first) sb.append(", "); - sb.append("ire:"); - if (this.ire == null) { - sb.append("null"); - } else { - sb.append(this.ire); - } - first = false; - if (!first) sb.append(", "); - sb.append("ue:"); - if (this.ue == null) { - sb.append("null"); - } else { - sb.append(this.ue); - } - first = false; - if (!first) sb.append(", "); - sb.append("te:"); - if (this.te == null) { - sb.append("null"); - } else { - sb.append(this.te); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - } - - public static class remove_counter_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("remove_counter_args"); - - private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField CONSISTENCY_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("consistency_level", org.apache.thrift.protocol.TType.I32, (short)3); - - public ByteBuffer key; - public ColumnPath path; - /** - * - * @see ConsistencyLevel - */ - public ConsistencyLevel consistency_level; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - KEY((short)1, "key"), - PATH((short)2, "path"), - /** - * - * @see ConsistencyLevel - */ - CONSISTENCY_LEVEL((short)3, "consistency_level"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // KEY - return KEY; - case 2: // PATH - return PATH; - case 3: // CONSISTENCY_LEVEL - return CONSISTENCY_LEVEL; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ColumnPath.class))); - tmpMap.put(_Fields.CONSISTENCY_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("consistency_level", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ConsistencyLevel.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(remove_counter_args.class, metaDataMap); - } - - public remove_counter_args() { - this.consistency_level = org.apache.cassandra.thrift.ConsistencyLevel.ONE; - - } - - public remove_counter_args( - ByteBuffer key, - ColumnPath path, - ConsistencyLevel consistency_level) - { - this(); - this.key = key; - this.path = path; - this.consistency_level = consistency_level; - } - - /** - * Performs a deep copy on other. - */ - public remove_counter_args(remove_counter_args other) { - if (other.isSetKey()) { - this.key = org.apache.thrift.TBaseHelper.copyBinary(other.key); -; - } - if (other.isSetPath()) { - this.path = new ColumnPath(other.path); - } - if (other.isSetConsistency_level()) { - this.consistency_level = other.consistency_level; - } - } - - public remove_counter_args deepCopy() { - return new remove_counter_args(this); - } - - @Override - public void clear() { - this.key = null; - this.path = null; - this.consistency_level = org.apache.cassandra.thrift.ConsistencyLevel.ONE; - - } - - public byte[] getKey() { - setKey(org.apache.thrift.TBaseHelper.rightSize(key)); - return key == null ? null : key.array(); - } - - public ByteBuffer bufferForKey() { - return key; - } - - public remove_counter_args setKey(byte[] key) { - setKey(key == null ? (ByteBuffer)null : ByteBuffer.wrap(key)); - return this; - } - - public remove_counter_args setKey(ByteBuffer key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - /** Returns true if field key is set (has been assigned a value) and false otherwise */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - public ColumnPath getPath() { - return this.path; - } - - public remove_counter_args setPath(ColumnPath path) { - this.path = path; - return this; - } - - public void unsetPath() { - this.path = null; - } - - /** Returns true if field path is set (has been assigned a value) and false otherwise */ - public boolean isSetPath() { - return this.path != null; - } - - public void setPathIsSet(boolean value) { - if (!value) { - this.path = null; - } - } - - /** - * - * @see ConsistencyLevel - */ - public ConsistencyLevel getConsistency_level() { - return this.consistency_level; - } - - /** - * - * @see ConsistencyLevel - */ - public remove_counter_args setConsistency_level(ConsistencyLevel consistency_level) { - this.consistency_level = consistency_level; - return this; - } - - public void unsetConsistency_level() { - this.consistency_level = null; - } - - /** Returns true if field consistency_level is set (has been assigned a value) and false otherwise */ - public boolean isSetConsistency_level() { - return this.consistency_level != null; - } - - public void setConsistency_levelIsSet(boolean value) { - if (!value) { - this.consistency_level = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case KEY: - if (value == null) { - unsetKey(); - } else { - setKey((ByteBuffer)value); - } - break; - - case PATH: - if (value == null) { - unsetPath(); - } else { - setPath((ColumnPath)value); - } - break; - - case CONSISTENCY_LEVEL: - if (value == null) { - unsetConsistency_level(); - } else { - setConsistency_level((ConsistencyLevel)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case KEY: - return getKey(); - - case PATH: - return getPath(); - - case CONSISTENCY_LEVEL: - return getConsistency_level(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case KEY: - return isSetKey(); - case PATH: - return isSetPath(); - case CONSISTENCY_LEVEL: - return isSetConsistency_level(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof remove_counter_args) - return this.equals((remove_counter_args)that); - return false; - } - - public boolean equals(remove_counter_args that) { - if (that == null) - return false; - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) - return false; - if (!this.key.equals(that.key)) - return false; - } - - boolean this_present_path = true && this.isSetPath(); - boolean that_present_path = true && that.isSetPath(); - if (this_present_path || that_present_path) { - if (!(this_present_path && that_present_path)) - return false; - if (!this.path.equals(that.path)) - return false; - } - - boolean this_present_consistency_level = true && this.isSetConsistency_level(); - boolean that_present_consistency_level = true && that.isSetConsistency_level(); - if (this_present_consistency_level || that_present_consistency_level) { - if (!(this_present_consistency_level && that_present_consistency_level)) - return false; - if (!this.consistency_level.equals(that.consistency_level)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_key = true && (isSetKey()); - builder.append(present_key); - if (present_key) - builder.append(key); - - boolean present_path = true && (isSetPath()); - builder.append(present_path); - if (present_path) - builder.append(path); - - boolean present_consistency_level = true && (isSetConsistency_level()); - builder.append(present_consistency_level); - if (present_consistency_level) - builder.append(consistency_level.getValue()); - - return builder.toHashCode(); - } - - public int compareTo(remove_counter_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - remove_counter_args typedOther = (remove_counter_args)other; - - lastComparison = Boolean.valueOf(isSetKey()).compareTo(typedOther.isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, typedOther.key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPath()).compareTo(typedOther.isSetPath()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPath()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, typedOther.path); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetConsistency_level()).compareTo(typedOther.isSetConsistency_level()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetConsistency_level()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.consistency_level, typedOther.consistency_level); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // KEY - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.key = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.path = new ColumnPath(); - this.path.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // CONSISTENCY_LEVEL - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32()); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeBinary(this.key); - oprot.writeFieldEnd(); - } - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - this.path.write(oprot); - oprot.writeFieldEnd(); - } - if (this.consistency_level != null) { - oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC); - oprot.writeI32(this.consistency_level.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("remove_counter_args("); - boolean first = true; - - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.key, sb); - } - first = false; - if (!first) sb.append(", "); - sb.append("path:"); - if (this.path == null) { - sb.append("null"); - } else { - sb.append(this.path); - } - first = false; - if (!first) sb.append(", "); - sb.append("consistency_level:"); - if (this.consistency_level == null) { - sb.append("null"); - } else { - sb.append(this.consistency_level); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (key == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'key' was not present! Struct: " + toString()); - } - if (path == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'path' was not present! Struct: " + toString()); - } - if (consistency_level == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString()); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - } - - public static class remove_counter_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("remove_counter_result"); - - private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField TE_FIELD_DESC = new org.apache.thrift.protocol.TField("te", org.apache.thrift.protocol.TType.STRUCT, (short)3); - - public InvalidRequestException ire; - public UnavailableException ue; - public TimedOutException te; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - IRE((short)1, "ire"), - UE((short)2, "ue"), - TE((short)3, "te"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // IRE - return IRE; - case 2: // UE - return UE; - case 3: // TE - return TE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.IRE, new org.apache.thrift.meta_data.FieldMetaData("ire", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - tmpMap.put(_Fields.UE, new org.apache.thrift.meta_data.FieldMetaData("ue", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - tmpMap.put(_Fields.TE, new org.apache.thrift.meta_data.FieldMetaData("te", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(remove_counter_result.class, metaDataMap); - } - - public remove_counter_result() { - } - - public remove_counter_result( - InvalidRequestException ire, - UnavailableException ue, - TimedOutException te) - { - this(); - this.ire = ire; - this.ue = ue; - this.te = te; - } - - /** - * Performs a deep copy on other. - */ - public remove_counter_result(remove_counter_result other) { - if (other.isSetIre()) { - this.ire = new InvalidRequestException(other.ire); - } - if (other.isSetUe()) { - this.ue = new UnavailableException(other.ue); - } - if (other.isSetTe()) { - this.te = new TimedOutException(other.te); - } - } - - public remove_counter_result deepCopy() { - return new remove_counter_result(this); - } - - @Override - public void clear() { - this.ire = null; - this.ue = null; - this.te = null; - } - - public InvalidRequestException getIre() { - return this.ire; - } - - public remove_counter_result setIre(InvalidRequestException ire) { - this.ire = ire; - return this; - } - - public void unsetIre() { - this.ire = null; - } - - /** Returns true if field ire is set (has been assigned a value) and false otherwise */ - public boolean isSetIre() { - return this.ire != null; - } - - public void setIreIsSet(boolean value) { - if (!value) { - this.ire = null; - } - } - - public UnavailableException getUe() { - return this.ue; - } - - public remove_counter_result setUe(UnavailableException ue) { - this.ue = ue; - return this; - } - - public void unsetUe() { - this.ue = null; - } - - /** Returns true if field ue is set (has been assigned a value) and false otherwise */ - public boolean isSetUe() { - return this.ue != null; - } - - public void setUeIsSet(boolean value) { - if (!value) { - this.ue = null; - } - } - - public TimedOutException getTe() { - return this.te; - } - - public remove_counter_result setTe(TimedOutException te) { - this.te = te; - return this; - } - - public void unsetTe() { - this.te = null; - } - - /** Returns true if field te is set (has been assigned a value) and false otherwise */ - public boolean isSetTe() { - return this.te != null; - } - - public void setTeIsSet(boolean value) { - if (!value) { - this.te = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case IRE: - if (value == null) { - unsetIre(); - } else { - setIre((InvalidRequestException)value); - } - break; - - case UE: - if (value == null) { - unsetUe(); - } else { - setUe((UnavailableException)value); - } - break; - - case TE: - if (value == null) { - unsetTe(); - } else { - setTe((TimedOutException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case IRE: - return getIre(); - - case UE: - return getUe(); - - case TE: - return getTe(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case IRE: - return isSetIre(); - case UE: - return isSetUe(); - case TE: - return isSetTe(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof remove_counter_result) - return this.equals((remove_counter_result)that); - return false; - } - - public boolean equals(remove_counter_result that) { - if (that == null) - return false; - - boolean this_present_ire = true && this.isSetIre(); - boolean that_present_ire = true && that.isSetIre(); - if (this_present_ire || that_present_ire) { - if (!(this_present_ire && that_present_ire)) - return false; - if (!this.ire.equals(that.ire)) - return false; - } - - boolean this_present_ue = true && this.isSetUe(); - boolean that_present_ue = true && that.isSetUe(); - if (this_present_ue || that_present_ue) { - if (!(this_present_ue && that_present_ue)) - return false; - if (!this.ue.equals(that.ue)) - return false; - } - - boolean this_present_te = true && this.isSetTe(); - boolean that_present_te = true && that.isSetTe(); - if (this_present_te || that_present_te) { - if (!(this_present_te && that_present_te)) - return false; - if (!this.te.equals(that.te)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_ire = true && (isSetIre()); - builder.append(present_ire); - if (present_ire) - builder.append(ire); - - boolean present_ue = true && (isSetUe()); - builder.append(present_ue); - if (present_ue) - builder.append(ue); - - boolean present_te = true && (isSetTe()); - builder.append(present_te); - if (present_te) - builder.append(te); - - return builder.toHashCode(); - } - - public int compareTo(remove_counter_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - remove_counter_result typedOther = (remove_counter_result)other; - - lastComparison = Boolean.valueOf(isSetIre()).compareTo(typedOther.isSetIre()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIre()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ire, typedOther.ire); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUe()).compareTo(typedOther.isSetUe()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUe()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ue, typedOther.ue); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTe()).compareTo(typedOther.isSetTe()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTe()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.te, typedOther.te); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // UE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ue = new UnavailableException(); - this.ue.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.te = new TimedOutException(); - this.te.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetUe()) { - oprot.writeFieldBegin(UE_FIELD_DESC); - this.ue.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetTe()) { - oprot.writeFieldBegin(TE_FIELD_DESC); - this.te.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("remove_counter_result("); - boolean first = true; - - sb.append("ire:"); - if (this.ire == null) { - sb.append("null"); - } else { - sb.append(this.ire); - } - first = false; - if (!first) sb.append(", "); - sb.append("ue:"); - if (this.ue == null) { - sb.append("null"); - } else { - sb.append(this.ue); - } - first = false; - if (!first) sb.append(", "); - sb.append("te:"); - if (this.te == null) { - sb.append("null"); - } else { - sb.append(this.te); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - } - public static class describe_schema_versions_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("describe_schema_versions_args"); @@ -25042,25 +20833,25 @@ public class Cassandra { case 0: // SUCCESS if (field.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map115 = iprot.readMapBegin(); - this.success = new HashMap>(2*_map115.size); - for (int _i116 = 0; _i116 < _map115.size; ++_i116) + org.apache.thrift.protocol.TMap _map98 = iprot.readMapBegin(); + this.success = new HashMap>(2*_map98.size); + for (int _i99 = 0; _i99 < _map98.size; ++_i99) { - String _key117; - List _val118; - _key117 = iprot.readString(); + String _key100; + List _val101; + _key100 = iprot.readString(); { - org.apache.thrift.protocol.TList _list119 = iprot.readListBegin(); - _val118 = new ArrayList(_list119.size); - for (int _i120 = 0; _i120 < _list119.size; ++_i120) + org.apache.thrift.protocol.TList _list102 = iprot.readListBegin(); + _val101 = new ArrayList(_list102.size); + for (int _i103 = 0; _i103 < _list102.size; ++_i103) { - String _elem121; - _elem121 = iprot.readString(); - _val118.add(_elem121); + String _elem104; + _elem104 = iprot.readString(); + _val101.add(_elem104); } iprot.readListEnd(); } - this.success.put(_key117, _val118); + this.success.put(_key100, _val101); } iprot.readMapEnd(); } @@ -25094,14 +20885,14 @@ public class Cassandra { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, this.success.size())); - for (Map.Entry> _iter122 : this.success.entrySet()) + for (Map.Entry> _iter105 : this.success.entrySet()) { - oprot.writeString(_iter122.getKey()); + oprot.writeString(_iter105.getKey()); { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter122.getValue().size())); - for (String _iter123 : _iter122.getValue()) + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter105.getValue().size())); + for (String _iter106 : _iter105.getValue()) { - oprot.writeString(_iter123); + oprot.writeString(_iter106); } oprot.writeListEnd(); } @@ -25700,14 +21491,14 @@ public class Cassandra { case 0: // SUCCESS if (field.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list124 = iprot.readListBegin(); - this.success = new ArrayList(_list124.size); - for (int _i125 = 0; _i125 < _list124.size; ++_i125) + org.apache.thrift.protocol.TList _list107 = iprot.readListBegin(); + this.success = new ArrayList(_list107.size); + for (int _i108 = 0; _i108 < _list107.size; ++_i108) { - KsDef _elem126; - _elem126 = new KsDef(); - _elem126.read(iprot); - this.success.add(_elem126); + KsDef _elem109; + _elem109 = new KsDef(); + _elem109.read(iprot); + this.success.add(_elem109); } iprot.readListEnd(); } @@ -25741,9 +21532,9 @@ public class Cassandra { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (KsDef _iter127 : this.success) + for (KsDef _iter110 : this.success) { - _iter127.write(oprot); + _iter110.write(oprot); } oprot.writeListEnd(); } @@ -27456,14 +23247,14 @@ public class Cassandra { case 0: // SUCCESS if (field.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list128 = iprot.readListBegin(); - this.success = new ArrayList(_list128.size); - for (int _i129 = 0; _i129 < _list128.size; ++_i129) + org.apache.thrift.protocol.TList _list111 = iprot.readListBegin(); + this.success = new ArrayList(_list111.size); + for (int _i112 = 0; _i112 < _list111.size; ++_i112) { - TokenRange _elem130; - _elem130 = new TokenRange(); - _elem130.read(iprot); - this.success.add(_elem130); + TokenRange _elem113; + _elem113 = new TokenRange(); + _elem113.read(iprot); + this.success.add(_elem113); } iprot.readListEnd(); } @@ -27497,9 +23288,9 @@ public class Cassandra { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (TokenRange _iter131 : this.success) + for (TokenRange _iter114 : this.success) { - _iter131.write(oprot); + _iter114.write(oprot); } oprot.writeListEnd(); } @@ -30301,13 +26092,13 @@ public class Cassandra { case 0: // SUCCESS if (field.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list132 = iprot.readListBegin(); - this.success = new ArrayList(_list132.size); - for (int _i133 = 0; _i133 < _list132.size; ++_i133) + org.apache.thrift.protocol.TList _list115 = iprot.readListBegin(); + this.success = new ArrayList(_list115.size); + for (int _i116 = 0; _i116 < _list115.size; ++_i116) { - String _elem134; - _elem134 = iprot.readString(); - this.success.add(_elem134); + String _elem117; + _elem117 = iprot.readString(); + this.success.add(_elem117); } iprot.readListEnd(); } @@ -30341,9 +26132,9 @@ public class Cassandra { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.success.size())); - for (String _iter135 : this.success) + for (String _iter118 : this.success) { - oprot.writeString(_iter135); + oprot.writeString(_iter118); } oprot.writeListEnd(); } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java index eecb6d4675..9a901ab65f 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java @@ -306,8 +306,6 @@ public class CfDef implements org.apache.thrift.TBase, jav this.read_repair_chance = 1; - this.replicate_on_write = false; - this.row_cache_provider = "org.apache.cassandra.cache.ConcurrentLinkedHashCacheProvider"; } @@ -417,8 +415,8 @@ public class CfDef implements org.apache.thrift.TBase, jav this.memtable_throughput_in_mb = 0; setMemtable_operations_in_millionsIsSet(false); this.memtable_operations_in_millions = 0.0; + setReplicate_on_writeIsSet(false); this.replicate_on_write = false; - setMerge_shards_chanceIsSet(false); this.merge_shards_chance = 0.0; this.key_validation_class = null; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnOrSuperColumn.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnOrSuperColumn.java index 2b65b67cda..a689e342f7 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnOrSuperColumn.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnOrSuperColumn.java @@ -49,22 +49,33 @@ import org.slf4j.LoggerFactory; * in Columns, those values will be in the attribute column. This change was made between 0.3 and 0.4 to standardize on * single query methods that may return either a SuperColumn or Column. * + * If the query was on a counter column family, you will either get a counter_column (instead of a column) or a + * counter_super_column (instead of a super_column) + * * @param column. The Column returned by get() or get_slice(). * @param super_column. The SuperColumn returned by get() or get_slice(). + * @param counter_column. The Counterolumn returned by get() or get_slice(). + * @param counter_super_column. The CounterSuperColumn returned by get() or get_slice(). */ public class ColumnOrSuperColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ColumnOrSuperColumn"); private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField SUPER_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("super_column", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField COUNTER_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("counter_column", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField COUNTER_SUPER_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("counter_super_column", org.apache.thrift.protocol.TType.STRUCT, (short)4); public Column column; public SuperColumn super_column; + public CounterColumn counter_column; + public CounterSuperColumn counter_super_column; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { COLUMN((short)1, "column"), - SUPER_COLUMN((short)2, "super_column"); + SUPER_COLUMN((short)2, "super_column"), + COUNTER_COLUMN((short)3, "counter_column"), + COUNTER_SUPER_COLUMN((short)4, "counter_super_column"); private static final Map byName = new HashMap(); @@ -83,6 +94,10 @@ public class ColumnOrSuperColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Counter"); - - private static final org.apache.thrift.protocol.TField COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("column", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField SUPER_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("super_column", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - public CounterColumn column; - public CounterSuperColumn super_column; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - COLUMN((short)1, "column"), - SUPER_COLUMN((short)2, "super_column"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // COLUMN - return COLUMN; - case 2: // SUPER_COLUMN - return SUPER_COLUMN; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.COLUMN, new org.apache.thrift.meta_data.FieldMetaData("column", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CounterColumn.class))); - tmpMap.put(_Fields.SUPER_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("super_column", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CounterSuperColumn.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Counter.class, metaDataMap); - } - - public Counter() { - } - - /** - * Performs a deep copy on other. - */ - public Counter(Counter other) { - if (other.isSetColumn()) { - this.column = new CounterColumn(other.column); - } - if (other.isSetSuper_column()) { - this.super_column = new CounterSuperColumn(other.super_column); - } - } - - public Counter deepCopy() { - return new Counter(this); - } - - @Override - public void clear() { - this.column = null; - this.super_column = null; - } - - public CounterColumn getColumn() { - return this.column; - } - - public Counter setColumn(CounterColumn column) { - this.column = column; - return this; - } - - public void unsetColumn() { - this.column = null; - } - - /** Returns true if field column is set (has been assigned a value) and false otherwise */ - public boolean isSetColumn() { - return this.column != null; - } - - public void setColumnIsSet(boolean value) { - if (!value) { - this.column = null; - } - } - - public CounterSuperColumn getSuper_column() { - return this.super_column; - } - - public Counter setSuper_column(CounterSuperColumn super_column) { - this.super_column = super_column; - return this; - } - - public void unsetSuper_column() { - this.super_column = null; - } - - /** Returns true if field super_column is set (has been assigned a value) and false otherwise */ - public boolean isSetSuper_column() { - return this.super_column != null; - } - - public void setSuper_columnIsSet(boolean value) { - if (!value) { - this.super_column = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case COLUMN: - if (value == null) { - unsetColumn(); - } else { - setColumn((CounterColumn)value); - } - break; - - case SUPER_COLUMN: - if (value == null) { - unsetSuper_column(); - } else { - setSuper_column((CounterSuperColumn)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case COLUMN: - return getColumn(); - - case SUPER_COLUMN: - return getSuper_column(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case COLUMN: - return isSetColumn(); - case SUPER_COLUMN: - return isSetSuper_column(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof Counter) - return this.equals((Counter)that); - return false; - } - - public boolean equals(Counter that) { - if (that == null) - return false; - - boolean this_present_column = true && this.isSetColumn(); - boolean that_present_column = true && that.isSetColumn(); - if (this_present_column || that_present_column) { - if (!(this_present_column && that_present_column)) - return false; - if (!this.column.equals(that.column)) - return false; - } - - boolean this_present_super_column = true && this.isSetSuper_column(); - boolean that_present_super_column = true && that.isSetSuper_column(); - if (this_present_super_column || that_present_super_column) { - if (!(this_present_super_column && that_present_super_column)) - return false; - if (!this.super_column.equals(that.super_column)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_column = true && (isSetColumn()); - builder.append(present_column); - if (present_column) - builder.append(column); - - boolean present_super_column = true && (isSetSuper_column()); - builder.append(present_super_column); - if (present_super_column) - builder.append(super_column); - - return builder.toHashCode(); - } - - public int compareTo(Counter other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - Counter typedOther = (Counter)other; - - lastComparison = Boolean.valueOf(isSetColumn()).compareTo(typedOther.isSetColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column, typedOther.column); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSuper_column()).compareTo(typedOther.isSetSuper_column()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuper_column()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.super_column, typedOther.super_column); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // COLUMN - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.column = new CounterColumn(); - this.column.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // SUPER_COLUMN - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.super_column = new CounterSuperColumn(); - this.super_column.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.column != null) { - if (isSetColumn()) { - oprot.writeFieldBegin(COLUMN_FIELD_DESC); - this.column.write(oprot); - oprot.writeFieldEnd(); - } - } - if (this.super_column != null) { - if (isSetSuper_column()) { - oprot.writeFieldBegin(SUPER_COLUMN_FIELD_DESC); - this.super_column.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("Counter("); - boolean first = true; - - if (isSetColumn()) { - sb.append("column:"); - if (this.column == null) { - sb.append("null"); - } else { - sb.append(this.column); - } - first = false; - } - if (isSetSuper_column()) { - if (!first) sb.append(", "); - sb.append("super_column:"); - if (this.super_column == null) { - sb.append("null"); - } else { - sb.append(this.super_column); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - -} - diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/Mutation.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/Mutation.java index 49bd38570a..1d1553d755 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/Mutation.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/Mutation.java @@ -43,9 +43,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * A Mutation is either an insert (represented by filling column_or_supercolumn), a deletion (represented by filling the deletion attribute), - * a counter addition (represented by filling counter), or a counter deletion (represented by filling counter_deletion). - * @param column_or_supercolumn. An insert to a column or supercolumn + * A Mutation is either an insert (represented by filling column_or_supercolumn) or a deletion (represented by filling the deletion attribute). + * @param column_or_supercolumn. An insert to a column or supercolumn (possibly counter column or supercolumn) * @param deletion. A deletion of a column or supercolumn */ public class Mutation implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -53,17 +52,14 @@ public class Mutation implements org.apache.thrift.TBase byName = new HashMap(); @@ -82,8 +78,6 @@ public class Mutation implements org.apache.thrift.TBase columns = thriftClient.get_slice(key, parent, predicate, consistencyLevel); AbstractType validator; @@ -366,7 +360,7 @@ public class CliClient extends CliUserHelp sessionState.out.println(")"); } - else + else if (cosc.isSetColumn()) { Column column = cosc.column; validator = getValidatorForValue(cfDef, column.getName()); @@ -381,23 +375,9 @@ public class CliClient extends CliUserHelp column.timestamp, column.isSetTtl() ? String.format(", ttl=%d", column.getTtl()) : ""); } - } - - sessionState.out.println("Returned " + columns.size() + " results."); - } - - private void doCounterSlice(String keyspace, ByteBuffer key, ColumnParent parent, SlicePredicate predicate, boolean isSuperCF) - throws InvalidRequestException, UnavailableException, TimedOutException, TException, IllegalAccessException, NotFoundException, InstantiationException, NoSuchFieldException - { - String columnFamily = parent.column_family; - List columns = thriftClient.get_counter_slice(key, parent, predicate, consistencyLevel); - - // Print out super columns or columns. - for (Counter cosc : columns) - { - if (cosc.isSetSuper_column()) + else if (cosc.isSetCounter_super_column()) { - CounterSuperColumn superColumn = cosc.super_column; + CounterSuperColumn superColumn = cosc.counter_super_column; sessionState.out.printf("=> (super_column=%s,", formatColumnName(keyspace, columnFamily, superColumn.name)); for (CounterColumn col : superColumn.getColumns()) @@ -406,9 +386,9 @@ public class CliClient extends CliUserHelp } sessionState.out.println(")"); } - else + else // cosc.isSetCounter_column() { - CounterColumn column = cosc.column; + CounterColumn column = cosc.counter_column; String formattedName = isSuperCF ? formatSubcolumnName(keyspace, columnFamily, column.name) : formatColumnName(keyspace, columnFamily, column.name); @@ -562,7 +542,7 @@ public class CliClient extends CliUserHelp CounterColumn column; try { - column = thriftClient.get_counter(key, path, consistencyLevel).column; + column = thriftClient.get(key, path, consistencyLevel).counter_column; } catch (NotFoundException e) { diff --git a/src/java/org/apache/cassandra/db/RowMutation.java b/src/java/org/apache/cassandra/db/RowMutation.java index a4bd459c16..bec6a9737a 100644 --- a/src/java/org/apache/cassandra/db/RowMutation.java +++ b/src/java/org/apache/cassandra/db/RowMutation.java @@ -33,7 +33,6 @@ import org.apache.cassandra.io.ICompactSerializer; import org.apache.cassandra.net.Message; import org.apache.cassandra.service.StorageService; import org.apache.cassandra.thrift.ColumnOrSuperColumn; -import org.apache.cassandra.thrift.Counter; import org.apache.cassandra.thrift.Deletion; import org.apache.cassandra.thrift.Mutation; import org.apache.cassandra.thrift.SlicePredicate; @@ -243,10 +242,6 @@ public class RowMutation implements IMutation, MessageProducer { addColumnOrSuperColumnToRowMutation(rm, cfName, mutation.column_or_supercolumn); } - if (mutation.counter != null) - { - addCounterToRowMutation(rm, cfName, mutation.counter); - } } } return rm; @@ -295,31 +290,27 @@ public class RowMutation implements IMutation, MessageProducer private static void addColumnOrSuperColumnToRowMutation(RowMutation rm, String cfName, ColumnOrSuperColumn cosc) { - if (cosc.column == null) + if (cosc.super_column != null) { for (org.apache.cassandra.thrift.Column column : cosc.super_column.columns) { rm.add(new QueryPath(cfName, cosc.super_column.name, column.name), column.value, column.timestamp, column.ttl); } } - else + else if (cosc.column != null) { rm.add(new QueryPath(cfName, null, cosc.column.name), cosc.column.value, cosc.column.timestamp, cosc.column.ttl); } - } - - private static void addCounterToRowMutation(RowMutation rm, String cfName, Counter counter) - { - if (counter.column == null) + else if (cosc.counter_super_column != null) { - for (org.apache.cassandra.thrift.CounterColumn column : counter.super_column.columns) + for (org.apache.cassandra.thrift.CounterColumn column : cosc.counter_super_column.columns) { - rm.addCounter(new QueryPath(cfName, counter.super_column.name, column.name), column.value); + rm.addCounter(new QueryPath(cfName, cosc.counter_super_column.name, column.name), column.value); } } - else + else // cosc.counter_column != null { - rm.addCounter(new QueryPath(cfName, null, counter.column.name), counter.column.value); + rm.addCounter(new QueryPath(cfName, null, cosc.counter_column.name), cosc.counter_column.value); } } diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java index 782851913d..bbc061fa5d 100644 --- a/src/java/org/apache/cassandra/thrift/CassandraServer.java +++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java @@ -65,6 +65,7 @@ public class CassandraServer implements Cassandra.Iface private final static List EMPTY_COLUMNS = Collections.emptyList(); private final static List EMPTY_SUBCOLUMNS = Collections.emptyList(); + private final static List EMPTY_COUNTER_SUBCOLUMNS = Collections.emptyList(); // thread local state containing session information public final ThreadLocal clientState = new ThreadLocal() @@ -157,6 +158,28 @@ public class CassandraServer implements Cassandra.Iface return thriftColumns; } + public List thriftifyCounterSubColumns(Collection columns) + { + if (columns == null || columns.isEmpty()) + { + return EMPTY_COUNTER_SUBCOLUMNS; + } + + ArrayList thriftColumns = new ArrayList(columns.size()); + for (IColumn column : columns) + { + if (column.isMarkedForDelete()) + { + continue; + } + assert column instanceof org.apache.cassandra.db.CounterColumn; + CounterColumn thrift_column = new CounterColumn(column.name(), CounterContext.instance().total(column.value())); + thriftColumns.add(thrift_column); + } + + return thriftColumns; + } + public List thriftifyColumns(Collection columns, boolean reverseOrder) { ArrayList thriftColumns = new ArrayList(columns.size()); @@ -166,12 +189,20 @@ public class CassandraServer implements Cassandra.Iface { continue; } - Column thrift_column = new Column(column.name(), column.value(), column.timestamp()); - if (column instanceof ExpiringColumn) + if (column instanceof org.apache.cassandra.db.CounterColumn) { - thrift_column.setTtl(((ExpiringColumn) column).getTimeToLive()); + CounterColumn thrift_column = new CounterColumn(column.name(), CounterContext.instance().total(column.value())); + thriftColumns.add(new ColumnOrSuperColumn().setCounter_column(thrift_column)); + } + else + { + Column thrift_column = new Column(column.name(), column.value(), column.timestamp()); + if (column instanceof ExpiringColumn) + { + thrift_column.setTtl(((ExpiringColumn) column).getTimeToLive()); + } + thriftColumns.add(new ColumnOrSuperColumn().setColumn(thrift_column)); } - thriftColumns.add(new ColumnOrSuperColumn().setColumn(thrift_column)); } // we have to do the reversing here, since internally we pass results around in ColumnFamily @@ -182,6 +213,14 @@ public class CassandraServer implements Cassandra.Iface return thriftColumns; } + private List thriftifySuperColumns(Collection columns, boolean reverseOrder, boolean isCounterCF) + { + if (isCounterCF) + return thriftifyCounterSuperColumns(columns, reverseOrder); + else + return thriftifySuperColumns(columns, reverseOrder); + } + private List thriftifySuperColumns(Collection columns, boolean reverseOrder) { ArrayList thriftSuperColumns = new ArrayList(columns.size()); @@ -202,6 +241,26 @@ public class CassandraServer implements Cassandra.Iface return thriftSuperColumns; } + private List thriftifyCounterSuperColumns(Collection columns, boolean reverseOrder) + { + ArrayList thriftSuperColumns = new ArrayList(columns.size()); + for (IColumn column : columns) + { + List subcolumns = thriftifyCounterSubColumns(column.getSubColumns()); + if (subcolumns.isEmpty()) + { + continue; + } + CounterSuperColumn superColumn = new CounterSuperColumn(column.name(), subcolumns); + thriftSuperColumns.add(new ColumnOrSuperColumn().setCounter_super_column(superColumn)); + } + + if (reverseOrder) + Collections.reverse(thriftSuperColumns); + + return thriftSuperColumns; + } + private Map> getSlice(List commands, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException { @@ -232,9 +291,14 @@ public class CassandraServer implements Cassandra.Iface return thriftifyColumns(subcolumns, reverseOrder); } if (cf.isSuper()) - return thriftifySuperColumns(cf.getSortedColumns(), reverseOrder); + { + boolean isCounterCF = cf.metadata().getDefaultValidator().isCommutative(); + return thriftifySuperColumns(cf.getSortedColumns(), reverseOrder, isCounterCF); + } else + { return thriftifyColumns(cf.getSortedColumns(), reverseOrder); + } } public List get_slice(ByteBuffer key, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) @@ -243,7 +307,7 @@ public class CassandraServer implements Cassandra.Iface logger.debug("get_slice"); state().hasColumnFamilyAccess(column_parent.column_family, Permission.READ); - return multigetSliceInternal(state().getKeyspace(), Collections.singletonList(key), column_parent, predicate, consistency_level, false).get(key); + return multigetSliceInternal(state().getKeyspace(), Collections.singletonList(key), column_parent, predicate, consistency_level).get(key); } public Map> multiget_slice(List keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) @@ -252,13 +316,13 @@ public class CassandraServer implements Cassandra.Iface logger.debug("multiget_slice"); state().hasColumnFamilyAccess(column_parent.column_family, Permission.READ); - return multigetSliceInternal(state().getKeyspace(), keys, column_parent, predicate, consistency_level, false); + return multigetSliceInternal(state().getKeyspace(), keys, column_parent, predicate, consistency_level); } - private Map> multigetSliceInternal(String keyspace, List keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level, boolean isCommutativeOp) + private Map> multigetSliceInternal(String keyspace, List keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException { - CFMetaData metadata = ThriftValidation.validateColumnFamily(keyspace, column_parent.column_family, isCommutativeOp); + CFMetaData metadata = ThriftValidation.validateColumnFamily(keyspace, column_parent.column_family); ThriftValidation.validateColumnParent(metadata, column_parent); ThriftValidation.validatePredicate(metadata, column_parent, predicate); @@ -284,13 +348,13 @@ public class CassandraServer implements Cassandra.Iface return getSlice(commands, consistency_level); } - private ColumnOrSuperColumn internal_get(ByteBuffer key, ColumnPath column_path, ConsistencyLevel consistency_level, boolean isCommutativeOp) + private ColumnOrSuperColumn internal_get(ByteBuffer key, ColumnPath column_path, ConsistencyLevel consistency_level) throws InvalidRequestException, NotFoundException, UnavailableException, TimedOutException { state().hasColumnFamilyAccess(column_path.column_family, Permission.READ); String keyspace = state().getKeyspace(); - CFMetaData metadata = ThriftValidation.validateColumnFamily(keyspace, column_path.column_family, isCommutativeOp); + CFMetaData metadata = ThriftValidation.validateColumnFamily(keyspace, column_path.column_family); ThriftValidation.validateColumnPath(metadata, column_path); QueryPath path = new QueryPath(column_path.column_family, column_path.column == null ? null : column_path.super_column); @@ -316,7 +380,7 @@ public class CassandraServer implements Cassandra.Iface { logger.debug("get"); - return internal_get(key, column_path, consistency_level, false); + return internal_get(key, column_path, consistency_level); } public int get_count(ByteBuffer key, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) @@ -338,7 +402,7 @@ public class CassandraServer implements Cassandra.Iface String keyspace = state().getKeyspace(); Map counts = new HashMap(); - Map> columnFamiliesMap = multigetSliceInternal(keyspace, keys, column_parent, predicate, consistency_level, false); + Map> columnFamiliesMap = multigetSliceInternal(keyspace, keys, column_parent, predicate, consistency_level); for (Map.Entry> cf : columnFamiliesMap.entrySet()) { counts.put(cf.getKey(), cf.getValue().size()); @@ -398,8 +462,6 @@ public class CassandraServer implements Cassandra.Iface cfamsSeen.add(cfName); } - boolean isCommutativeOp = false; - boolean isOnlyDeletion = true; CFMetaData metadata = ThriftValidation.validateColumnFamily(keyspace, cfName); ThriftValidation.validateKey(metadata, key); @@ -1028,73 +1090,6 @@ public class CassandraServer implements Cassandra.Iface doInsert(consistency_level, Arrays.asList(rm)); } - private Counter getCounter(ColumnOrSuperColumn cosc) - { - if (cosc.isSetColumn()) { - return new Counter().setColumn(new CounterColumn(cosc.column.name, CounterContext.instance().total(cosc.column.value))); - } else if(cosc.isSetSuper_column()) { - List cc = new ArrayList(cosc.super_column.columns.size()); - for (Column col : cosc.super_column.columns) - { - cc.add(new CounterColumn(col.name, CounterContext.instance().total(col.value))); - } - return new Counter().setSuper_column(new CounterSuperColumn(cosc.super_column.name, cc)); - } - return null; - } - - public Counter get_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level) - throws InvalidRequestException, NotFoundException, UnavailableException, TimedOutException, TException - { - logger.debug("get_counter"); - - String keyspace = state().getKeyspace(); - - return getCounter(internal_get(key, path, consistency_level, true)); - } - - private List getCounters(List cosc) - { - List rv = new ArrayList(cosc.size()); - for (ColumnOrSuperColumn columnOrSuperColumn : cosc) - { - Counter c = getCounter(columnOrSuperColumn); - if (c != null) { - rv.add(c); - } - } - return rv; - } - - public List get_counter_slice(ByteBuffer key, ColumnParent column_parent, SlicePredicate predicate, - ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, - TException - { - if (logger.isDebugEnabled()) - logger.debug("get_counter_slice"); - - state().hasColumnFamilyAccess(column_parent.column_family, Permission.READ); - List cosc = multigetSliceInternal(state().getKeyspace(), Collections.singletonList(key), column_parent, predicate, consistency_level, true).get(key); - return getCounters(cosc); - } - - public Map> multiget_counter_slice(List keys, ColumnParent column_parent, - SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, - UnavailableException, TimedOutException, TException - { - if (logger.isDebugEnabled()) - logger.debug("multiget_counter_slice"); - - state().hasColumnFamilyAccess(column_parent.column_family, Permission.READ); - Map> slices = multigetSliceInternal(state().getKeyspace(), keys, column_parent, predicate, consistency_level, true); - Map> rv = new HashMap>(slices.size()); - for (Entry> entry : slices.entrySet()) - { - rv.put(entry.getKey(), getCounters(entry.getValue())); - } - return rv; - } - public void remove_counter(ByteBuffer key, ColumnPath path, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { diff --git a/src/java/org/apache/cassandra/thrift/ThriftValidation.java b/src/java/org/apache/cassandra/thrift/ThriftValidation.java index 45916b6d00..e6eda4832f 100644 --- a/src/java/org/apache/cassandra/thrift/ThriftValidation.java +++ b/src/java/org/apache/cassandra/thrift/ThriftValidation.java @@ -96,7 +96,7 @@ public class ThriftValidation return metadata; } - // This should only be used when the operation should be authorized whether this is a counter CF or not + // To be used when the operation should be authorized whether this is a counter CF or not public static CFMetaData validateColumnFamily(String tablename, String cfName) throws InvalidRequestException { validateTable(tablename); @@ -249,8 +249,22 @@ public class ThriftValidation public static void validateColumnOrSuperColumn(CFMetaData metadata, ColumnOrSuperColumn cosc) throws InvalidRequestException { + boolean isCommutative = metadata.getDefaultValidator().isCommutative(); + + int nulls = 0; + if (cosc.column == null) nulls++; + if (cosc.super_column == null) nulls++; + if (cosc.counter_column == null) nulls++; + if (cosc.counter_super_column == null) nulls++; + + if (nulls != 3) + throw new InvalidRequestException("ColumnOrSuperColumn must have one (and only one) of column, super_column, counter and counter_super_column"); + if (cosc.column != null) { + if (isCommutative) + throw new InvalidRequestException("invalid operation for commutative columnfamily " + metadata.cfName); + validateTtl(cosc.column); validateColumnPath(metadata, new ColumnPath(metadata.cfName).setSuper_column((ByteBuffer)null).setColumn(cosc.column.name)); validateColumnData(metadata, cosc.column); @@ -258,6 +272,9 @@ public class ThriftValidation if (cosc.super_column != null) { + if (isCommutative) + throw new InvalidRequestException("invalid operation for commutative columnfamily " + metadata.cfName); + for (Column c : cosc.super_column.columns) { validateColumnPath(metadata, new ColumnPath(metadata.cfName).setSuper_column(cosc.super_column.name).setColumn(c.name)); @@ -265,24 +282,22 @@ public class ThriftValidation } } - if (cosc.column == null && cosc.super_column == null) - throw new InvalidRequestException("ColumnOrSuperColumn must have one or both of Column or SuperColumn"); - } - - public static void validateCounter(CFMetaData metadata, Counter counter) - throws InvalidRequestException - { - if (counter.column != null) - validateColumnPath(metadata, new ColumnPath(metadata.cfName).setSuper_column((ByteBuffer)null).setColumn(counter.column.name)); - - if (counter.super_column != null) + if (cosc.counter_column != null) { - for (CounterColumn c : counter.super_column.columns) - validateColumnPath(metadata, new ColumnPath(metadata.cfName).setSuper_column(counter.super_column.name).setColumn(c.name)); + if (!isCommutative) + throw new InvalidRequestException("invalid operation for non commutative columnfamily " + metadata.cfName); + + validateColumnPath(metadata, new ColumnPath(metadata.cfName).setSuper_column((ByteBuffer)null).setColumn(cosc.counter_column.name)); } - if (counter.column == null && counter.super_column == null) - throw new InvalidRequestException("Counter must have one or both of column or super_column"); + if (cosc.counter_super_column != null) + { + if (!isCommutative) + throw new InvalidRequestException("invalid operation for non commutative columnfamily " + metadata.cfName); + + for (CounterColumn c : cosc.counter_super_column.columns) + validateColumnPath(metadata, new ColumnPath(metadata.cfName).setSuper_column(cosc.counter_super_column.name).setColumn(c.name)); + } } private static void validateTtl(Column column) throws InvalidRequestException @@ -300,34 +315,21 @@ public class ThriftValidation { ColumnOrSuperColumn cosc = mut.column_or_supercolumn; Deletion del = mut.deletion; - Counter counter = mut.counter; - boolean isCommutative = metadata.getDefaultValidator().isCommutative(); int nulls = 0; if (cosc == null) nulls++; if (del == null) nulls++; - if (counter == null) nulls++; - if (nulls != 2) + if (nulls != 1) { - throw new InvalidRequestException("mutation must have one and only one of column_or_supercolumn, deletion, counter or counter_deletion"); + throw new InvalidRequestException("mutation must have one and only one of column_or_supercolumn or deletion"); } if (cosc != null) { - if (isCommutative) - throw new InvalidRequestException("invalid operation for commutative columnfamily " + metadata.cfName); - validateColumnOrSuperColumn(metadata, cosc); } - if (counter != null) - { - if (!isCommutative) - throw new InvalidRequestException("invalid operation for non commutative columnfamily " + metadata.cfName); - - validateCounter(metadata, counter); - } - if (del != null) + else { validateDeletion(metadata, del); } diff --git a/test/system/test_thrift_server.py b/test/system/test_thrift_server.py index 01bb086089..a9c8d99f0c 100644 --- a/test/system/test_thrift_server.py +++ b/test/system/test_thrift_server.py @@ -55,13 +55,6 @@ def _assert_no_columnpath(key, column_path): except NotFoundException: assert True, 'column did not exist' -def _assert_no_columnpath_counter(key, column_path): - try: - client.get_counter(key, column_path, ConsistencyLevel.ONE) - assert False, ('columnpath %s existed in %s when it should not' % (column_path, key)) - except NotFoundException: - assert True, 'column did not exist' - def _insert_simple(block=True): return _insert_multi(['key1']) @@ -1504,18 +1497,18 @@ class TestMutations(ThriftTester): # insert positive and negative values and check the counts client.add('key1', ColumnParent(column_family='Counter1'), CounterColumn('c1', d1), ConsistencyLevel.ONE) time.sleep(0.1) - rv1 = client.get_counter('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) - assert rv1.column.value == d1 + rv1 = client.get('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) + assert rv1.counter_column.value == d1 client.add('key1', ColumnParent(column_family='Counter1'), CounterColumn('c1', d2), ConsistencyLevel.ONE) time.sleep(0.1) - rv2 = client.get_counter('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) - assert rv2.column.value == (d1+d2) + rv2 = client.get('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) + assert rv2.counter_column.value == (d1+d2) client.add('key1', ColumnParent(column_family='Counter1'), CounterColumn('c1', d3), ConsistencyLevel.ONE) time.sleep(0.1) - rv3 = client.get_counter('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) - assert rv3.column.value == (d1+d2+d3) + rv3 = client.get('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) + assert rv3.counter_column.value == (d1+d2+d3) def test_incr_decr_super_add(self): _set_keyspace('Keyspace1') @@ -1527,19 +1520,19 @@ class TestMutations(ThriftTester): client.add('key1', ColumnParent(column_family='SuperCounter1', super_column='sc1'), CounterColumn('c1', d1), ConsistencyLevel.ONE) client.add('key1', ColumnParent(column_family='SuperCounter1', super_column='sc1'), CounterColumn('c2', d2), ConsistencyLevel.ONE) time.sleep(0.1) - rv1 = client.get_counter('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1'), ConsistencyLevel.ONE) - assert rv1.super_column.columns[0].value == d1 - assert rv1.super_column.columns[1].value == d2 + rv1 = client.get('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1'), ConsistencyLevel.ONE) + assert rv1.counter_super_column.columns[0].value == d1 + assert rv1.counter_super_column.columns[1].value == d2 client.add('key1', ColumnParent(column_family='SuperCounter1', super_column='sc1'), CounterColumn('c1', d2), ConsistencyLevel.ONE) time.sleep(0.1) - rv2 = client.get_counter('key1', ColumnPath('SuperCounter1', 'sc1', 'c1'), ConsistencyLevel.ONE) - assert rv2.column.value == (d1+d2) + rv2 = client.get('key1', ColumnPath('SuperCounter1', 'sc1', 'c1'), ConsistencyLevel.ONE) + assert rv2.counter_column.value == (d1+d2) client.add('key1', ColumnParent(column_family='SuperCounter1', super_column='sc1'), CounterColumn('c1', d3), ConsistencyLevel.ONE) time.sleep(0.1) - rv3 = client.get_counter('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1'), ConsistencyLevel.ONE) - assert rv3.column.value == (d1+d2+d3) + rv3 = client.get('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1'), ConsistencyLevel.ONE) + assert rv3.counter_column.value == (d1+d2+d3) def test_incr_standard_remove(self): _set_keyspace('Keyspace1') @@ -1549,22 +1542,22 @@ class TestMutations(ThriftTester): # insert value and check it exists client.add('key1', ColumnParent(column_family='Counter1'), CounterColumn('c1', d1), ConsistencyLevel.ONE) time.sleep(5) - rv1 = client.get_counter('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) - assert rv1.column.value == d1 + rv1 = client.get('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) + assert rv1.counter_column.value == d1 # remove the previous column and check that it is gone client.remove_counter('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) time.sleep(5) - _assert_no_columnpath_counter('key1', ColumnPath(column_family='Counter1', column='c1')) + _assert_no_columnpath('key1', ColumnPath(column_family='Counter1', column='c1')) # insert again and this time delete the whole row, check that it is gone client.add('key1', ColumnParent(column_family='Counter1'), CounterColumn('c1', d1), ConsistencyLevel.ONE) time.sleep(5) - rv2 = client.get_counter('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) - assert rv2.column.value == d1 + rv2 = client.get('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) + assert rv2.counter_column.value == d1 client.remove_counter('key1', ColumnPath(column_family='Counter1'), ConsistencyLevel.ONE) time.sleep(5) - _assert_no_columnpath_counter('key1', ColumnPath(column_family='Counter1', column='c1')) + _assert_no_columnpath('key1', ColumnPath(column_family='Counter1', column='c1')) def test_incr_super_remove(self): _set_keyspace('Keyspace1') @@ -1574,22 +1567,22 @@ class TestMutations(ThriftTester): # insert value and check it exists client.add('key1', ColumnParent(column_family='SuperCounter1', super_column='sc1'), CounterColumn('c1', d1), ConsistencyLevel.ONE) time.sleep(5) - rv1 = client.get_counter('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1'), ConsistencyLevel.ONE) - assert rv1.column.value == d1 + rv1 = client.get('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1'), ConsistencyLevel.ONE) + assert rv1.counter_column.value == d1 # remove the previous column and check that it is gone client.remove_counter('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1'), ConsistencyLevel.ONE) time.sleep(5) - _assert_no_columnpath_counter('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1')) + _assert_no_columnpath('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1')) # insert again and this time delete the whole row, check that it is gone client.add('key1', ColumnParent(column_family='SuperCounter1', super_column='sc1'), CounterColumn('c1', d1), ConsistencyLevel.ONE) time.sleep(5) - rv2 = client.get_counter('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1'), ConsistencyLevel.ONE) - assert rv2.column.value == d1 + rv2 = client.get('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1'), ConsistencyLevel.ONE) + assert rv2.counter_column.value == d1 client.remove_counter('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1'), ConsistencyLevel.ONE) time.sleep(5) - _assert_no_columnpath_counter('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1')) + _assert_no_columnpath('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1')) def test_incr_decr_standard_remove(self): _set_keyspace('Keyspace1') @@ -1599,22 +1592,22 @@ class TestMutations(ThriftTester): # insert value and check it exists client.add('key1', ColumnParent(column_family='Counter1'), CounterColumn('c1', d1), ConsistencyLevel.ONE) time.sleep(5) - rv1 = client.get_counter('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) - assert rv1.column.value == d1 + rv1 = client.get('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) + assert rv1.counter_column.value == d1 # remove the previous column and check that it is gone client.remove_counter('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) time.sleep(5) - _assert_no_columnpath_counter('key1', ColumnPath(column_family='Counter1', column='c1')) + _assert_no_columnpath('key1', ColumnPath(column_family='Counter1', column='c1')) # insert again and this time delete the whole row, check that it is gone client.add('key1', ColumnParent(column_family='Counter1'), CounterColumn('c1', d1), ConsistencyLevel.ONE) time.sleep(5) - rv2 = client.get_counter('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) - assert rv2.column.value == d1 + rv2 = client.get('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) + assert rv2.counter_column.value == d1 client.remove_counter('key1', ColumnPath(column_family='Counter1'), ConsistencyLevel.ONE) time.sleep(5) - _assert_no_columnpath_counter('key1', ColumnPath(column_family='Counter1', column='c1')) + _assert_no_columnpath('key1', ColumnPath(column_family='Counter1', column='c1')) def test_incr_decr_super_remove(self): _set_keyspace('Keyspace1') @@ -1624,22 +1617,22 @@ class TestMutations(ThriftTester): # insert value and check it exists client.add('key1', ColumnParent(column_family='SuperCounter1', super_column='sc1'), CounterColumn('c1', d1), ConsistencyLevel.ONE) time.sleep(5) - rv1 = client.get_counter('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1'), ConsistencyLevel.ONE) - assert rv1.column.value == d1 + rv1 = client.get('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1'), ConsistencyLevel.ONE) + assert rv1.counter_column.value == d1 # remove the previous column and check that it is gone client.remove_counter('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1'), ConsistencyLevel.ONE) time.sleep(5) - _assert_no_columnpath_counter('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1')) + _assert_no_columnpath('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1')) # insert again and this time delete the whole row, check that it is gone client.add('key1', ColumnParent(column_family='SuperCounter1', super_column='sc1'), CounterColumn('c1', d1), ConsistencyLevel.ONE) time.sleep(5) - rv2 = client.get_counter('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1'), ConsistencyLevel.ONE) - assert rv2.column.value == d1 + rv2 = client.get('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1'), ConsistencyLevel.ONE) + assert rv2.counter_column.value == d1 client.remove_counter('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1'), ConsistencyLevel.ONE) time.sleep(5) - _assert_no_columnpath_counter('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1')) + _assert_no_columnpath('key1', ColumnPath(column_family='SuperCounter1', super_column='sc1', column='c1')) def test_incr_decr_standard_batch_add(self): _set_keyspace('Keyspace1') @@ -1647,15 +1640,15 @@ class TestMutations(ThriftTester): d1 = 12 d2 = -21 update_map = {'key1': {'Counter1': [ - Mutation(counter=Counter(column=CounterColumn('c1', d1))), - Mutation(counter=Counter(column=CounterColumn('c1', d2))), + Mutation(column_or_supercolumn=ColumnOrSuperColumn(counter_column=CounterColumn('c1', d1))), + Mutation(column_or_supercolumn=ColumnOrSuperColumn(counter_column=CounterColumn('c1', d2))), ]}} # insert positive and negative values and check the counts client.batch_mutate(update_map, ConsistencyLevel.ONE) time.sleep(0.1) - rv1 = client.get_counter('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) - assert rv1.column.value == d1+d2 + rv1 = client.get('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) + assert rv1.counter_column.value == d1+d2 def test_incr_decr_standard_batch_remove(self): _set_keyspace('Keyspace1') @@ -1665,13 +1658,13 @@ class TestMutations(ThriftTester): # insert positive and negative values and check the counts update_map = {'key1': {'Counter1': [ - Mutation(counter=Counter(column=CounterColumn('c1', d1))), - Mutation(counter=Counter(column=CounterColumn('c1', d2))), + Mutation(column_or_supercolumn=ColumnOrSuperColumn(counter_column=CounterColumn('c1', d1))), + Mutation(column_or_supercolumn=ColumnOrSuperColumn(counter_column=CounterColumn('c1', d2))), ]}} client.batch_mutate(update_map, ConsistencyLevel.ONE) time.sleep(5) - rv1 = client.get_counter('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) - assert rv1.column.value == d1+d2 + rv1 = client.get('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) + assert rv1.counter_column.value == d1+d2 # remove the previous column and check that it is gone update_map = {'key1': {'Counter1': [ @@ -1679,24 +1672,24 @@ class TestMutations(ThriftTester): ]}} client.batch_mutate(update_map, ConsistencyLevel.ONE) time.sleep(5) - _assert_no_columnpath_counter('key1', ColumnPath(column_family='Counter1', column='c1')) + _assert_no_columnpath('key1', ColumnPath(column_family='Counter1', column='c1')) # insert again and this time delete the whole row, check that it is gone update_map = {'key1': {'Counter1': [ - Mutation(counter=Counter(column=CounterColumn('c1', d1))), - Mutation(counter=Counter(column=CounterColumn('c1', d2))), + Mutation(column_or_supercolumn=ColumnOrSuperColumn(counter_column=CounterColumn('c1', d1))), + Mutation(column_or_supercolumn=ColumnOrSuperColumn(counter_column=CounterColumn('c1', d2))), ]}} client.batch_mutate(update_map, ConsistencyLevel.ONE) time.sleep(5) - rv2 = client.get_counter('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) - assert rv2.column.value == d1+d2 + rv2 = client.get('key1', ColumnPath(column_family='Counter1', column='c1'), ConsistencyLevel.ONE) + assert rv2.counter_column.value == d1+d2 update_map = {'key1': {'Counter1': [ Mutation(deletion=Deletion()), ]}} client.batch_mutate(update_map, ConsistencyLevel.ONE) time.sleep(5) - _assert_no_columnpath_counter('key1', ColumnPath(column_family='Counter1', column='c1')) + _assert_no_columnpath('key1', ColumnPath(column_family='Counter1', column='c1')) def test_incr_decr_standard_slice(self): _set_keyspace('Keyspace1') @@ -1712,10 +1705,10 @@ class TestMutations(ThriftTester): time.sleep(0.1) # insert positive and negative values and check the counts - counters = client.get_counter_slice('key1', ColumnParent('Counter1'), SlicePredicate(['c3', 'c4']), ConsistencyLevel.ONE) + counters = client.get_slice('key1', ColumnParent('Counter1'), SlicePredicate(['c3', 'c4']), ConsistencyLevel.ONE) - assert counters[0].column.value == d1+d2 - assert counters[1].column.value == d1 + assert counters[0].counter_column.value == d1+d2 + assert counters[1].counter_column.value == d1 def test_incr_decr_standard_muliget_slice(self): _set_keyspace('Keyspace1') @@ -1737,12 +1730,12 @@ class TestMutations(ThriftTester): time.sleep(0.1) # insert positive and negative values and check the counts - counters = client.multiget_counter_slice(['key1', 'key2'], ColumnParent('Counter1'), SlicePredicate(['c3', 'c4']), ConsistencyLevel.ONE) + counters = client.multiget_slice(['key1', 'key2'], ColumnParent('Counter1'), SlicePredicate(['c3', 'c4']), ConsistencyLevel.ONE) - assert counters['key1'][0].column.value == d1+d2 - assert counters['key1'][1].column.value == d1 - assert counters['key2'][0].column.value == d1+d2 - assert counters['key2'][1].column.value == d1 + assert counters['key1'][0].counter_column.value == d1+d2 + assert counters['key1'][1].counter_column.value == d1 + assert counters['key2'][0].counter_column.value == d1+d2 + assert counters['key2'][1].counter_column.value == d1 def test_index_scan(self): _set_keyspace('Keyspace1') diff --git a/tools/stress/src/org/apache/cassandra/stress/operations/CounterAdder.java b/tools/stress/src/org/apache/cassandra/stress/operations/CounterAdder.java index 89fe857ba3..adbc2d2025 100644 --- a/tools/stress/src/org/apache/cassandra/stress/operations/CounterAdder.java +++ b/tools/stress/src/org/apache/cassandra/stress/operations/CounterAdder.java @@ -111,8 +111,8 @@ public class CounterAdder extends Operation for (CounterSuperColumn s : superColumns) { - Counter counter = new Counter().setSuper_column(s); - mutations.add(new Mutation().setCounter(counter)); + ColumnOrSuperColumn cosc = new ColumnOrSuperColumn().setCounter_super_column(s); + mutations.add(new Mutation().setColumn_or_supercolumn(cosc)); } mutationMap.put("SuperCounter1", mutations); @@ -127,8 +127,8 @@ public class CounterAdder extends Operation for (CounterColumn c : columns) { - Counter counter = new Counter().setColumn(c); - mutations.add(new Mutation().setCounter(counter)); + ColumnOrSuperColumn cosc = new ColumnOrSuperColumn().setCounter_column(c); + mutations.add(new Mutation().setColumn_or_supercolumn(cosc)); } mutationMap.put("Counter1", mutations); diff --git a/tools/stress/src/org/apache/cassandra/stress/operations/CounterGetter.java b/tools/stress/src/org/apache/cassandra/stress/operations/CounterGetter.java index c4b8440381..09dcb32954 100644 --- a/tools/stress/src/org/apache/cassandra/stress/operations/CounterGetter.java +++ b/tools/stress/src/org/apache/cassandra/stress/operations/CounterGetter.java @@ -77,8 +77,8 @@ public class CounterGetter extends Operation try { - List counters; - counters = client.get_counter_slice(key, parent, predicate, session.getConsistencyLevel()); + List counters; + counters = client.get_slice(key, parent, predicate, session.getConsistencyLevel()); success = (counters.size() != 0); } catch (Exception e) @@ -122,8 +122,8 @@ public class CounterGetter extends Operation try { - List counters; - counters = client.get_counter_slice(keyBuffer, parent, predicate, session.getConsistencyLevel()); + List counters; + counters = client.get_slice(keyBuffer, parent, predicate, session.getConsistencyLevel()); success = (counters.size() != 0); } catch (Exception e)