thrift changes for 1156

git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@981913 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2010-08-03 15:03:33 +00:00
parent 1b5577b254
commit 49f34a25fe
8 changed files with 1785 additions and 3089 deletions

View File

@ -308,15 +308,15 @@ public class AuthenticationRequest implements TBase<AuthenticationRequest, Authe
case 1: // CREDENTIALS
if (field.type == TType.MAP) {
{
TMap _map24 = iprot.readMapBegin();
this.credentials = new HashMap<String,String>(2*_map24.size);
for (int _i25 = 0; _i25 < _map24.size; ++_i25)
TMap _map20 = iprot.readMapBegin();
this.credentials = new HashMap<String,String>(2*_map20.size);
for (int _i21 = 0; _i21 < _map20.size; ++_i21)
{
String _key26;
String _val27;
_key26 = iprot.readString();
_val27 = iprot.readString();
this.credentials.put(_key26, _val27);
String _key22;
String _val23;
_key22 = iprot.readString();
_val23 = iprot.readString();
this.credentials.put(_key22, _val23);
}
iprot.readMapEnd();
}
@ -343,10 +343,10 @@ public class AuthenticationRequest implements TBase<AuthenticationRequest, Authe
oprot.writeFieldBegin(CREDENTIALS_FIELD_DESC);
{
oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.credentials.size()));
for (Map.Entry<String, String> _iter28 : this.credentials.entrySet())
for (Map.Entry<String, String> _iter24 : this.credentials.entrySet())
{
oprot.writeString(_iter28.getKey());
oprot.writeString(_iter28.getValue());
oprot.writeString(_iter24.getKey());
oprot.writeString(_iter24.getValue());
}
oprot.writeMapEnd();
}

View File

@ -1248,14 +1248,14 @@ public class CfDef implements TBase<CfDef, CfDef._Fields>, java.io.Serializable,
case 13: // COLUMN_METADATA
if (field.type == TType.LIST) {
{
TList _list29 = iprot.readListBegin();
this.column_metadata = new ArrayList<ColumnDef>(_list29.size);
for (int _i30 = 0; _i30 < _list29.size; ++_i30)
TList _list25 = iprot.readListBegin();
this.column_metadata = new ArrayList<ColumnDef>(_list25.size);
for (int _i26 = 0; _i26 < _list25.size; ++_i26)
{
ColumnDef _elem31;
_elem31 = new ColumnDef();
_elem31.read(iprot);
this.column_metadata.add(_elem31);
ColumnDef _elem27;
_elem27 = new ColumnDef();
_elem27.read(iprot);
this.column_metadata.add(_elem27);
}
iprot.readListEnd();
}
@ -1363,9 +1363,9 @@ public class CfDef implements TBase<CfDef, CfDef._Fields>, java.io.Serializable,
oprot.writeFieldBegin(COLUMN_METADATA_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRUCT, this.column_metadata.size()));
for (ColumnDef _iter32 : this.column_metadata)
for (ColumnDef _iter28 : this.column_metadata)
{
_iter32.write(oprot);
_iter28.write(oprot);
}
oprot.writeListEnd();
}

View File

@ -42,6 +42,6 @@ import org.slf4j.LoggerFactory;
public class Constants {
public static final String VERSION = "9.0.0";
public static final String VERSION = "10.0.0";
}

View File

