Sonar does not like Exception, fix the issues reported.
Change-Id: I483b4bb04839f577261f4a141ddfc0dd8b90b08a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
*/
package org.opendaylight.mdsal.dom.store.inmemory.benchmark;
*/
package org.opendaylight.mdsal.dom.store.inmemory.benchmark;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
import java.util.concurrent.TimeUnit;
import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
protected InMemoryDOMDataStore domStore;
protected InMemoryDOMDataStore domStore;
- protected void initTestNode() throws Exception {
+ protected void initTestNode() throws InterruptedException, ExecutionException {
final YangInstanceIdentifier testPath = YangInstanceIdentifier.builder(BenchmarkModel.TEST_PATH).build();
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
writeTx.write(testPath, provideOuterListNode());
final YangInstanceIdentifier testPath = YangInstanceIdentifier.builder(BenchmarkModel.TEST_PATH).build();
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
writeTx.write(testPath, provideOuterListNode());
@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
- public void write100KSingleNodeWithOneInnerItemInOneCommitBenchmark() throws Exception {
+ public void write100KSingleNodeWithOneInnerItemInOneCommitBenchmark()
+ throws InterruptedException, ExecutionException {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
writeTx.write(OUTER_LIST_100K_PATHS[outerListKey], OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
writeTx.write(OUTER_LIST_100K_PATHS[outerListKey], OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
- public void write100KSingleNodeWithOneInnerItemInCommitPerWriteBenchmark() throws Exception {
+ public void write100KSingleNodeWithOneInnerItemInCommitPerWriteBenchmark()
+ throws InterruptedException, ExecutionException {
for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
writeTx.write(OUTER_LIST_100K_PATHS[outerListKey], OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
writeTx.write(OUTER_LIST_100K_PATHS[outerListKey], OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
- public void write50KSingleNodeWithTwoInnerItemsInOneCommitBenchmark() throws Exception {
+ public void write50KSingleNodeWithTwoInnerItemsInOneCommitBenchmark()
+ throws InterruptedException, ExecutionException {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
writeTx.write(OUTER_LIST_50K_PATHS[outerListKey], OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
writeTx.write(OUTER_LIST_50K_PATHS[outerListKey], OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
- public void write50KSingleNodeWithTwoInnerItemsInCommitPerWriteBenchmark() throws Exception {
+ public void write50KSingleNodeWithTwoInnerItemsInCommitPerWriteBenchmark()
+ throws InterruptedException, ExecutionException {
for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
writeTx.write(OUTER_LIST_50K_PATHS[outerListKey], OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
writeTx.write(OUTER_LIST_50K_PATHS[outerListKey], OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
- public void write10KSingleNodeWithTenInnerItemsInOneCommitBenchmark() throws Exception {
+ public void write10KSingleNodeWithTenInnerItemsInOneCommitBenchmark()
+ throws InterruptedException, ExecutionException {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) {
writeTx.write(OUTER_LIST_10K_PATHS[outerListKey], OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]);
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) {
writeTx.write(OUTER_LIST_10K_PATHS[outerListKey], OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]);
@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
- public void write10KSingleNodeWithTenInnerItemsInCommitPerWriteBenchmark() throws Exception {
+ public void write10KSingleNodeWithTenInnerItemsInCommitPerWriteBenchmark()
+ throws InterruptedException, ExecutionException {
for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
writeTx.write(OUTER_LIST_10K_PATHS[outerListKey], OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]);
for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) {
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
writeTx.write(OUTER_LIST_10K_PATHS[outerListKey], OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]);