cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1137780 - in /cassandra/trunk/src/java/org/apache/cassandra: db/Memtable.java db/compaction/SizeTieredCompactionStrategy.java io/sstable/SSTableReader.java service/AntiEntropyService.java streaming/StreamInSession.java
Date Mon, 20 Jun 2011 20:59:38 GMT
Author: jbellis
Date: Mon Jun 20 20:59:37 2011
New Revision: 1137780

URL: http://svn.apache.org/viewvc?rev=1137780&view=rev
Log:
r/m unused code

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java
    cassandra/trunk/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
    cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
    cassandra/trunk/src/java/org/apache/cassandra/service/AntiEntropyService.java
    cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamInSession.java

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java?rev=1137780&r1=1137779&r2=1137780&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java Mon Jun 20 20:59:37 2011
@@ -46,7 +46,7 @@ import org.apache.cassandra.io.sstable.S
 import org.apache.cassandra.utils.WrappedRunnable;
 import org.github.jamm.MemoryMeter;
 
-public class Memtable implements Comparable<Memtable>
+public class Memtable
 {
     private static final Logger logger = LoggerFactory.getLogger(Memtable.class);
 
@@ -73,7 +73,6 @@ public class Memtable implements Compara
     private final AtomicLong currentThroughput = new AtomicLong(0);
     private final AtomicLong currentOperations = new AtomicLong(0);
 
-    private final long creationTime;
     private final ConcurrentNavigableMap<DecoratedKey, ColumnFamily> columnFamilies
= new ConcurrentSkipListMap<DecoratedKey, ColumnFamily>();
     public final ColumnFamilyStore cfs;
 
@@ -84,28 +83,10 @@ public class Memtable implements Compara
     public Memtable(ColumnFamilyStore cfs)
     {
         this.cfs = cfs;
-        creationTime = System.currentTimeMillis();
         THRESHOLD = cfs.getMemtableThroughputInMB() * 1024L * 1024L;
         THRESHOLD_COUNT = (long) (cfs.getMemtableOperationsInMillions() * 1024 * 1024);
     }
 
-    /**
-     * Compares two Memtable based on creation time.
-     * @param rhs Memtable to compare to.
-     * @return a negative integer, zero, or a positive integer as this object
-     * is less than, equal to, or greater than the specified object.
-     */
-    public int compareTo(Memtable rhs)
-    {
-    	long diff = creationTime - rhs.creationTime;
-    	if ( diff > 0 )
-    		return 1;
-    	else if ( diff < 0 )
-    		return -1;
-    	else
-    		return 0;
-    }
-
     public long getLiveSize()
     {
         // 25% fudge factor
@@ -300,11 +281,6 @@ public class Memtable implements Compara
         return columnFamilies.isEmpty();
     }
 
-    public String getTableName()
-    {
-        return cfs.table.name;
-    }
-
     /**
      * obtain an iterator of columns in this memtable in the specified order starting from
a given column.
      */
@@ -394,5 +370,4 @@ public class Memtable implements Compara
     {
         columnFamilies.clear();
     }
-
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java?rev=1137780&r1=1137779&r2=1137780&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
(original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
Mon Jun 20 20:59:37 2011
@@ -60,7 +60,13 @@ public class SizeTieredCompactionStrateg
             if (bucket.size() < cfs.getMinimumCompactionThreshold())
                 continue;
 
-            Collections.sort(bucket);
+            Collections.sort(bucket, new Comparator<SSTableReader>()
+            {
+                public int compare(SSTableReader o1, SSTableReader o2)
+                {
+                    return o1.descriptor.generation - o2.descriptor.generation;
+                }
+            });
             tasks.add(new CompactionTask(cfs, bucket.subList(0, Math.min(bucket.size(), cfs.getMaximumCompactionThreshold())),
gcBefore));
         }
 

Modified: cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java?rev=1137780&r1=1137779&r2=1137780&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/io/sstable/SSTableReader.java Mon Jun 20
20:59:37 2011
@@ -52,7 +52,7 @@ import org.apache.cassandra.utils.*;
  * SSTableReaders are open()ed by Table.onStart; after that they are created by SSTableWriter.renameAndOpen.
  * Do not re-call open() on existing SSTable files; use the references kept by ColumnFamilyStore
post-start instead.
  */
-public class SSTableReader extends SSTable implements Comparable<SSTableReader>
+public class SSTableReader extends SSTable
 {
     private static final Logger logger = LoggerFactory.getLogger(SSTableReader.class);
 
@@ -680,29 +680,6 @@ public class SSTableReader extends SSTab
         return dfile.getSegment(position, bufferSize);
     }
 
-
-    public int compareTo(SSTableReader o)
-    {
-        return descriptor.generation - o.descriptor.generation;
-    }
-
-    public AbstractType getColumnComparator()
-    {
-        return metadata.comparator;
-    }
-
-    public ColumnFamily createColumnFamily()
-    {
-        return ColumnFamily.create(metadata);
-    }
-
-    public IColumnSerializer getColumnSerializer()
-    {
-        return metadata.cfType == ColumnFamilyType.Standard
-               ? Column.serializer()
-               : SuperColumn.serializer(metadata.subcolumnComparator);
-    }
-
     /**
      * Tests if the sstable contains data newer than the given age param (in localhost currentMilli
time).
      * This works in conjunction with maxDataAge which is an upper bound on the create of
data in this sstable.

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/AntiEntropyService.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/AntiEntropyService.java?rev=1137780&r1=1137779&r2=1137780&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/AntiEntropyService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/AntiEntropyService.java Mon Jun
20 20:59:37 2011
@@ -282,8 +282,6 @@ public class AntiEntropyService
         public final TreeRequest request;
         public final MerkleTree tree;
 
-        // the minimum token sorts first, but falls into the last range
-        private transient List<MerkleTree.RowHash> minrows;
         // null when all rows with the min token have been consumed
         private transient long validated;
         private transient MerkleTree.TreeRange range;
@@ -307,7 +305,6 @@ public class AntiEntropyService
             // Reestablishing the range because we don't serialize it (for bad
             // reason - see MerkleTree for details)
             this.tree.fullRange = this.request.range;
-            minrows = new ArrayList<MerkleTree.RowHash>();
             validated = 0;
             range = null;
             ranges = null;

Modified: cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamInSession.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamInSession.java?rev=1137780&r1=1137779&r2=1137780&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamInSession.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamInSession.java Mon Jun 20
20:59:37 2011
@@ -137,8 +137,6 @@ public class StreamInSession
                 {
                     SSTableReader sstable = future.get();
                     assert sstable.getTableName().equals(table);
-                    if (sstable == null)
-                        continue;
                     ColumnFamilyStore cfs = Table.open(sstable.getTableName()).getColumnFamilyStore(sstable.getColumnFamilyName());
                     cfs.addSSTable(sstable);
                     if (!cfstores.containsKey(cfs))



Mime
View raw message