@ -50,18 +50,18 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
private static final TStruct STRUCT_DESC = new TStruct("IndexClause");
private static final TField EXPRESSIONS_FIELD_DESC = new TField("expressions", TType.LIST, (short)1);
private static final TField COUNT_FIELD_DESC = new TField("count", TType.I32, (short)2);
private static final TField START_KEY_FIELD_DESC = new TField("start_key", TType.STRING, (short)3);
private static final TField START_KEY_FIELD_DESC = new TField("start_key", TType.STRING, (short)2);
private static final TField COUNT_FIELD_DESC = new TField("count", TType.I32, (short)3);
public List<IndexExpression> expressions;
public int count;
public byte[] start_key;
public int count;
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements TFieldIdEnum {
EXPRESSIONS((short)1, "expressions"),
COUNT((short)2, "count"),
START_KEY((short)3, "start_key");
START_KEY((short)2, "start_key"),
COUNT((short)3, "count");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@ -78,10 +78,10 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
switch(fieldId) {
case 1: // EXPRESSIONS
return EXPRESSIONS;
case 2: // COUNT
return COUNT;
case 3: // START_KEY
case 2: // START_KEY
return START_KEY;
case 3: // COUNT
return COUNT;
default:
return null;
}
@ -131,10 +131,10 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
tmpMap.put(_Fields.EXPRESSIONS, new FieldMetaData("expressions", TFieldRequirementType.REQUIRED,
new ListMetaData(TType.LIST,
new StructMetaData(TType.STRUCT, IndexExpression.class))));
tmpMap.put(_Fields.START_KEY, new FieldMetaData("start_key", TFieldRequirementType.REQUIRED,
new FieldValueMetaData(TType.STRING)));
tmpMap.put(_Fields.COUNT, new FieldMetaData("count", TFieldRequirementType.REQUIRED,
new FieldValueMetaData(TType.I32)));
tmpMap.put(_Fields.START_KEY, new FieldMetaData("start_key", TFieldRequirementType.OPTIONAL,
new FieldValueMetaData(TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
FieldMetaData.addStructMetaDataMap(IndexClause.class, metaDataMap);
}
@ -146,10 +146,12 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
public IndexClause(
List<IndexExpression> expressions,
byte[] start_key,
int count)
{
this();
this.expressions = expressions;
this.start_key = start_key;
this.count = count;
setCountIsSet(true);
}
@ -167,11 +169,11 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
}
this.expressions = __this__expressions;
}
this.count = other.count;
if (other.isSetStart_key()) {
this.start_key = new byte[other.start_key.length];
System.arraycopy(other.start_key, 0, start_key, 0, other.start_key.length);
}
this.count = other.count;
}
public IndexClause deepCopy() {
@ -222,29 +224,6 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
}
}
public int getCount() {
return this.count;
}
public IndexClause setCount(int count) {
this.count = count;
setCountIsSet(true);
return this;
}
public void unsetCount() {
__isset_bit_vector.clear(__COUNT_ISSET_ID);
}
/** Returns true if field count is set (has been asigned a value) and false otherwise */
public boolean isSetCount() {
return __isset_bit_vector.get(__COUNT_ISSET_ID);
}
public void setCountIsSet(boolean value) {
__isset_bit_vector.set(__COUNT_ISSET_ID, value);
}
public byte[] getStart_key() {
return this.start_key;
}
@ -269,6 +248,29 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
}
}
public int getCount() {
return this.count;
}
public IndexClause setCount(int count) {
this.count = count;
setCountIsSet(true);
return this;
}
public void unsetCount() {
__isset_bit_vector.clear(__COUNT_ISSET_ID);
}
/** Returns true if field count is set (has been asigned a value) and false otherwise */
public boolean isSetCount() {
return __isset_bit_vector.get(__COUNT_ISSET_ID);
}
public void setCountIsSet(boolean value) {
__isset_bit_vector.set(__COUNT_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case EXPRESSIONS:
@ -279,14 +281,6 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
}
break;
case COUNT:
if (value == null) {
unsetCount();
} else {
setCount((Integer)value);
}
break;
case START_KEY:
if (value == null) {
unsetStart_key();
@ -295,6 +289,14 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
}
break;
case COUNT:
if (value == null) {
unsetCount();
} else {
setCount((Integer)value);
}
break;
}
}
@ -307,12 +309,12 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
case EXPRESSIONS:
return getExpressions();
case COUNT:
return new Integer(getCount());
case START_KEY:
return getStart_key();
case COUNT:
return new Integer(getCount());
}
throw new IllegalStateException();
}
@ -326,10 +328,10 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
switch (field) {
case EXPRESSIONS:
return isSetExpressions();
case COUNT:
return isSetCount();
case START_KEY:
return isSetStart_key();
case COUNT:
return isSetCount();
}
throw new IllegalStateException();
}
@ -360,15 +362,6 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
return false;
}
boolean this_present_count = true;
boolean that_present_count = true;
if (this_present_count || that_present_count) {
if (!(this_present_count && that_present_count))
return false;
if (this.count != that.count)
return false;
}
boolean this_present_start_key = true && this.isSetStart_key();
boolean that_present_start_key = true && that.isSetStart_key();
if (this_present_start_key || that_present_start_key) {
@ -378,6 +371,15 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
return false;
}
boolean this_present_count = true;
boolean that_present_count = true;
if (this_present_count || that_present_count) {
if (!(this_present_count && that_present_count))
return false;
if (this.count != that.count)
return false;
}
return true;
}
@ -403,15 +405,6 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetCount()).compareTo(typedOther.isSetCount());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetCount()) { lastComparison = TBaseHelper.compareTo(this.count, typedOther.count);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetStart_key()).compareTo(typedOther.isSetStart_key());
if (lastComparison != 0) {
return lastComparison;
@ -421,6 +414,15 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetCount()).compareTo(typedOther.isSetCount());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetCount()) { lastComparison = TBaseHelper.compareTo(this.count, typedOther.count);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@ -452,17 +454,17 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
TProtocolUtil.skip(iprot, field.type);
}
break;
case 2: // COUNT
if (field.type == TType.I32) {
this.count = iprot.readI32();
setCountIsSet(true);
case 2: // START_KEY
if (field.type == TType.STRING) {
this.start_key = iprot.readBinary();
} else {
TProtocolUtil.skip(iprot, field.type);
}
break;
case 3: // START_KEY
if (field.type == TType.STRING) {
this.start_key = iprot.readBinary();
case 3: // COUNT
if (field.type == TType.I32) {
this.count = iprot.readI32();
setCountIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
@ -497,16 +499,14 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
}
oprot.writeFieldEnd();
}
if (this.start_key != null) {
oprot.writeFieldBegin(START_KEY_FIELD_DESC);
oprot.writeBinary(this.start_key);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(COUNT_FIELD_DESC);
oprot.writeI32(this.count);
oprot.writeFieldEnd();
if (this.start_key != null) {
if (isSetStart_key()) {
oprot.writeFieldBegin(START_KEY_FIELD_DESC);
oprot.writeBinary(this.start_key);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@ -524,24 +524,22 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
}
first = false;
if (!first) sb.append(", ");
sb.append("start_key:");
if (this.start_key == null) {
sb.append("null");
} else {
int __start_key_size = Math.min(this.start_key.length, 128);
for (int i = 0; i < __start_key_size; i++) {
if (i != 0) sb.append(" ");
sb.append(Integer.toHexString(this.start_key[i]).length() > 1 ? Integer.toHexString(this.start_key[i]).substring(Integer.toHexString(this.start_key[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.start_key[i]).toUpperCase());
}
if (this.start_key.length > 128) sb.append(" ...");
}
first = false;
if (!first) sb.append(", ");
sb.append("count:");
sb.append(this.count);
first = false;
if (isSetStart_key()) {
if (!first) sb.append(", ");
sb.append("start_key:");
if (this.start_key == null) {
sb.append("null");
} else {
int __start_key_size = Math.min(this.start_key.length, 128);
for (int i = 0; i < __start_key_size; i++) {
if (i != 0) sb.append(" ");
sb.append(Integer.toHexString(this.start_key[i]).length() > 1 ? Integer.toHexString(this.start_key[i]).substring(Integer.toHexString(this.start_key[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.start_key[i]).toUpperCase());
}
if (this.start_key.length > 128) sb.append(" ...");
}
first = false;
}
sb.append(")");
return sb.toString();
}
@ -551,6 +549,9 @@ public class IndexClause implements TBase<IndexClause, IndexClause._Fields>, jav
if (expressions == null) {
throw new TProtocolException("Required field 'expressions' was not present! Struct: " + toString());
}
if (start_key == null) {
throw new TProtocolException("Required field 'start_key' was not present! Struct: " + toString());
}
// alas, we cannot check 'count' because it's a primitive and you chose the non-beans generator.
}

View File

@ -382,14 +382,14 @@ public class KeySlice implements TBase<KeySlice, KeySlice._Fields>, java.io.Seri
case 2: // COLUMNS
if (field.type == TType.LIST) {
{
TList _list16 = iprot.readListBegin();
this.columns = new ArrayList<ColumnOrSuperColumn>(_list16.size);
for (int _i17 = 0; _i17 < _list16.size; ++_i17)
TList _list12 = iprot.readListBegin();
this.columns = new ArrayList<ColumnOrSuperColumn>(_list12.size);
for (int _i13 = 0; _i13 < _list12.size; ++_i13)
{
ColumnOrSuperColumn _elem18;
_elem18 = new ColumnOrSuperColumn();
_elem18.read(iprot);
this.columns.add(_elem18);
ColumnOrSuperColumn _elem14;
_elem14 = new ColumnOrSuperColumn();
_elem14.read(iprot);
this.columns.add(_elem14);
}
iprot.readListEnd();
}
@ -421,9 +421,9 @@ public class KeySlice implements TBase<KeySlice, KeySlice._Fields>, java.io.Seri
oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRUCT, this.columns.size()));
for (ColumnOrSuperColumn _iter19 : this.columns)
for (ColumnOrSuperColumn _iter15 : this.columns)
{
_iter19.write(oprot);
_iter15.write(oprot);
}
oprot.writeListEnd();
}

View File

@ -607,15 +607,15 @@ public class KsDef implements TBase<KsDef, KsDef._Fields>, java.io.Serializable,
case 3: // STRATEGY_OPTIONS
if (field.type == TType.MAP) {
{
TMap _map33 = iprot.readMapBegin();
this.strategy_options = new HashMap<String,String>(2*_map33.size);
for (int _i34 = 0; _i34 < _map33.size; ++_i34)
TMap _map29 = iprot.readMapBegin();
this.strategy_options = new HashMap<String,String>(2*_map29.size);
for (int _i30 = 0; _i30 < _map29.size; ++_i30)
{
String _key35;
String _val36;
_key35 = iprot.readString();
_val36 = iprot.readString();
this.strategy_options.put(_key35, _val36);
String _key31;
String _val32;
_key31 = iprot.readString();
_val32 = iprot.readString();
this.strategy_options.put(_key31, _val32);
}
iprot.readMapEnd();
}
@ -634,14 +634,14 @@ public class KsDef implements TBase<KsDef, KsDef._Fields>, java.io.Serializable,
case 5: // CF_DEFS
if (field.type == TType.LIST) {
{
TList _list37 = iprot.readListBegin();
this.cf_defs = new ArrayList<CfDef>(_list37.size);
for (int _i38 = 0; _i38 < _list37.size; ++_i38)
TList _list33 = iprot.readListBegin();
this.cf_defs = new ArrayList<CfDef>(_list33.size);
for (int _i34 = 0; _i34 < _list33.size; ++_i34)
{
CfDef _elem39;
_elem39 = new CfDef();
_elem39.read(iprot);
this.cf_defs.add(_elem39);
CfDef _elem35;
_elem35 = new CfDef();
_elem35.read(iprot);
this.cf_defs.add(_elem35);
}
iprot.readListEnd();
}
@ -682,10 +682,10 @@ public class KsDef implements TBase<KsDef, KsDef._Fields>, java.io.Serializable,
oprot.writeFieldBegin(STRATEGY_OPTIONS_FIELD_DESC);
{
oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.strategy_options.size()));
for (Map.Entry<String, String> _iter40 : this.strategy_options.entrySet())
for (Map.Entry<String, String> _iter36 : this.strategy_options.entrySet())
{
oprot.writeString(_iter40.getKey());
oprot.writeString(_iter40.getValue());
oprot.writeString(_iter36.getKey());
oprot.writeString(_iter36.getValue());
}
oprot.writeMapEnd();
}
@ -699,9 +699,9 @@ public class KsDef implements TBase<KsDef, KsDef._Fields>, java.io.Serializable,
oprot.writeFieldBegin(CF_DEFS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRUCT, this.cf_defs.size()));
for (CfDef _iter41 : this.cf_defs)
for (CfDef _iter37 : this.cf_defs)
{
_iter41.write(oprot);
_iter37.write(oprot);
}
oprot.writeListEnd();
}

View File

@ -448,13 +448,13 @@ public class TokenRange implements TBase<TokenRange, TokenRange._Fields>, java.i
case 3: // ENDPOINTS
if (field.type == TType.LIST) {
{
TList _list20 = iprot.readListBegin();
this.endpoints = new ArrayList<String>(_list20.size);
for (int _i21 = 0; _i21 < _list20.size; ++_i21)
TList _list16 = iprot.readListBegin();
this.endpoints = new ArrayList<String>(_list16.size);
for (int _i17 = 0; _i17 < _list16.size; ++_i17)
{
String _elem22;
_elem22 = iprot.readString();
this.endpoints.add(_elem22);
String _elem18;
_elem18 = iprot.readString();
this.endpoints.add(_elem18);
}
iprot.readListEnd();
}
@ -491,9 +491,9 @@ public class TokenRange implements TBase<TokenRange, TokenRange._Fields>, java.i
oprot.writeFieldBegin(ENDPOINTS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRING, this.endpoints.size()));
for (String _iter23 : this.endpoints)
for (String _iter19 : this.endpoints)
{
oprot.writeString(_iter23);
oprot.writeString(_iter19);
}
oprot.writeListEnd();
}