Search in sources :

Example 1 with DOMDataReadWriteTransaction

use of org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction in project controller by opendaylight.

the class AbstractInMemoryBrokerWriteTransactionBenchmark method initTestNode.

protected void initTestNode() throws Exception {
    final YangInstanceIdentifier testPath = YangInstanceIdentifier.builder(BenchmarkModel.TEST_PATH).build();
    DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
    writeTx.put(LogicalDatastoreType.OPERATIONAL, testPath, provideOuterListNode());
    writeTx.submit().get();
}
Also used : DOMDataReadWriteTransaction(org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)

Example 2 with DOMDataReadWriteTransaction

use of org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction in project controller by opendaylight.

the class AbstractInMemoryBrokerWriteTransactionBenchmark method write50KSingleNodeWithTwoInnerItemsInCommitPerWriteBenchmark.

@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
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.submit().get();
    }
}
Also used : DOMDataReadWriteTransaction(org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction) Measurement(org.openjdk.jmh.annotations.Measurement) Warmup(org.openjdk.jmh.annotations.Warmup) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 3 with DOMDataReadWriteTransaction

use of org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction in project controller by opendaylight.

the class AbstractInMemoryBrokerWriteTransactionBenchmark method write50KSingleNodeWithTwoInnerItemsInOneCommitBenchmark.

@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
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.submit().get();
}
Also used : DOMDataReadWriteTransaction(org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction) Measurement(org.openjdk.jmh.annotations.Measurement) Warmup(org.openjdk.jmh.annotations.Warmup) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 4 with DOMDataReadWriteTransaction

use of org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction in project controller by opendaylight.

the class AbstractInMemoryBrokerWriteTransactionBenchmark method write100KSingleNodeWithOneInnerItemInOneCommitBenchmark.

@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write100KSingleNodeWithOneInnerItemInOneCommitBenchmark() throws Exception {
    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.submit().get();
}
Also used : DOMDataReadWriteTransaction(org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction) Measurement(org.openjdk.jmh.annotations.Measurement) Warmup(org.openjdk.jmh.annotations.Warmup) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 5 with DOMDataReadWriteTransaction

use of org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction in project controller by opendaylight.

the class AbstractInMemoryBrokerWriteTransactionBenchmark method write10KSingleNodeWithTenInnerItemsInOneCommitBenchmark.

@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
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.submit().get();
}
Also used : DOMDataReadWriteTransaction(org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction) Measurement(org.openjdk.jmh.annotations.Measurement) Warmup(org.openjdk.jmh.annotations.Warmup) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Aggregations

DOMDataReadWriteTransaction (org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction)24 Test (org.junit.Test)8 NormalizedNode (org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)6 Benchmark (org.openjdk.jmh.annotations.Benchmark)6 Measurement (org.openjdk.jmh.annotations.Measurement)6 Warmup (org.openjdk.jmh.annotations.Warmup)6 Optional (com.google.common.base.Optional)5 TransactionCommitFailedException (org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException)5 ReadFailedException (org.opendaylight.controller.md.sal.common.api.data.ReadFailedException)4 DOMTransactionChain (org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain)4 TransactionChainListener (org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener)3 DOMDataReadOnlyTransaction (org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction)3 DOMDataReadTransaction (org.opendaylight.controller.md.sal.dom.api.DOMDataReadTransaction)3 DOMDataWriteTransaction (org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction)3 ForwardingDOMDataReadWriteTransaction (org.opendaylight.controller.md.sal.dom.spi.ForwardingDOMDataReadWriteTransaction)3 YangInstanceIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)3 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)2 InOrder (org.mockito.InOrder)2 AsyncTransaction (org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction)2 DOMDataBroker (org.opendaylight.controller.md.sal.dom.api.DOMDataBroker)2