import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.outer.list.InnerListKey;
public final class BaListBuilder {
- public static List<OuterList> buildOuterList(int outerElements, int innerElements) {
+ public static List<OuterList> buildOuterList(final int outerElements, final int innerElements) {
List<OuterList> outerList = new ArrayList<>(outerElements);
for (int j = 0; j < outerElements; j++) {
outerList.add(new OuterListBuilder()
return outerList;
}
- private static List<InnerList> buildInnerList( int index, int elements ) {
+ private static List<InnerList> buildInnerList( final int index, final int elements ) {
List<InnerList> innerList = new ArrayList<>( elements );
final String itemStr = "Item-" + String.valueOf(index) + "-";
protected int txError = 0;
- public DatastoreAbstractWriter(StartTestInput.Operation oper,
- int outerListElem, int innerListElem, long writesPerTx, DataStore dataStore) {
+ public DatastoreAbstractWriter(final StartTestInput.Operation oper,
+ final int outerListElem, final int innerListElem, final long writesPerTx, final DataStore dataStore) {
this.outerListElem = outerListElem;
this.innerListElem = innerListElem;
this.writesPerTx = writesPerTx;
// Outer List Qname identifier for yang model's 'id'
private static final org.opendaylight.yangtools.yang.common.QName OL_ID = QName.create(OuterList.QNAME, "id");
- public static List<MapEntryNode> buildOuterList(int outerElements, int innerElements) {
+ public static List<MapEntryNode> buildOuterList(final int outerElements, final int innerElements) {
List<MapEntryNode> outerList = new ArrayList<>(outerElements);
for (int j = 0; j < outerElements; j++) {
outerList.add(ImmutableNodes.mapEntryBuilder()
return outerList;
}
- private static MapNode buildInnerList(int index, int elements ) {
+ private static MapNode buildInnerList(final int index, final int elements ) {
CollectionNodeBuilder<MapEntryNode, MapNode> innerList = ImmutableNodes.mapNodeBuilder(InnerList.QNAME);
final String itemStr = "Item-" + String.valueOf(index) + "-";
private long testsCompleted = 0;
- public DsbenchmarkProvider(DOMDataBroker domDataBroker, DataBroker bindingDataBroker) {
+ public DsbenchmarkProvider(final DOMDataBroker domDataBroker, final DataBroker bindingDataBroker) {
// We have to get the DOMDataBroker via the constructor,
// since we can't get it from the session
this.domDataBroker = domDataBroker;
}
@Override
- public void onSessionInitiated(ProviderContext session) {
+ public void onSessionInitiated(final ProviderContext session) {
this.dataBroker = session.getSALService(DataBroker.class);
this.dstReg = session.addRpcImplementation( DsbenchmarkService.class, this );
listenerProvider.setDataBroker(dataBroker);
}
@Override
- public Future<RpcResult<StartTestOutput>> startTest(StartTestInput input) {
+ public Future<RpcResult<StartTestOutput>> startTest(final StartTestInput input) {
LOG.info("Starting the data store benchmark test, input: {}", input);
// Check if there is a test in progress
this.testsCompleted++;
- } catch (Exception e) {
+ } catch (final Exception e) {
LOG.error( "Test error: {}", e.toString());
execStatus.set( ExecStatus.Idle );
return RpcResultBuilder.success(new StartTestOutputBuilder()
return RpcResultBuilder.success(output).buildFuture();
}
- private void setTestOperData( ExecStatus sts, long tstCompl ) {
+ private void setTestOperData( final ExecStatus sts, final long tstCompl ) {
TestStatus status = new TestStatusBuilder()
.setExecStatus(sts)
.setTestsCompleted(tstCompl)
try {
tx.submit().checkedGet();
- } catch (TransactionCommitFailedException e) {
+ } catch (final TransactionCommitFailedException e) {
throw new IllegalStateException(e);
}
try {
tx.submit().checkedGet();
LOG.debug("DataStore config test data cleaned up");
- } catch (TransactionCommitFailedException e) {
+ } catch (final TransactionCommitFailedException e) {
LOG.info("Failed to cleanup DataStore configtest data");
throw new IllegalStateException(e);
}
try {
tx.submit().checkedGet();
LOG.debug("DataStore operational test data cleaned up");
- } catch (TransactionCommitFailedException e) {
+ } catch (final TransactionCommitFailedException e) {
LOG.info("Failed to cleanup DataStore operational test data");
throw new IllegalStateException(e);
}
}
- private DatastoreAbstractWriter getDatastoreWriter(StartTestInput input) {
+ private DatastoreAbstractWriter getDatastoreWriter(final StartTestInput input) {
final DatastoreAbstractWriter retVal;
@Override
public void onDataTreeChanged(
- Collection<DataTreeModification<TestExec>> changes) {
+ final Collection<DataTreeModification<TestExec>> changes) {
// Since we're registering the same DsbenchmarkListener object for both
// OPERATIONAL and CONFIG, the onDataTreeChanged() method can be called
// from different threads, and we need to use atomic counters.
}
}
- private static synchronized void logDataTreeChangeEvent(int eventNum,
- Collection<DataTreeModification<TestExec>> changes) {
+ private static synchronized void logDataTreeChangeEvent(final int eventNum,
+ final Collection<DataTreeModification<TestExec>> changes) {
LOG.debug("DsbenchmarkListener-onDataTreeChanged: Event {}", eventNum);
for (DataTreeModification<TestExec> change : changes) {
new ArrayList<>();
private DataBroker dataBroker;
- public void setDataBroker(DataBroker dataBroker) {
+ public void setDataBroker(final DataBroker dataBroker) {
this.dataBroker = dataBroker;
LOG.debug("DsbenchmarkListenerProvider created");
}
- public void createAndRegisterListeners(int numListeners) {
+ public void createAndRegisterListeners(final int numListeners) {
for (int i = 0; i < numListeners; i++) {
DsbenchmarkListener listener = new DsbenchmarkListener();
listeners.add(dataBroker.registerDataTreeChangeListener(
try {
tx.submit().checkedGet();
txOk++;
- } catch (TransactionCommitFailedException e) {
+ } catch (final TransactionCommitFailedException e) {
LOG.error("Transaction failed: {}", e);
txError++;
}
if (putCnt != 0) {
try {
tx.submit().checkedGet();
- } catch (TransactionCommitFailedException e) {
+ } catch (final TransactionCommitFailedException e) {
LOG.error("Transaction failed: {}", e);
}
}
} else {
txError++;
}
- } catch (ReadFailedException e) {
+ } catch (final ReadFailedException e) {
LOG.warn("failed to ....", e);
txError++;
}
try {
tx.submit().checkedGet();
txOk++;
- } catch (TransactionCommitFailedException e) {
+ } catch (final TransactionCommitFailedException e) {
LOG.error("Transaction failed: {}", e);
txError++;
}
if (writeCnt != 0) {
try {
tx.submit().checkedGet();
- } catch (TransactionCommitFailedException e) {
+ } catch (final TransactionCommitFailedException e) {
LOG.error("Transaction failed: {}", e);
}
}
try {
tx.submit().checkedGet();
txOk++;
- } catch (TransactionCommitFailedException e) {
+ } catch (final TransactionCommitFailedException e) {
LOG.error("Transaction failed: {}", e);
txError++;
}
if (writeCnt != 0) {
try {
tx.submit().checkedGet();
- } catch (TransactionCommitFailedException e) {
+ } catch (final TransactionCommitFailedException e) {
LOG.error("Transaction failed: {}", e);
}
}
txError++;
LOG.warn("optionalDataObject is either null or .isPresent is false");
}
- } catch (ReadFailedException e) {
+ } catch (final ReadFailedException e) {
LOG.warn("failed to ....", e);
txError++;
}
try {
tx.submit().checkedGet();
txOk++;
- } catch (TransactionCommitFailedException e) {
+ } catch (final TransactionCommitFailedException e) {
LOG.error("Transaction failed", e);
txError++;
}
if (writeCnt != 0) {
try {
tx.submit().checkedGet();
- } catch (TransactionCommitFailedException e) {
+ } catch (final TransactionCommitFailedException e) {
LOG.error("Transaction failed", e);
}
}
txSubmitted++;
}
tx.submit().checkedGet();
- } catch (TransactionCommitFailedException e) {
+ } catch (final TransactionCommitFailedException e) {
LOG.error("Transaction failed", e);
}
try {
chain.close();
- } catch (IllegalStateException e) {
+ } catch (final IllegalStateException e) {
LOG.error("Transaction close failed,", e);
}
LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, (txOk + txError));
} else {
txError++;
}
- } catch (ReadFailedException e) {
+ } catch (final ReadFailedException e) {
LOG.warn("failed to ....", e);
txError++;
}
txSubmitted++;
tx.submit().checkedGet();
txOk++;
- } catch (TransactionCommitFailedException e) {
+ } catch (final TransactionCommitFailedException e) {
LOG.error("Transaction failed", e);
txError++;
}
try {
chain.close();
- } catch (IllegalStateException e) {
+ } catch (final IllegalStateException e) {
LOG.error("Transaction close failed,", e);
}
LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, (txOk + txError));
txSubmitted++;
tx.submit().checkedGet();
txOk++;
- } catch (TransactionCommitFailedException e) {
+ } catch (final TransactionCommitFailedException e) {
LOG.error("Transaction failed", e);
txError++;
}
try {
chain.close();
- } catch (IllegalStateException e) {
+ } catch (final IllegalStateException e) {
LOG.error("Transaction close failed,", e);
}
LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, (txOk + txError));
if (optionalDataObject != null && optionalDataObject.isPresent()) {
txOk++;
}
- } catch (ReadFailedException e) {
+ } catch (final ReadFailedException e) {
LOG.warn("failed to ....", e);
txError++;
}
txSubmitted++;
tx.submit().checkedGet();
txOk++;
- } catch (TransactionCommitFailedException e) {
+ } catch (final TransactionCommitFailedException e) {
LOG.error("Transaction failed", e);
txError++;
}
try {
chain.close();
- } catch (IllegalStateException e) {
+ } catch (final IllegalStateException e) {
LOG.error("Transaction close failed,", e);
}
import org.opendaylight.dsbenchmark.DsbenchmarkProvider;
public class DsbenchmarkImplModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.impl.rev141210.AbstractDsbenchmarkImplModule {
- public DsbenchmarkImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+ public DsbenchmarkImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
}
- public DsbenchmarkImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.impl.rev141210.DsbenchmarkImplModule oldModule, java.lang.AutoCloseable oldInstance) {
+ public DsbenchmarkImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.impl.rev141210.DsbenchmarkImplModule oldModule, final java.lang.AutoCloseable oldInstance) {
super(identifier, dependencyResolver, oldModule, oldInstance);
}