You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by db...@apache.org on 2015/03/11 06:35:52 UTC
cassandra git commit: remove dead params
Repository: cassandra
Updated Branches:
refs/heads/trunk dca37a612 -> d06fd788e
remove dead params
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/d06fd788
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/d06fd788
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/d06fd788
Branch: refs/heads/trunk
Commit: d06fd788e590734671fc913b4c09114025d0889c
Parents: dca37a6
Author: Dave Brosius <db...@mebigfatguy.com>
Authored: Wed Mar 11 01:35:38 2015 -0400
Committer: Dave Brosius <db...@mebigfatguy.com>
Committed: Wed Mar 11 01:35:38 2015 -0400
----------------------------------------------------------------------
.../cassandra/cql3/SingleColumnRelation.java | 15 +++++++-------
.../cassandra/db/filter/ExtendedFilter.java | 4 ++--
.../cassandra/hadoop/cql3/CqlConfigHelper.java | 4 ++--
.../service/pager/AbstractQueryPager.java | 6 +++---
.../apache/cassandra/tools/SSTableExport.java | 14 ++++++-------
.../cassandra/utils/memory/NativeAllocator.java | 4 ++--
.../cassandra/tools/SSTableExportTest.java | 21 +++++++-------------
7 files changed, 29 insertions(+), 39 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/d06fd788/src/java/org/apache/cassandra/cql3/SingleColumnRelation.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/SingleColumnRelation.java b/src/java/org/apache/cassandra/cql3/SingleColumnRelation.java
index 78b4d5d..c4c48aa 100644
--- a/src/java/org/apache/cassandra/cql3/SingleColumnRelation.java
+++ b/src/java/org/apache/cassandra/cql3/SingleColumnRelation.java
@@ -140,10 +140,10 @@ public final class SingleColumnRelation extends Relation
ColumnDefinition columnDef = toColumnDefinition(cfm, entity);
if (mapKey == null)
{
- Term term = toTerm(toReceivers(cfm, columnDef), value, cfm.ksName, boundNames);
+ Term term = toTerm(toReceivers(columnDef), value, cfm.ksName, boundNames);
return new SingleColumnRestriction.EQ(columnDef, term);
}
- List<? extends ColumnSpecification> receivers = toReceivers(cfm, columnDef);
+ List<? extends ColumnSpecification> receivers = toReceivers(columnDef);
Term entryKey = toTerm(Collections.singletonList(receivers.get(0)), mapKey, cfm.ksName, boundNames);
Term entryValue = toTerm(Collections.singletonList(receivers.get(1)), value, cfm.ksName, boundNames);
return new SingleColumnRestriction.Contains(columnDef, entryKey, entryValue);
@@ -154,7 +154,7 @@ public final class SingleColumnRelation extends Relation
VariableSpecifications boundNames) throws InvalidRequestException
{
ColumnDefinition columnDef = cfm.getColumnDefinition(getEntity().prepare(cfm));
- List<? extends ColumnSpecification> receivers = toReceivers(cfm, columnDef);
+ List<? extends ColumnSpecification> receivers = toReceivers(columnDef);
List<Term> terms = toTerms(receivers, inValues, cfm.ksName, boundNames);
if (terms == null)
{
@@ -171,7 +171,7 @@ public final class SingleColumnRelation extends Relation
boolean inclusive) throws InvalidRequestException
{
ColumnDefinition columnDef = toColumnDefinition(cfm, entity);
- Term term = toTerm(toReceivers(cfm, columnDef), value, cfm.ksName, boundNames);
+ Term term = toTerm(toReceivers(columnDef), value, cfm.ksName, boundNames);
return new SingleColumnRestriction.Slice(columnDef, bound, inclusive, term);
}
@@ -181,19 +181,18 @@ public final class SingleColumnRelation extends Relation
boolean isKey) throws InvalidRequestException
{
ColumnDefinition columnDef = toColumnDefinition(cfm, entity);
- Term term = toTerm(toReceivers(cfm, columnDef), value, cfm.ksName, boundNames);
+ Term term = toTerm(toReceivers(columnDef), value, cfm.ksName, boundNames);
return new SingleColumnRestriction.Contains(columnDef, term, isKey);
}
/**
* Returns the receivers for this relation.
- *
- * @param cfm the Column Family meta data
* @param columnDef the column definition
+ *
* @return the receivers for the specified relation.
* @throws InvalidRequestException if the relation is invalid
*/
- private List<? extends ColumnSpecification> toReceivers(CFMetaData cfm, ColumnDefinition columnDef) throws InvalidRequestException
+ private List<? extends ColumnSpecification> toReceivers(ColumnDefinition columnDef) throws InvalidRequestException
{
ColumnSpecification receiver = columnDef;
http://git-wip-us.apache.org/repos/asf/cassandra/blob/d06fd788/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java b/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java
index f908e8c..5bc02c5 100644
--- a/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java
+++ b/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java
@@ -338,7 +338,7 @@ public abstract class ExtendedFilter
{
if (def.type.isCollection() && def.type.isMultiCell())
{
- if (!collectionSatisfies(def, data, prefix, expression, collectionElement))
+ if (!collectionSatisfies(def, data, prefix, expression))
return false;
continue;
}
@@ -390,7 +390,7 @@ public abstract class ExtendedFilter
return true;
}
- private static boolean collectionSatisfies(ColumnDefinition def, ColumnFamily data, Composite prefix, IndexExpression expr, ByteBuffer collectionElement)
+ private static boolean collectionSatisfies(ColumnDefinition def, ColumnFamily data, Composite prefix, IndexExpression expr)
{
assert def.type.isCollection() && def.type.isMultiCell();
CollectionType type = (CollectionType)def.type;
http://git-wip-us.apache.org/repos/asf/cassandra/blob/d06fd788/src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java b/src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java
index d06d05f..ac5a7e5 100644
--- a/src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java
+++ b/src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java
@@ -297,7 +297,7 @@ public class CqlConfigHelper
Optional<AuthProvider> authProvider = getAuthProvider(conf);
Optional<SSLOptions> sslOptions = getSSLOptions(conf);
Optional<Integer> protocolVersion = getProtocolVersion(conf);
- LoadBalancingPolicy loadBalancingPolicy = getReadLoadBalancingPolicy(conf, hosts);
+ LoadBalancingPolicy loadBalancingPolicy = getReadLoadBalancingPolicy(hosts);
SocketOptions socketOptions = getReadSocketOptions(conf);
QueryOptions queryOptions = getReadQueryOptions(conf);
PoolingOptions poolingOptions = getReadPoolingOptions(conf);
@@ -488,7 +488,7 @@ public class CqlConfigHelper
return socketOptions;
}
- private static LoadBalancingPolicy getReadLoadBalancingPolicy(Configuration conf, final String[] stickHosts)
+ private static LoadBalancingPolicy getReadLoadBalancingPolicy(final String[] stickHosts)
{
return new LimitedLocalNodeFirstLocalBalancingPolicy(stickHosts);
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/d06fd788/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java b/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java
index bc64582..8195d2e 100644
--- a/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java
+++ b/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java
@@ -303,7 +303,7 @@ abstract class AbstractQueryPager implements QueryPager
DeletionInfo.InOrderTester tester = cf.deletionInfo().inOrderTester(isReversed);
return isReversed
? discardTail(cf, toDiscard, newCf, cf.reverseIterator(), tester)
- : discardHead(cf, toDiscard, newCf, cf.iterator(), tester);
+ : discardHead(toDiscard, newCf, cf.iterator(), tester);
}
private int discardLast(ColumnFamily cf, int toDiscard, ColumnFamily newCf)
@@ -311,11 +311,11 @@ abstract class AbstractQueryPager implements QueryPager
boolean isReversed = isReversed();
DeletionInfo.InOrderTester tester = cf.deletionInfo().inOrderTester(isReversed);
return isReversed
- ? discardHead(cf, toDiscard, newCf, cf.reverseIterator(), tester)
+ ? discardHead(toDiscard, newCf, cf.reverseIterator(), tester)
: discardTail(cf, toDiscard, newCf, cf.iterator(), tester);
}
- private int discardHead(ColumnFamily cf, int toDiscard, ColumnFamily copy, Iterator<Cell> iter, DeletionInfo.InOrderTester tester)
+ private int discardHead(int toDiscard, ColumnFamily copy, Iterator<Cell> iter, DeletionInfo.InOrderTester tester)
{
ColumnCounter counter = columnCounter();
http://git-wip-us.apache.org/repos/asf/cassandra/blob/d06fd788/src/java/org/apache/cassandra/tools/SSTableExport.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/SSTableExport.java b/src/java/org/apache/cassandra/tools/SSTableExport.java
index b62f516..61edad2 100644
--- a/src/java/org/apache/cassandra/tools/SSTableExport.java
+++ b/src/java/org/apache/cassandra/tools/SSTableExport.java
@@ -313,7 +313,7 @@ public class SSTableExport
// This is necessary to accommodate the test suite since you cannot open a Reader more
// than once from within the same process.
- static void export(SSTableReader reader, PrintStream outs, String[] excludes, CFMetaData metadata) throws IOException
+ static void export(SSTableReader reader, PrintStream outs, String[] excludes) throws IOException
{
Set<String> excludeSet = new HashSet<String>();
@@ -361,12 +361,11 @@ public class SSTableExport
* @param desc the descriptor of the sstable to read from
* @param outs PrintStream to write the output to
* @param excludes keys to exclude from export
- * @param metadata Metadata to print keys in a proper format
* @throws IOException on failure to read/write input/output
*/
- public static void export(Descriptor desc, PrintStream outs, String[] excludes, CFMetaData metadata) throws IOException
+ public static void export(Descriptor desc, PrintStream outs, String[] excludes) throws IOException
{
- export(SSTableReader.open(desc), outs, excludes, metadata);
+ export(SSTableReader.open(desc), outs, excludes);
}
/**
@@ -374,12 +373,11 @@ public class SSTableExport
*
* @param desc the descriptor of the sstable to read from
* @param excludes keys to exclude from export
- * @param metadata Metadata to print keys in a proper format
* @throws IOException on failure to read/write SSTable/standard out
*/
- public static void export(Descriptor desc, String[] excludes, CFMetaData metadata) throws IOException
+ public static void export(Descriptor desc, String[] excludes) throws IOException
{
- export(desc, System.out, excludes, metadata);
+ export(desc, System.out, excludes);
}
/**
@@ -462,7 +460,7 @@ public class SSTableExport
if ((keys != null) && (keys.length > 0))
export(descriptor, System.out, Arrays.asList(keys), excludes, cfStore.metadata);
else
- export(descriptor, excludes, cfStore.metadata);
+ export(descriptor, excludes);
}
}
catch (IOException e)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/d06fd788/src/java/org/apache/cassandra/utils/memory/NativeAllocator.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/memory/NativeAllocator.java b/src/java/org/apache/cassandra/utils/memory/NativeAllocator.java
index be78c5d..88846c5 100644
--- a/src/java/org/apache/cassandra/utils/memory/NativeAllocator.java
+++ b/src/java/org/apache/cassandra/utils/memory/NativeAllocator.java
@@ -102,7 +102,7 @@ public class NativeAllocator extends MemtableAllocator
// satisfy large allocations directly from JVM since they don't cause fragmentation
// as badly, and fill up our regions quickly
if (size > MAX_CLONED_SIZE)
- return allocateOversize(size, opGroup);
+ return allocateOversize(size);
while (true)
{
@@ -143,7 +143,7 @@ public class NativeAllocator extends MemtableAllocator
MemoryUtil.free(next.peer);
}
- private long allocateOversize(int size, OpOrder.Group opGroup)
+ private long allocateOversize(int size)
{
// satisfy large allocations directly from JVM since they don't cause fragmentation
// as badly, and fill up our regions quickly
http://git-wip-us.apache.org/repos/asf/cassandra/blob/d06fd788/test/unit/org/apache/cassandra/tools/SSTableExportTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/tools/SSTableExportTest.java b/test/unit/org/apache/cassandra/tools/SSTableExportTest.java
index f13f67d..023b5f3 100644
--- a/test/unit/org/apache/cassandra/tools/SSTableExportTest.java
+++ b/test/unit/org/apache/cassandra/tools/SSTableExportTest.java
@@ -157,8 +157,7 @@ public class SSTableExportTest
// Export to JSON and verify
File tempJson = File.createTempFile("Standard1", ".json");
- SSTableExport.export(reader, new PrintStream(tempJson.getPath()), new String[]{asHex("rowExclude")},
- CFMetaData.sparseCFMetaData(KEYSPACE1, "Standard1", BytesType.instance));
+ SSTableExport.export(reader, new PrintStream(tempJson.getPath()), new String[]{asHex("rowExclude")});
JSONArray json = (JSONArray)JSONValue.parseWithException(new FileReader(tempJson));
assertEquals("unexpected number of rows", 2, json.size());
@@ -207,8 +206,7 @@ public class SSTableExportTest
// Export to JSON and verify
File tempJson = File.createTempFile("Standard1", ".json");
- SSTableExport.export(reader, new PrintStream(tempJson.getPath()), new String[]{asHex("rowExclude")},
- CFMetaData.sparseCFMetaData(KEYSPACE1, "Standard1", BytesType.instance));
+ SSTableExport.export(reader, new PrintStream(tempJson.getPath()), new String[]{asHex("rowExclude")});
// Import JSON to another SSTable file
File tempSS2 = tempSSTableFile(KEYSPACE1, "Standard1");
@@ -243,8 +241,7 @@ public class SSTableExportTest
// Export to JSON and verify
File tempJson = File.createTempFile("Counter1", ".json");
- SSTableExport.export(reader, new PrintStream(tempJson.getPath()), new String[0],
- CFMetaData.sparseCFMetaData(KEYSPACE1, "Counter1", BytesType.instance));
+ SSTableExport.export(reader, new PrintStream(tempJson.getPath()), new String[0]);
JSONArray json = (JSONArray)JSONValue.parseWithException(new FileReader(tempJson));
assertEquals("unexpected number of rows", 1, json.size());
@@ -275,8 +272,7 @@ public class SSTableExportTest
// Export to JSON and verify
File tempJson = File.createTempFile("ValuesWithQuotes", ".json");
- SSTableExport.export(reader, new PrintStream(tempJson.getPath()), new String[0],
- CFMetaData.sparseCFMetaData(KEYSPACE1, "ValuesWithQuotes", BytesType.instance));
+ SSTableExport.export(reader, new PrintStream(tempJson.getPath()), new String[0]);
JSONArray json = (JSONArray)JSONValue.parseWithException(new FileReader(tempJson));
assertEquals("unexpected number of rows", 1, json.size());
@@ -307,8 +303,7 @@ public class SSTableExportTest
SSTableReader reader = writer.closeAndOpenReader();
// Export to JSON and verify
File tempJson = File.createTempFile("CFWithDeletionInfo", ".json");
- SSTableExport.export(reader, new PrintStream(tempJson.getPath()), new String[0],
- CFMetaData.sparseCFMetaData(KEYSPACE1, "Counter1", BytesType.instance));
+ SSTableExport.export(reader, new PrintStream(tempJson.getPath()), new String[0]);
JSONArray json = (JSONArray)JSONValue.parseWithException(new FileReader(tempJson));
assertEquals("unexpected number of rows", 1, json.size());
@@ -367,8 +362,7 @@ public class SSTableExportTest
SSTableReader reader = writer.closeAndOpenReader();
// Export to JSON and verify
File tempJson = File.createTempFile("CFWithColumnNameEqualToDefaultKeyAlias", ".json");
- SSTableExport.export(reader, new PrintStream(tempJson.getPath()), new String[0],
- CFMetaData.sparseCFMetaData(KEYSPACE1, "UUIDKeys", BytesType.instance));
+ SSTableExport.export(reader, new PrintStream(tempJson.getPath()), new String[0]);
JSONArray json = (JSONArray)JSONValue.parseWithException(new FileReader(tempJson));
assertEquals(1, json.size());
@@ -399,8 +393,7 @@ public class SSTableExportTest
File tempJson = File.createTempFile("CFWithAsciiKeys", ".json");
SSTableExport.export(reader,
new PrintStream(tempJson.getPath()),
- new String[0],
- CFMetaData.sparseCFMetaData(KEYSPACE1, "AsciiKeys", BytesType.instance));
+ new String[0]);
JSONArray json = (JSONArray)JSONValue.parseWithException(new FileReader(tempJson));
assertEquals(1, json.size());