/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
import org.openjdk.jmh.annotations.Warmup;
/**
+ * Abstract class to handle transaction benchmarks.
+ *
* @author Lukas Sedlak
*/
-public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark extends AbstractInMemoryWriteTransactionBenchmark {
+public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark
+ extends AbstractInMemoryWriteTransactionBenchmark {
protected SerializedDOMDataBroker domBroker;
protected void initTestNode() throws Exception {
- final YangInstanceIdentifier testPath = YangInstanceIdentifier.builder(BenchmarkModel.TEST_PATH)
- .build();
+ final YangInstanceIdentifier testPath = YangInstanceIdentifier.builder(BenchmarkModel.TEST_PATH).build();
DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
writeTx.put(LogicalDatastoreType.OPERATIONAL, testPath, provideOuterListNode());
DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
- writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_100K_PATHS[outerListKey], OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
+ writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_100K_PATHS[outerListKey],
+ OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
}
writeTx.submit().get();
public void write100KSingleNodeWithOneInnerItemInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
- writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_100K_PATHS[outerListKey], OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
+ writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_100K_PATHS[outerListKey],
+ OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
writeTx.submit().get();
}
public void write50KSingleNodeWithTwoInnerItemsInOneCommitBenchmark() throws Exception {
DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
- writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_50K_PATHS[outerListKey], OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
+ writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_50K_PATHS[outerListKey],
+ OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
}
writeTx.submit().get();
public void write50KSingleNodeWithTwoInnerItemsInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
- writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_50K_PATHS[outerListKey], OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
+ writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_50K_PATHS[outerListKey],
+ OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
writeTx.submit().get();
}
}
public void write10KSingleNodeWithTenInnerItemsInOneCommitBenchmark() throws Exception {
DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) {
- writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_10K_PATHS[outerListKey], OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]);
+ writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_10K_PATHS[outerListKey],
+ OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]);
}
writeTx.submit().get();
}
public void write10KSingleNodeWithTenInnerItemsInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) {
DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
- writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_10K_PATHS[outerListKey], OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]);
+ writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_10K_PATHS[outerListKey],
+ OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]);
writeTx.submit().get();
}
}