cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject git commit: Adds some missing generics infos
Date Fri, 27 Jan 2012 09:53:25 GMT
Updated Branches:
  refs/heads/trunk 998dbcef2 -> 006137294


Adds some missing generics infos


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/00613729
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/00613729
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/00613729

Branch: refs/heads/trunk
Commit: 006137294999d1713956a99abfe7cd41807c73c3
Parents: 998dbce
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Fri Jan 27 10:53:09 2012 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Fri Jan 27 10:53:09 2012 +0100

----------------------------------------------------------------------
 .../org/apache/cassandra/db/ColumnFamilyStore.java |    8 +++---
 .../apache/cassandra/io/sstable/IndexSummary.java  |    6 ++--
 .../apache/cassandra/io/sstable/SSTableReader.java |   16 +++++++-------
 3 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/00613729/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index 15a0b64..6ec9c51 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -1487,10 +1487,10 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         return Iterables.concat(stores);
     }
 
-    public Iterable<DecoratedKey> allKeySamples()
+    public Iterable<DecoratedKey<?>> allKeySamples()
     {
         Collection<SSTableReader> sstables = getSSTables();
-        Iterable<DecoratedKey>[] samples = new Iterable[sstables.size()];
+        Iterable<DecoratedKey<?>>[] samples = new Iterable[sstables.size()];
         int i = 0;
         for (SSTableReader sstable: sstables)
         {
@@ -1499,10 +1499,10 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         return Iterables.concat(samples);
     }
 
-    public Iterable<DecoratedKey> keySamples(Range<Token> range)
+    public Iterable<DecoratedKey<?>> keySamples(Range<Token> range)
     {
         Collection<SSTableReader> sstables = getSSTables();
-        Iterable<DecoratedKey>[] samples = new Iterable[sstables.size()];
+        Iterable<DecoratedKey<?>>[] samples = new Iterable[sstables.size()];
         int i = 0;
         for (SSTableReader sstable: sstables)
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/00613729/src/java/org/apache/cassandra/io/sstable/IndexSummary.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/IndexSummary.java b/src/java/org/apache/cassandra/io/sstable/IndexSummary.java
index 4c6efb5..99d84da 100644
--- a/src/java/org/apache/cassandra/io/sstable/IndexSummary.java
+++ b/src/java/org/apache/cassandra/io/sstable/IndexSummary.java
@@ -36,7 +36,7 @@ import org.apache.cassandra.db.RowPosition;
 public class IndexSummary
 {
     private ArrayList<Long> positions;
-    private ArrayList<DecoratedKey> keys;
+    private ArrayList<DecoratedKey<?>> keys;
     private long keysWritten = 0;
 
     public IndexSummary(long expectedKeys)
@@ -46,7 +46,7 @@ public class IndexSummary
             // TODO: that's a _lot_ of keys, or a very low interval
             throw new RuntimeException("Cannot use index_interval of " + DatabaseDescriptor.getIndexInterval()
+ " with " + expectedKeys + " (expected) keys.");
         positions = new ArrayList<Long>((int)expectedEntries);
-        keys = new ArrayList<DecoratedKey>((int)expectedEntries);
+        keys = new ArrayList<DecoratedKey<?>>((int)expectedEntries);
     }
 
     public void incrementRowid()
@@ -72,7 +72,7 @@ public class IndexSummary
         incrementRowid();
     }
 
-    public List<DecoratedKey> getKeys()
+    public List<DecoratedKey<?>> getKeys()
     {
         return keys;
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/00613729/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableReader.java b/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
index 0162249..e5a8f40 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
@@ -489,12 +489,12 @@ public class SSTableReader extends SSTable
     /**
      * @return Approximately 1/INDEX_INTERVALth of the keys in this SSTable.
      */
-    public Collection<DecoratedKey> getKeySamples()
+    public Collection<DecoratedKey<?>> getKeySamples()
     {
         return indexSummary.getKeys();
     }
 
-    private static List<Pair<Integer,Integer>> getSampleIndexesForRanges(List<DecoratedKey>
samples, Collection<Range<Token>> ranges)
+    private static List<Pair<Integer,Integer>> getSampleIndexesForRanges(List<DecoratedKey<?>>
samples, Collection<Range<Token>> ranges)
     {
         // use the index to determine a minimal section for each range
         List<Pair<Integer,Integer>> positions = new ArrayList<Pair<Integer,Integer>>();
@@ -538,20 +538,20 @@ public class SSTableReader extends SSTable
         return positions;
     }
 
-    public Iterable<DecoratedKey> getKeySamples(final Range<Token> range)
+    public Iterable<DecoratedKey<?>> getKeySamples(final Range<Token> range)
     {
-        final List<DecoratedKey> samples = indexSummary.getKeys();
+        final List<DecoratedKey<?>> samples = indexSummary.getKeys();
 
         final List<Pair<Integer, Integer>> indexRanges = getSampleIndexesForRanges(samples,
Collections.singletonList(range));
 
         if (indexRanges.isEmpty())
             return Collections.emptyList();
 
-        return new Iterable<DecoratedKey>()
+        return new Iterable<DecoratedKey<?>>()
         {
-            public Iterator<DecoratedKey> iterator()
+            public Iterator<DecoratedKey<?>> iterator()
             {
-                return new Iterator<DecoratedKey>()
+                return new Iterator<DecoratedKey<?>>()
                 {
                     private Iterator<Pair<Integer, Integer>> rangeIter = indexRanges.iterator();
                     private Pair<Integer, Integer> current;
@@ -578,7 +578,7 @@ public class SSTableReader extends SSTable
                         RowPosition k = samples.get(idx++);
                         // the index should only contain valid row key, we only allow RowPosition
in KeyPosition for search purposes
                         assert k instanceof DecoratedKey;
-                        return (DecoratedKey)k;
+                        return (DecoratedKey<?>)k;
                     }
 
                     public void remove()


Mime
View raw message