Search in sources :

Example 1 with TestStatus

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestStatus in project controller by opendaylight.

the class DsbenchmarkProvider method setTestOperData.

private void setTestOperData(final ExecStatus sts, final long tstCompl) {
    TestStatus status = new TestStatusBuilder().setExecStatus(sts).setTestsCompleted(tstCompl).build();
    WriteTransaction tx = simpleTxDataBroker.newWriteOnlyTransaction();
    tx.put(LogicalDatastoreType.OPERATIONAL, TEST_STATUS_IID, status);
    try {
        tx.submit().checkedGet();
    } catch (final TransactionCommitFailedException e) {
        throw new IllegalStateException(e);
    }
    LOG.debug("DataStore test oper status populated: {}", status);
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) TestStatus(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestStatus) TransactionCommitFailedException(org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException) TestStatusBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestStatusBuilder)

Example 2 with TestStatus

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestStatus in project controller by opendaylight.

the class RpcbenchmarkProvider method testStatus.

@Override
public Future<RpcResult<TestStatusOutput>> testStatus() {
    LOG.info("testStatus");
    TestStatusOutput output = new TestStatusOutputBuilder().setGlobalServerCnt((long) globalServer.getNumRpcs()).setExecStatus(execStatus.get()).build();
    return RpcResultBuilder.success(output).buildFuture();
}
Also used : TestStatusOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rpcbenchmark.rev150702.TestStatusOutputBuilder) TestStatusOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rpcbenchmark.rev150702.TestStatusOutput)

Aggregations

WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)1 TransactionCommitFailedException (org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException)1 TestStatus (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestStatus)1 TestStatusBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestStatusBuilder)1 TestStatusOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rpcbenchmark.rev150702.TestStatusOutput)1 TestStatusOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rpcbenchmark.rev150702.TestStatusOutputBuilder)1