X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fbroker%2Fimpl%2FDOMDataBrokerImpl.java;h=fc87a9110576054eb75571167d01f60c1c95c98e;hp=fcf8b40efe52106fb8477897d028dc153c956eee;hb=08217531fbe76dbcc429c71d593894fc211e50aa;hpb=76b4cab3979151c4c599761301deab0766e0bbf1 diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMDataBrokerImpl.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMDataBrokerImpl.java index fcf8b40efe..fc87a91105 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMDataBrokerImpl.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMDataBrokerImpl.java @@ -120,7 +120,7 @@ public class DOMDataBrokerImpl implements DOMDataBroker, AutoCloseable { private ListenableFuture> submit( final WriteTransactionImpl transaction) { - LOG.debug("Tx: {} is submitted for execution.",transaction.getIdentifier()); + LOG.debug("Tx: {} is submitted for execution.", transaction.getIdentifier()); return executor.submit(new CommitCoordination(transaction)); } @@ -253,7 +253,8 @@ public class DOMDataBrokerImpl implements DOMDataBroker, AutoCloseable { } @Override - public void merge(final LogicalDatastoreType store, final InstanceIdentifier path, final NormalizedNode data) { + public void merge(final LogicalDatastoreType store, final InstanceIdentifier path, + final NormalizedNode data) { } } @@ -269,15 +270,18 @@ public class DOMDataBrokerImpl implements DOMDataBroker, AutoCloseable { @Override public RpcResult call() throws Exception { - Boolean canCommit = canCommit().get(); try { + Boolean canCommit = canCommit().get(); + if (canCommit) { try { preCommit().get(); try { commit().get(); - COORDINATOR_LOG.debug("Tx: {} Is commited.",transaction.getIdentifier()); - return Rpcs.getRpcResult(true, TransactionStatus.COMMITED, Collections.emptySet()); + COORDINATOR_LOG.debug("Tx: {} Is commited.", transaction.getIdentifier()); + return Rpcs.getRpcResult(true, TransactionStatus.COMMITED, + Collections. emptySet()); + } catch (InterruptedException | ExecutionException e) { COORDINATOR_LOG.error("Tx: {} Error during commit", transaction.getIdentifier(), e); } @@ -287,7 +291,7 @@ public class DOMDataBrokerImpl implements DOMDataBroker, AutoCloseable { transaction.getIdentifier(), e); } } else { - COORDINATOR_LOG.info("Tx: {} Did not pass canCommit phase."); + COORDINATOR_LOG.info("Tx: {} Did not pass canCommit phase.", transaction.getIdentifier()); abort().get(); } } catch (InterruptedException | ExecutionException e) { @@ -299,7 +303,7 @@ public class DOMDataBrokerImpl implements DOMDataBroker, AutoCloseable { } catch (InterruptedException | ExecutionException e) { COORDINATOR_LOG.error("Tx: {} Error during abort", transaction.getIdentifier(), e); } - return Rpcs.getRpcResult(false, TransactionStatus.FAILED, Collections.emptySet()); + return Rpcs.getRpcResult(false, TransactionStatus.FAILED, Collections. emptySet()); } public ListenableFuture preCommit() {