From: Tony Tkacik Date: Wed, 7 May 2014 11:14:00 +0000 (+0000) Subject: Merge "Fixed typo in SnapshotBackedWriteTransaction class" X-Git-Tag: autorelease-tag-v20140601202136_82eb3f9~131 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=31b7a44c89d1057489338492fcf62a64147bea24;hp=-c Merge "Fixed typo in SnapshotBackedWriteTransaction class" --- 31b7a44c89d1057489338492fcf62a64147bea24 diff --combined opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStore.java index 9bbba1e24d,de674eb71e..0a2b66c2d0 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStore.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStore.java @@@ -90,7 -90,7 +90,7 @@@ public class InMemoryDOMDataStore imple @Override public DOMStoreWriteTransaction newWriteOnlyTransaction() { - return new SnaphostBackedWriteTransaction(nextIdentifier(), snapshot.get(), this, operationTree); + return new SnapshotBackedWriteTransaction(nextIdentifier(), snapshot.get(), this, operationTree); } @Override @@@ -139,7 -139,7 +139,7 @@@ } private synchronized DOMStoreThreePhaseCommitCohort submit( - final SnaphostBackedWriteTransaction writeTx) { + final SnapshotBackedWriteTransaction writeTx) { LOG.debug("Tx: {} is submitted. Modifications: {}",writeTx.getIdentifier(),writeTx.getMutatedView()); return new ThreePhaseCommitImpl(writeTx); } @@@ -226,12 -226,12 +226,12 @@@ } } - private static class SnaphostBackedWriteTransaction extends AbstractDOMStoreTransaction implements DOMStoreWriteTransaction { + private static class SnapshotBackedWriteTransaction extends AbstractDOMStoreTransaction implements DOMStoreWriteTransaction { private MutableDataTree mutableTree; private InMemoryDOMDataStore store; private boolean ready = false; - public SnaphostBackedWriteTransaction(final Object identifier, final DataAndMetadataSnapshot snapshot, + public SnapshotBackedWriteTransaction(final Object identifier, final DataAndMetadataSnapshot snapshot, final InMemoryDOMDataStore store, final ModificationApplyOperation applyOper) { super(identifier); mutableTree = MutableDataTree.from(snapshot, applyOper); @@@ -258,18 -258,6 +258,18 @@@ } } + @Override + public void merge(final InstanceIdentifier path, final NormalizedNode data) { + checkNotReady(); + try { + LOG.trace("Tx: {} Merge: {}:{}",getIdentifier(),path,data); + mutableTree.merge(path, data); + // FIXME: Add checked exception + } catch (Exception e) { + LOG.error("Tx: {}, failed to write {}:{} in {}",getIdentifier(),path,data,mutableTree,e); + } + } + @Override public void delete(final InstanceIdentifier path) { checkNotReady(); @@@ -310,7 -298,7 +310,7 @@@ } } - private static class SnapshotBackedReadWriteTransaction extends SnaphostBackedWriteTransaction implements + private static class SnapshotBackedReadWriteTransaction extends SnapshotBackedWriteTransaction implements DOMStoreReadWriteTransaction { protected SnapshotBackedReadWriteTransaction(final Object identifier, final DataAndMetadataSnapshot snapshot, @@@ -332,14 -320,14 +332,14 @@@ private class ThreePhaseCommitImpl implements DOMStoreThreePhaseCommitCohort { - private final SnaphostBackedWriteTransaction transaction; + private final SnapshotBackedWriteTransaction transaction; private final NodeModification modification; private DataAndMetadataSnapshot storeSnapshot; private Optional proposedSubtree; private ResolveDataChangeEventsTask listenerResolver; - public ThreePhaseCommitImpl(final SnaphostBackedWriteTransaction writeTransaction) { + public ThreePhaseCommitImpl(final SnapshotBackedWriteTransaction writeTransaction) { this.transaction = writeTransaction; this.modification = transaction.getMutatedView().getRootModification(); }