cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jji...@apache.org
Subject cassandra git commit: Refactor GcCompactionTest to avoid boxing
Date Sat, 07 Oct 2017 06:30:37 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk d46c1f3ea -> 2ecadc88e


Refactor GcCompactionTest to avoid boxing

Closes #116

Patch by Hashrajsinh Thakor; Reviewed by Jeff Jirsa for CASSANDRA-13941


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

Branch: refs/heads/trunk
Commit: 2ecadc88e4407ebd4b3325f42e0296e1e1dc8944
Parents: d46c1f3
Author: Harshrajsinh Thakor <hrthakor7@gmail.com>
Authored: Sun Jun 4 20:34:38 2017 -0700
Committer: Jeff Jirsa <jjirsa@apple.com>
Committed: Fri Oct 6 23:27:57 2017 -0700

----------------------------------------------------------------------
 CHANGES.txt                                               |  1 +
 test/unit/org/apache/cassandra/cql3/GcCompactionTest.java | 10 +++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2ecadc88/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index eeed794..b8d22cb 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.0
+ * Refactor GcCompactionTest to avoid boxing (CASSANDRA-13941)
  * Checksum sstable metadata (CASSANDRA-13321)
  * Expose recent histograms in JmxHistograms (CASSANDRA-13642)
  * Fix buffer length comparison when decompressing in netty-based streaming (CASSANDRA-13899)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2ecadc88/test/unit/org/apache/cassandra/cql3/GcCompactionTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/cql3/GcCompactionTest.java b/test/unit/org/apache/cassandra/cql3/GcCompactionTest.java
index 5a78d31..a09d79e 100644
--- a/test/unit/org/apache/cassandra/cql3/GcCompactionTest.java
+++ b/test/unit/org/apache/cassandra/cql3/GcCompactionTest.java
@@ -24,7 +24,7 @@ import static org.junit.Assert.assertTrue;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
-import java.util.function.Function;
+import java.util.function.ToIntFunction;
 
 import com.google.common.collect.Iterables;
 import org.junit.Test;
@@ -367,7 +367,7 @@ public class GcCompactionTest extends CQLTester
         return ccd.cellsCount();
     }
 
-    int count(SSTableReader reader, Function<Unfiltered, Integer> predicate, Function<UnfilteredRowIterator,
Integer> partitionPredicate)
+    int count(SSTableReader reader, ToIntFunction<Unfiltered> predicate, ToIntFunction<UnfilteredRowIterator>
partitionPredicate)
     {
         int instances = 0;
         try (ISSTableScanner partitions = reader.getScanner())
@@ -376,15 +376,15 @@ public class GcCompactionTest extends CQLTester
             {
                 try (UnfilteredRowIterator iter = partitions.next())
                 {
-                    instances += partitionPredicate.apply(iter);
+                    instances += partitionPredicate.applyAsInt(iter);
                     while (iter.hasNext())
                     {
                         Unfiltered atom = iter.next();
-                        instances += predicate.apply(atom);
+                        instances += predicate.applyAsInt(atom);
                     }
                 }
             }
         }
         return instances;
     }
-}
\ No newline at end of file
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message