You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2010/07/08 17:17:21 UTC
svn commit: r961795 [3/4] - in /cassandra/trunk: interface/
interface/thrift/gen-java/org/apache/cassandra/thrift/
src/java/org/apache/cassandra/cli/ src/java/org/apache/cassandra/config/
src/java/org/apache/cassandra/db/ src/java/org/apache/cassandra/...
Modified: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java?rev=961795&r1=961794&r2=961795&view=diff
==============================================================================
--- cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java (original)
+++ cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java Thu Jul 8 15:17:20 2010
@@ -1156,14 +1156,14 @@ public class CfDef implements TBase<CfDe
case 13: // COLUMN_METADATA
if (field.type == TType.LIST) {
{
- TList _list25 = iprot.readListBegin();
- this.column_metadata = new ArrayList<ColumnDef>(_list25.size);
- for (int _i26 = 0; _i26 < _list25.size; ++_i26)
+ TList _list33 = iprot.readListBegin();
+ this.column_metadata = new ArrayList<ColumnDef>(_list33.size);
+ for (int _i34 = 0; _i34 < _list33.size; ++_i34)
{
- ColumnDef _elem27;
- _elem27 = new ColumnDef();
- _elem27.read(iprot);
- this.column_metadata.add(_elem27);
+ ColumnDef _elem35;
+ _elem35 = new ColumnDef();
+ _elem35.read(iprot);
+ this.column_metadata.add(_elem35);
}
iprot.readListEnd();
}
@@ -1263,9 +1263,9 @@ public class CfDef implements TBase<CfDe
oprot.writeFieldBegin(COLUMN_METADATA_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRUCT, this.column_metadata.size()));
- for (ColumnDef _iter28 : this.column_metadata)
+ for (ColumnDef _iter36 : this.column_metadata)
{
- _iter28.write(oprot);
+ _iter36.write(oprot);
}
oprot.writeListEnd();
}
Modified: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java?rev=961795&r1=961794&r2=961795&view=diff
==============================================================================
--- cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java (original)
+++ cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java Thu Jul 8 15:17:20 2010
@@ -42,6 +42,6 @@ import org.slf4j.LoggerFactory;
public class Constants {
- public static final String VERSION = "8.2.0";
+ public static final String VERSION = "8.3.0";
}
Added: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexClause.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexClause.java?rev=961795&view=auto
==============================================================================
--- cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexClause.java (added)
+++ cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexClause.java Thu Jul 8 15:17:20 2010
@@ -0,0 +1,549 @@
+/**
+ * Autogenerated by Thrift
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ */
+package org.apache.cassandra.thrift;
+/*
+ *
+ * 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;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.thrift.*;
+import org.apache.thrift.meta_data.*;
+import org.apache.thrift.protocol.*;
+
+public class IndexClause implements TBase<IndexClause._Fields>, java.io.Serializable, Cloneable, Comparable<IndexClause> {
+ 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);
+
+ public List<IndexExpression> expressions;
+ public int count;
+ public byte[] start_key;
+
+ /** 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");
+
+ 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 __COUNT_ISSET_ID = 0;
+ private BitSet __isset_bit_vector = new BitSet(1);
+
+ public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
+ put(_Fields.EXPRESSIONS, new FieldMetaData("expressions", TFieldRequirementType.REQUIRED,
+ new ListMetaData(TType.LIST,
+ new StructMetaData(TType.STRUCT, IndexExpression.class))));
+ put(_Fields.COUNT, new FieldMetaData("count", TFieldRequirementType.REQUIRED,
+ new FieldValueMetaData(TType.I32)));
+ put(_Fields.START_KEY, new FieldMetaData("start_key", TFieldRequirementType.OPTIONAL,
+ new FieldValueMetaData(TType.STRING)));
+ }});
+
+ static {
+ FieldMetaData.addStructMetaDataMap(IndexClause.class, metaDataMap);
+ }
+
+ public IndexClause() {
+ this.count = 100;
+
+ }
+
+ public IndexClause(
+ List<IndexExpression> expressions,
+ int count)
+ {
+ this();
+ this.expressions = expressions;
+ this.count = count;
+ setCountIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public IndexClause(IndexClause other) {
+ __isset_bit_vector.clear();
+ __isset_bit_vector.or(other.__isset_bit_vector);
+ if (other.isSetExpressions()) {
+ List<IndexExpression> __this__expressions = new ArrayList<IndexExpression>();
+ for (IndexExpression other_element : other.expressions) {
+ __this__expressions.add(new IndexExpression(other_element));
+ }
+ 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);
+ }
+ }
+
+ public IndexClause deepCopy() {
+ return new IndexClause(this);
+ }
+
+ @Deprecated
+ public IndexClause clone() {
+ return new IndexClause(this);
+ }
+
+ public int getExpressionsSize() {
+ return (this.expressions == null) ? 0 : this.expressions.size();
+ }
+
+ public java.util.Iterator<IndexExpression> getExpressionsIterator() {
+ return (this.expressions == null) ? null : this.expressions.iterator();
+ }
+
+ public void addToExpressions(IndexExpression elem) {
+ if (this.expressions == null) {
+ this.expressions = new ArrayList<IndexExpression>();
+ }
+ this.expressions.add(elem);
+ }
+
+ public List<IndexExpression> getExpressions() {
+ return this.expressions;
+ }
+
+ public IndexClause setExpressions(List<IndexExpression> expressions) {
+ this.expressions = expressions;
+ return this;
+ }
+
+ public void unsetExpressions() {
+ this.expressions = null;
+ }
+
+ /** Returns true if field expressions is set (has been asigned a value) and false otherwise */
+ public boolean isSetExpressions() {
+ return this.expressions != null;
+ }
+
+ public void setExpressionsIsSet(boolean value) {
+ if (!value) {
+ this.expressions = null;
+ }
+ }
+
+ 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;
+ }
+
+ public IndexClause setStart_key(byte[] start_key) {
+ this.start_key = start_key;
+ return this;
+ }
+
+ public void unsetStart_key() {
+ this.start_key = null;
+ }
+
+ /** Returns true if field start_key is set (has been asigned a value) and false otherwise */
+ public boolean isSetStart_key() {
+ return this.start_key != null;
+ }
+
+ public void setStart_keyIsSet(boolean value) {
+ if (!value) {
+ this.start_key = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case EXPRESSIONS:
+ if (value == null) {
+ unsetExpressions();
+ } else {
+ setExpressions((List<IndexExpression>)value);
+ }
+ break;
+
+ case COUNT:
+ if (value == null) {
+ unsetCount();
+ } else {
+ setCount((Integer)value);
+ }
+ break;
+
+ case START_KEY:
+ if (value == null) {
+ unsetStart_key();
+ } else {
+ setStart_key((byte[])value);
+ }
+ break;
+
+ }
+ }
+
+ public void setFieldValue(int fieldID, Object value) {
+ setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case EXPRESSIONS:
+ return getExpressions();
+
+ case COUNT:
+ return new Integer(getCount());
+
+ case START_KEY:
+ return getStart_key();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ 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 EXPRESSIONS:
+ return isSetExpressions();
+ case COUNT:
+ return isSetCount();
+ case START_KEY:
+ return isSetStart_key();
+ }
+ throw new IllegalStateException();
+ }
+
+ public boolean isSet(int fieldID) {
+ return isSet(_Fields.findByThriftIdOrThrow(fieldID));
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof IndexClause)
+ return this.equals((IndexClause)that);
+ return false;
+ }
+
+ public boolean equals(IndexClause that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_expressions = true && this.isSetExpressions();
+ boolean that_present_expressions = true && that.isSetExpressions();
+ if (this_present_expressions || that_present_expressions) {
+ if (!(this_present_expressions && that_present_expressions))
+ return false;
+ if (!this.expressions.equals(that.expressions))
+ 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) {
+ if (!(this_present_start_key && that_present_start_key))
+ return false;
+ if (!java.util.Arrays.equals(this.start_key, that.start_key))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(IndexClause other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ IndexClause typedOther = (IndexClause)other;
+
+ lastComparison = Boolean.valueOf(isSetExpressions()).compareTo(typedOther.isSetExpressions());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetExpressions()) { lastComparison = TBaseHelper.compareTo(expressions, typedOther.expressions);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetCount()).compareTo(typedOther.isSetCount());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetCount()) { lastComparison = TBaseHelper.compareTo(count, typedOther.count);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetStart_key()).compareTo(typedOther.isSetStart_key());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetStart_key()) { lastComparison = TBaseHelper.compareTo(start_key, typedOther.start_key);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public void read(TProtocol iprot) throws TException {
+ TField field;
+ iprot.readStructBegin();
+ while (true)
+ {
+ field = iprot.readFieldBegin();
+ if (field.type == TType.STOP) {
+ break;
+ }
+ switch (field.id) {
+ case 1: // EXPRESSIONS
+ if (field.type == TType.LIST) {
+ {
+ TList _list12 = iprot.readListBegin();
+ this.expressions = new ArrayList<IndexExpression>(_list12.size);
+ for (int _i13 = 0; _i13 < _list12.size; ++_i13)
+ {
+ IndexExpression _elem14;
+ _elem14 = new IndexExpression();
+ _elem14.read(iprot);
+ this.expressions.add(_elem14);
+ }
+ iprot.readListEnd();
+ }
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 2: // COUNT
+ if (field.type == TType.I32) {
+ this.count = iprot.readI32();
+ setCountIsSet(true);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 3: // START_KEY
+ if (field.type == TType.STRING) {
+ this.start_key = iprot.readBinary();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ default:
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ if (!isSetCount()) {
+ throw new TProtocolException("Required field 'count' was not found in serialized data! Struct: " + toString());
+ }
+ validate();
+ }
+
+ public void write(TProtocol oprot) throws TException {
+ validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (this.expressions != null) {
+ oprot.writeFieldBegin(EXPRESSIONS_FIELD_DESC);
+ {
+ oprot.writeListBegin(new TList(TType.STRUCT, this.expressions.size()));
+ for (IndexExpression _iter15 : this.expressions)
+ {
+ _iter15.write(oprot);
+ }
+ oprot.writeListEnd();
+ }
+ 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();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("IndexClause(");
+ boolean first = true;
+
+ sb.append("expressions:");
+ if (this.expressions == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.expressions);
+ }
+ 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();
+ }
+
+ public void validate() throws TException {
+ // check for required fields
+ if (expressions == null) {
+ throw new TProtocolException("Required field 'expressions' was not present! Struct: " + toString());
+ }
+ // alas, we cannot check 'count' because it's a primitive and you chose the non-beans generator.
+ }
+
+}
+
Added: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexExpression.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexExpression.java?rev=961795&view=auto
==============================================================================
--- cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexExpression.java (added)
+++ cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexExpression.java Thu Jul 8 15:17:20 2010
@@ -0,0 +1,534 @@
+/**
+ * Autogenerated by Thrift
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ */
+package org.apache.cassandra.thrift;
+/*
+ *
+ * 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;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.thrift.*;
+import org.apache.thrift.meta_data.*;
+import org.apache.thrift.protocol.*;
+
+public class IndexExpression implements TBase<IndexExpression._Fields>, java.io.Serializable, Cloneable, Comparable<IndexExpression> {
+ private static final TStruct STRUCT_DESC = new TStruct("IndexExpression");
+
+ private static final TField COLUMN_NAME_FIELD_DESC = new TField("column_name", TType.STRING, (short)1);
+ private static final TField OP_FIELD_DESC = new TField("op", TType.I32, (short)2);
+ private static final TField VALUE_FIELD_DESC = new TField("value", TType.STRING, (short)3);
+
+ public byte[] column_name;
+ /**
+ *
+ * @see IndexOperator
+ */
+ public IndexOperator op;
+ public byte[] value;
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements TFieldIdEnum {
+ COLUMN_NAME((short)1, "column_name"),
+ /**
+ *
+ * @see IndexOperator
+ */
+ OP((short)2, "op"),
+ VALUE((short)3, "value");
+
+ 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<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
+ put(_Fields.COLUMN_NAME, new FieldMetaData("column_name", TFieldRequirementType.REQUIRED,
+ new FieldValueMetaData(TType.STRING)));
+ put(_Fields.OP, new FieldMetaData("op", TFieldRequirementType.REQUIRED,
+ new EnumMetaData(TType.ENUM, IndexOperator.class)));
+ put(_Fields.VALUE, new FieldMetaData("value", TFieldRequirementType.REQUIRED,
+ new FieldValueMetaData(TType.STRING)));
+ }});
+
+ static {
+ FieldMetaData.addStructMetaDataMap(IndexExpression.class, metaDataMap);
+ }
+
+ public IndexExpression() {
+ }
+
+ public IndexExpression(
+ byte[] column_name,
+ IndexOperator op,
+ byte[] value)
+ {
+ this();
+ this.column_name = column_name;
+ this.op = op;
+ this.value = value;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public IndexExpression(IndexExpression other) {
+ if (other.isSetColumn_name()) {
+ this.column_name = new byte[other.column_name.length];
+ System.arraycopy(other.column_name, 0, column_name, 0, other.column_name.length);
+ }
+ if (other.isSetOp()) {
+ this.op = other.op;
+ }
+ if (other.isSetValue()) {
+ this.value = new byte[other.value.length];
+ System.arraycopy(other.value, 0, value, 0, other.value.length);
+ }
+ }
+
+ public IndexExpression deepCopy() {
+ return new IndexExpression(this);
+ }
+
+ @Deprecated
+ public IndexExpression clone() {
+ return new IndexExpression(this);
+ }
+
+ public byte[] getColumn_name() {
+ return this.column_name;
+ }
+
+ public IndexExpression setColumn_name(byte[] column_name) {
+ this.column_name = column_name;
+ return this;
+ }
+
+ public void unsetColumn_name() {
+ this.column_name = null;
+ }
+
+ /** Returns true if field column_name is set (has been asigned a value) and false otherwise */
+ public boolean isSetColumn_name() {
+ return this.column_name != null;
+ }
+
+ public void setColumn_nameIsSet(boolean value) {
+ if (!value) {
+ this.column_name = null;
+ }
+ }
+
+ /**
+ *
+ * @see IndexOperator
+ */
+ public IndexOperator getOp() {
+ return this.op;
+ }
+
+ /**
+ *
+ * @see IndexOperator
+ */
+ public IndexExpression setOp(IndexOperator op) {
+ this.op = op;
+ return this;
+ }
+
+ public void unsetOp() {
+ this.op = null;
+ }
+
+ /** Returns true if field op is set (has been asigned a value) and false otherwise */
+ public boolean isSetOp() {
+ return this.op != null;
+ }
+
+ public void setOpIsSet(boolean value) {
+ if (!value) {
+ this.op = null;
+ }
+ }
+
+ public byte[] getValue() {
+ return this.value;
+ }
+
+ public IndexExpression setValue(byte[] value) {
+ this.value = value;
+ return this;
+ }
+
+ public void unsetValue() {
+ this.value = null;
+ }
+
+ /** Returns true if field value is set (has been asigned a value) and false otherwise */
+ public boolean isSetValue() {
+ return this.value != null;
+ }
+
+ public void setValueIsSet(boolean value) {
+ if (!value) {
+ this.value = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case COLUMN_NAME:
+ if (value == null) {
+ unsetColumn_name();
+ } else {
+ setColumn_name((byte[])value);
+ }
+ break;
+
+ case OP:
+ if (value == null) {
+ unsetOp();
+ } else {
+ setOp((IndexOperator)value);
+ }
+ break;
+
+ case VALUE:
+ if (value == null) {
+ unsetValue();
+ } else {
+ setValue((byte[])value);
+ }
+ break;
+
+ }
+ }
+
+ public void setFieldValue(int fieldID, Object value) {
+ setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case COLUMN_NAME:
+ return getColumn_name();
+
+ case OP:
+ return getOp();
+
+ case VALUE:
+ return getValue();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ 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 COLUMN_NAME:
+ return isSetColumn_name();
+ case OP:
+ return isSetOp();
+ case VALUE:
+ return isSetValue();
+ }
+ throw new IllegalStateException();
+ }
+
+ public boolean isSet(int fieldID) {
+ return isSet(_Fields.findByThriftIdOrThrow(fieldID));
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof IndexExpression)
+ return this.equals((IndexExpression)that);
+ return false;
+ }
+
+ public boolean equals(IndexExpression that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_column_name = true && this.isSetColumn_name();
+ boolean that_present_column_name = true && that.isSetColumn_name();
+ if (this_present_column_name || that_present_column_name) {
+ if (!(this_present_column_name && that_present_column_name))
+ return false;
+ if (!java.util.Arrays.equals(this.column_name, that.column_name))
+ return false;
+ }
+
+ boolean this_present_op = true && this.isSetOp();
+ boolean that_present_op = true && that.isSetOp();
+ if (this_present_op || that_present_op) {
+ if (!(this_present_op && that_present_op))
+ return false;
+ if (!this.op.equals(that.op))
+ return false;
+ }
+
+ boolean this_present_value = true && this.isSetValue();
+ boolean that_present_value = true && that.isSetValue();
+ if (this_present_value || that_present_value) {
+ if (!(this_present_value && that_present_value))
+ return false;
+ if (!java.util.Arrays.equals(this.value, that.value))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(IndexExpression other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ IndexExpression typedOther = (IndexExpression)other;
+
+ lastComparison = Boolean.valueOf(isSetColumn_name()).compareTo(typedOther.isSetColumn_name());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetColumn_name()) { lastComparison = TBaseHelper.compareTo(column_name, typedOther.column_name);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetOp()).compareTo(typedOther.isSetOp());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetOp()) { lastComparison = TBaseHelper.compareTo(op, typedOther.op);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetValue()) { lastComparison = TBaseHelper.compareTo(value, typedOther.value);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public void read(TProtocol iprot) throws TException {
+ TField field;
+ iprot.readStructBegin();
+ while (true)
+ {
+ field = iprot.readFieldBegin();
+ if (field.type == TType.STOP) {
+ break;
+ }
+ switch (field.id) {
+ case 1: // COLUMN_NAME
+ if (field.type == TType.STRING) {
+ this.column_name = iprot.readBinary();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 2: // OP
+ if (field.type == TType.I32) {
+ this.op = IndexOperator.findByValue(iprot.readI32());
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 3: // VALUE
+ if (field.type == TType.STRING) {
+ this.value = iprot.readBinary();
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ default:
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ validate();
+ }
+
+ public void write(TProtocol oprot) throws TException {
+ validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (this.column_name != null) {
+ oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC);
+ oprot.writeBinary(this.column_name);
+ oprot.writeFieldEnd();
+ }
+ if (this.op != null) {
+ oprot.writeFieldBegin(OP_FIELD_DESC);
+ oprot.writeI32(this.op.getValue());
+ oprot.writeFieldEnd();
+ }
+ if (this.value != null) {
+ oprot.writeFieldBegin(VALUE_FIELD_DESC);
+ oprot.writeBinary(this.value);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("IndexExpression(");
+ boolean first = true;
+
+ sb.append("column_name:");
+ if (this.column_name == null) {
+ sb.append("null");
+ } else {
+ int __column_name_size = Math.min(this.column_name.length, 128);
+ for (int i = 0; i < __column_name_size; i++) {
+ if (i != 0) sb.append(" ");
+ sb.append(Integer.toHexString(this.column_name[i]).length() > 1 ? Integer.toHexString(this.column_name[i]).substring(Integer.toHexString(this.column_name[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.column_name[i]).toUpperCase());
+ }
+ if (this.column_name.length > 128) sb.append(" ...");
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("op:");
+ if (this.op == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.op);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("value:");
+ if (this.value == null) {
+ sb.append("null");
+ } else {
+ int __value_size = Math.min(this.value.length, 128);
+ for (int i = 0; i < __value_size; i++) {
+ if (i != 0) sb.append(" ");
+ sb.append(Integer.toHexString(this.value[i]).length() > 1 ? Integer.toHexString(this.value[i]).substring(Integer.toHexString(this.value[i]).length() - 2).toUpperCase() : "0" + Integer.toHexString(this.value[i]).toUpperCase());
+ }
+ if (this.value.length > 128) sb.append(" ...");
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws TException {
+ // check for required fields
+ if (column_name == null) {
+ throw new TProtocolException("Required field 'column_name' was not present! Struct: " + toString());
+ }
+ if (op == null) {
+ throw new TProtocolException("Required field 'op' was not present! Struct: " + toString());
+ }
+ if (value == null) {
+ throw new TProtocolException("Required field 'value' was not present! Struct: " + toString());
+ }
+ }
+
+}
+
Copied: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexOperator.java (from r961780, cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java)
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexOperator.java?p2=cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexOperator.java&p1=cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java&r1=961780&r2=961795&rev=961795&view=diff
==============================================================================
--- cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java (original)
+++ cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/IndexOperator.java Thu Jul 8 15:17:20 2010
@@ -26,22 +26,37 @@ package org.apache.cassandra.thrift;
*/
-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;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.thrift.TEnum;
+
+public enum IndexOperator implements TEnum {
+ EQ(0);
+
+ private final int value;
-public class Constants {
+ private IndexOperator(int value) {
+ this.value = value;
+ }
- public static final String VERSION = "8.2.0";
+ /**
+ * Get the integer value of this enum value, as defined in the Thrift IDL.
+ */
+ public int getValue() {
+ return value;
+ }
+ /**
+ * Find a the enum type by its integer value, as defined in the Thrift IDL.
+ * @return null if the value is not found.
+ */
+ public static IndexOperator findByValue(int value) {
+ switch (value) {
+ case 0:
+ return EQ;
+ default:
+ return null;
+ }
+ }
}
Copied: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/KeyCount.java (from r961780, cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/KeySlice.java)
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/KeyCount.java?p2=cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/KeyCount.java&p1=cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/KeySlice.java&r1=961780&r2=961795&rev=961795&view=diff
==============================================================================
--- cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/KeySlice.java (original)
+++ cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/KeyCount.java Thu Jul 8 15:17:20 2010
@@ -44,26 +44,19 @@ import org.apache.thrift.*;
import org.apache.thrift.meta_data.*;
import org.apache.thrift.protocol.*;
-/**
- * A KeySlice is key followed by the data it maps to. A collection of KeySlice is returned by the get_range_slice operation.
- *
- * @param key. a row key
- * @param columns. List of data represented by the key. Typically, the list is pared down to only the columns specified by
- * a SlicePredicate.
- */
-public class KeySlice implements TBase<KeySlice._Fields>, java.io.Serializable, Cloneable, Comparable<KeySlice> {
- private static final TStruct STRUCT_DESC = new TStruct("KeySlice");
+public class KeyCount implements TBase<KeyCount._Fields>, java.io.Serializable, Cloneable, Comparable<KeyCount> {
+ private static final TStruct STRUCT_DESC = new TStruct("KeyCount");
private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)1);
- private static final TField COLUMNS_FIELD_DESC = new TField("columns", TType.LIST, (short)2);
+ private static final TField COUNT_FIELD_DESC = new TField("count", TType.I32, (short)2);
public byte[] key;
- public List<ColumnOrSuperColumn> columns;
+ public int count;
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements TFieldIdEnum {
KEY((short)1, "key"),
- COLUMNS((short)2, "columns");
+ COUNT((short)2, "count");
private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -117,62 +110,60 @@ public class KeySlice implements TBase<K
}
// isset id assignments
+ private static final int __COUNT_ISSET_ID = 0;
+ private BitSet __isset_bit_vector = new BitSet(1);
public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
put(_Fields.KEY, new FieldMetaData("key", TFieldRequirementType.REQUIRED,
new FieldValueMetaData(TType.STRING)));
- put(_Fields.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.REQUIRED,
- new ListMetaData(TType.LIST,
- new StructMetaData(TType.STRUCT, ColumnOrSuperColumn.class))));
+ put(_Fields.COUNT, new FieldMetaData("count", TFieldRequirementType.REQUIRED,
+ new FieldValueMetaData(TType.I32)));
}});
static {
- FieldMetaData.addStructMetaDataMap(KeySlice.class, metaDataMap);
+ FieldMetaData.addStructMetaDataMap(KeyCount.class, metaDataMap);
}
- public KeySlice() {
+ public KeyCount() {
}
- public KeySlice(
+ public KeyCount(
byte[] key,
- List<ColumnOrSuperColumn> columns)
+ int count)
{
this();
this.key = key;
- this.columns = columns;
+ this.count = count;
+ setCountIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
- public KeySlice(KeySlice other) {
+ public KeyCount(KeyCount other) {
+ __isset_bit_vector.clear();
+ __isset_bit_vector.or(other.__isset_bit_vector);
if (other.isSetKey()) {
this.key = new byte[other.key.length];
System.arraycopy(other.key, 0, key, 0, other.key.length);
}
- if (other.isSetColumns()) {
- List<ColumnOrSuperColumn> __this__columns = new ArrayList<ColumnOrSuperColumn>();
- for (ColumnOrSuperColumn other_element : other.columns) {
- __this__columns.add(new ColumnOrSuperColumn(other_element));
- }
- this.columns = __this__columns;
- }
+ this.count = other.count;
}
- public KeySlice deepCopy() {
- return new KeySlice(this);
+ public KeyCount deepCopy() {
+ return new KeyCount(this);
}
@Deprecated
- public KeySlice clone() {
- return new KeySlice(this);
+ public KeyCount clone() {
+ return new KeyCount(this);
}
public byte[] getKey() {
return this.key;
}
- public KeySlice setKey(byte[] key) {
+ public KeyCount setKey(byte[] key) {
this.key = key;
return this;
}
@@ -192,43 +183,27 @@ public class KeySlice implements TBase<K
}
}
- public int getColumnsSize() {
- return (this.columns == null) ? 0 : this.columns.size();
- }
-
- public java.util.Iterator<ColumnOrSuperColumn> getColumnsIterator() {
- return (this.columns == null) ? null : this.columns.iterator();
- }
-
- public void addToColumns(ColumnOrSuperColumn elem) {
- if (this.columns == null) {
- this.columns = new ArrayList<ColumnOrSuperColumn>();
- }
- this.columns.add(elem);
- }
-
- public List<ColumnOrSuperColumn> getColumns() {
- return this.columns;
+ public int getCount() {
+ return this.count;
}
- public KeySlice setColumns(List<ColumnOrSuperColumn> columns) {
- this.columns = columns;
+ public KeyCount setCount(int count) {
+ this.count = count;
+ setCountIsSet(true);
return this;
}
- public void unsetColumns() {
- this.columns = null;
+ public void unsetCount() {
+ __isset_bit_vector.clear(__COUNT_ISSET_ID);
}
- /** Returns true if field columns is set (has been asigned a value) and false otherwise */
- public boolean isSetColumns() {
- return this.columns != null;
+ /** 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 setColumnsIsSet(boolean value) {
- if (!value) {
- this.columns = null;
- }
+ public void setCountIsSet(boolean value) {
+ __isset_bit_vector.set(__COUNT_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
@@ -241,11 +216,11 @@ public class KeySlice implements TBase<K
}
break;
- case COLUMNS:
+ case COUNT:
if (value == null) {
- unsetColumns();
+ unsetCount();
} else {
- setColumns((List<ColumnOrSuperColumn>)value);
+ setCount((Integer)value);
}
break;
@@ -261,8 +236,8 @@ public class KeySlice implements TBase<K
case KEY:
return getKey();
- case COLUMNS:
- return getColumns();
+ case COUNT:
+ return new Integer(getCount());
}
throw new IllegalStateException();
@@ -277,8 +252,8 @@ public class KeySlice implements TBase<K
switch (field) {
case KEY:
return isSetKey();
- case COLUMNS:
- return isSetColumns();
+ case COUNT:
+ return isSetCount();
}
throw new IllegalStateException();
}
@@ -291,12 +266,12 @@ public class KeySlice implements TBase<K
public boolean equals(Object that) {
if (that == null)
return false;
- if (that instanceof KeySlice)
- return this.equals((KeySlice)that);
+ if (that instanceof KeyCount)
+ return this.equals((KeyCount)that);
return false;
}
- public boolean equals(KeySlice that) {
+ public boolean equals(KeyCount that) {
if (that == null)
return false;
@@ -309,12 +284,12 @@ public class KeySlice implements TBase<K
return false;
}
- boolean this_present_columns = true && this.isSetColumns();
- boolean that_present_columns = true && that.isSetColumns();
- if (this_present_columns || that_present_columns) {
- if (!(this_present_columns && that_present_columns))
+ 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.columns.equals(that.columns))
+ if (this.count != that.count)
return false;
}
@@ -326,13 +301,13 @@ public class KeySlice implements TBase<K
return 0;
}
- public int compareTo(KeySlice other) {
+ public int compareTo(KeyCount other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
- KeySlice typedOther = (KeySlice)other;
+ KeyCount typedOther = (KeyCount)other;
lastComparison = Boolean.valueOf(isSetKey()).compareTo(typedOther.isSetKey());
if (lastComparison != 0) {
@@ -343,11 +318,11 @@ public class KeySlice implements TBase<K
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns());
+ lastComparison = Boolean.valueOf(isSetCount()).compareTo(typedOther.isSetCount());
if (lastComparison != 0) {
return lastComparison;
}
- if (isSetColumns()) { lastComparison = TBaseHelper.compareTo(columns, typedOther.columns);
+ if (isSetCount()) { lastComparison = TBaseHelper.compareTo(count, typedOther.count);
if (lastComparison != 0) {
return lastComparison;
}
@@ -372,20 +347,10 @@ public class KeySlice implements TBase<K
TProtocolUtil.skip(iprot, field.type);
}
break;
- case 2: // COLUMNS
- if (field.type == TType.LIST) {
- {
- TList _list12 = iprot.readListBegin();
- this.columns = new ArrayList<ColumnOrSuperColumn>(_list12.size);
- for (int _i13 = 0; _i13 < _list12.size; ++_i13)
- {
- ColumnOrSuperColumn _elem14;
- _elem14 = new ColumnOrSuperColumn();
- _elem14.read(iprot);
- this.columns.add(_elem14);
- }
- iprot.readListEnd();
- }
+ case 2: // COUNT
+ if (field.type == TType.I32) {
+ this.count = iprot.readI32();
+ setCountIsSet(true);
} else {
TProtocolUtil.skip(iprot, field.type);
}
@@ -398,6 +363,9 @@ public class KeySlice implements TBase<K
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
+ if (!isSetCount()) {
+ throw new TProtocolException("Required field 'count' was not found in serialized data! Struct: " + toString());
+ }
validate();
}
@@ -410,25 +378,16 @@ public class KeySlice implements TBase<K
oprot.writeBinary(this.key);
oprot.writeFieldEnd();
}
- if (this.columns != null) {
- oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
- {
- oprot.writeListBegin(new TList(TType.STRUCT, this.columns.size()));
- for (ColumnOrSuperColumn _iter15 : this.columns)
- {
- _iter15.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
+ oprot.writeFieldBegin(COUNT_FIELD_DESC);
+ oprot.writeI32(this.count);
+ oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder("KeySlice(");
+ StringBuilder sb = new StringBuilder("KeyCount(");
boolean first = true;
sb.append("key:");
@@ -444,12 +403,8 @@ public class KeySlice implements TBase<K
}
first = false;
if (!first) sb.append(", ");
- sb.append("columns:");
- if (this.columns == null) {
- sb.append("null");
- } else {
- sb.append(this.columns);
- }
+ sb.append("count:");
+ sb.append(this.count);
first = false;
sb.append(")");
return sb.toString();
@@ -460,9 +415,7 @@ public class KeySlice implements TBase<K
if (key == null) {
throw new TProtocolException("Required field 'key' was not present! Struct: " + toString());
}
- if (columns == null) {
- throw new TProtocolException("Required field 'columns' was not present! Struct: " + toString());
- }
+ // alas, we cannot check 'count' because it's a primitive and you chose the non-beans generator.
}
}
Modified: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/KeySlice.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/KeySlice.java?rev=961795&r1=961794&r2=961795&view=diff
==============================================================================
--- cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/KeySlice.java (original)
+++ cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/KeySlice.java Thu Jul 8 15:17:20 2010
@@ -375,14 +375,14 @@ public class KeySlice implements TBase<K
case 2: // COLUMNS
if (field.type == TType.LIST) {
{
- TList _list12 = iprot.readListBegin();
- this.columns = new ArrayList<ColumnOrSuperColumn>(_list12.size);
- for (int _i13 = 0; _i13 < _list12.size; ++_i13)
+ TList _list20 = iprot.readListBegin();
+ this.columns = new ArrayList<ColumnOrSuperColumn>(_list20.size);
+ for (int _i21 = 0; _i21 < _list20.size; ++_i21)
{
- ColumnOrSuperColumn _elem14;
- _elem14 = new ColumnOrSuperColumn();
- _elem14.read(iprot);
- this.columns.add(_elem14);
+ ColumnOrSuperColumn _elem22;
+ _elem22 = new ColumnOrSuperColumn();
+ _elem22.read(iprot);
+ this.columns.add(_elem22);
}
iprot.readListEnd();
}
@@ -414,9 +414,9 @@ public class KeySlice implements TBase<K
oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRUCT, this.columns.size()));
- for (ColumnOrSuperColumn _iter15 : this.columns)
+ for (ColumnOrSuperColumn _iter23 : this.columns)
{
- _iter15.write(oprot);
+ _iter23.write(oprot);
}
oprot.writeListEnd();
}
Modified: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/KsDef.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/KsDef.java?rev=961795&r1=961794&r2=961795&view=diff
==============================================================================
--- cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/KsDef.java (original)
+++ cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/KsDef.java Thu Jul 8 15:17:20 2010
@@ -514,14 +514,14 @@ public class KsDef implements TBase<KsDe
case 5: // CF_DEFS
if (field.type == TType.LIST) {
{
- TList _list29 = iprot.readListBegin();
- this.cf_defs = new ArrayList<CfDef>(_list29.size);
- for (int _i30 = 0; _i30 < _list29.size; ++_i30)
+ TList _list37 = iprot.readListBegin();
+ this.cf_defs = new ArrayList<CfDef>(_list37.size);
+ for (int _i38 = 0; _i38 < _list37.size; ++_i38)
{
- CfDef _elem31;
- _elem31 = new CfDef();
- _elem31.read(iprot);
- this.cf_defs.add(_elem31);
+ CfDef _elem39;
+ _elem39 = new CfDef();
+ _elem39.read(iprot);
+ this.cf_defs.add(_elem39);
}
iprot.readListEnd();
}
@@ -564,9 +564,9 @@ public class KsDef implements TBase<KsDe
oprot.writeFieldBegin(CF_DEFS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRUCT, this.cf_defs.size()));
- for (CfDef _iter32 : this.cf_defs)
+ for (CfDef _iter40 : this.cf_defs)
{
- _iter32.write(oprot);
+ _iter40.write(oprot);
}
oprot.writeListEnd();
}
Added: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/RowPredicate.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/RowPredicate.java?rev=961795&view=auto
==============================================================================
--- cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/RowPredicate.java (added)
+++ cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/RowPredicate.java Thu Jul 8 15:17:20 2010
@@ -0,0 +1,539 @@
+/**
+ * Autogenerated by Thrift
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ */
+package org.apache.cassandra.thrift;
+/*
+ *
+ * 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;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.thrift.*;
+import org.apache.thrift.meta_data.*;
+import org.apache.thrift.protocol.*;
+
+public class RowPredicate implements TBase<RowPredicate._Fields>, java.io.Serializable, Cloneable, Comparable<RowPredicate> {
+ private static final TStruct STRUCT_DESC = new TStruct("RowPredicate");
+
+ private static final TField KEYS_FIELD_DESC = new TField("keys", TType.LIST, (short)1);
+ private static final TField KEY_RANGE_FIELD_DESC = new TField("key_range", TType.STRUCT, (short)2);
+ private static final TField INDEX_CLAUSE_FIELD_DESC = new TField("index_clause", TType.STRUCT, (short)3);
+
+ public List<byte[]> keys;
+ public KeyRange key_range;
+ public IndexClause index_clause;
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements TFieldIdEnum {
+ KEYS((short)1, "keys"),
+ KEY_RANGE((short)2, "key_range"),
+ INDEX_CLAUSE((short)3, "index_clause");
+
+ 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<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
+ put(_Fields.KEYS, new FieldMetaData("keys", TFieldRequirementType.OPTIONAL,
+ new ListMetaData(TType.LIST,
+ new FieldValueMetaData(TType.STRING))));
+ put(_Fields.KEY_RANGE, new FieldMetaData("key_range", TFieldRequirementType.OPTIONAL,
+ new StructMetaData(TType.STRUCT, KeyRange.class)));
+ put(_Fields.INDEX_CLAUSE, new FieldMetaData("index_clause", TFieldRequirementType.OPTIONAL,
+ new StructMetaData(TType.STRUCT, IndexClause.class)));
+ }});
+
+ static {
+ FieldMetaData.addStructMetaDataMap(RowPredicate.class, metaDataMap);
+ }
+
+ public RowPredicate() {
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public RowPredicate(RowPredicate other) {
+ if (other.isSetKeys()) {
+ List<byte[]> __this__keys = new ArrayList<byte[]>();
+ for (byte[] other_element : other.keys) {
+ byte[] temp_binary_element = new byte[other_element.length];
+ System.arraycopy(other_element, 0, temp_binary_element, 0, other_element.length);
+ __this__keys.add(temp_binary_element);
+ }
+ this.keys = __this__keys;
+ }
+ if (other.isSetKey_range()) {
+ this.key_range = new KeyRange(other.key_range);
+ }
+ if (other.isSetIndex_clause()) {
+ this.index_clause = new IndexClause(other.index_clause);
+ }
+ }
+
+ public RowPredicate deepCopy() {
+ return new RowPredicate(this);
+ }
+
+ @Deprecated
+ public RowPredicate clone() {
+ return new RowPredicate(this);
+ }
+
+ public int getKeysSize() {
+ return (this.keys == null) ? 0 : this.keys.size();
+ }
+
+ public java.util.Iterator<byte[]> getKeysIterator() {
+ return (this.keys == null) ? null : this.keys.iterator();
+ }
+
+ public void addToKeys(byte[] elem) {
+ if (this.keys == null) {
+ this.keys = new ArrayList<byte[]>();
+ }
+ this.keys.add(elem);
+ }
+
+ public List<byte[]> getKeys() {
+ return this.keys;
+ }
+
+ public RowPredicate setKeys(List<byte[]> keys) {
+ this.keys = keys;
+ return this;
+ }
+
+ public void unsetKeys() {
+ this.keys = null;
+ }
+
+ /** Returns true if field keys is set (has been asigned a value) and false otherwise */
+ public boolean isSetKeys() {
+ return this.keys != null;
+ }
+
+ public void setKeysIsSet(boolean value) {
+ if (!value) {
+ this.keys = null;
+ }
+ }
+
+ public KeyRange getKey_range() {
+ return this.key_range;
+ }
+
+ public RowPredicate setKey_range(KeyRange key_range) {
+ this.key_range = key_range;
+ return this;
+ }
+
+ public void unsetKey_range() {
+ this.key_range = null;
+ }
+
+ /** Returns true if field key_range is set (has been asigned a value) and false otherwise */
+ public boolean isSetKey_range() {
+ return this.key_range != null;
+ }
+
+ public void setKey_rangeIsSet(boolean value) {
+ if (!value) {
+ this.key_range = null;
+ }
+ }
+
+ public IndexClause getIndex_clause() {
+ return this.index_clause;
+ }
+
+ public RowPredicate setIndex_clause(IndexClause index_clause) {
+ this.index_clause = index_clause;
+ return this;
+ }
+
+ public void unsetIndex_clause() {
+ this.index_clause = null;
+ }
+
+ /** Returns true if field index_clause is set (has been asigned a value) and false otherwise */
+ public boolean isSetIndex_clause() {
+ return this.index_clause != null;
+ }
+
+ public void setIndex_clauseIsSet(boolean value) {
+ if (!value) {
+ this.index_clause = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case KEYS:
+ if (value == null) {
+ unsetKeys();
+ } else {
+ setKeys((List<byte[]>)value);
+ }
+ break;
+
+ case KEY_RANGE:
+ if (value == null) {
+ unsetKey_range();
+ } else {
+ setKey_range((KeyRange)value);
+ }
+ break;
+
+ case INDEX_CLAUSE:
+ if (value == null) {
+ unsetIndex_clause();
+ } else {
+ setIndex_clause((IndexClause)value);
+ }
+ break;
+
+ }
+ }
+
+ public void setFieldValue(int fieldID, Object value) {
+ setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case KEYS:
+ return getKeys();
+
+ case KEY_RANGE:
+ return getKey_range();
+
+ case INDEX_CLAUSE:
+ return getIndex_clause();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ 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 KEYS:
+ return isSetKeys();
+ case KEY_RANGE:
+ return isSetKey_range();
+ case INDEX_CLAUSE:
+ return isSetIndex_clause();
+ }
+ throw new IllegalStateException();
+ }
+
+ public boolean isSet(int fieldID) {
+ return isSet(_Fields.findByThriftIdOrThrow(fieldID));
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof RowPredicate)
+ return this.equals((RowPredicate)that);
+ return false;
+ }
+
+ public boolean equals(RowPredicate that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_keys = true && this.isSetKeys();
+ boolean that_present_keys = true && that.isSetKeys();
+ if (this_present_keys || that_present_keys) {
+ if (!(this_present_keys && that_present_keys))
+ return false;
+ if (!this.keys.equals(that.keys))
+ return false;
+ }
+
+ boolean this_present_key_range = true && this.isSetKey_range();
+ boolean that_present_key_range = true && that.isSetKey_range();
+ if (this_present_key_range || that_present_key_range) {
+ if (!(this_present_key_range && that_present_key_range))
+ return false;
+ if (!this.key_range.equals(that.key_range))
+ return false;
+ }
+
+ boolean this_present_index_clause = true && this.isSetIndex_clause();
+ boolean that_present_index_clause = true && that.isSetIndex_clause();
+ if (this_present_index_clause || that_present_index_clause) {
+ if (!(this_present_index_clause && that_present_index_clause))
+ return false;
+ if (!this.index_clause.equals(that.index_clause))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public int compareTo(RowPredicate other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ RowPredicate typedOther = (RowPredicate)other;
+
+ lastComparison = Boolean.valueOf(isSetKeys()).compareTo(typedOther.isSetKeys());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetKeys()) { lastComparison = TBaseHelper.compareTo(keys, typedOther.keys);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetKey_range()).compareTo(typedOther.isSetKey_range());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetKey_range()) { lastComparison = TBaseHelper.compareTo(key_range, typedOther.key_range);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetIndex_clause()).compareTo(typedOther.isSetIndex_clause());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetIndex_clause()) { lastComparison = TBaseHelper.compareTo(index_clause, typedOther.index_clause);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public void read(TProtocol iprot) throws TException {
+ TField field;
+ iprot.readStructBegin();
+ while (true)
+ {
+ field = iprot.readFieldBegin();
+ if (field.type == TType.STOP) {
+ break;
+ }
+ switch (field.id) {
+ case 1: // KEYS
+ if (field.type == TType.LIST) {
+ {
+ TList _list16 = iprot.readListBegin();
+ this.keys = new ArrayList<byte[]>(_list16.size);
+ for (int _i17 = 0; _i17 < _list16.size; ++_i17)
+ {
+ byte[] _elem18;
+ _elem18 = iprot.readBinary();
+ this.keys.add(_elem18);
+ }
+ iprot.readListEnd();
+ }
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 2: // KEY_RANGE
+ if (field.type == TType.STRUCT) {
+ this.key_range = new KeyRange();
+ this.key_range.read(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case 3: // INDEX_CLAUSE
+ if (field.type == TType.STRUCT) {
+ this.index_clause = new IndexClause();
+ this.index_clause.read(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ default:
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ validate();
+ }
+
+ public void write(TProtocol oprot) throws TException {
+ validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (this.keys != null) {
+ if (isSetKeys()) {
+ oprot.writeFieldBegin(KEYS_FIELD_DESC);
+ {
+ oprot.writeListBegin(new TList(TType.STRING, this.keys.size()));
+ for (byte[] _iter19 : this.keys)
+ {
+ oprot.writeBinary(_iter19);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ }
+ if (this.key_range != null) {
+ if (isSetKey_range()) {
+ oprot.writeFieldBegin(KEY_RANGE_FIELD_DESC);
+ this.key_range.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (this.index_clause != null) {
+ if (isSetIndex_clause()) {
+ oprot.writeFieldBegin(INDEX_CLAUSE_FIELD_DESC);
+ this.index_clause.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("RowPredicate(");
+ boolean first = true;
+
+ if (isSetKeys()) {
+ sb.append("keys:");
+ if (this.keys == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.keys);
+ }
+ first = false;
+ }
+ if (isSetKey_range()) {
+ if (!first) sb.append(", ");
+ sb.append("key_range:");
+ if (this.key_range == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.key_range);
+ }
+ first = false;
+ }
+ if (isSetIndex_clause()) {
+ if (!first) sb.append(", ");
+ sb.append("index_clause:");
+ if (this.index_clause == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.index_clause);
+ }
+ first = false;
+ }
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws TException {
+ // check for required fields
+ }
+
+}
+
Modified: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/TokenRange.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/TokenRange.java?rev=961795&r1=961794&r2=961795&view=diff
==============================================================================
--- cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/TokenRange.java (original)
+++ cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/TokenRange.java Thu Jul 8 15:17:20 2010
@@ -439,13 +439,13 @@ public class TokenRange implements TBase
case 3: // ENDPOINTS
if (field.type == TType.LIST) {
{
- TList _list16 = iprot.readListBegin();
- this.endpoints = new ArrayList<String>(_list16.size);
- for (int _i17 = 0; _i17 < _list16.size; ++_i17)
+ TList _list24 = iprot.readListBegin();
+ this.endpoints = new ArrayList<String>(_list24.size);
+ for (int _i25 = 0; _i25 < _list24.size; ++_i25)
{
- String _elem18;
- _elem18 = iprot.readString();
- this.endpoints.add(_elem18);
+ String _elem26;
+ _elem26 = iprot.readString();
+ this.endpoints.add(_elem26);
}
iprot.readListEnd();
}
@@ -482,9 +482,9 @@ public class TokenRange implements TBase
oprot.writeFieldBegin(ENDPOINTS_FIELD_DESC);
{
oprot.writeListBegin(new TList(TType.STRING, this.endpoints.size()));
- for (String _iter19 : this.endpoints)
+ for (String _iter27 : this.endpoints)
{
- oprot.writeString(_iter19);
+ oprot.writeString(_iter27);
}
oprot.writeListEnd();
}
Modified: cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java?rev=961795&r1=961794&r2=961795&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java Thu Jul 8 15:17:20 2010
@@ -22,6 +22,7 @@ import org.apache.cassandra.db.marshal.A
import org.apache.cassandra.db.marshal.BytesType;
import org.apache.cassandra.thrift.*;
+import org.apache.cassandra.utils.FBUtilities;
import org.apache.thrift.*;
import org.antlr.runtime.tree.*;
@@ -229,19 +230,12 @@ public class CliClient
columnName = CliCompiler.getColumn(columnFamilySpec, 1).getBytes("UTF-8");
}
- Clock thrift_clock = new Clock().setTimestamp(timestampMicros());
+ Clock thrift_clock = new Clock().setTimestamp(FBUtilities.timestampMicros());
thriftClient_.remove(key.getBytes(), new ColumnPath(columnFamily).setSuper_column(superColumnName).setColumn(columnName),
thrift_clock, ConsistencyLevel.ONE);
css_.out.println(String.format("%s removed.", (columnSpecCnt == 0) ? "row" : "column"));
}
- private static long timestampMicros()
- {
- // we use microsecond resolution for compatibility with other client libraries, even though
- // we can't actually get microsecond precision.
- return System.currentTimeMillis() * 1000;
- }
-
private void doSlice(String keyspace, String key, String columnFamily, byte[] superColumnName)
throws InvalidRequestException, UnavailableException, TimedOutException, TException, UnsupportedEncodingException, IllegalAccessException, NotFoundException, InstantiationException, NoSuchFieldException
{
@@ -414,7 +408,7 @@ public class CliClient
}
// do the insert
- Clock thrift_clock = new Clock().setTimestamp(timestampMicros());
+ Clock thrift_clock = new Clock().setTimestamp(FBUtilities.timestampMicros());
thriftClient_.insert(key.getBytes(), new ColumnParent(columnFamily).setSuper_column(superColumnName),
new Column(columnName, value.getBytes(), thrift_clock), ConsistencyLevel.ONE);
Modified: cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java?rev=961795&r1=961794&r2=961795&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java Thu Jul 8 15:17:20 2010
@@ -316,7 +316,7 @@ public final class CFMetaData
.toHashCode();
}
- private static int nextId()
+ private static int nextId()
{
return idGen.getAndIncrement();
}
Modified: cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java?rev=961795&r1=961794&r2=961795&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java Thu Jul 8 15:17:20 2010
@@ -110,7 +110,7 @@ public class DatabaseDescriptor
configFileName = getStorageConfigPath();
if (logger.isDebugEnabled())
- logger.debug("Loading settings from " + configFileName);
+ logger.info("Loading settings from " + configFileName);
InputStream input = new FileInputStream(new File(configFileName));
org.yaml.snakeyaml.constructor.Constructor constructor = new org.yaml.snakeyaml.constructor.Constructor(Config.class);
Modified: cassandra/trunk/src/java/org/apache/cassandra/config/KSMetaData.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/KSMetaData.java?rev=961795&r1=961794&r2=961795&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/KSMetaData.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/KSMetaData.java Thu Jul 8 15:17:20 2010
@@ -48,7 +48,7 @@ public final class KSMetaData
Map<String, CFMetaData> cfmap = new HashMap<String, CFMetaData>();
for (CFMetaData cfm : cfDefs)
cfmap.put(cfm.cfName, cfm);
- this.cfMetaData = Collections.<String, CFMetaData>unmodifiableMap(cfmap);
+ this.cfMetaData = Collections.unmodifiableMap(cfmap);
}
public boolean equals(Object obj)
Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamily.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamily.java?rev=961795&r1=961794&r2=961795&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamily.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamily.java Thu Jul 8 15:17:20 2010
@@ -30,14 +30,20 @@ import org.apache.cassandra.config.CFMet
import org.apache.cassandra.db.IClock.ClockRelationship;
import org.apache.cassandra.db.clock.AbstractReconciler;
import org.apache.cassandra.config.DatabaseDescriptor;
+import org.apache.cassandra.dht.BytesToken;
+import org.apache.cassandra.dht.LocalPartitioner;
import org.apache.cassandra.io.ICompactSerializer2;
import org.apache.cassandra.db.filter.QueryPath;
import org.apache.cassandra.db.marshal.AbstractType;
import org.apache.cassandra.io.util.IIterableColumns;
import org.apache.cassandra.utils.FBUtilities;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class ColumnFamily implements IColumnContainer, IIterableColumns
{
+ private static Logger logger = LoggerFactory.getLogger(ColumnFamily.class);
+
/* The column serializer for this Column Family. Create based on config. */
private static ColumnFamilySerializer serializer = new ColumnFamilySerializer();
@@ -58,8 +64,7 @@ public class ColumnFamily implements ICo
public static ColumnFamily create(CFMetaData cfm)
{
- if (cfm == null)
- throw new IllegalArgumentException("Unknown column family.");
+ assert cfm != null;
return new ColumnFamily(cfm.cfType, cfm.clockType, cfm.comparator, cfm.subcolumnComparator, cfm.reconciler, cfm.cfId);
}
@@ -185,6 +190,11 @@ public class ColumnFamily implements ICo
addColumn(path.superColumnName, column);
}
+ public void deleteColumn(byte[] column, int localDeletionTime, IClock clock)
+ {
+ addColumn(null, new DeletedColumn(column, localDeletionTime, clock));
+ }
+
public void deleteColumn(QueryPath path, int localDeletionTime, IClock clock)
{
assert path.columnName != null : path;