diff --git a/interface/cassandra.thrift b/interface/cassandra.thrift index e73528955a..a875525528 100644 --- a/interface/cassandra.thrift +++ b/interface/cassandra.thrift @@ -473,9 +473,11 @@ service Cassandra { returns list of token strings such that first subrange is (list[0], list[1]], next is (list[1], list[2]], etc. */ - list describe_splits(1:required string start_token, - 2:required string end_token, - 3:required i32 keys_per_split), + list describe_splits(1:required string keyspace, + 2:required string cfName, + 3:required string start_token, + 4:required string end_token, + 5:required i32 keys_per_split), /** adds a column family. returns the new schema id. */ string system_add_column_family(1:required CfDef cf_def) diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/AccessLevel.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/AccessLevel.java index c78a3e6c78..c4dfe76135 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/AccessLevel.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/AccessLevel.java @@ -4,27 +4,6 @@ * 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.Map; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationException.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationException.java index a4384dd155..73cd0e5e1e 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationException.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationException.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationRequest.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationRequest.java index 733fc425ac..16dcf7163a 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationRequest.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationRequest.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthorizationException.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthorizationException.java index cddf0694d1..b9ebce7ec4 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthorizationException.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthorizationException.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java index 72e3866b07..fba3cb4728 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java @@ -4,27 +4,6 @@ * 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; @@ -211,22 +190,58 @@ public class Cassandra { * returns list of token strings such that first subrange is (list[0], list[1]], * next is (list[1], list[2]], etc. * + * @param keyspace + * @param cfName * @param start_token * @param end_token * @param keys_per_split */ - public List describe_splits(String start_token, String end_token, int keys_per_split) throws TException; + public List describe_splits(String keyspace, String cfName, String start_token, String end_token, int keys_per_split) throws TException; + /** + * adds a column family. returns the new schema id. + * + * @param cf_def + */ public String system_add_column_family(CfDef cf_def) throws InvalidRequestException, TException; + /** + * drops a column family. returns the new schema id. + * + * @param keyspace + * @param column_family + */ public String system_drop_column_family(String keyspace, String column_family) throws InvalidRequestException, TException; + /** + * renames a column family. returns the new schema id. + * + * @param keyspace + * @param old_name + * @param new_name + */ public String system_rename_column_family(String keyspace, String old_name, String new_name) throws InvalidRequestException, TException; + /** + * adds a keyspace and any column families that are part of it. returns the new schema id. + * + * @param ks_def + */ public String system_add_keyspace(KsDef ks_def) throws InvalidRequestException, TException; + /** + * drops a keyspace and any column families that are part of it. returns the new schema id. + * + * @param keyspace + */ public String system_drop_keyspace(String keyspace) throws InvalidRequestException, TException; + /** + * renames a keyspace. returns the new schema id. + * + * @param old_name + * @param new_name + */ public String system_rename_keyspace(String old_name, String new_name) throws InvalidRequestException, TException; } @@ -964,16 +979,18 @@ public class Cassandra { throw new TApplicationException(TApplicationException.MISSING_RESULT, "describe_keyspace failed: unknown result"); } - public List describe_splits(String start_token, String end_token, int keys_per_split) throws TException + public List describe_splits(String keyspace, String cfName, String start_token, String end_token, int keys_per_split) throws TException { - send_describe_splits(start_token, end_token, keys_per_split); + send_describe_splits(keyspace, cfName, start_token, end_token, keys_per_split); return recv_describe_splits(); } - public void send_describe_splits(String start_token, String end_token, int keys_per_split) throws TException + public void send_describe_splits(String keyspace, String cfName, String start_token, String end_token, int keys_per_split) throws TException { oprot_.writeMessageBegin(new TMessage("describe_splits", TMessageType.CALL, seqid_)); describe_splits_args args = new describe_splits_args(); + args.keyspace = keyspace; + args.cfName = cfName; args.start_token = start_token; args.end_token = end_token; args.keys_per_split = keys_per_split; @@ -1973,7 +1990,7 @@ public class Cassandra { } iprot.readMessageEnd(); describe_splits_result result = new describe_splits_result(); - result.success = iface_.describe_splits(args.start_token, args.end_token, args.keys_per_split); + result.success = iface_.describe_splits(args.keyspace, args.cfName, args.start_token, args.end_token, args.keys_per_split); oprot.writeMessageBegin(new TMessage("describe_splits", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); @@ -17420,19 +17437,25 @@ public class Cassandra { public static class describe_splits_args implements TBase, java.io.Serializable, Cloneable, Comparable { private static final TStruct STRUCT_DESC = new TStruct("describe_splits_args"); - private static final TField START_TOKEN_FIELD_DESC = new TField("start_token", TType.STRING, (short)1); - private static final TField END_TOKEN_FIELD_DESC = new TField("end_token", TType.STRING, (short)2); - private static final TField KEYS_PER_SPLIT_FIELD_DESC = new TField("keys_per_split", TType.I32, (short)3); + private static final TField KEYSPACE_FIELD_DESC = new TField("keyspace", TType.STRING, (short)1); + private static final TField CF_NAME_FIELD_DESC = new TField("cfName", TType.STRING, (short)2); + private static final TField START_TOKEN_FIELD_DESC = new TField("start_token", TType.STRING, (short)3); + private static final TField END_TOKEN_FIELD_DESC = new TField("end_token", TType.STRING, (short)4); + private static final TField KEYS_PER_SPLIT_FIELD_DESC = new TField("keys_per_split", TType.I32, (short)5); + public String keyspace; + public String cfName; public String start_token; public String end_token; public int keys_per_split; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { - START_TOKEN((short)1, "start_token"), - END_TOKEN((short)2, "end_token"), - KEYS_PER_SPLIT((short)3, "keys_per_split"); + KEYSPACE((short)1, "keyspace"), + CF_NAME((short)2, "cfName"), + START_TOKEN((short)3, "start_token"), + END_TOKEN((short)4, "end_token"), + KEYS_PER_SPLIT((short)5, "keys_per_split"); private static final Map byId = new HashMap(); private static final Map byName = new HashMap(); @@ -17490,6 +17513,10 @@ public class Cassandra { 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.KEYSPACE, new FieldMetaData("keyspace", TFieldRequirementType.REQUIRED, + new FieldValueMetaData(TType.STRING))); + put(_Fields.CF_NAME, new FieldMetaData("cfName", TFieldRequirementType.REQUIRED, + new FieldValueMetaData(TType.STRING))); put(_Fields.START_TOKEN, new FieldMetaData("start_token", TFieldRequirementType.REQUIRED, new FieldValueMetaData(TType.STRING))); put(_Fields.END_TOKEN, new FieldMetaData("end_token", TFieldRequirementType.REQUIRED, @@ -17506,11 +17533,15 @@ public class Cassandra { } public describe_splits_args( + String keyspace, + String cfName, String start_token, String end_token, int keys_per_split) { this(); + this.keyspace = keyspace; + this.cfName = cfName; this.start_token = start_token; this.end_token = end_token; this.keys_per_split = keys_per_split; @@ -17523,6 +17554,12 @@ public class Cassandra { public describe_splits_args(describe_splits_args other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); + if (other.isSetKeyspace()) { + this.keyspace = other.keyspace; + } + if (other.isSetCfName()) { + this.cfName = other.cfName; + } if (other.isSetStart_token()) { this.start_token = other.start_token; } @@ -17541,6 +17578,54 @@ public class Cassandra { return new describe_splits_args(this); } + public String getKeyspace() { + return this.keyspace; + } + + public describe_splits_args setKeyspace(String keyspace) { + this.keyspace = keyspace; + return this; + } + + public void unsetKeyspace() { + this.keyspace = null; + } + + /** Returns true if field keyspace is set (has been asigned a value) and false otherwise */ + public boolean isSetKeyspace() { + return this.keyspace != null; + } + + public void setKeyspaceIsSet(boolean value) { + if (!value) { + this.keyspace = null; + } + } + + public String getCfName() { + return this.cfName; + } + + public describe_splits_args setCfName(String cfName) { + this.cfName = cfName; + return this; + } + + public void unsetCfName() { + this.cfName = null; + } + + /** Returns true if field cfName is set (has been asigned a value) and false otherwise */ + public boolean isSetCfName() { + return this.cfName != null; + } + + public void setCfNameIsSet(boolean value) { + if (!value) { + this.cfName = null; + } + } + public String getStart_token() { return this.start_token; } @@ -17614,6 +17699,22 @@ public class Cassandra { public void setFieldValue(_Fields field, Object value) { switch (field) { + case KEYSPACE: + if (value == null) { + unsetKeyspace(); + } else { + setKeyspace((String)value); + } + break; + + case CF_NAME: + if (value == null) { + unsetCfName(); + } else { + setCfName((String)value); + } + break; + case START_TOKEN: if (value == null) { unsetStart_token(); @@ -17647,6 +17748,12 @@ public class Cassandra { public Object getFieldValue(_Fields field) { switch (field) { + case KEYSPACE: + return getKeyspace(); + + case CF_NAME: + return getCfName(); + case START_TOKEN: return getStart_token(); @@ -17667,6 +17774,10 @@ public class Cassandra { /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { switch (field) { + case KEYSPACE: + return isSetKeyspace(); + case CF_NAME: + return isSetCfName(); case START_TOKEN: return isSetStart_token(); case END_TOKEN: @@ -17694,6 +17805,24 @@ public class Cassandra { if (that == null) return false; + boolean this_present_keyspace = true && this.isSetKeyspace(); + boolean that_present_keyspace = true && that.isSetKeyspace(); + if (this_present_keyspace || that_present_keyspace) { + if (!(this_present_keyspace && that_present_keyspace)) + return false; + if (!this.keyspace.equals(that.keyspace)) + return false; + } + + boolean this_present_cfName = true && this.isSetCfName(); + boolean that_present_cfName = true && that.isSetCfName(); + if (this_present_cfName || that_present_cfName) { + if (!(this_present_cfName && that_present_cfName)) + return false; + if (!this.cfName.equals(that.cfName)) + return false; + } + boolean this_present_start_token = true && this.isSetStart_token(); boolean that_present_start_token = true && that.isSetStart_token(); if (this_present_start_token || that_present_start_token) { @@ -17737,6 +17866,24 @@ public class Cassandra { int lastComparison = 0; describe_splits_args typedOther = (describe_splits_args)other; + lastComparison = Boolean.valueOf(isSetKeyspace()).compareTo(typedOther.isSetKeyspace()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKeyspace()) { lastComparison = TBaseHelper.compareTo(keyspace, typedOther.keyspace); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetCfName()).compareTo(typedOther.isSetCfName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCfName()) { lastComparison = TBaseHelper.compareTo(cfName, typedOther.cfName); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = Boolean.valueOf(isSetStart_token()).compareTo(typedOther.isSetStart_token()); if (lastComparison != 0) { return lastComparison; @@ -17777,21 +17924,35 @@ public class Cassandra { break; } switch (field.id) { - case 1: // START_TOKEN + case 1: // KEYSPACE + if (field.type == TType.STRING) { + this.keyspace = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // CF_NAME + if (field.type == TType.STRING) { + this.cfName = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // START_TOKEN if (field.type == TType.STRING) { this.start_token = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case 2: // END_TOKEN + case 4: // END_TOKEN if (field.type == TType.STRING) { this.end_token = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; - case 3: // KEYS_PER_SPLIT + case 5: // KEYS_PER_SPLIT if (field.type == TType.I32) { this.keys_per_split = iprot.readI32(); setKeys_per_splitIsSet(true); @@ -17817,6 +17978,16 @@ public class Cassandra { validate(); oprot.writeStructBegin(STRUCT_DESC); + if (this.keyspace != null) { + oprot.writeFieldBegin(KEYSPACE_FIELD_DESC); + oprot.writeString(this.keyspace); + oprot.writeFieldEnd(); + } + if (this.cfName != null) { + oprot.writeFieldBegin(CF_NAME_FIELD_DESC); + oprot.writeString(this.cfName); + oprot.writeFieldEnd(); + } if (this.start_token != null) { oprot.writeFieldBegin(START_TOKEN_FIELD_DESC); oprot.writeString(this.start_token); @@ -17839,6 +18010,22 @@ public class Cassandra { StringBuilder sb = new StringBuilder("describe_splits_args("); boolean first = true; + sb.append("keyspace:"); + if (this.keyspace == null) { + sb.append("null"); + } else { + sb.append(this.keyspace); + } + first = false; + if (!first) sb.append(", "); + sb.append("cfName:"); + if (this.cfName == null) { + sb.append("null"); + } else { + sb.append(this.cfName); + } + first = false; + if (!first) sb.append(", "); sb.append("start_token:"); if (this.start_token == null) { sb.append("null"); @@ -17864,6 +18051,12 @@ public class Cassandra { public void validate() throws TException { // check for required fields + if (keyspace == null) { + throw new TProtocolException("Required field 'keyspace' was not present! Struct: " + toString()); + } + if (cfName == null) { + throw new TProtocolException("Required field 'cfName' was not present! Struct: " + toString()); + } if (start_token == null) { throw new TProtocolException("Required field 'start_token' was not present! Struct: " + toString()); } diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java index 8257a476f1..832c14f260 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/CfDef.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java index b254e89dfe..f528716a3d 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnOrSuperColumn.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnOrSuperColumn.java index 328ca0317e..7dfb125bd5 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnOrSuperColumn.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnOrSuperColumn.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnParent.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnParent.java index 0d3730f602..8e3c3d5f98 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnParent.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnParent.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnPath.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnPath.java index a89548b226..ead8735d65 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnPath.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/ColumnPath.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/ConsistencyLevel.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/ConsistencyLevel.java index 914344ef40..5b5ca9d94d 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/ConsistencyLevel.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/ConsistencyLevel.java @@ -4,27 +4,6 @@ * 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.Map; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java index 17fd81708b..35e98fbda5 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/Deletion.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/Deletion.java index 433ddfc874..ed9e9cdb5a 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/Deletion.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/Deletion.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java index ba1350df0a..d269467e97 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/KeyRange.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/KeyRange.java index 6d514e2354..5e8b644d8c 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/KeyRange.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/KeyRange.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/KeySlice.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/KeySlice.java index 774c2213e6..35b3005980 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/KeySlice.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/KeySlice.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/KsDef.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/KsDef.java index 1882a1b644..aaea50817b 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/KsDef.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/KsDef.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/Mutation.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/Mutation.java index b89cdad38e..8999e73e39 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/Mutation.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/Mutation.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java index 585a027b73..4b1278040e 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/SlicePredicate.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/SlicePredicate.java index c5c91728bc..0907d594f2 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/SlicePredicate.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/SlicePredicate.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/SliceRange.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/SliceRange.java index ca7c476d96..4f7b2f387c 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/SliceRange.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/SliceRange.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java index 807cb119d3..2d7667e4d7 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/TimedOutException.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/TimedOutException.java index f751c29796..bf0ed92761 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/TimedOutException.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/TimedOutException.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/TokenRange.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/TokenRange.java index 360bdfaf0b..1a5952f613 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/TokenRange.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/TokenRange.java @@ -4,27 +4,6 @@ * 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; diff --git a/interface/thrift/gen-java/org/apache/cassandra/thrift/UnavailableException.java b/interface/thrift/gen-java/org/apache/cassandra/thrift/UnavailableException.java index 37a0ae73b0..f58d0bcb49 100644 --- a/interface/thrift/gen-java/org/apache/cassandra/thrift/UnavailableException.java +++ b/interface/thrift/gen-java/org/apache/cassandra/thrift/UnavailableException.java @@ -4,27 +4,6 @@ * 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; diff --git a/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java b/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java index 38963c49e7..bdfe9c4384 100644 --- a/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java +++ b/src/java/org/apache/cassandra/hadoop/ColumnFamilyInputFormat.java @@ -64,6 +64,10 @@ public class ColumnFamilyInputFormat extends InputFormat masterRangeNodes = getRangeMap(ConfigHelper.getKeyspace(conf)); - int splitsize = ConfigHelper.getInputSplitSize(context.getConfiguration()); + splitsize = ConfigHelper.getInputSplitSize(context.getConfiguration()); + keyspace = ConfigHelper.getKeyspace(context.getConfiguration()); + cfName = ConfigHelper.getColumnFamily(context.getConfiguration()); // cannonical ranges, split into pieces, fetching the splits in parallel ExecutorService executor = Executors.newCachedThreadPool(); @@ -98,7 +104,7 @@ public class ColumnFamilyInputFormat extends InputFormat call() throws Exception { ArrayList splits = new ArrayList(); - List tokens = getSubSplits(range, splitsize); + List tokens = getSubSplits(keyspace, cfName, range, splitsize); // turn the sub-ranges into InputSplits String[] endpoints = range.endpoints.toArray(new String[range.endpoints.size()]); @@ -164,7 +168,7 @@ public class ColumnFamilyInputFormat extends InputFormat getSubSplits(TokenRange range, int splitsize) throws IOException + private List getSubSplits(String keyspace, String cfName, TokenRange range, int splitsize) throws IOException { // TODO handle failure of range replicas & retry TSocket socket = new TSocket(range.endpoints.get(0), @@ -182,7 +186,7 @@ public class ColumnFamilyInputFormat extends InputFormat splits; try { - splits = client.describe_splits(range.start_token, range.end_token, splitsize); + splits = client.describe_splits(keyspace, cfName, range.start_token, range.end_token, splitsize); } catch (TException e) { diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java index 2985166d2b..e00e5c42f3 100644 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@ -1279,20 +1279,19 @@ public class StorageService implements IEndpointStateChangeSubscriber, StorageSe /** * @return list of Tokens (_not_ keys!) breaking up the data this node is responsible for into pieces of roughly keysPerSplit */ - public List getSplits(Range range, int keysPerSplit) + public List getSplits(String table, String cfName, Range range, int keysPerSplit) { List tokens = new ArrayList(); // we use the actual Range token for the first and last brackets of the splits to ensure correctness tokens.add(range.left); List keys = new ArrayList(); - for (ColumnFamilyStore cfs : ColumnFamilyStore.all()) + Table t = Table.open(table); + ColumnFamilyStore cfs = t.getColumnFamilyStore(cfName); + for (DecoratedKey sample : cfs.allKeySamples()) { - for (DecoratedKey sample : cfs.allKeySamples()) - { - if (range.contains(sample.token)) - keys.add(sample); - } + if (range.contains(sample.token)) + keys.add(sample); } FBUtilities.sortSampledKeys(keys, range); int splits = keys.size() * SSTableReader.indexInterval() / keysPerSplit; diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java index e1e242fd15..e6fe75f8b5 100644 --- a/src/java/org/apache/cassandra/thrift/CassandraServer.java +++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java @@ -559,10 +559,10 @@ public class CassandraServer implements Cassandra.Iface return ranges; } - public List describe_splits(String start_token, String end_token, int keys_per_split) throws TException + public List describe_splits(String keyspace, String cfName, String start_token, String end_token, int keys_per_split) throws TException { Token.TokenFactory tf = StorageService.getPartitioner().getTokenFactory(); - List tokens = StorageService.instance.getSplits(new Range(tf.fromString(start_token), tf.fromString(end_token)), keys_per_split); + List tokens = StorageService.instance.getSplits(keyspace, cfName, new Range(tf.fromString(start_token), tf.fromString(end_token)), keys_per_split); List splits = new ArrayList(tokens.size()); for (Token token : tokens) {