Search in sources :

Example 1 with DOMStoreThreePhaseCommitCohort

use of org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort in project controller by opendaylight.

the class AbstractInMemoryDatastoreWriteTransactionBenchmark method write100KSingleNodeWithOneInnerItemInCommitPerWriteBenchmark.

@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write100KSingleNodeWithOneInnerItemInCommitPerWriteBenchmark() throws Exception {
    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]);
        DOMStoreThreePhaseCommitCohort cohort = writeTx.ready();
        cohort.canCommit().get();
        cohort.preCommit().get();
        cohort.commit().get();
    }
}
Also used : DOMStoreReadWriteTransaction(org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction) DOMStoreThreePhaseCommitCohort(org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort) Measurement(org.openjdk.jmh.annotations.Measurement) Warmup(org.openjdk.jmh.annotations.Warmup) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 2 with DOMStoreThreePhaseCommitCohort

use of org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort in project controller by opendaylight.

the class AbstractInMemoryDatastoreWriteTransactionBenchmark method write50KSingleNodeWithTwoInnerItemsInOneCommitBenchmark.

@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write50KSingleNodeWithTwoInnerItemsInOneCommitBenchmark() throws Exception {
    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]);
    }
    DOMStoreThreePhaseCommitCohort cohort = writeTx.ready();
    cohort.canCommit().get();
    cohort.preCommit().get();
    cohort.commit().get();
}
Also used : DOMStoreReadWriteTransaction(org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction) DOMStoreThreePhaseCommitCohort(org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort) Measurement(org.openjdk.jmh.annotations.Measurement) Warmup(org.openjdk.jmh.annotations.Warmup) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 3 with DOMStoreThreePhaseCommitCohort

use of org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort in project controller by opendaylight.

the class AbstractInMemoryDatastoreWriteTransactionBenchmark 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) {
        DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
        writeTx.write(OUTER_LIST_50K_PATHS[outerListKey], OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
        DOMStoreThreePhaseCommitCohort cohort = writeTx.ready();
        cohort.canCommit().get();
        cohort.preCommit().get();
        cohort.commit().get();
    }
}
Also used : DOMStoreReadWriteTransaction(org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction) DOMStoreThreePhaseCommitCohort(org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort) Measurement(org.openjdk.jmh.annotations.Measurement) Warmup(org.openjdk.jmh.annotations.Warmup) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 4 with DOMStoreThreePhaseCommitCohort

use of org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort in project controller by opendaylight.

the class AbstractInMemoryDatastoreWriteTransactionBenchmark method write100KSingleNodeWithOneInnerItemInOneCommitBenchmark.

@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write100KSingleNodeWithOneInnerItemInOneCommitBenchmark() throws Exception {
    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]);
    }
    DOMStoreThreePhaseCommitCohort cohort = writeTx.ready();
    cohort.canCommit().get();
    cohort.preCommit().get();
    cohort.commit().get();
}
Also used : DOMStoreReadWriteTransaction(org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction) DOMStoreThreePhaseCommitCohort(org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort) Measurement(org.openjdk.jmh.annotations.Measurement) Warmup(org.openjdk.jmh.annotations.Warmup) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 5 with DOMStoreThreePhaseCommitCohort

use of org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort in project controller by opendaylight.

the class AbstractInMemoryDatastoreWriteTransactionBenchmark method initTestNode.

protected void initTestNode() throws Exception {
    final YangInstanceIdentifier testPath = YangInstanceIdentifier.builder(BenchmarkModel.TEST_PATH).build();
    DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
    writeTx.write(testPath, provideOuterListNode());
    DOMStoreThreePhaseCommitCohort cohort = writeTx.ready();
    cohort.canCommit().get();
    cohort.preCommit().get();
    cohort.commit().get();
}
Also used : DOMStoreReadWriteTransaction(org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) DOMStoreThreePhaseCommitCohort(org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort)

Aggregations

DOMStoreThreePhaseCommitCohort (org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort)19 DOMStoreReadWriteTransaction (org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction)12 Benchmark (org.openjdk.jmh.annotations.Benchmark)6 Measurement (org.openjdk.jmh.annotations.Measurement)6 Warmup (org.openjdk.jmh.annotations.Warmup)6 Test (org.junit.Test)5 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)4 DOMStoreReadTransaction (org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction)2 DOMStoreWriteTransaction (org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction)2 NodeIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier)2 NormalizedNode (org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)2 Optional (com.google.common.base.Optional)1 ArrayList (java.util.ArrayList)1 ExecutionException (java.util.concurrent.ExecutionException)1 ReadFailedException (org.opendaylight.controller.md.sal.common.api.data.ReadFailedException)1 TransactionCommitFailedException (org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException)1 DOMStoreTransactionChain (org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain)1 YangInstanceIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)1 ContainerNode (org.opendaylight.yangtools.yang.data.api.schema.ContainerNode)1