Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F1D5518518 for ; Fri, 13 Nov 2015 13:24:45 +0000 (UTC) Received: (qmail 32415 invoked by uid 500); 13 Nov 2015 13:24:45 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 32381 invoked by uid 500); 13 Nov 2015 13:24:45 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 32372 invoked by uid 99); 13 Nov 2015 13:24:45 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Nov 2015 13:24:45 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 84BB1E02A2; Fri, 13 Nov 2015 13:24:45 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ignite git commit: Improve IgnitePutGetTxBenchmark Date: Fri, 13 Nov 2015 13:24:45 +0000 (UTC) Repository: ignite Updated Branches: refs/heads/ignite-1.5 c9cea7665 -> 5a116cb26 Improve IgnitePutGetTxBenchmark Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5a116cb2 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5a116cb2 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5a116cb2 Branch: refs/heads/ignite-1.5 Commit: 5a116cb264a8834840fde8e5e8a60d06023d6b1a Parents: c9cea76 Author: ashutak Authored: Fri Nov 13 16:23:56 2015 +0300 Committer: ashutak Committed: Fri Nov 13 16:23:56 2015 +0300 ---------------------------------------------------------------------- .../config/benchmark-multicast.properties | 4 +- .../yardstick/IgniteBenchmarkArguments.java | 2 +- .../cache/IgnitePutGetTxBenchmark.java | 41 +++++++++++++++----- 3 files changed, 35 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/5a116cb2/modules/yardstick/config/benchmark-multicast.properties ---------------------------------------------------------------------- diff --git a/modules/yardstick/config/benchmark-multicast.properties b/modules/yardstick/config/benchmark-multicast.properties index c508471..85f6c11 100644 --- a/modules/yardstick/config/benchmark-multicast.properties +++ b/modules/yardstick/config/benchmark-multicast.properties @@ -90,7 +90,9 @@ CONFIGS="\ -cfg ${SCRIPT_DIR}/../config/ignite-multicast-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm ${sm} -dn IgnitePutBenchmark -sn IgniteNode -ds ${ver}atomic-put-1-backup,\ -cfg ${SCRIPT_DIR}/../config/ignite-multicast-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm ${sm} -dn IgnitePutGetBenchmark -sn IgniteNode -ds ${ver}atomic-put-get-1-backup,\ -cfg ${SCRIPT_DIR}/../config/ignite-multicast-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm ${sm} -dn IgnitePutTxBenchmark -sn IgniteNode -ds ${ver}tx-put-1-backup,\ --cfg ${SCRIPT_DIR}/../config/ignite-multicast-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm ${sm} -dn IgnitePutGetTxBenchmark -sn IgniteNode -ds ${ver}tx-put-get-1-backup,\ +-cfg ${SCRIPT_DIR}/../config/ignite-multicast-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm ${sm} -txc OPTIMISTIC -dn IgnitePutGetTxBenchmark -sn IgniteNode -ds ${ver}tx-optim-repRead-put-get-1-backup,\ +-cfg ${SCRIPT_DIR}/../config/ignite-multicast-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm ${sm} -txc PESSIMISTIC -dn IgnitePutGetTxBenchmark -sn IgniteNode -ds ${ver}tx-pessim-repRead-put-get-1-backup,\ +-cfg ${SCRIPT_DIR}/../config/ignite-multicast-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm ${sm} -txc OPTIMISTIC -txi SERIALIZABLE -dn IgnitePutGetTxBenchmark -sn IgniteNode -ds ${ver}tx-opt-serial-put-get-1-backup,\ -cfg ${SCRIPT_DIR}/../config/ignite-multicast-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm ${sm} -dn IgniteSqlQueryBenchmark -sn IgniteNode -ds ${ver}sql-query-1-backup,\ -cfg ${SCRIPT_DIR}/../config/ignite-multicast-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm ${sm} -dn IgniteSqlQueryJoinBenchmark -sn IgniteNode -ds ${ver}sql-query-join-1-backup,\ -cfg ${SCRIPT_DIR}/../config/ignite-multicast-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm ${sm} -dn IgniteSqlQueryPutBenchmark -sn IgniteNode -ds ${ver}sql-query-put-1-backup,\ http://git-wip-us.apache.org/repos/asf/ignite/blob/5a116cb2/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java ---------------------------------------------------------------------- diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java index 74b1da9..1ecfa0f 100644 --- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java +++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/IgniteBenchmarkArguments.java @@ -62,7 +62,7 @@ public class IgniteBenchmarkArguments { /** */ @Parameter(names = {"-txc", "--txConcurrency"}, description = "Transaction concurrency") - private TransactionConcurrency txConcurrency = TransactionConcurrency.OPTIMISTIC; + private TransactionConcurrency txConcurrency = TransactionConcurrency.PESSIMISTIC; /** */ @Parameter(names = {"-txi", "--txIsolation"}, description = "Transaction isolation") http://git-wip-us.apache.org/repos/asf/ignite/blob/5a116cb2/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutGetTxBenchmark.java ---------------------------------------------------------------------- diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutGetTxBenchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutGetTxBenchmark.java index 5afe0b2..3235721 100644 --- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutGetTxBenchmark.java +++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/IgnitePutGetTxBenchmark.java @@ -18,28 +18,49 @@ package org.apache.ignite.yardstick.cache; import java.util.Map; +import java.util.concurrent.Callable; import org.apache.ignite.IgniteCache; -import org.apache.ignite.transactions.Transaction; +import org.apache.ignite.IgniteTransactions; import org.apache.ignite.yardstick.cache.model.SampleValue; +import org.yardstickframework.BenchmarkConfiguration; + +import static org.apache.ignite.yardstick.IgniteBenchmarkUtils.doInTransaction; /** * Ignite benchmark that performs transactional put and get operations. */ public class IgnitePutGetTxBenchmark extends IgniteCacheAbstractBenchmark { + /** */ + private IgniteTransactions txs; + + /** */ + private Callable clo; + /** {@inheritDoc} */ - @Override public boolean test(Map ctx) throws Exception { - int key = nextRandom(0, args.range() / 2); + @Override public void setUp(BenchmarkConfiguration cfg) throws Exception { + super.setUp(cfg); + + txs = ignite().transactions(); - try (Transaction tx = ignite().transactions().txStart()) { - Object val = cache.get(key); + clo = new Callable() { + @Override public Void call() throws Exception { + int key = nextRandom(0, args.range() / 2); - if (val != null) - key = nextRandom(args.range() / 2, args.range()); + Object val = cache.get(key); - cache.put(key, new SampleValue(key)); + if (val != null) + key = nextRandom(args.range() / 2, args.range()); - tx.commit(); - } + cache.put(key, new SampleValue(key)); + + return null; + } + }; + } + + /** {@inheritDoc} */ + @Override public boolean test(Map ctx) throws Exception { + doInTransaction(txs, args.txConcurrency(), args.txIsolation(), clo); return true; }