Author: jbellis Date: Thu Jul 29 21:18:23 2010 New Revision: 980583 URL: http://svn.apache.org/viewvc?rev=980583&view=rev Log: r/m unnecessary `final` from local variables, clean up gcbefore in RowIteratorFactory. patch by jbellis
Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java cassandra/trunk/src/java/org/apache/cassandra/db/RowIteratorFactory.java Modified: cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=980583&r1=980582&r2=980583&view=diff ============================================================================== --- cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original) +++ cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Thu Jul 29 21:18:23 2010 @@ -1003,14 +1003,10 @@ public class ColumnFamilyStore implement : range; List<Row> rows = new ArrayList<Row>(); - final DecoratedKey startWith = new DecoratedKey(range.left, (byte[])null); - final DecoratedKey stopAt = new DecoratedKey(range.right, (byte[])null); + DecoratedKey startWith = new DecoratedKey(range.left, (byte[])null); + DecoratedKey stopAt = new DecoratedKey(range.right, (byte[])null); - final int gcBefore = (int) (System.currentTimeMillis() / 1000) - metadata.gcGraceSeconds; - - final QueryPath queryPath = new QueryPath(columnFamily_, superColumn, null); - - final QueryFilter filter = new QueryFilter(null, queryPath, columnFilter); + QueryFilter filter = new QueryFilter(null, new QueryPath(columnFamily_, superColumn, null), columnFilter); Collection<Memtable> memtables = new ArrayList<Memtable>(); memtables.add(getMemtableThreadSafe()); memtables.addAll(memtablesPendingFlush); @@ -1018,7 +1014,7 @@ public class ColumnFamilyStore implement Collection<SSTableReader> sstables = new ArrayList<SSTableReader>(); Iterables.addAll(sstables, ssTables_); - RowIterator iterator = RowIteratorFactory.getIterator(memtables, sstables, startWith, stopAt, filter, getComparator(), this, gcBefore); + RowIterator iterator = RowIteratorFactory.getIterator(memtables, sstables, startWith, stopAt, filter, getComparator(), this); try { Modified: cassandra/trunk/src/java/org/apache/cassandra/db/RowIteratorFactory.java URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/RowIteratorFactory.java?rev=980583&r1=980582&r2=980583&view=diff ============================================================================== --- cassandra/trunk/src/java/org/apache/cassandra/db/RowIteratorFactory.java (original) +++ cassandra/trunk/src/java/org/apache/cassandra/db/RowIteratorFactory.java Thu Jul 29 21:18:23 2010 @@ -62,7 +62,6 @@ public class RowIteratorFactory * @param stopAt Stop and this key * @param filter Used to decide which columns to pull out * @param comparator - * @param gcBefore * @return A row iterator following all the given restrictions */ public static RowIterator getIterator(final Collection<Memtable> memtables, @@ -71,8 +70,8 @@ public class RowIteratorFactory final DecoratedKey stopAt, final QueryFilter filter, final AbstractType comparator, - final ColumnFamilyStore cfs, - final int gcBefore) + final ColumnFamilyStore cfs + ) { // fetch data from current memtable, historical memtables, and SSTables in the correct order. final List<Iterator<IColumnIterator>> iterators = new ArrayList<Iterator<IColumnIterator>>(); @@ -109,7 +108,8 @@ public class RowIteratorFactory // reduce rows from all sources into a single row ReducingIterator<IColumnIterator, Row> reduced = new ReducingIterator<IColumnIterator, Row>(collated) { - private List<IColumnIterator> colIters = new ArrayList<IColumnIterator>(); + private final int gcBefore = (int) (System.currentTimeMillis() / 1000) - cfs.metadata.gcGraceSeconds; + private final List<IColumnIterator> colIters = new ArrayList<IColumnIterator>(); private DecoratedKey key; public void reduce(IColumnIterator current)