Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2D43A62B2 for ; Wed, 6 Jul 2011 16:13:57 +0000 (UTC) Received: (qmail 48520 invoked by uid 500); 6 Jul 2011 16:13:57 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 48454 invoked by uid 500); 6 Jul 2011 16:13:56 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 48446 invoked by uid 99); 6 Jul 2011 16:13:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2011 16:13:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2011 16:13:52 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9A99D238885D for ; Wed, 6 Jul 2011 16:13:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1143483 - in /cassandra/trunk: ./ contrib/ interface/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/hadoop/ src/java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/tools/ Date: Wed, 06 Jul 2011 16:13:32 -0000 To: commits@cassandra.apache.org From: jbellis@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110706161332.9A99D238885D@eris.apache.org> Author: jbellis Date: Wed Jul 6 16:13:31 2011 New Revision: 1143483 URL: http://svn.apache.org/viewvc?rev=1143483&view=rev Log: merge from 0.8 Modified: cassandra/trunk/ (props changed) cassandra/trunk/contrib/ (props changed) cassandra/trunk/interface/cassandra.thrift cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java (contents, props changed) cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java (props changed) cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java (props changed) cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java (props changed) cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java (props changed) cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java cassandra/trunk/src/java/org/apache/cassandra/hadoop/ConfigHelper.java cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java Propchange: cassandra/trunk/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Jul 6 16:13:31 2011 @@ -1,7 +1,7 @@ /cassandra/branches/cassandra-0.6:922689-1052356,1052358-1053452,1053454,1053456-1131291 -/cassandra/branches/cassandra-0.7:1026516-1140567,1141129,1141213,1141217,1143437,1143444 +/cassandra/branches/cassandra-0.7:1026516-1140567,1140928,1141129,1141213,1141217,1143437,1143444 /cassandra/branches/cassandra-0.7.0:1053690-1055654 -/cassandra/branches/cassandra-0.8:1090934-1125013,1125019-1140755,1140760,1141134,1141214,1141220,1143352,1143438,1143445 +/cassandra/branches/cassandra-0.8:1090934-1125013,1125019-1141220,1143352,1143438,1143445 /cassandra/branches/cassandra-0.8.0:1125021-1130369 /cassandra/branches/cassandra-0.8.1:1101014-1125018 /cassandra/tags/cassandra-0.7.0-rc3:1051699-1053689 Propchange: cassandra/trunk/contrib/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Jul 6 16:13:31 2011 @@ -1,7 +1,7 @@ /cassandra/branches/cassandra-0.6/contrib:922689-1052356,1052358-1053452,1053454,1053456-1068009 -/cassandra/branches/cassandra-0.7/contrib:1026516-1140567,1141129,1141213,1141217,1143437,1143444 +/cassandra/branches/cassandra-0.7/contrib:1026516-1140567,1140928,1141129,1141213,1141217,1143437,1143444 /cassandra/branches/cassandra-0.7.0/contrib:1053690-1055654 -/cassandra/branches/cassandra-0.8/contrib:1090934-1125013,1125019-1140755,1140760,1141134,1141214,1141220,1143352,1143438,1143445 +/cassandra/branches/cassandra-0.8/contrib:1090934-1125013,1125019-1141220,1143352,1143438,1143445 /cassandra/branches/cassandra-0.8.0/contrib:1125021-1130369 /cassandra/branches/cassandra-0.8.1/contrib:1101014-1125018 /cassandra/tags/cassandra-0.7.0-rc3/contrib:1051699-1053689 Modified: cassandra/trunk/interface/cassandra.thrift URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/cassandra.thrift?rev=1143483&r1=1143482&r2=1143483&view=diff ============================================================================== --- cassandra/trunk/interface/cassandra.thrift (original) +++ cassandra/trunk/interface/cassandra.thrift Wed Jul 6 16:13:31 2011 @@ -624,13 +624,6 @@ service Cassandra { 4:required i32 keys_per_split) throws (1:InvalidRequestException ire), - /** experimental API for hadoop/parallel query support. - may change violently and without warning. - - returns alive endpoints, sorted by proximity, that belong in the same datacenter as the given endpoint */ - list sort_endpoints_by_proximity(1: string endpoint, 2: required list endpoints, 3: bool restrictToSameDC) - throws (1:InvalidRequestException ire), - /** adds a column family. returns the new schema id. */ string system_add_column_family(1:required CfDef cf_def) throws (1:InvalidRequestException ire, 2:SchemaDisagreementException sde), Modified: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java?rev=1143483&r1=1143482&r2=1143483&view=diff ============================================================================== --- cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java (original) +++ cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java Wed Jul 6 16:13:31 2011 @@ -256,18 +256,6 @@ public class Cassandra { public List describe_splits(String cfName, String start_token, String end_token, int keys_per_split) throws InvalidRequestException, org.apache.thrift.TException; /** - * experimental API for hadoop/parallel query support. - * may change violently and without warning. - * - * returns alive endpoints, sorted by proximity, that belong in the same datacenter as the given endpoint - * - * @param endpoint - * @param endpoints - * @param restrictToSameDC - */ - public List sort_endpoints_by_proximity(String endpoint, List endpoints, boolean restrictToSameDC) throws InvalidRequestException, org.apache.thrift.TException; - - /** * adds a column family. returns the new schema id. * * @param cf_def @@ -370,8 +358,6 @@ public class Cassandra { public void describe_splits(String cfName, String start_token, String end_token, int keys_per_split, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void sort_endpoints_by_proximity(String endpoint, List endpoints, boolean restrictToSameDC, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void system_add_column_family(CfDef cf_def, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void system_drop_column_family(String column_family, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -1438,47 +1424,6 @@ public class Cassandra { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "describe_splits failed: unknown result"); } - public List sort_endpoints_by_proximity(String endpoint, List endpoints, boolean restrictToSameDC) throws InvalidRequestException, org.apache.thrift.TException - { - send_sort_endpoints_by_proximity(endpoint, endpoints, restrictToSameDC); - return recv_sort_endpoints_by_proximity(); - } - - public void send_sort_endpoints_by_proximity(String endpoint, List endpoints, boolean restrictToSameDC) throws org.apache.thrift.TException - { - oprot_.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sort_endpoints_by_proximity", org.apache.thrift.protocol.TMessageType.CALL, ++seqid_)); - sort_endpoints_by_proximity_args args = new sort_endpoints_by_proximity_args(); - args.setEndpoint(endpoint); - args.setEndpoints(endpoints); - args.setRestrictToSameDC(restrictToSameDC); - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public List recv_sort_endpoints_by_proximity() throws InvalidRequestException, org.apache.thrift.TException - { - org.apache.thrift.protocol.TMessage msg = iprot_.readMessageBegin(); - if (msg.type == org.apache.thrift.protocol.TMessageType.EXCEPTION) { - org.apache.thrift.TApplicationException x = org.apache.thrift.TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - if (msg.seqid != seqid_) { - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.BAD_SEQUENCE_ID, "sort_endpoints_by_proximity failed: out of sequence response"); - } - sort_endpoints_by_proximity_result result = new sort_endpoints_by_proximity_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; - } - if (result.ire != null) { - throw result.ire; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "sort_endpoints_by_proximity failed: unknown result"); - } - public String system_add_column_family(CfDef cf_def) throws InvalidRequestException, SchemaDisagreementException, org.apache.thrift.TException { send_system_add_column_family(cf_def); @@ -2653,44 +2598,6 @@ public class Cassandra { } } - public void sort_endpoints_by_proximity(String endpoint, List endpoints, boolean restrictToSameDC, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - sort_endpoints_by_proximity_call method_call = new sort_endpoints_by_proximity_call(endpoint, endpoints, restrictToSameDC, resultHandler, this, protocolFactory, transport); - this.currentMethod = method_call; - manager.call(method_call); - } - - public static class sort_endpoints_by_proximity_call extends org.apache.thrift.async.TAsyncMethodCall { - private String endpoint; - private List endpoints; - private boolean restrictToSameDC; - public sort_endpoints_by_proximity_call(String endpoint, List endpoints, boolean restrictToSameDC, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.endpoint = endpoint; - this.endpoints = endpoints; - this.restrictToSameDC = restrictToSameDC; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sort_endpoints_by_proximity", org.apache.thrift.protocol.TMessageType.CALL, 0)); - sort_endpoints_by_proximity_args args = new sort_endpoints_by_proximity_args(); - args.setEndpoint(endpoint); - args.setEndpoints(endpoints); - args.setRestrictToSameDC(restrictToSameDC); - args.write(prot); - prot.writeMessageEnd(); - } - - public List getResult() throws InvalidRequestException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_sort_endpoints_by_proximity(); - } - } - public void system_add_column_family(CfDef cf_def, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); system_add_column_family_call method_call = new system_add_column_family_call(cf_def, resultHandler, this, protocolFactory, transport); @@ -2949,7 +2856,6 @@ public class Cassandra { processMap_.put("describe_snitch", new describe_snitch()); processMap_.put("describe_keyspace", new describe_keyspace()); processMap_.put("describe_splits", new describe_splits()); - processMap_.put("sort_endpoints_by_proximity", new sort_endpoints_by_proximity()); processMap_.put("system_add_column_family", new system_add_column_family()); processMap_.put("system_drop_column_family", new system_drop_column_family()); processMap_.put("system_add_keyspace", new system_add_keyspace()); @@ -3905,44 +3811,6 @@ public class Cassandra { } - private class sort_endpoints_by_proximity implements ProcessFunction { - public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException - { - sort_endpoints_by_proximity_args args = new sort_endpoints_by_proximity_args(); - try { - args.read(iprot); - } catch (org.apache.thrift.protocol.TProtocolException e) { - iprot.readMessageEnd(); - org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.PROTOCOL_ERROR, e.getMessage()); - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sort_endpoints_by_proximity", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - iprot.readMessageEnd(); - sort_endpoints_by_proximity_result result = new sort_endpoints_by_proximity_result(); - try { - result.success = iface_.sort_endpoints_by_proximity(args.endpoint, args.endpoints, args.restrictToSameDC); - } catch (InvalidRequestException ire) { - result.ire = ire; - } catch (Throwable th) { - LOGGER.error("Internal error processing sort_endpoints_by_proximity", th); - org.apache.thrift.TApplicationException x = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, "Internal error processing sort_endpoints_by_proximity"); - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sort_endpoints_by_proximity", org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return; - } - oprot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sort_endpoints_by_proximity", org.apache.thrift.protocol.TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - private class system_add_column_family implements ProcessFunction { public void process(int seqid, org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { @@ -26326,938 +26194,6 @@ public class Cassandra { } - public static class sort_endpoints_by_proximity_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sort_endpoints_by_proximity_args"); - - private static final org.apache.thrift.protocol.TField ENDPOINT_FIELD_DESC = new org.apache.thrift.protocol.TField("endpoint", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField ENDPOINTS_FIELD_DESC = new org.apache.thrift.protocol.TField("endpoints", org.apache.thrift.protocol.TType.LIST, (short)2); - private static final org.apache.thrift.protocol.TField RESTRICT_TO_SAME_DC_FIELD_DESC = new org.apache.thrift.protocol.TField("restrictToSameDC", org.apache.thrift.protocol.TType.BOOL, (short)3); - - public String endpoint; - public List endpoints; - public boolean restrictToSameDC; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - ENDPOINT((short)1, "endpoint"), - ENDPOINTS((short)2, "endpoints"), - RESTRICT_TO_SAME_DC((short)3, "restrictToSameDC"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // ENDPOINT - return ENDPOINT; - case 2: // ENDPOINTS - return ENDPOINTS; - case 3: // RESTRICT_TO_SAME_DC - return RESTRICT_TO_SAME_DC; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __RESTRICTTOSAMEDC_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.ENDPOINT, new org.apache.thrift.meta_data.FieldMetaData("endpoint", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.ENDPOINTS, new org.apache.thrift.meta_data.FieldMetaData("endpoints", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.RESTRICT_TO_SAME_DC, new org.apache.thrift.meta_data.FieldMetaData("restrictToSameDC", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sort_endpoints_by_proximity_args.class, metaDataMap); - } - - public sort_endpoints_by_proximity_args() { - } - - public sort_endpoints_by_proximity_args( - String endpoint, - List endpoints, - boolean restrictToSameDC) - { - this(); - this.endpoint = endpoint; - this.endpoints = endpoints; - this.restrictToSameDC = restrictToSameDC; - setRestrictToSameDCIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public sort_endpoints_by_proximity_args(sort_endpoints_by_proximity_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - if (other.isSetEndpoint()) { - this.endpoint = other.endpoint; - } - if (other.isSetEndpoints()) { - List __this__endpoints = new ArrayList(); - for (String other_element : other.endpoints) { - __this__endpoints.add(other_element); - } - this.endpoints = __this__endpoints; - } - this.restrictToSameDC = other.restrictToSameDC; - } - - public sort_endpoints_by_proximity_args deepCopy() { - return new sort_endpoints_by_proximity_args(this); - } - - @Override - public void clear() { - this.endpoint = null; - this.endpoints = null; - setRestrictToSameDCIsSet(false); - this.restrictToSameDC = false; - } - - public String getEndpoint() { - return this.endpoint; - } - - public sort_endpoints_by_proximity_args setEndpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - public void unsetEndpoint() { - this.endpoint = null; - } - - /** Returns true if field endpoint is set (has been assigned a value) and false otherwise */ - public boolean isSetEndpoint() { - return this.endpoint != null; - } - - public void setEndpointIsSet(boolean value) { - if (!value) { - this.endpoint = null; - } - } - - public int getEndpointsSize() { - return (this.endpoints == null) ? 0 : this.endpoints.size(); - } - - public java.util.Iterator getEndpointsIterator() { - return (this.endpoints == null) ? null : this.endpoints.iterator(); - } - - public void addToEndpoints(String elem) { - if (this.endpoints == null) { - this.endpoints = new ArrayList(); - } - this.endpoints.add(elem); - } - - public List getEndpoints() { - return this.endpoints; - } - - public sort_endpoints_by_proximity_args setEndpoints(List endpoints) { - this.endpoints = endpoints; - return this; - } - - public void unsetEndpoints() { - this.endpoints = null; - } - - /** Returns true if field endpoints is set (has been assigned a value) and false otherwise */ - public boolean isSetEndpoints() { - return this.endpoints != null; - } - - public void setEndpointsIsSet(boolean value) { - if (!value) { - this.endpoints = null; - } - } - - public boolean isRestrictToSameDC() { - return this.restrictToSameDC; - } - - public sort_endpoints_by_proximity_args setRestrictToSameDC(boolean restrictToSameDC) { - this.restrictToSameDC = restrictToSameDC; - setRestrictToSameDCIsSet(true); - return this; - } - - public void unsetRestrictToSameDC() { - __isset_bit_vector.clear(__RESTRICTTOSAMEDC_ISSET_ID); - } - - /** Returns true if field restrictToSameDC is set (has been assigned a value) and false otherwise */ - public boolean isSetRestrictToSameDC() { - return __isset_bit_vector.get(__RESTRICTTOSAMEDC_ISSET_ID); - } - - public void setRestrictToSameDCIsSet(boolean value) { - __isset_bit_vector.set(__RESTRICTTOSAMEDC_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ENDPOINT: - if (value == null) { - unsetEndpoint(); - } else { - setEndpoint((String)value); - } - break; - - case ENDPOINTS: - if (value == null) { - unsetEndpoints(); - } else { - setEndpoints((List)value); - } - break; - - case RESTRICT_TO_SAME_DC: - if (value == null) { - unsetRestrictToSameDC(); - } else { - setRestrictToSameDC((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ENDPOINT: - return getEndpoint(); - - case ENDPOINTS: - return getEndpoints(); - - case RESTRICT_TO_SAME_DC: - return new Boolean(isRestrictToSameDC()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case ENDPOINT: - return isSetEndpoint(); - case ENDPOINTS: - return isSetEndpoints(); - case RESTRICT_TO_SAME_DC: - return isSetRestrictToSameDC(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof sort_endpoints_by_proximity_args) - return this.equals((sort_endpoints_by_proximity_args)that); - return false; - } - - public boolean equals(sort_endpoints_by_proximity_args that) { - if (that == null) - return false; - - boolean this_present_endpoint = true && this.isSetEndpoint(); - boolean that_present_endpoint = true && that.isSetEndpoint(); - if (this_present_endpoint || that_present_endpoint) { - if (!(this_present_endpoint && that_present_endpoint)) - return false; - if (!this.endpoint.equals(that.endpoint)) - return false; - } - - boolean this_present_endpoints = true && this.isSetEndpoints(); - boolean that_present_endpoints = true && that.isSetEndpoints(); - if (this_present_endpoints || that_present_endpoints) { - if (!(this_present_endpoints && that_present_endpoints)) - return false; - if (!this.endpoints.equals(that.endpoints)) - return false; - } - - boolean this_present_restrictToSameDC = true; - boolean that_present_restrictToSameDC = true; - if (this_present_restrictToSameDC || that_present_restrictToSameDC) { - if (!(this_present_restrictToSameDC && that_present_restrictToSameDC)) - return false; - if (this.restrictToSameDC != that.restrictToSameDC) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_endpoint = true && (isSetEndpoint()); - builder.append(present_endpoint); - if (present_endpoint) - builder.append(endpoint); - - boolean present_endpoints = true && (isSetEndpoints()); - builder.append(present_endpoints); - if (present_endpoints) - builder.append(endpoints); - - boolean present_restrictToSameDC = true; - builder.append(present_restrictToSameDC); - if (present_restrictToSameDC) - builder.append(restrictToSameDC); - - return builder.toHashCode(); - } - - public int compareTo(sort_endpoints_by_proximity_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - sort_endpoints_by_proximity_args typedOther = (sort_endpoints_by_proximity_args)other; - - lastComparison = Boolean.valueOf(isSetEndpoint()).compareTo(typedOther.isSetEndpoint()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEndpoint()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endpoint, typedOther.endpoint); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetEndpoints()).compareTo(typedOther.isSetEndpoints()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEndpoints()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endpoints, typedOther.endpoints); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRestrictToSameDC()).compareTo(typedOther.isSetRestrictToSameDC()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRestrictToSameDC()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.restrictToSameDC, typedOther.restrictToSameDC); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // ENDPOINT - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.endpoint = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // ENDPOINTS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list119 = iprot.readListBegin(); - this.endpoints = new ArrayList(_list119.size); - for (int _i120 = 0; _i120 < _list119.size; ++_i120) - { - String _elem121; - _elem121 = iprot.readString(); - this.endpoints.add(_elem121); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // RESTRICT_TO_SAME_DC - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.restrictToSameDC = iprot.readBool(); - setRestrictToSameDCIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.endpoint != null) { - oprot.writeFieldBegin(ENDPOINT_FIELD_DESC); - oprot.writeString(this.endpoint); - oprot.writeFieldEnd(); - } - if (this.endpoints != null) { - oprot.writeFieldBegin(ENDPOINTS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.endpoints.size())); - for (String _iter122 : this.endpoints) - { - oprot.writeString(_iter122); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(RESTRICT_TO_SAME_DC_FIELD_DESC); - oprot.writeBool(this.restrictToSameDC); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("sort_endpoints_by_proximity_args("); - boolean first = true; - - sb.append("endpoint:"); - if (this.endpoint == null) { - sb.append("null"); - } else { - sb.append(this.endpoint); - } - first = false; - if (!first) sb.append(", "); - sb.append("endpoints:"); - if (this.endpoints == null) { - sb.append("null"); - } else { - sb.append(this.endpoints); - } - first = false; - if (!first) sb.append(", "); - sb.append("restrictToSameDC:"); - sb.append(this.restrictToSameDC); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (endpoints == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'endpoints' was not present! Struct: " + toString()); - } - } - - } - - public static class sort_endpoints_by_proximity_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sort_endpoints_by_proximity_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); - private static final org.apache.thrift.protocol.TField IRE_FIELD_DESC = new org.apache.thrift.protocol.TField("ire", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - public List success; - public InvalidRequestException ire; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"), - IRE((short)1, "ire"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - case 1: // IRE - return IRE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.IRE, new org.apache.thrift.meta_data.FieldMetaData("ire", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sort_endpoints_by_proximity_result.class, metaDataMap); - } - - public sort_endpoints_by_proximity_result() { - } - - public sort_endpoints_by_proximity_result( - List success, - InvalidRequestException ire) - { - this(); - this.success = success; - this.ire = ire; - } - - /** - * Performs a deep copy on other. - */ - public sort_endpoints_by_proximity_result(sort_endpoints_by_proximity_result other) { - if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (String other_element : other.success) { - __this__success.add(other_element); - } - this.success = __this__success; - } - if (other.isSetIre()) { - this.ire = new InvalidRequestException(other.ire); - } - } - - public sort_endpoints_by_proximity_result deepCopy() { - return new sort_endpoints_by_proximity_result(this); - } - - @Override - public void clear() { - this.success = null; - this.ire = null; - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public java.util.Iterator getSuccessIterator() { - return (this.success == null) ? null : this.success.iterator(); - } - - public void addToSuccess(String elem) { - if (this.success == null) { - this.success = new ArrayList(); - } - this.success.add(elem); - } - - public List getSuccess() { - return this.success; - } - - public sort_endpoints_by_proximity_result setSuccess(List success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public InvalidRequestException getIre() { - return this.ire; - } - - public sort_endpoints_by_proximity_result setIre(InvalidRequestException ire) { - this.ire = ire; - return this; - } - - public void unsetIre() { - this.ire = null; - } - - /** Returns true if field ire is set (has been assigned a value) and false otherwise */ - public boolean isSetIre() { - return this.ire != null; - } - - public void setIreIsSet(boolean value) { - if (!value) { - this.ire = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((List)value); - } - break; - - case IRE: - if (value == null) { - unsetIre(); - } else { - setIre((InvalidRequestException)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - case IRE: - return getIre(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - case IRE: - return isSetIre(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof sort_endpoints_by_proximity_result) - return this.equals((sort_endpoints_by_proximity_result)that); - return false; - } - - public boolean equals(sort_endpoints_by_proximity_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - boolean this_present_ire = true && this.isSetIre(); - boolean that_present_ire = true && that.isSetIre(); - if (this_present_ire || that_present_ire) { - if (!(this_present_ire && that_present_ire)) - return false; - if (!this.ire.equals(that.ire)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - boolean present_ire = true && (isSetIre()); - builder.append(present_ire); - if (present_ire) - builder.append(ire); - - return builder.toHashCode(); - } - - public int compareTo(sort_endpoints_by_proximity_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - sort_endpoints_by_proximity_result typedOther = (sort_endpoints_by_proximity_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIre()).compareTo(typedOther.isSetIre()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIre()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ire, typedOther.ire); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list123 = iprot.readListBegin(); - this.success = new ArrayList(_list123.size); - for (int _i124 = 0; _i124 < _list123.size; ++_i124) - { - String _elem125; - _elem125 = iprot.readString(); - this.success.add(_elem125); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // IRE - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.ire = new InvalidRequestException(); - this.ire.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.success.size())); - for (String _iter126 : this.success) - { - oprot.writeString(_iter126); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetIre()) { - oprot.writeFieldBegin(IRE_FIELD_DESC); - this.ire.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("sort_endpoints_by_proximity_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - if (!first) sb.append(", "); - sb.append("ire:"); - if (this.ire == null) { - sb.append("null"); - } else { - sb.append(this.ire); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - } - public static class system_add_column_family_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("system_add_column_family_args"); Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Jul 6 16:13:31 2011 @@ -1,7 +1,7 @@ /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1052356,1052358-1053452,1053454,1053456-1131291 -/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1140567,1141129,1141213,1141217,1143437,1143444 +/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1140567,1140928,1141129,1141213,1141217,1143437,1143444 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1053690-1055654 -/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090934-1125013,1125019-1140755,1140760,1141134,1141214,1141220,1143352,1143438,1143445 +/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090934-1125013,1125019-1141220,1143352,1143438,1143445 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1125021-1130369 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1101014-1125018 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1051699-1053689 Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Jul 6 16:13:31 2011 @@ -1,7 +1,7 @@ /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1052356,1052358-1053452,1053454,1053456-1131291 -/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1140567,1141129,1141213,1141217,1143437,1143444 +/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1140567,1140928,1141129,1141213,1141217,1143437,1143444 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1053690-1055654 -/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090934-1125013,1125019-1140755,1140760,1141134,1141214,1141220,1143352,1143438,1143445 +/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090934-1125013,1125019-1141220,1143352,1143438,1143445 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1125021-1130369 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1101014-1125018 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1051699-1053689 Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Jul 6 16:13:31 2011 @@ -1,7 +1,7 @@ /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1052356,1052358-1053452,1053454,1053456-1131291 -/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1140567,1141129,1141213,1141217,1143437,1143444 +/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1140567,1140928,1141129,1141213,1141217,1143437,1143444 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1053690-1055654 -/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090934-1125013,1125019-1140755,1140760,1141134,1141214,1141220,1143352,1143438,1143445 +/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090934-1125013,1125019-1141220,1143352,1143438,1143445 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1125021-1130369 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1101014-1125018 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1051699-1053689 Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Jul 6 16:13:31 2011 @@ -1,7 +1,7 @@ /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1052356,1052358-1053452,1053454,1053456-1131291 -/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1140567,1141129,1141213,1141217,1143437,1143444 +/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1140567,1140928,1141129,1141213,1141217,1143437,1143444 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1053690-1055654 -/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090934-1125013,1125019-1140755,1140760,1141134,1141214,1141220,1143352,1143438,1143445 +/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090934-1125013,1125019-1141220,1143352,1143438,1143445 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1125021-1130369 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1101014-1125018 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1051699-1053689 Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Jul 6 16:13:31 2011 @@ -1,7 +1,7 @@ /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1052356,1052358-1053452,1053454,1053456-1131291 -/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1140567,1141129,1141213,1141217,1143437,1143444 +/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1140567,1140928,1141129,1141213,1141217,1143437,1143444 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1053690-1055654 -/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090934-1125013,1125019-1140755,1140760,1141134,1141214,1141220,1143352,1143438,1143445 +/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090934-1125013,1125019-1141220,1143352,1143438,1143445 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1125021-1130369 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1101014-1125018 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1051699-1053689 Modified: cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java?rev=1143483&r1=1143482&r2=1143483&view=diff ============================================================================== --- cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java (original) +++ cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java Wed Jul 6 16:13:31 2011 @@ -197,7 +197,7 @@ public class ColumnFamilyInputFormat ext throw new IOException("failed connecting to all endpoints " + StringUtils.join(range.endpoints, ",")); } - static Cassandra.Client createConnection(String host, Integer port, boolean framed) throws IOException + private static Cassandra.Client createConnection(String host, Integer port, boolean framed) throws IOException { TSocket socket = new TSocket(host, port); TTransport trans = framed ? new TFramedTransport(socket) : socket; Modified: cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java?rev=1143483&r1=1143482&r2=1143483&view=diff ============================================================================== --- cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java (original) +++ cassandra/trunk/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java Wed Jul 6 16:13:31 2011 @@ -1,5 +1,4 @@ package org.apache.cassandra.hadoop; - /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -21,6 +20,7 @@ package org.apache.cassandra.hadoop; * */ + import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; @@ -38,7 +38,6 @@ import org.apache.cassandra.dht.IPartiti import org.apache.cassandra.thrift.*; import org.apache.cassandra.utils.FBUtilities; import org.apache.cassandra.utils.Pair; -import org.apache.commons.lang.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.mapreduce.InputSplit; import org.apache.hadoop.mapreduce.RecordReader; @@ -46,13 +45,9 @@ import org.apache.hadoop.mapreduce.TaskA import org.apache.thrift.TException; import org.apache.thrift.transport.TFramedTransport; import org.apache.thrift.transport.TSocket; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class ColumnFamilyRecordReader extends RecordReader> { - private static final Logger logger = LoggerFactory.getLogger(ColumnFamilyRecordReader.class); - private ColumnFamilySplit split; private RowIterator iter; private Pair> currentRow; @@ -65,7 +60,7 @@ public class ColumnFamilyRecordReader ex private Cassandra.Client client; private ConsistencyLevel consistencyLevel; - public void close() + public void close() { if (socket != null && socket.isOpen()) { @@ -74,7 +69,7 @@ public class ColumnFamilyRecordReader ex client = null; } } - + public ByteBuffer getCurrentKey() { return currentRow.left; @@ -84,14 +79,13 @@ public class ColumnFamilyRecordReader ex { return currentRow.right; } - + public float getProgress() { - // the progress is likely to be reported slightly off the actual but - // close enough - return ((float) iter.rowsRead()) / totalRowCount; + // the progress is likely to be reported slightly off the actual but close enough + return ((float)iter.rowsRead()) / totalRowCount; } - + public void initialize(InputSplit split, TaskAttemptContext context) throws IOException { this.split = (ColumnFamilySplit) split; @@ -101,9 +95,10 @@ public class ColumnFamilyRecordReader ex batchRowCount = ConfigHelper.getRangeBatchSize(conf); cfName = ConfigHelper.getInputColumnFamily(conf); consistencyLevel = ConsistencyLevel.valueOf(ConfigHelper.getReadConsistencyLevel(conf)); - + + keyspace = ConfigHelper.getInputKeyspace(conf); - + try { // only need to connect once @@ -111,31 +106,11 @@ public class ColumnFamilyRecordReader ex return; // create connection using thrift - List locationsAttempted = new ArrayList(); - for (Iterator it = getLocations(conf); it.hasNext(); ) - { - String location = it.next(); - try - { - socket = new TSocket(location, ConfigHelper.getRpcPort(conf)); - TBinaryProtocol binaryProtocol = new TBinaryProtocol(new TFramedTransport(socket)); - client = new Cassandra.Client(binaryProtocol); - socket.open(); - break; - } - catch (TException e) - { - logger.info("failed to connect to " + location + ':' + ConfigHelper.getRpcPort(conf), e); - locationsAttempted.add(location); - client = null; - } - } - if (client == null) - { - String message = String.format("For the split %s there were no locations %salive: %s", - split, (ConfigHelper.getInputSplitUseOnlySameDCReplica(conf) ? "(from same DC) " : ""), StringUtils.join(locationsAttempted, ", ")); - throw new RuntimeException(message); - } + String location = getLocation(); + socket = new TSocket(location, ConfigHelper.getRpcPort(conf)); + TBinaryProtocol binaryProtocol = new TBinaryProtocol(new TFramedTransport(socket)); + client = new Cassandra.Client(binaryProtocol); + socket.open(); // log in client.set_keyspace(keyspace); @@ -155,7 +130,7 @@ public class ColumnFamilyRecordReader ex iter = new RowIterator(); } - + public boolean nextKeyValue() throws IOException { if (!iter.hasNext()) @@ -165,15 +140,23 @@ public class ColumnFamilyRecordReader ex } // we don't use endpointsnitch since we are trying to support hadoop nodes that are - // not necessarily on Cassandra machines, too. This should be adequate for - // single-DC clusters, at least. - private Iterator getLocations(final Configuration conf) throws IOException + // not necessarily on Cassandra machines, too. This should be adequate for single-DC clusters, at least. + private String getLocation() { - for (InetAddress address : InetAddress.getAllByName(InetAddress.getLocalHost().getHostAddress())) + InetAddress[] localAddresses; + try + { + localAddresses = InetAddress.getAllByName(InetAddress.getLocalHost().getHostAddress()); + } + catch (UnknownHostException e) + { + throw new AssertionError(e); + } + for (InetAddress address : localAddresses) { - for (final String location : split.getLocations()) + for (String location : split.getLocations()) { - InetAddress locationAddress; + InetAddress locationAddress = null; try { locationAddress = InetAddress.getByName(location); @@ -182,16 +165,13 @@ public class ColumnFamilyRecordReader ex { throw new AssertionError(e); } - if (address.equals(locationAddress)) { - // add fall back replicas from same DC via the following Iterator - return new SplitEndpointIterator(location, conf); + return location; } } } - - return Arrays.asList(split.getLocations()).iterator(); + return split.getLocations()[0]; } private class RowIterator extends AbstractIterator>> @@ -238,38 +218,43 @@ public class ColumnFamilyRecordReader ex private void maybeInit() { - // check if we need another batch + // check if we need another batch if (rows != null && i >= rows.size()) rows = null; - + if (rows != null) return; if (startToken == null) { startToken = split.getStartToken(); - } + } else if (startToken.equals(split.getEndToken())) { rows = null; return; } - - KeyRange keyRange = new KeyRange(batchRowCount).setStart_token(startToken).setEnd_token(split.getEndToken()); + + KeyRange keyRange = new KeyRange(batchRowCount) + .setStart_token(startToken) + .setEnd_token(split.getEndToken()); try { - rows = client.get_range_slices(new ColumnParent(cfName), predicate, keyRange, consistencyLevel); - + rows = client.get_range_slices(new ColumnParent(cfName), + predicate, + keyRange, + consistencyLevel); + // nothing new? reached the end if (rows.isEmpty()) { rows = null; return; } - + // reset to iterate through this new batch i = 0; - + // prepare for the next slice to be read KeySlice lastRow = rows.get(rows.size() - 1); ByteBuffer rowkey = lastRow.key; @@ -294,7 +279,7 @@ public class ColumnFamilyRecordReader ex maybeInit(); if (rows == null) return endOfData(); - + totalRead++; KeySlice ks = rows.get(i++); SortedMap map = new TreeMap(comparator); @@ -328,101 +313,4 @@ public class ColumnFamilyRecordReader ex return new org.apache.cassandra.db.Column(column.name, column.value, column.timestamp); } } - - private class SplitEndpointIterator extends AbstractIterator - { - private final boolean restrictToSameDC; - private final String location; - private final Configuration conf; - private Cassandra.Client client; - private List endpoints; - private int endpointsIdx = -1; - - SplitEndpointIterator(final String location, final Configuration conf) - { - this.location = location; - this.conf = conf; - restrictToSameDC = ConfigHelper.getInputSplitUseOnlySameDCReplica(conf); - } - - protected String computeNext() - { - if (-1 == endpointsIdx) - { - // location is the preference. always return it first. - endpointsIdx = 0; - return location; - } - else - { - if (null == endpoints) - { - try - { - for (String nextLocation : split.getLocations()) - { - try - { - endpoints = sortEndpointsByProximity(nextLocation, Arrays.asList(split.getLocations()), restrictToSameDC); - if (location.equals(endpoints.get(0))) - { - ++endpointsIdx; - } - break; - } - catch (TException e) - { - logger.info(String.format("failed to sortEndpointsByProximity(%s, [%s], %s)", - location, StringUtils.join(split.getLocations(), ','), restrictToSameDC), e); - } - catch (IOException e) - { - logger.info(String.format("failed to sortEndpointsByProximity(%s, [%s], %s)", - location, StringUtils.join(split.getLocations(), ','), restrictToSameDC), e); - } - } - } - catch (InvalidRequestException e) - { - throw new AssertionError(e); - } - if (null == endpoints) - { - throw new AssertionError(String.format("failed to find any fallback replica endpoints from %s", - StringUtils.join(split.getLocations(), ','))); - } - } - if (endpoints.size() > endpointsIdx) - { - return endpoints.get(endpointsIdx++); - } - } - return endOfData(); - } - - private List sortEndpointsByProximity(String connectTo, List endpoints, boolean restrictToSameDC) - throws InvalidRequestException, TException, IOException - { - try - { - // try first our configured initialAddress - return getClient(ConfigHelper.getInitialAddress(conf)).sort_endpoints_by_proximity(location, endpoints, restrictToSameDC); - } - catch (IOException ex) - { - // connect through the endpoint. if it fails it's no good - // anyway. - return getClient(connectTo).sort_endpoints_by_proximity(location, endpoints, restrictToSameDC); - } - } - - private Cassandra.Client getClient(String host) throws IOException - { - if (null == client) - { - client = ColumnFamilyInputFormat.createConnection(host, ConfigHelper.getRpcPort(conf), true); - } - return client; - } - } } Modified: cassandra/trunk/src/java/org/apache/cassandra/hadoop/ConfigHelper.java URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/hadoop/ConfigHelper.java?rev=1143483&r1=1143482&r2=1143483&view=diff ============================================================================== --- cassandra/trunk/src/java/org/apache/cassandra/hadoop/ConfigHelper.java (original) +++ cassandra/trunk/src/java/org/apache/cassandra/hadoop/ConfigHelper.java Wed Jul 6 16:13:31 2011 @@ -51,7 +51,6 @@ public class ConfigHelper private static final String INITIAL_THRIFT_ADDRESS = "cassandra.thrift.address"; private static final String READ_CONSISTENCY_LEVEL = "cassandra.consistencylevel.read"; private static final String WRITE_CONSISTENCY_LEVEL = "cassandra.consistencylevel.write"; - private static final String INPUT_SPLIT_USE_ONLY_SAME_DC_REPLICA = "cassandra.input.split.useOnlySameDCReplica"; /** * Set the keyspace and column family for the input of this job. @@ -145,24 +144,6 @@ public class ConfigHelper } /** - * If true only endpoints for a split within the same datacenter - * can be used if the localhost endpoint fails. - * Set to false if any of the split's replicas can be used. - * - * @param conf Job configuration you are about to run - * @param inDC - */ - public static void setInputSplitUseOnlySameDCReplica(Configuration conf, boolean inDC) - { - conf.setBoolean(INPUT_SPLIT_USE_ONLY_SAME_DC_REPLICA, inDC); - } - - public static boolean getInputSplitUseOnlySameDCReplica(Configuration conf) - { - return conf.getBoolean(INPUT_SPLIT_USE_ONLY_SAME_DC_REPLICA, true); - } - - /** * Set the predicate that determines what columns will be selected from each row. * * @param conf Job configuration you are about to run Modified: cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java?rev=1143483&r1=1143482&r2=1143483&view=diff ============================================================================== --- cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java (original) +++ cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java Wed Jul 6 16:13:31 2011 @@ -33,8 +33,6 @@ import java.util.zip.Inflater; import com.google.common.base.Predicates; import com.google.common.collect.Maps; -import java.net.InetAddress; -import java.net.UnknownHostException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -50,15 +48,12 @@ import org.apache.cassandra.db.marshal.M import org.apache.cassandra.db.migration.*; import org.apache.cassandra.db.context.CounterContext; import org.apache.cassandra.dht.*; -import org.apache.cassandra.gms.FailureDetector; -import org.apache.cassandra.gms.Gossiper; import org.apache.cassandra.locator.*; import org.apache.cassandra.scheduler.IRequestScheduler; import org.apache.cassandra.service.ClientState; import org.apache.cassandra.service.StorageProxy; import org.apache.cassandra.service.StorageService; import org.apache.cassandra.utils.ByteBufferUtil; -import org.apache.cassandra.utils.FBUtilities; import org.apache.thrift.TException; public class CassandraServer implements Cassandra.Iface @@ -751,45 +746,6 @@ public class CassandraServer implements return splits; } - public List sort_endpoints_by_proximity(String endpoint, List endpoints, boolean restrictToSameDC) - throws TException, InvalidRequestException - { - try - { - List results = new ArrayList(); - InetAddress address = InetAddress.getByName(endpoint); - boolean endpointValid = null != Gossiper.instance.getEndpointStateForEndpoint(address); - String datacenter = DatabaseDescriptor - .getEndpointSnitch().getDatacenter(endpointValid ? address : FBUtilities.getBroadcastAddress()); - List addresses = new ArrayList(); - for(String ep : endpoints) - { - addresses.add(InetAddress.getByName(ep)); - } - IEndpointSnitch snitch = DatabaseDescriptor.getEndpointSnitch(); - - //Only use the dynamic snitch when endpoint is a cassandra node - if (!endpointValid && snitch instanceof DynamicEndpointSnitch) - snitch = ((DynamicEndpointSnitch)snitch).subsnitch; - - snitch.sortByProximity(address, addresses); - for(InetAddress ep : addresses) - { - String dc = DatabaseDescriptor.getEndpointSnitch().getDatacenter(ep); - if(FailureDetector.instance.isAlive(ep) && (!restrictToSameDC || datacenter.equals(dc))) - { - results.add(ep.getHostName()); - } - } - - return results; - } - catch (UnknownHostException e) - { - throw new InvalidRequestException(e.getMessage()); - } - } - public void login(AuthenticationRequest auth_request) throws AuthenticationException, AuthorizationException, TException { state().login(auth_request.getCredentials()); Modified: cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java?rev=1143483&r1=1143482&r2=1143483&view=diff ============================================================================== --- cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java (original) +++ cassandra/trunk/src/java/org/apache/cassandra/tools/NodeCmd.java Wed Jul 6 16:13:31 2011 @@ -445,6 +445,7 @@ public class NodeCmd outs.println("\t\tSSTable count: " + cfstore.getLiveSSTableCount()); outs.println("\t\tSpace used (live): " + cfstore.getLiveDiskSpaceUsed()); outs.println("\t\tSpace used (total): " + cfstore.getTotalDiskSpaceUsed()); + outs.println("\t\tNumber of Keys (estimate): " + cfstore.estimateKeys()); outs.println("\t\tMemtable Columns Count: " + cfstore.getMemtableColumnsCount()); outs.println("\t\tMemtable Data Size: " + cfstore.getMemtableDataSize()); outs.println("\t\tMemtable Switch Count: " + cfstore.getMemtableSwitchCount());