You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ee...@apache.org on 2010/01/05 21:33:45 UTC
svn commit: r896207 [2/4] -
/incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/
Modified: incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java?rev=896207&r1=896206&r2=896207&view=diff
==============================================================================
--- incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java (original)
+++ incubator/cassandra/trunk/interface/gen-java/org/apache/cassandra/service/Cassandra.java Tue Jan 5 20:33:44 2010
@@ -4,34 +4,15 @@
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package org.apache.cassandra.service;
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
+import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
+import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.util.Arrays;
@@ -55,7 +36,7 @@
* @param column_path
* @param consistency_level
*/
- public ColumnOrSuperColumn get(String keyspace, String key, ColumnPath column_path, int consistency_level) throws InvalidRequestException, NotFoundException, UnavailableException, TimedOutException, TException;
+ public ColumnOrSuperColumn get(String keyspace, String key, ColumnPath column_path, ConsistencyLevel consistency_level) throws InvalidRequestException, NotFoundException, UnavailableException, TimedOutException, TException;
/**
* Get the group of columns contained by column_parent (either a ColumnFamily name or a ColumnFamily/SuperColumn name
@@ -67,7 +48,7 @@
* @param predicate
* @param consistency_level
*/
- public List<ColumnOrSuperColumn> get_slice(String keyspace, String key, ColumnParent column_parent, SlicePredicate predicate, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
+ public List<ColumnOrSuperColumn> get_slice(String keyspace, String key, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
/**
* Perform a get for column_path in parallel on the given list<string> keys. The return value maps keys to the
@@ -79,7 +60,7 @@
* @param column_path
* @param consistency_level
*/
- public Map<String,ColumnOrSuperColumn> multiget(String keyspace, List<String> keys, ColumnPath column_path, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
+ public Map<String,ColumnOrSuperColumn> multiget(String keyspace, List<String> keys, ColumnPath column_path, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
/**
* Performs a get_slice for column_parent and predicate for the given keys in parallel.
@@ -90,7 +71,7 @@
* @param predicate
* @param consistency_level
*/
- public Map<String,List<ColumnOrSuperColumn>> multiget_slice(String keyspace, List<String> keys, ColumnParent column_parent, SlicePredicate predicate, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
+ public Map<String,List<ColumnOrSuperColumn>> multiget_slice(String keyspace, List<String> keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
/**
* returns the number of columns for a particular <code>key</code> and <code>ColumnFamily</code> or <code>SuperColumn</code>.
@@ -100,7 +81,7 @@
* @param column_parent
* @param consistency_level
*/
- public int get_count(String keyspace, String key, ColumnParent column_parent, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
+ public int get_count(String keyspace, String key, ColumnParent column_parent, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
/**
* @deprecated; use get_range_slice instead
@@ -112,7 +93,7 @@
* @param count
* @param consistency_level
*/
- public List<String> get_key_range(String keyspace, String column_family, String start, String finish, int count, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
+ public List<String> get_key_range(String keyspace, String column_family, String start, String finish, int count, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
/**
* returns a subset of columns for a range of keys.
@@ -125,7 +106,7 @@
* @param row_count
* @param consistency_level
*/
- public List<KeySlice> get_range_slice(String keyspace, ColumnParent column_parent, SlicePredicate predicate, String start_key, String finish_key, int row_count, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
+ public List<KeySlice> get_range_slice(String keyspace, ColumnParent column_parent, SlicePredicate predicate, String start_key, String finish_key, int row_count, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
/**
* Insert a Column consisting of (column_path.column, value, timestamp) at the given column_path.column_family and optional
@@ -139,7 +120,7 @@
* @param timestamp
* @param consistency_level
*/
- public void insert(String keyspace, String key, ColumnPath column_path, byte[] value, long timestamp, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
+ public void insert(String keyspace, String key, ColumnPath column_path, byte[] value, long timestamp, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
/**
* Insert Columns or SuperColumns across different Column Families for the same row key. batch_mutation is a
@@ -151,7 +132,7 @@
* @param cfmap
* @param consistency_level
*/
- public void batch_insert(String keyspace, String key, Map<String,List<ColumnOrSuperColumn>> cfmap, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
+ public void batch_insert(String keyspace, String key, Map<String,List<ColumnOrSuperColumn>> cfmap, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
/**
* Remove data from the row specified by key at the granularity specified by column_path, and the given timestamp. Note
@@ -164,9 +145,9 @@
* @param timestamp
* @param consistency_level
*/
- public void remove(String keyspace, String key, ColumnPath column_path, long timestamp, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
+ public void remove(String keyspace, String key, ColumnPath column_path, long timestamp, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
- public void batch_mutate(String keyspace, Map<String,Map<String,List<Mutation>>> mutation_map, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
+ public void batch_mutate(String keyspace, Map<String,Map<String,List<Mutation>>> mutation_map, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException;
/**
* get property whose value is of type string.
@@ -218,13 +199,13 @@
return this.oprot_;
}
- public ColumnOrSuperColumn get(String keyspace, String key, ColumnPath column_path, int consistency_level) throws InvalidRequestException, NotFoundException, UnavailableException, TimedOutException, TException
+ public ColumnOrSuperColumn get(String keyspace, String key, ColumnPath column_path, ConsistencyLevel consistency_level) throws InvalidRequestException, NotFoundException, UnavailableException, TimedOutException, TException
{
send_get(keyspace, key, column_path, consistency_level);
return recv_get();
}
- public void send_get(String keyspace, String key, ColumnPath column_path, int consistency_level) throws TException
+ public void send_get(String keyspace, String key, ColumnPath column_path, ConsistencyLevel consistency_level) throws TException
{
oprot_.writeMessageBegin(new TMessage("get", TMessageType.CALL, seqid_));
get_args args = new get_args();
@@ -266,13 +247,13 @@
throw new TApplicationException(TApplicationException.MISSING_RESULT, "get failed: unknown result");
}
- public List<ColumnOrSuperColumn> get_slice(String keyspace, String key, ColumnParent column_parent, SlicePredicate predicate, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
+ public List<ColumnOrSuperColumn> get_slice(String keyspace, String key, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
{
send_get_slice(keyspace, key, column_parent, predicate, consistency_level);
return recv_get_slice();
}
- public void send_get_slice(String keyspace, String key, ColumnParent column_parent, SlicePredicate predicate, int consistency_level) throws TException
+ public void send_get_slice(String keyspace, String key, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws TException
{
oprot_.writeMessageBegin(new TMessage("get_slice", TMessageType.CALL, seqid_));
get_slice_args args = new get_slice_args();
@@ -312,13 +293,13 @@
throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_slice failed: unknown result");
}
- public Map<String,ColumnOrSuperColumn> multiget(String keyspace, List<String> keys, ColumnPath column_path, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
+ public Map<String,ColumnOrSuperColumn> multiget(String keyspace, List<String> keys, ColumnPath column_path, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
{
send_multiget(keyspace, keys, column_path, consistency_level);
return recv_multiget();
}
- public void send_multiget(String keyspace, List<String> keys, ColumnPath column_path, int consistency_level) throws TException
+ public void send_multiget(String keyspace, List<String> keys, ColumnPath column_path, ConsistencyLevel consistency_level) throws TException
{
oprot_.writeMessageBegin(new TMessage("multiget", TMessageType.CALL, seqid_));
multiget_args args = new multiget_args();
@@ -357,13 +338,13 @@
throw new TApplicationException(TApplicationException.MISSING_RESULT, "multiget failed: unknown result");
}
- public Map<String,List<ColumnOrSuperColumn>> multiget_slice(String keyspace, List<String> keys, ColumnParent column_parent, SlicePredicate predicate, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
+ public Map<String,List<ColumnOrSuperColumn>> multiget_slice(String keyspace, List<String> keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
{
send_multiget_slice(keyspace, keys, column_parent, predicate, consistency_level);
return recv_multiget_slice();
}
- public void send_multiget_slice(String keyspace, List<String> keys, ColumnParent column_parent, SlicePredicate predicate, int consistency_level) throws TException
+ public void send_multiget_slice(String keyspace, List<String> keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws TException
{
oprot_.writeMessageBegin(new TMessage("multiget_slice", TMessageType.CALL, seqid_));
multiget_slice_args args = new multiget_slice_args();
@@ -403,13 +384,13 @@
throw new TApplicationException(TApplicationException.MISSING_RESULT, "multiget_slice failed: unknown result");
}
- public int get_count(String keyspace, String key, ColumnParent column_parent, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
+ public int get_count(String keyspace, String key, ColumnParent column_parent, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
{
send_get_count(keyspace, key, column_parent, consistency_level);
return recv_get_count();
}
- public void send_get_count(String keyspace, String key, ColumnParent column_parent, int consistency_level) throws TException
+ public void send_get_count(String keyspace, String key, ColumnParent column_parent, ConsistencyLevel consistency_level) throws TException
{
oprot_.writeMessageBegin(new TMessage("get_count", TMessageType.CALL, seqid_));
get_count_args args = new get_count_args();
@@ -448,13 +429,13 @@
throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_count failed: unknown result");
}
- public List<String> get_key_range(String keyspace, String column_family, String start, String finish, int count, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
+ public List<String> get_key_range(String keyspace, String column_family, String start, String finish, int count, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
{
send_get_key_range(keyspace, column_family, start, finish, count, consistency_level);
return recv_get_key_range();
}
- public void send_get_key_range(String keyspace, String column_family, String start, String finish, int count, int consistency_level) throws TException
+ public void send_get_key_range(String keyspace, String column_family, String start, String finish, int count, ConsistencyLevel consistency_level) throws TException
{
oprot_.writeMessageBegin(new TMessage("get_key_range", TMessageType.CALL, seqid_));
get_key_range_args args = new get_key_range_args();
@@ -495,13 +476,13 @@
throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_key_range failed: unknown result");
}
- public List<KeySlice> get_range_slice(String keyspace, ColumnParent column_parent, SlicePredicate predicate, String start_key, String finish_key, int row_count, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
+ public List<KeySlice> get_range_slice(String keyspace, ColumnParent column_parent, SlicePredicate predicate, String start_key, String finish_key, int row_count, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
{
send_get_range_slice(keyspace, column_parent, predicate, start_key, finish_key, row_count, consistency_level);
return recv_get_range_slice();
}
- public void send_get_range_slice(String keyspace, ColumnParent column_parent, SlicePredicate predicate, String start_key, String finish_key, int row_count, int consistency_level) throws TException
+ public void send_get_range_slice(String keyspace, ColumnParent column_parent, SlicePredicate predicate, String start_key, String finish_key, int row_count, ConsistencyLevel consistency_level) throws TException
{
oprot_.writeMessageBegin(new TMessage("get_range_slice", TMessageType.CALL, seqid_));
get_range_slice_args args = new get_range_slice_args();
@@ -543,13 +524,13 @@
throw new TApplicationException(TApplicationException.MISSING_RESULT, "get_range_slice failed: unknown result");
}
- public void insert(String keyspace, String key, ColumnPath column_path, byte[] value, long timestamp, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
+ public void insert(String keyspace, String key, ColumnPath column_path, byte[] value, long timestamp, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
{
send_insert(keyspace, key, column_path, value, timestamp, consistency_level);
recv_insert();
}
- public void send_insert(String keyspace, String key, ColumnPath column_path, byte[] value, long timestamp, int consistency_level) throws TException
+ public void send_insert(String keyspace, String key, ColumnPath column_path, byte[] value, long timestamp, ConsistencyLevel consistency_level) throws TException
{
oprot_.writeMessageBegin(new TMessage("insert", TMessageType.CALL, seqid_));
insert_args args = new insert_args();
@@ -587,13 +568,13 @@
return;
}
- public void batch_insert(String keyspace, String key, Map<String,List<ColumnOrSuperColumn>> cfmap, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
+ public void batch_insert(String keyspace, String key, Map<String,List<ColumnOrSuperColumn>> cfmap, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
{
send_batch_insert(keyspace, key, cfmap, consistency_level);
recv_batch_insert();
}
- public void send_batch_insert(String keyspace, String key, Map<String,List<ColumnOrSuperColumn>> cfmap, int consistency_level) throws TException
+ public void send_batch_insert(String keyspace, String key, Map<String,List<ColumnOrSuperColumn>> cfmap, ConsistencyLevel consistency_level) throws TException
{
oprot_.writeMessageBegin(new TMessage("batch_insert", TMessageType.CALL, seqid_));
batch_insert_args args = new batch_insert_args();
@@ -629,13 +610,13 @@
return;
}
- public void remove(String keyspace, String key, ColumnPath column_path, long timestamp, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
+ public void remove(String keyspace, String key, ColumnPath column_path, long timestamp, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
{
send_remove(keyspace, key, column_path, timestamp, consistency_level);
recv_remove();
}
- public void send_remove(String keyspace, String key, ColumnPath column_path, long timestamp, int consistency_level) throws TException
+ public void send_remove(String keyspace, String key, ColumnPath column_path, long timestamp, ConsistencyLevel consistency_level) throws TException
{
oprot_.writeMessageBegin(new TMessage("remove", TMessageType.CALL, seqid_));
remove_args args = new remove_args();
@@ -672,13 +653,13 @@
return;
}
- public void batch_mutate(String keyspace, Map<String,Map<String,List<Mutation>>> mutation_map, int consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
+ public void batch_mutate(String keyspace, Map<String,Map<String,List<Mutation>>> mutation_map, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException
{
send_batch_mutate(keyspace, mutation_map, consistency_level);
recv_batch_mutate();
}
- public void send_batch_mutate(String keyspace, Map<String,Map<String,List<Mutation>>> mutation_map, int consistency_level) throws TException
+ public void send_batch_mutate(String keyspace, Map<String,Map<String,List<Mutation>>> mutation_map, ConsistencyLevel consistency_level) throws TException
{
oprot_.writeMessageBegin(new TMessage("batch_mutate", TMessageType.CALL, seqid_));
batch_mutate_args args = new batch_mutate_args();
@@ -1279,8 +1260,9 @@
}
- public static class get_args implements TBase, java.io.Serializable, Cloneable, Comparable<get_args> {
+ public static class get_args implements TBase<get_args._Fields>, java.io.Serializable, Cloneable, Comparable<get_args> {
private static final TStruct STRUCT_DESC = new TStruct("get_args");
+
private static final TField KEYSPACE_FIELD_DESC = new TField("keyspace", TType.STRING, (short)1);
private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)2);
private static final TField COLUMN_PATH_FIELD_DESC = new TField("column_path", TType.STRUCT, (short)3);
@@ -1293,25 +1275,81 @@
*
* @see ConsistencyLevel
*/
- public int consistency_level;
- public static final int KEYSPACE = 1;
- public static final int KEY = 2;
- public static final int COLUMN_PATH = 3;
- public static final int CONSISTENCY_LEVEL = 4;
+ public ConsistencyLevel consistency_level;
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements TFieldIdEnum {
+ KEYSPACE((short)1, "keyspace"),
+ KEY((short)2, "key"),
+ COLUMN_PATH((short)3, "column_path"),
+ /**
+ *
+ * @see ConsistencyLevel
+ */
+ CONSISTENCY_LEVEL((short)4, "consistency_level");
+
+ private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byId.put((int)field._thriftId, field);
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ return byId.get(fieldId);
+ }
+
+ /**
+ * 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
- private static final int __CONSISTENCY_LEVEL_ISSET_ID = 0;
- private BitSet __isset_bit_vector = new BitSet(1);
- public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
- put(KEYSPACE, new FieldMetaData("keyspace", TFieldRequirementType.REQUIRED,
+ public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
+ put(_Fields.KEYSPACE, new FieldMetaData("keyspace", TFieldRequirementType.REQUIRED,
new FieldValueMetaData(TType.STRING)));
- put(KEY, new FieldMetaData("key", TFieldRequirementType.REQUIRED,
+ put(_Fields.KEY, new FieldMetaData("key", TFieldRequirementType.REQUIRED,
new FieldValueMetaData(TType.STRING)));
- put(COLUMN_PATH, new FieldMetaData("column_path", TFieldRequirementType.REQUIRED,
+ put(_Fields.COLUMN_PATH, new FieldMetaData("column_path", TFieldRequirementType.REQUIRED,
new StructMetaData(TType.STRUCT, ColumnPath.class)));
- put(CONSISTENCY_LEVEL, new FieldMetaData("consistency_level", TFieldRequirementType.REQUIRED,
- new FieldValueMetaData(TType.I32)));
+ put(_Fields.CONSISTENCY_LEVEL, new FieldMetaData("consistency_level", TFieldRequirementType.REQUIRED,
+ new EnumMetaData(TType.ENUM, ConsistencyLevel.class)));
}});
static {
@@ -1319,7 +1357,7 @@
}
public get_args() {
- this.consistency_level = 1;
+ this.consistency_level = ConsistencyLevel.ONE;
}
@@ -1327,22 +1365,19 @@
String keyspace,
String key,
ColumnPath column_path,
- int consistency_level)
+ ConsistencyLevel consistency_level)
{
this();
this.keyspace = keyspace;
this.key = key;
this.column_path = column_path;
this.consistency_level = consistency_level;
- setConsistency_levelIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public get_args(get_args other) {
- __isset_bit_vector.clear();
- __isset_bit_vector.or(other.__isset_bit_vector);
if (other.isSetKeyspace()) {
this.keyspace = other.keyspace;
}
@@ -1352,7 +1387,9 @@
if (other.isSetColumn_path()) {
this.column_path = new ColumnPath(other.column_path);
}
- this.consistency_level = other.consistency_level;
+ if (other.isSetConsistency_level()) {
+ this.consistency_level = other.consistency_level;
+ }
}
public get_args deepCopy() {
@@ -1377,7 +1414,7 @@
this.keyspace = null;
}
- // Returns true if field keyspace is set (has been asigned a value) and false otherwise
+ /** Returns true if field keyspace is set (has been asigned a value) and false otherwise */
public boolean isSetKeyspace() {
return this.keyspace != null;
}
@@ -1401,7 +1438,7 @@
this.key = null;
}
- // Returns true if field key is set (has been asigned a value) and false otherwise
+ /** Returns true if field key is set (has been asigned a value) and false otherwise */
public boolean isSetKey() {
return this.key != null;
}
@@ -1425,7 +1462,7 @@
this.column_path = null;
}
- // Returns true if field column_path is set (has been asigned a value) and false otherwise
+ /** Returns true if field column_path is set (has been asigned a value) and false otherwise */
public boolean isSetColumn_path() {
return this.column_path != null;
}
@@ -1440,7 +1477,7 @@
*
* @see ConsistencyLevel
*/
- public int getConsistency_level() {
+ public ConsistencyLevel getConsistency_level() {
return this.consistency_level;
}
@@ -1448,27 +1485,28 @@
*
* @see ConsistencyLevel
*/
- public get_args setConsistency_level(int consistency_level) {
+ public get_args setConsistency_level(ConsistencyLevel consistency_level) {
this.consistency_level = consistency_level;
- setConsistency_levelIsSet(true);
return this;
}
public void unsetConsistency_level() {
- __isset_bit_vector.clear(__CONSISTENCY_LEVEL_ISSET_ID);
+ this.consistency_level = null;
}
- // Returns true if field consistency_level is set (has been asigned a value) and false otherwise
+ /** Returns true if field consistency_level is set (has been asigned a value) and false otherwise */
public boolean isSetConsistency_level() {
- return __isset_bit_vector.get(__CONSISTENCY_LEVEL_ISSET_ID);
+ return this.consistency_level != null;
}
public void setConsistency_levelIsSet(boolean value) {
- __isset_bit_vector.set(__CONSISTENCY_LEVEL_ISSET_ID, value);
+ if (!value) {
+ this.consistency_level = null;
+ }
}
- public void setFieldValue(int fieldID, Object value) {
- switch (fieldID) {
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
case KEYSPACE:
if (value == null) {
unsetKeyspace();
@@ -1497,17 +1535,19 @@
if (value == null) {
unsetConsistency_level();
} else {
- setConsistency_level((Integer)value);
+ setConsistency_level((ConsistencyLevel)value);
}
break;
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
}
- public Object getFieldValue(int fieldID) {
- switch (fieldID) {
+ public void setFieldValue(int fieldID, Object value) {
+ setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
case KEYSPACE:
return getKeyspace();
@@ -1520,14 +1560,17 @@
case CONSISTENCY_LEVEL:
return getConsistency_level();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
+ throw new IllegalStateException();
}
- // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise
- public boolean isSet(int fieldID) {
- switch (fieldID) {
+ public Object getFieldValue(int fieldId) {
+ return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ switch (field) {
case KEYSPACE:
return isSetKeyspace();
case KEY:
@@ -1536,9 +1579,12 @@
return isSetColumn_path();
case CONSISTENCY_LEVEL:
return isSetConsistency_level();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
+ throw new IllegalStateException();
+ }
+
+ public boolean isSet(int fieldID) {
+ return isSet(_Fields.findByThriftIdOrThrow(fieldID));
}
@Override
@@ -1581,12 +1627,12 @@
return false;
}
- boolean this_present_consistency_level = true;
- boolean that_present_consistency_level = true;
+ 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 != that.consistency_level)
+ if (!this.consistency_level.equals(that.consistency_level))
return false;
}
@@ -1650,51 +1696,47 @@
if (field.type == TType.STOP) {
break;
}
- switch (field.id)
- {
- case KEYSPACE:
- if (field.type == TType.STRING) {
- this.keyspace = iprot.readString();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case KEY:
- if (field.type == TType.STRING) {
- this.key = iprot.readString();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case COLUMN_PATH:
- if (field.type == TType.STRUCT) {
- this.column_path = new ColumnPath();
- this.column_path.read(iprot);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case CONSISTENCY_LEVEL:
- if (field.type == TType.I32) {
- this.consistency_level = iprot.readI32();
- setConsistency_levelIsSet(true);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- TProtocolUtil.skip(iprot, field.type);
- break;
+ _Fields fieldId = _Fields.findByThriftId(field.id);
+ if (fieldId == null) {
+ TProtocolUtil.skip(iprot, field.type);
+ } else {
+ switch (fieldId) {
+ case KEYSPACE:
+ if (field.type == TType.STRING) {
+ this.keyspace = iprot.readString();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case KEY:
+ if (field.type == TType.STRING) {
+ this.key = iprot.readString();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case COLUMN_PATH:
+ if (field.type == TType.STRUCT) {
+ this.column_path = new ColumnPath();
+ this.column_path.read(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case CONSISTENCY_LEVEL:
+ if (field.type == TType.I32) {
+ this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32());
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ }
+ iprot.readFieldEnd();
}
- iprot.readFieldEnd();
}
iprot.readStructEnd();
-
// check for required fields of primitive type, which can't be checked in the validate method
- if (!isSetConsistency_level()) {
- throw new TProtocolException("Required field 'consistency_level' was not found in serialized data! Struct: " + toString());
- }
validate();
}
@@ -1717,9 +1759,11 @@
this.column_path.write(oprot);
oprot.writeFieldEnd();
}
- oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC);
- oprot.writeI32(this.consistency_level);
- 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();
}
@@ -1754,14 +1798,10 @@
first = false;
if (!first) sb.append(", ");
sb.append("consistency_level:");
- String consistency_level_name = ConsistencyLevel.VALUES_TO_NAMES.get(this.consistency_level);
- if (consistency_level_name != null) {
- sb.append(consistency_level_name);
- sb.append(" (");
- }
- sb.append(this.consistency_level);
- if (consistency_level_name != null) {
- sb.append(")");
+ if (this.consistency_level == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.consistency_level);
}
first = false;
sb.append(")");
@@ -1779,17 +1819,16 @@
if (column_path == null) {
throw new TProtocolException("Required field 'column_path' was not present! Struct: " + toString());
}
- // alas, we cannot check 'consistency_level' because it's a primitive and you chose the non-beans generator.
- // check that fields of type enum have valid values
- if (isSetConsistency_level() && !ConsistencyLevel.VALID_VALUES.contains(consistency_level)){
- throw new TProtocolException("The field 'consistency_level' has been assigned the invalid value " + consistency_level);
+ if (consistency_level == null) {
+ throw new TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString());
}
}
}
- public static class get_result implements TBase, java.io.Serializable, Cloneable, Comparable<get_result> {
+ public static class get_result implements TBase<get_result._Fields>, java.io.Serializable, Cloneable, Comparable<get_result> {
private static final TStruct STRUCT_DESC = new TStruct("get_result");
+
private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
private static final TField IRE_FIELD_DESC = new TField("ire", TType.STRUCT, (short)1);
private static final TField NFE_FIELD_DESC = new TField("nfe", TType.STRUCT, (short)2);
@@ -1801,24 +1840,78 @@
public NotFoundException nfe;
public UnavailableException ue;
public TimedOutException te;
- public static final int SUCCESS = 0;
- public static final int IRE = 1;
- public static final int NFE = 2;
- public static final int UE = 3;
- public static final int TE = 4;
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements 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<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byId.put((int)field._thriftId, field);
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ return byId.get(fieldId);
+ }
+
+ /**
+ * 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<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
- put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT,
+ public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
+ put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT,
new StructMetaData(TType.STRUCT, ColumnOrSuperColumn.class)));
- put(IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT,
+ put(_Fields.IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.STRUCT)));
- put(NFE, new FieldMetaData("nfe", TFieldRequirementType.DEFAULT,
+ put(_Fields.NFE, new FieldMetaData("nfe", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.STRUCT)));
- put(UE, new FieldMetaData("ue", TFieldRequirementType.DEFAULT,
+ put(_Fields.UE, new FieldMetaData("ue", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.STRUCT)));
- put(TE, new FieldMetaData("te", TFieldRequirementType.DEFAULT,
+ put(_Fields.TE, new FieldMetaData("te", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.STRUCT)));
}});
@@ -1887,7 +1980,7 @@
this.success = null;
}
- // Returns true if field success is set (has been asigned a value) and false otherwise
+ /** Returns true if field success is set (has been asigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
@@ -1911,7 +2004,7 @@
this.ire = null;
}
- // Returns true if field ire is set (has been asigned a value) and false otherwise
+ /** Returns true if field ire is set (has been asigned a value) and false otherwise */
public boolean isSetIre() {
return this.ire != null;
}
@@ -1935,7 +2028,7 @@
this.nfe = null;
}
- // Returns true if field nfe is set (has been asigned a value) and false otherwise
+ /** Returns true if field nfe is set (has been asigned a value) and false otherwise */
public boolean isSetNfe() {
return this.nfe != null;
}
@@ -1959,7 +2052,7 @@
this.ue = null;
}
- // Returns true if field ue is set (has been asigned a value) and false otherwise
+ /** Returns true if field ue is set (has been asigned a value) and false otherwise */
public boolean isSetUe() {
return this.ue != null;
}
@@ -1983,7 +2076,7 @@
this.te = null;
}
- // Returns true if field te is set (has been asigned a value) and false otherwise
+ /** Returns true if field te is set (has been asigned a value) and false otherwise */
public boolean isSetTe() {
return this.te != null;
}
@@ -1994,8 +2087,8 @@
}
}
- public void setFieldValue(int fieldID, Object value) {
- switch (fieldID) {
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
@@ -2036,13 +2129,15 @@
}
break;
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
}
- public Object getFieldValue(int fieldID) {
- switch (fieldID) {
+ public void setFieldValue(int fieldID, Object value) {
+ setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
case SUCCESS:
return getSuccess();
@@ -2058,14 +2153,17 @@
case TE:
return getTe();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
+ throw new IllegalStateException();
}
- // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise
- public boolean isSet(int fieldID) {
- switch (fieldID) {
+ public Object getFieldValue(int fieldId) {
+ return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ switch (field) {
case SUCCESS:
return isSetSuccess();
case IRE:
@@ -2076,9 +2174,12 @@
return isSetUe();
case TE:
return isSetTe();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
+ throw new IllegalStateException();
+ }
+
+ public boolean isSet(int fieldID) {
+ return isSet(_Fields.findByThriftIdOrThrow(fieldID));
}
@Override
@@ -2207,57 +2308,57 @@
if (field.type == TType.STOP) {
break;
}
- switch (field.id)
- {
- case SUCCESS:
- if (field.type == TType.STRUCT) {
- this.success = new ColumnOrSuperColumn();
- this.success.read(iprot);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case IRE:
- if (field.type == TType.STRUCT) {
- this.ire = new InvalidRequestException();
- this.ire.read(iprot);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case NFE:
- if (field.type == TType.STRUCT) {
- this.nfe = new NotFoundException();
- this.nfe.read(iprot);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case UE:
- if (field.type == TType.STRUCT) {
- this.ue = new UnavailableException();
- this.ue.read(iprot);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case TE:
- if (field.type == TType.STRUCT) {
- this.te = new TimedOutException();
- this.te.read(iprot);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- TProtocolUtil.skip(iprot, field.type);
- break;
+ _Fields fieldId = _Fields.findByThriftId(field.id);
+ if (fieldId == null) {
+ TProtocolUtil.skip(iprot, field.type);
+ } else {
+ switch (fieldId) {
+ case SUCCESS:
+ if (field.type == TType.STRUCT) {
+ this.success = new ColumnOrSuperColumn();
+ this.success.read(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case IRE:
+ if (field.type == TType.STRUCT) {
+ this.ire = new InvalidRequestException();
+ this.ire.read(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case NFE:
+ if (field.type == TType.STRUCT) {
+ this.nfe = new NotFoundException();
+ this.nfe.read(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case UE:
+ if (field.type == TType.STRUCT) {
+ this.ue = new UnavailableException();
+ this.ue.read(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case TE:
+ if (field.type == TType.STRUCT) {
+ this.te = new TimedOutException();
+ this.te.read(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ }
+ iprot.readFieldEnd();
}
- iprot.readFieldEnd();
}
iprot.readStructEnd();
-
// check for required fields of primitive type, which can't be checked in the validate method
validate();
}
@@ -2340,13 +2441,13 @@
public void validate() throws TException {
// check for required fields
- // check that fields of type enum have valid values
}
}
- public static class get_slice_args implements TBase, java.io.Serializable, Cloneable, Comparable<get_slice_args> {
+ public static class get_slice_args implements TBase<get_slice_args._Fields>, java.io.Serializable, Cloneable, Comparable<get_slice_args> {
private static final TStruct STRUCT_DESC = new TStruct("get_slice_args");
+
private static final TField KEYSPACE_FIELD_DESC = new TField("keyspace", TType.STRING, (short)1);
private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)2);
private static final TField COLUMN_PARENT_FIELD_DESC = new TField("column_parent", TType.STRUCT, (short)3);
@@ -2361,28 +2462,84 @@
*
* @see ConsistencyLevel
*/
- public int consistency_level;
- public static final int KEYSPACE = 1;
- public static final int KEY = 2;
- public static final int COLUMN_PARENT = 3;
- public static final int PREDICATE = 4;
- public static final int CONSISTENCY_LEVEL = 5;
+ public ConsistencyLevel consistency_level;
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements TFieldIdEnum {
+ KEYSPACE((short)1, "keyspace"),
+ KEY((short)2, "key"),
+ COLUMN_PARENT((short)3, "column_parent"),
+ PREDICATE((short)4, "predicate"),
+ /**
+ *
+ * @see ConsistencyLevel
+ */
+ CONSISTENCY_LEVEL((short)5, "consistency_level");
+
+ private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byId.put((int)field._thriftId, field);
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ return byId.get(fieldId);
+ }
+
+ /**
+ * 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
- private static final int __CONSISTENCY_LEVEL_ISSET_ID = 0;
- private BitSet __isset_bit_vector = new BitSet(1);
- public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
- put(KEYSPACE, new FieldMetaData("keyspace", TFieldRequirementType.REQUIRED,
+ public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
+ put(_Fields.KEYSPACE, new FieldMetaData("keyspace", TFieldRequirementType.REQUIRED,
new FieldValueMetaData(TType.STRING)));
- put(KEY, new FieldMetaData("key", TFieldRequirementType.REQUIRED,
+ put(_Fields.KEY, new FieldMetaData("key", TFieldRequirementType.REQUIRED,
new FieldValueMetaData(TType.STRING)));
- put(COLUMN_PARENT, new FieldMetaData("column_parent", TFieldRequirementType.REQUIRED,
+ put(_Fields.COLUMN_PARENT, new FieldMetaData("column_parent", TFieldRequirementType.REQUIRED,
new StructMetaData(TType.STRUCT, ColumnParent.class)));
- put(PREDICATE, new FieldMetaData("predicate", TFieldRequirementType.REQUIRED,
+ put(_Fields.PREDICATE, new FieldMetaData("predicate", TFieldRequirementType.REQUIRED,
new StructMetaData(TType.STRUCT, SlicePredicate.class)));
- put(CONSISTENCY_LEVEL, new FieldMetaData("consistency_level", TFieldRequirementType.REQUIRED,
- new FieldValueMetaData(TType.I32)));
+ put(_Fields.CONSISTENCY_LEVEL, new FieldMetaData("consistency_level", TFieldRequirementType.REQUIRED,
+ new EnumMetaData(TType.ENUM, ConsistencyLevel.class)));
}});
static {
@@ -2390,7 +2547,7 @@
}
public get_slice_args() {
- this.consistency_level = 1;
+ this.consistency_level = ConsistencyLevel.ONE;
}
@@ -2399,7 +2556,7 @@
String key,
ColumnParent column_parent,
SlicePredicate predicate,
- int consistency_level)
+ ConsistencyLevel consistency_level)
{
this();
this.keyspace = keyspace;
@@ -2407,15 +2564,12 @@
this.column_parent = column_parent;
this.predicate = predicate;
this.consistency_level = consistency_level;
- setConsistency_levelIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public get_slice_args(get_slice_args other) {
- __isset_bit_vector.clear();
- __isset_bit_vector.or(other.__isset_bit_vector);
if (other.isSetKeyspace()) {
this.keyspace = other.keyspace;
}
@@ -2428,7 +2582,9 @@
if (other.isSetPredicate()) {
this.predicate = new SlicePredicate(other.predicate);
}
- this.consistency_level = other.consistency_level;
+ if (other.isSetConsistency_level()) {
+ this.consistency_level = other.consistency_level;
+ }
}
public get_slice_args deepCopy() {
@@ -2453,7 +2609,7 @@
this.keyspace = null;
}
- // Returns true if field keyspace is set (has been asigned a value) and false otherwise
+ /** Returns true if field keyspace is set (has been asigned a value) and false otherwise */
public boolean isSetKeyspace() {
return this.keyspace != null;
}
@@ -2477,7 +2633,7 @@
this.key = null;
}
- // Returns true if field key is set (has been asigned a value) and false otherwise
+ /** Returns true if field key is set (has been asigned a value) and false otherwise */
public boolean isSetKey() {
return this.key != null;
}
@@ -2501,7 +2657,7 @@
this.column_parent = null;
}
- // Returns true if field column_parent is set (has been asigned a value) and false otherwise
+ /** Returns true if field column_parent is set (has been asigned a value) and false otherwise */
public boolean isSetColumn_parent() {
return this.column_parent != null;
}
@@ -2525,7 +2681,7 @@
this.predicate = null;
}
- // Returns true if field predicate is set (has been asigned a value) and false otherwise
+ /** Returns true if field predicate is set (has been asigned a value) and false otherwise */
public boolean isSetPredicate() {
return this.predicate != null;
}
@@ -2540,7 +2696,7 @@
*
* @see ConsistencyLevel
*/
- public int getConsistency_level() {
+ public ConsistencyLevel getConsistency_level() {
return this.consistency_level;
}
@@ -2548,27 +2704,28 @@
*
* @see ConsistencyLevel
*/
- public get_slice_args setConsistency_level(int consistency_level) {
+ public get_slice_args setConsistency_level(ConsistencyLevel consistency_level) {
this.consistency_level = consistency_level;
- setConsistency_levelIsSet(true);
return this;
}
public void unsetConsistency_level() {
- __isset_bit_vector.clear(__CONSISTENCY_LEVEL_ISSET_ID);
+ this.consistency_level = null;
}
- // Returns true if field consistency_level is set (has been asigned a value) and false otherwise
+ /** Returns true if field consistency_level is set (has been asigned a value) and false otherwise */
public boolean isSetConsistency_level() {
- return __isset_bit_vector.get(__CONSISTENCY_LEVEL_ISSET_ID);
+ return this.consistency_level != null;
}
public void setConsistency_levelIsSet(boolean value) {
- __isset_bit_vector.set(__CONSISTENCY_LEVEL_ISSET_ID, value);
+ if (!value) {
+ this.consistency_level = null;
+ }
}
- public void setFieldValue(int fieldID, Object value) {
- switch (fieldID) {
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
case KEYSPACE:
if (value == null) {
unsetKeyspace();
@@ -2605,17 +2762,19 @@
if (value == null) {
unsetConsistency_level();
} else {
- setConsistency_level((Integer)value);
+ setConsistency_level((ConsistencyLevel)value);
}
break;
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
}
- public Object getFieldValue(int fieldID) {
- switch (fieldID) {
+ public void setFieldValue(int fieldID, Object value) {
+ setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
case KEYSPACE:
return getKeyspace();
@@ -2631,14 +2790,17 @@
case CONSISTENCY_LEVEL:
return getConsistency_level();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
+ throw new IllegalStateException();
}
- // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise
- public boolean isSet(int fieldID) {
- switch (fieldID) {
+ public Object getFieldValue(int fieldId) {
+ return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ switch (field) {
case KEYSPACE:
return isSetKeyspace();
case KEY:
@@ -2649,9 +2811,12 @@
return isSetPredicate();
case CONSISTENCY_LEVEL:
return isSetConsistency_level();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
+ throw new IllegalStateException();
+ }
+
+ public boolean isSet(int fieldID) {
+ return isSet(_Fields.findByThriftIdOrThrow(fieldID));
}
@Override
@@ -2703,12 +2868,12 @@
return false;
}
- boolean this_present_consistency_level = true;
- boolean that_present_consistency_level = true;
+ 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 != that.consistency_level)
+ if (!this.consistency_level.equals(that.consistency_level))
return false;
}
@@ -2780,59 +2945,55 @@
if (field.type == TType.STOP) {
break;
}
- switch (field.id)
- {
- case KEYSPACE:
- if (field.type == TType.STRING) {
- this.keyspace = iprot.readString();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case KEY:
- if (field.type == TType.STRING) {
- this.key = iprot.readString();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case COLUMN_PARENT:
- if (field.type == TType.STRUCT) {
- this.column_parent = new ColumnParent();
- this.column_parent.read(iprot);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case PREDICATE:
- if (field.type == TType.STRUCT) {
- this.predicate = new SlicePredicate();
- this.predicate.read(iprot);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case CONSISTENCY_LEVEL:
- if (field.type == TType.I32) {
- this.consistency_level = iprot.readI32();
- setConsistency_levelIsSet(true);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- TProtocolUtil.skip(iprot, field.type);
- break;
+ _Fields fieldId = _Fields.findByThriftId(field.id);
+ if (fieldId == null) {
+ TProtocolUtil.skip(iprot, field.type);
+ } else {
+ switch (fieldId) {
+ case KEYSPACE:
+ if (field.type == TType.STRING) {
+ this.keyspace = iprot.readString();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case KEY:
+ if (field.type == TType.STRING) {
+ this.key = iprot.readString();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case COLUMN_PARENT:
+ if (field.type == TType.STRUCT) {
+ this.column_parent = new ColumnParent();
+ this.column_parent.read(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case PREDICATE:
+ if (field.type == TType.STRUCT) {
+ this.predicate = new SlicePredicate();
+ this.predicate.read(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case CONSISTENCY_LEVEL:
+ if (field.type == TType.I32) {
+ this.consistency_level = ConsistencyLevel.findByValue(iprot.readI32());
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ }
+ iprot.readFieldEnd();
}
- iprot.readFieldEnd();
}
iprot.readStructEnd();
-
// check for required fields of primitive type, which can't be checked in the validate method
- if (!isSetConsistency_level()) {
- throw new TProtocolException("Required field 'consistency_level' was not found in serialized data! Struct: " + toString());
- }
validate();
}
@@ -2860,9 +3021,11 @@
this.predicate.write(oprot);
oprot.writeFieldEnd();
}
- oprot.writeFieldBegin(CONSISTENCY_LEVEL_FIELD_DESC);
- oprot.writeI32(this.consistency_level);
- 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();
}
@@ -2905,14 +3068,10 @@
first = false;
if (!first) sb.append(", ");
sb.append("consistency_level:");
- String consistency_level_name = ConsistencyLevel.VALUES_TO_NAMES.get(this.consistency_level);
- if (consistency_level_name != null) {
- sb.append(consistency_level_name);
- sb.append(" (");
- }
- sb.append(this.consistency_level);
- if (consistency_level_name != null) {
- sb.append(")");
+ if (this.consistency_level == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.consistency_level);
}
first = false;
sb.append(")");
@@ -2933,17 +3092,16 @@
if (predicate == null) {
throw new TProtocolException("Required field 'predicate' was not present! Struct: " + toString());
}
- // alas, we cannot check 'consistency_level' because it's a primitive and you chose the non-beans generator.
- // check that fields of type enum have valid values
- if (isSetConsistency_level() && !ConsistencyLevel.VALID_VALUES.contains(consistency_level)){
- throw new TProtocolException("The field 'consistency_level' has been assigned the invalid value " + consistency_level);
+ if (consistency_level == null) {
+ throw new TProtocolException("Required field 'consistency_level' was not present! Struct: " + toString());
}
}
}
- public static class get_slice_result implements TBase, java.io.Serializable, Cloneable, Comparable<get_slice_result> {
+ public static class get_slice_result implements TBase<get_slice_result._Fields>, java.io.Serializable, Cloneable, Comparable<get_slice_result> {
private static final TStruct STRUCT_DESC = new TStruct("get_slice_result");
+
private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
private static final TField IRE_FIELD_DESC = new TField("ire", TType.STRUCT, (short)1);
private static final TField UE_FIELD_DESC = new TField("ue", TType.STRUCT, (short)2);
@@ -2953,22 +3111,76 @@
public InvalidRequestException ire;
public UnavailableException ue;
public TimedOutException te;
- public static final int SUCCESS = 0;
- public static final int IRE = 1;
- public static final int UE = 2;
- public static final int TE = 3;
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements TFieldIdEnum {
+ SUCCESS((short)0, "success"),
+ IRE((short)1, "ire"),
+ UE((short)2, "ue"),
+ TE((short)3, "te");
+
+ private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byId.put((int)field._thriftId, field);
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ return byId.get(fieldId);
+ }
+
+ /**
+ * 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<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
- put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT,
+ public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
+ put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT,
new ListMetaData(TType.LIST,
new StructMetaData(TType.STRUCT, ColumnOrSuperColumn.class))));
- put(IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT,
+ put(_Fields.IRE, new FieldMetaData("ire", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.STRUCT)));
- put(UE, new FieldMetaData("ue", TFieldRequirementType.DEFAULT,
+ put(_Fields.UE, new FieldMetaData("ue", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.STRUCT)));
- put(TE, new FieldMetaData("te", TFieldRequirementType.DEFAULT,
+ put(_Fields.TE, new FieldMetaData("te", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.STRUCT)));
}});
@@ -3051,7 +3263,7 @@
this.success = null;
}
- // Returns true if field success is set (has been asigned a value) and false otherwise
+ /** Returns true if field success is set (has been asigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
@@ -3075,7 +3287,7 @@
this.ire = null;
}
- // Returns true if field ire is set (has been asigned a value) and false otherwise
+ /** Returns true if field ire is set (has been asigned a value) and false otherwise */
public boolean isSetIre() {
return this.ire != null;
}
@@ -3099,7 +3311,7 @@
this.ue = null;
}
- // Returns true if field ue is set (has been asigned a value) and false otherwise
+ /** Returns true if field ue is set (has been asigned a value) and false otherwise */
public boolean isSetUe() {
return this.ue != null;
}
@@ -3123,7 +3335,7 @@
this.te = null;
}
- // Returns true if field te is set (has been asigned a value) and false otherwise
+ /** Returns true if field te is set (has been asigned a value) and false otherwise */
public boolean isSetTe() {
return this.te != null;
}
@@ -3134,8 +3346,8 @@
}
}
- public void setFieldValue(int fieldID, Object value) {
- switch (fieldID) {
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
@@ -3168,13 +3380,15 @@
}
break;
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
}
- public Object getFieldValue(int fieldID) {
- switch (fieldID) {
+ public void setFieldValue(int fieldID, Object value) {
+ setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
case SUCCESS:
return getSuccess();
@@ -3187,14 +3401,17 @@
case TE:
return getTe();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
+ throw new IllegalStateException();
}
- // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise
- public boolean isSet(int fieldID) {
- switch (fieldID) {
+ public Object getFieldValue(int fieldId) {
+ return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ switch (field) {
case SUCCESS:
return isSetSuccess();
case IRE:
@@ -3203,9 +3420,12 @@
return isSetUe();
case TE:
return isSetTe();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
+ throw new IllegalStateException();
+ }
+
+ public boolean isSet(int fieldID) {
+ return isSet(_Fields.findByThriftIdOrThrow(fieldID));
}
@Override
@@ -3317,59 +3537,59 @@
if (field.type == TType.STOP) {
break;
}
- switch (field.id)
- {
- case SUCCESS:
- if (field.type == TType.LIST) {
- {
- TList _list12 = iprot.readListBegin();
- this.success = new ArrayList<ColumnOrSuperColumn>(_list12.size);
- for (int _i13 = 0; _i13 < _list12.size; ++_i13)
+ _Fields fieldId = _Fields.findByThriftId(field.id);
+ if (fieldId == null) {
+ TProtocolUtil.skip(iprot, field.type);
+ } else {
+ switch (fieldId) {
+ case SUCCESS:
+ if (field.type == TType.LIST) {
{
- ColumnOrSuperColumn _elem14;
- _elem14 = new ColumnOrSuperColumn();
- _elem14.read(iprot);
- this.success.add(_elem14);
+ TList _list12 = iprot.readListBegin();
+ this.success = new ArrayList<ColumnOrSuperColumn>(_list12.size);
+ for (int _i13 = 0; _i13 < _list12.size; ++_i13)
+ {
+ ColumnOrSuperColumn _elem14;
+ _elem14 = new ColumnOrSuperColumn();
+ _elem14.read(iprot);
+ this.success.add(_elem14);
+ }
+ iprot.readListEnd();
}
- iprot.readListEnd();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
}
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case IRE:
- if (field.type == TType.STRUCT) {
- this.ire = new InvalidRequestException();
- this.ire.read(iprot);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case UE:
- if (field.type == TType.STRUCT) {
- this.ue = new UnavailableException();
- this.ue.read(iprot);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case TE:
- if (field.type == TType.STRUCT) {
- this.te = new TimedOutException();
- this.te.read(iprot);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- TProtocolUtil.skip(iprot, field.type);
- break;
+ break;
+ case IRE:
+ if (field.type == TType.STRUCT) {
+ this.ire = new InvalidRequestException();
+ this.ire.read(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case UE:
+ if (field.type == TType.STRUCT) {
+ this.ue = new UnavailableException();
+ this.ue.read(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case TE:
+ if (field.type == TType.STRUCT) {
+ this.te = new TimedOutException();
+ this.te.read(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ }
+ iprot.readFieldEnd();
}
- iprot.readFieldEnd();
}
iprot.readStructEnd();
-
// check for required fields of primitive type, which can't be checked in the validate method
validate();
}
@@ -3447,13 +3667,13 @@
public void validate() throws TException {
// check for required fields
- // check that fields of type enum have valid values
}
}
- public static class multiget_args implements TBase, java.io.Serializable, Cloneable, Comparable<multiget_args> {
+ public static class multiget_args implements TBase<multiget_args._Fields>, java.io.Serializable, Cloneable, Comparable<multiget_args> {
private static final TStruct STRUCT_DESC = new TStruct("multiget_args");
+
private static final TField KEYSPACE_FIELD_DESC = new TField("keyspace", TType.STRING, (short)1);
private static final TField KEYS_FIELD_DESC = new TField("keys", TType.LIST, (short)2);
private static final TField COLUMN_PATH_FIELD_DESC = new TField("column_path", TType.STRUCT, (short)3);
@@ -3466,26 +3686,82 @@
*
* @see ConsistencyLevel
*/
- public int consistency_level;
- public static final int KEYSPACE = 1;
- public static final int KEYS = 2;
- public static final int COLUMN_PATH = 3;
- public static final int CONSISTENCY_LEVEL = 4;
+ public ConsistencyLevel consistency_level;
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements TFieldIdEnum {
+ KEYSPACE((short)1, "keyspace"),
+ KEYS((short)2, "keys"),
+ COLUMN_PATH((short)3, "column_path"),
+ /**
+ *
+ * @see ConsistencyLevel
+ */
+ CONSISTENCY_LEVEL((short)4, "consistency_level");
+
+ private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byId.put((int)field._thriftId, field);
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ return byId.get(fieldId);
+ }
+
+ /**
+ * 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
- private static final int __CONSISTENCY_LEVEL_ISSET_ID = 0;
- private BitSet __isset_bit_vector = new BitSet(1);
- public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
- put(KEYSPACE, new FieldMetaData("keyspace", TFieldRequirementType.REQUIRED,
+ public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
+ put(_Fields.KEYSPACE, new FieldMetaData("keyspace", TFieldRequirementType.REQUIRED,
new FieldValueMetaData(TType.STRING)));
- put(KEYS, new FieldMetaData("keys", TFieldRequirementType.REQUIRED,
+ put(_Fields.KEYS, new FieldMetaData("keys", TFieldRequirementType.REQUIRED,
new ListMetaData(TType.LIST,
new FieldValueMetaData(TType.STRING))));
- put(COLUMN_PATH, new FieldMetaData("column_path", TFieldRequirementType.REQUIRED,
+ put(_Fields.COLUMN_PATH, new FieldMetaData("column_path", TFieldRequirementType.REQUIRED,
new StructMetaData(TType.STRUCT, ColumnPath.class)));
- put(CONSISTENCY_LEVEL, new FieldMetaData("consistency_level", TFieldRequirementType.REQUIRED,
- new FieldValueMetaData(TType.I32)));
+ put(_Fields.CONSISTENCY_LEVEL, new FieldMetaData("consistency_level", TFieldRequirementType.REQUIRED,
+ new EnumMetaData(TType.ENUM, ConsistencyLevel.class)));
}});
static {
@@ -3493,7 +3769,7 @@
}
public multiget_args() {
- this.consistency_level = 1;
+ this.consistency_level = ConsistencyLevel.ONE;
}
@@ -3501,22 +3777,19 @@
String keyspace,
List<String> keys,
ColumnPath column_path,
- int consistency_level)
+ ConsistencyLevel consistency_level)
{
this();
this.keyspace = keyspace;
this.keys = keys;
this.column_path = column_path;
this.consistency_level = consistency_level;
- setConsistency_levelIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public multiget_args(multiget_args other) {
- __isset_bit_vector.clear();
- __isset_bit_vector.or(other.__isset_bit_vector);
if (other.isSetKeyspace()) {
this.keyspace = other.keyspace;
}
@@ -3530,7 +3803,9 @@
if (other.isSetColumn_path()) {
this.column_path = new ColumnPath(other.column_path);
}
- this.consistency_level = other.consistency_level;
+ if (other.isSetConsistency_level()) {
+ this.consistency_level = other.consistency_level;
+ }
}
public multiget_args deepCopy() {
@@ -3555,7 +3830,7 @@
this.keyspace = null;
}
- // Returns true if field keyspace is set (has been asigned a value) and false otherwise
+ /** Returns true if field keyspace is set (has been asigned a value) and false otherwise */
public boolean isSetKeyspace() {
return this.keyspace != null;
}
@@ -3594,7 +3869,7 @@
this.keys = null;
}
- // Returns true if field keys is set (has been asigned a value) and false otherwise
+ /** Returns true if field keys is set (has been asigned a value) and false otherwise */
public boolean isSetKeys() {
return this.keys != null;
}
@@ -3618,7 +3893,7 @@
this.column_path = null;
}
- // Returns true if field column_path is set (has been asigned a value) and false otherwise
+ /** Returns true if field column_path is set (has been asigned a value) and false otherwise */
public boolean isSetColumn_path() {
return this.column_path != null;
}
@@ -3633,7 +3908,7 @@
*
* @see ConsistencyLevel
*/
- public int getConsistency_level() {
+ public ConsistencyLevel getConsistency_level() {
return this.consistency_level;
}
@@ -3641,27 +3916,28 @@
*
* @see ConsistencyLevel
*/
- public multiget_args setConsistency_level(int consistency_level) {
+ public multiget_args setConsistency_level(ConsistencyLevel consistency_level) {
this.consistency_level = consistency_level;
- setConsistency_levelIsSet(true);
return this;
}
public void unsetConsistency_level() {
- __isset_bit_vector.clear(__CONSISTENCY_LEVEL_ISSET_ID);
+ this.consistency_level = null;
}
- // Returns true if field consistency_level is set (has been asigned a value) and false otherwise
+ /** Returns true if field consistency_level is set (has been asigned a value) and false otherwise */
public boolean isSetConsistency_level() {
- return __isset_bit_vector.get(__CONSISTENCY_LEVEL_ISSET_ID);
+ return this.consistency_level != null;
}
public void setConsistency_levelIsSet(boolean value) {
- __isset_bit_vector.set(__CONSISTENCY_LEVEL_ISSET_ID, value);
+ if (!value) {
+ this.consistency_level = null;
+ }
}
- public void setFieldValue(int fieldID, Object value) {
- switch (fieldID) {
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
case KEYSPACE:
if (value == null) {
unsetKeyspace();
@@ -3690,17 +3966,19 @@
if (value == null) {
unsetConsistency_level();
} else {
- setConsistency_level((Integer)value);
+ setConsistency_level((ConsistencyLevel)value);
}
break;
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
}
- public Object getFieldValue(int fieldID) {
- switch (fieldID) {
+ public void setFieldValue(int fieldID, Object value) {
+ setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
case KEYSPACE:
return getKeyspace();
@@ -3713,14 +3991,17 @@
case CONSISTENCY_LEVEL:
return getConsistency_level();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
+ throw new IllegalStateException();
}
- // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise
- public boolean isSet(int fieldID) {
- switch (fieldID) {
+ public Object getFieldValue(int fieldId) {
+ return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ switch (field) {
case KEYSPACE:
return isSetKeyspace();
case KEYS:
@@ -3729,9 +4010,12 @@
return isSetColumn_path();
case CONSISTENCY_LEVEL:
return isSetConsistency_level();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
+ throw new IllegalStateException();
+ }
+
+ public boolean isSet(int fieldID) {
+ return isSet(_Fields.findByThriftIdOrThrow(fieldID));
}
@Override
@@ -3774,12 +4058,12 @@
return false;
}
- boolean this_present_consistency_level = true;
- boolean that_present_consistency_level = true;
+ 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 != that.consistency_level)
+ if (!this.consistency_level.equals(that.consistency_level))
return false;
}
@@ -3843,61 +4127,57 @@
if (field.type == TType.STOP) {
break;
}
- switch (field.id)
- {
- case KEYSPACE:
- if (field.type == TType.STRING) {
- this.keyspace = iprot.readString();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case KEYS:
- if (field.type == TType.LIST) {
- {
- TList _list16 = iprot.readListBegin();
- this.keys = new ArrayList<String>(_list16.size);
- for (int _i17 = 0; _i17 < _list16.size; ++_i17)
+ _Fields fieldId = _Fields.findByThriftId(field.id);
+ if (fieldId == null) {
+ TProtocolUtil.skip(iprot, field.type);
+ } else {
+ switch (fieldId) {
+ case KEYSPACE:
+ if (field.type == TType.STRING) {
+ this.keyspace = iprot.readString();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case KEYS:
+ if (field.type == TType.LIST) {
{
- String _elem18;
- _elem18 = iprot.readString();
- this.keys.add(_elem18);
+ TList _list16 = iprot.readListBegin();
+ this.keys = new ArrayList<String>(_list16.size);
+ for (int _i17 = 0; _i17 < _list16.size; ++_i17)
+ {
+ String _elem18;
+ _elem18 = iprot.readString();
+ this.keys.add(_elem18);
+ }
+ iprot.readListEnd();
}
- iprot.readListEnd();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
}
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case COLUMN_PATH:
- if (field.type == TType.STRUCT) {
- this.column_path = new ColumnPath();
- this.column_path.read(iprot);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case CONSISTENCY_LEVEL:
- if (field.type == TType.I32) {
- this.consistency_level = iprot.readI32();
[... 7804 lines stripped ...]