Fixed put-get batch benchmarks.

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

Branch: refs/heads/ignite-2100
Commit: be57765eabe1fb0ca2dd9bce50d8260a690b054e
Parents: ca8e602
Author: nikolay_tikhonov <ntikho...@gridgain.com>
Authored: Tue Dec 15 16:07:35 2015 +0300
Committer: nikolay_tikhonov <ntikho...@gridgain.com>
Committed: Tue Dec 15 16:07:58 2015 +0300

----------------------------------------------------------------------
 .../yardstick/cache/IgnitePutGetBatchBenchmark.java  | 15 +++++++--------
 .../cache/IgnitePutGetTxBatchBenchmark.java          | 15 +++++++--------
 2 files changed, 14 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/be57765e/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutGetBatchBenchmark.java
----------------------------------------------------------------------
diff --git 
a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutGetBatchBenchmark.java
 
b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutGetBatchBenchmark.java
index 26097c0..a9f59d4 100644
--- 
a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutGetBatchBenchmark.java
+++ 
b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutGetBatchBenchmark.java
@@ -39,14 +39,13 @@ public class IgnitePutGetBatchBenchmark extends 
IgniteCacheAbstractBenchmark<Int
 
         Map<Integer, SampleValue> updates = new TreeMap<>();
 
-        for (Map.Entry<Integer, Object> e : vals.entrySet()) {
-            if (e.getValue() != null) {
-                int key = nextRandom(args.range());
-
-                updates.put(key, new SampleValue(key));
-            }
-            else
-                updates.put(e.getKey(), new SampleValue(e.getKey()));
+        for (Integer key : keys) {
+            Object val = vals.get(key);
+
+            if (val != null)
+                key = nextRandom(args.range());
+
+            updates.put(key, new SampleValue(key));
         }
 
         cache.putAll(updates);

http://git-wip-us.apache.org/repos/asf/ignite/blob/be57765e/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutGetTxBatchBenchmark.java
----------------------------------------------------------------------
diff --git 
a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutGetTxBatchBenchmark.java
 
b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutGetTxBatchBenchmark.java
index 930f08a..7ac8180 100644
--- 
a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutGetTxBatchBenchmark.java
+++ 
b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutGetTxBatchBenchmark.java
@@ -56,14 +56,13 @@ public class IgnitePutGetTxBatchBenchmark extends 
IgniteCacheAbstractBenchmark<I
 
                 Map<Integer, SampleValue> updates = new TreeMap<>();
 
-                for (Map.Entry<Integer, Object> e : vals.entrySet()) {
-                    if (e.getValue() != null) {
-                        int key = nextRandom(args.range());
-
-                        updates.put(key, new SampleValue(key));
-                    }
-                    else
-                        updates.put(e.getKey(), new SampleValue(e.getKey()));
+                for (Integer key : keys) {
+                    Object val = vals.get(key);
+
+                    if (val != null)
+                        key = nextRandom(args.range());
+
+                    updates.put(key, new SampleValue(key));
                 }
 
                 cache.putAll(updates);

Reply via email to