This is an automated email from the ASF dual-hosted git repository.

av pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 344dad80d5e IGNITE-22089 Removal of MVCC benchmarks in Yardstick 
(#11345)
344dad80d5e is described below

commit 344dad80d5efbe35ce1cf3437f3667bb63c21863
Author: Julia Bakulina <[email protected]>
AuthorDate: Thu May 30 13:46:09 2024 +0300

    IGNITE-22089 Removal of MVCC benchmarks in Yardstick (#11345)
---
 .../ignite/yardstick/IgniteBenchmarkArguments.java |  16 ----
 .../jdbc/NativeJavaApiPutRemoveBenchmark.java      |  55 -----------
 .../mvcc/AbstractDistributedMvccBenchmark.java     | 102 ---------------------
 .../jdbc/mvcc/MvccProcessorBenchmark.java          |  61 ------------
 .../jdbc/mvcc/MvccUpdateContentionBenchmark.java   |  66 -------------
 5 files changed, 300 deletions(-)

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 45f16127289..29d75fd3a9c 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
@@ -293,15 +293,6 @@ public class IgniteBenchmarkArguments {
     @GridToStringInclude
     public UploadBenchmarkArguments upload = new UploadBenchmarkArguments();
 
-    /** */
-    @Parameter(names = {"--mvcc-contention-range", "--mvccContentionRange"},
-        description = "Mvcc benchmark specific: " +
-            "Size of range of table keys that should be used in query. " +
-            "Should be less than 'range'. " +
-            "Useful together with 'sqlRange' to control, how often key 
contentions of sql operations occur.")
-    @GridToStringInclude
-    public long mvccContentionRange = 10_000;
-
     /** See {@link #selectCommand()}. */
     @Parameter(names = {"--select-command"})
     private SelectCommand selectCommand = SelectCommand.BY_PRIMARY_KEY;
@@ -733,13 +724,6 @@ public class IgniteBenchmarkArguments {
         return clientNodesAfterId;
     }
 
-    /**
-     * @return Mvcc contention range.
-     */
-    public long mvccContentionRange() {
-        return mvccContentionRange;
-    }
-
     /**
      * @return What type of SQL SELECT queries to execute. It affects what 
type of field will present in the WHERE
      * clause: PK, indexed value field, etc.
diff --git 
a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/jdbc/NativeJavaApiPutRemoveBenchmark.java
 
b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/jdbc/NativeJavaApiPutRemoveBenchmark.java
deleted file mode 100644
index e6d8c3af7f1..00000000000
--- 
a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/jdbc/NativeJavaApiPutRemoveBenchmark.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.yardstick.jdbc;
-
-import java.util.Map;
-import java.util.concurrent.ThreadLocalRandom;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteException;
-import org.yardstickframework.BenchmarkConfiguration;
-
-/**
- * Benchmark that fetches data from cache to compare with SQL SELECT operation.
- */
-public class NativeJavaApiPutRemoveBenchmark extends AbstractNativeBenchmark {
-    /** Cache for created table. */
-    private IgniteCache<Object, Object> tabCache;
-
-    /** {@inheritDoc} */
-    @Override public void setUp(BenchmarkConfiguration cfg) throws Exception {
-        super.setUp(cfg);
-
-        tabCache = ignite().cache("SQL_PUBLIC_TEST_LONG");
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean test(Map<Object, Object> ctx) throws Exception {
-        long insertKey = ThreadLocalRandom.current().nextLong(args.range()) + 
1 + args.range();
-        long insertVal = insertKey + 1;
-
-        try {
-            tabCache.put(insertKey, insertVal);
-            tabCache.remove(insertKey);
-        }
-        catch (IgniteException ignore) {
-            // Collision occurred, ignoring.
-        }
-
-        return true;
-    }
-}
diff --git 
a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/jdbc/mvcc/AbstractDistributedMvccBenchmark.java
 
b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/jdbc/mvcc/AbstractDistributedMvccBenchmark.java
deleted file mode 100644
index 6c3c42e1edc..00000000000
--- 
a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/jdbc/mvcc/AbstractDistributedMvccBenchmark.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.yardstick.jdbc.mvcc;
-
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-import org.apache.ignite.IgniteCountDownLatch;
-import org.apache.ignite.cache.query.QueryCursor;
-import org.apache.ignite.cache.query.SqlFieldsQuery;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.yardstick.IgniteAbstractBenchmark;
-import org.yardstickframework.BenchmarkConfiguration;
-
-import static org.apache.ignite.yardstick.jdbc.JdbcUtils.fillData;
-import static org.yardstickframework.BenchmarkUtils.println;
-
-/**
- * Base for mvcc benchmarks that are running on multiply hosts.
- */
-public abstract class AbstractDistributedMvccBenchmark extends 
IgniteAbstractBenchmark {
-    /** Sql query to create load. */
-    public static final String UPDATE_QRY = "UPDATE test_long SET val = (val + 
1) WHERE id BETWEEN ? AND ?";
-
-    /** Timeout in minutest for test data to be loaded. */
-    public static final long DATA_WAIT_TIMEOUT_MIN = 20;
-
-    /** Member id of the host driver is running */
-    protected int memberId;
-
-    /**
-     * Number of nodes handled by driver.
-     */
-    protected int driversNodesCnt;
-
-    /** {@inheritDoc} */
-    @Override public void setUp(BenchmarkConfiguration cfg) throws Exception {
-        super.setUp(cfg);
-
-        memberId = cfg.memberId();
-
-        if (memberId < 0)
-            throw new IllegalStateException("Member id should be initialized 
with non-negative value");
-
-        // We assume there is no client nodes in the cluster except clients 
that are yardstick drivers.
-        driversNodesCnt = ignite().cluster().forClients().nodes().size();
-
-        IgniteCountDownLatch dataIsReady = 
ignite().countDownLatch("fillDataLatch", 1, true, true);
-
-        try {
-            if (memberId == 0) {
-                fillData(cfg, (IgniteEx)ignite(), args.range(), 
args.atomicMode());
-
-                dataIsReady.countDown();
-            }
-            else {
-                println(cfg, "No need to upload data for memberId=" + memberId 
+ ". Just waiting");
-
-                dataIsReady.await(DATA_WAIT_TIMEOUT_MIN, TimeUnit.MINUTES);
-
-                println(cfg, "Data is ready.");
-            }
-
-        }
-        catch (Throwable th) {
-            dataIsReady.countDownAll();
-
-            throw new RuntimeException("Fill Data failed.", th);
-        }
-
-        // Workaround for "Table TEST_LONG not found" on sql update.
-        execute(new SqlFieldsQuery("SELECT COUNT(*) FROM test_long"));
-    }
-
-    /**
-     * Execute specified query using started driver node.
-     * Returns result using {@link QueryCursor#getAll()}.
-     *
-     * @param qry sql query to execute.
-     */
-    protected List<List<?>> execute(SqlFieldsQuery qry) {
-        return ((IgniteEx)ignite())
-            .context()
-            .query()
-            .querySqlFields(qry, false)
-            .getAll();
-    }
-}
diff --git 
a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/jdbc/mvcc/MvccProcessorBenchmark.java
 
b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/jdbc/mvcc/MvccProcessorBenchmark.java
deleted file mode 100644
index 543e7549fce..00000000000
--- 
a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/jdbc/mvcc/MvccProcessorBenchmark.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.yardstick.jdbc.mvcc;
-
-import java.util.Map;
-import org.apache.ignite.cache.query.SqlFieldsQuery;
-import org.apache.ignite.yardstick.jdbc.DisjointRangeGenerator;
-import org.yardstickframework.BenchmarkConfiguration;
-
-/**
- * Benchmark app that creates load on Mvcc Processor.
- * Should be run in many threads on many hosts against one single server node.
- */
-public class MvccProcessorBenchmark extends AbstractDistributedMvccBenchmark {
-    /** Generates id, that are disjoint only among threads running current 
host. */
-    private DisjointRangeGenerator locIdGen;
-
-    /** Offset for current host ids range, to make it disjoint among all the 
other host id ranges. */
-    private int idOffset;
-
-    /** {@inheritDoc} */
-    @Override public void setUp(BenchmarkConfiguration cfg) throws Exception {
-        super.setUp(cfg);
-
-        int locIdRangeWidth = args.range() / driversNodesCnt;
-
-        locIdGen = new DisjointRangeGenerator(cfg.threads(), locIdRangeWidth, 
args.sqlRange());
-
-        idOffset = locIdRangeWidth * memberId;
-    }
-
-    /**
-     *  Performs sql updates on the key sets that are disjoint among all the 
threads on all the hosts.
-     */
-    @Override public boolean test(Map<Object, Object> ctx) throws Exception {
-        long locStart = locIdGen.nextRangeStartId();
-
-        long start = idOffset + locStart;
-
-        long end = idOffset + locIdGen.endRangeId(locStart);
-
-        execute(new SqlFieldsQuery(UPDATE_QRY).setArgs(start, end));
-
-        return true;
-    }
-}
diff --git 
a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/jdbc/mvcc/MvccUpdateContentionBenchmark.java
 
b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/jdbc/mvcc/MvccUpdateContentionBenchmark.java
deleted file mode 100644
index fd50e86a3ab..00000000000
--- 
a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/jdbc/mvcc/MvccUpdateContentionBenchmark.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.yardstick.jdbc.mvcc;
-
-import java.util.Map;
-import java.util.concurrent.ThreadLocalRandom;
-import java.util.concurrent.atomic.AtomicLong;
-import org.apache.ignite.cache.query.SqlFieldsQuery;
-import org.apache.ignite.internal.processors.query.IgniteSQLException;
-
-import static org.yardstickframework.BenchmarkUtils.println;
-
-/**
- * Benchmark app that eliminates update contention in mvcc mode.
- * Designed to be ran in many threads on many hosts.
- */
-public class MvccUpdateContentionBenchmark extends 
AbstractDistributedMvccBenchmark {
-    /** Counter of failed updates. */
-    private final AtomicLong failsCnt = new AtomicLong();
-
-    /** {@inheritDoc} */
-    @Override public boolean test(Map<Object, Object> ctx) throws Exception {
-        ThreadLocalRandom rnd = ThreadLocalRandom.current();
-
-        long start = rnd.nextLong(args.mvccContentionRange() - 
(args.sqlRange() - 1)) + 1;
-
-        long end = start + (args.sqlRange() - 1);
-
-        try {
-            execute(new SqlFieldsQuery(UPDATE_QRY).setArgs(start, end));
-        }
-        catch (IgniteSQLException exc) {
-            failsCnt.incrementAndGet();
-        }
-        catch (Exception e) {
-            throw new RuntimeException("Could not perform update.", e);
-        }
-
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void tearDown() throws Exception {
-        try {
-            super.tearDown();
-        }
-        finally {
-            println("Update contention count : " + failsCnt.get());
-        }
-    }
-}

Reply via email to