From 1326e9fa5cffe326b82aeee9d82d008526aff947 Mon Sep 17 00:00:00 2001 From: Maros Marsalek Date: Mon, 5 Sep 2016 12:10:26 +0200 Subject: Cleanup TODOs and FIXMEs - Fix minor ones - Report bigger and include issue number in comment - Pull common dependencies into dependency management of common/parents Change-Id: I06a6ac37c52b603fd73ed42023d6b2e7fa18010f Signed-off-by: Maros Marsalek --- infra/data-impl/pom.xml | 17 ----------------- .../data/impl/ModifiableDataTreeDelegator.java | 4 ++-- .../io/fd/honeycomb/data/impl/ModificationDiff.java | 2 +- .../honeycomb/data/impl/PersistingDataTreeAdapter.java | 8 ++++---- .../honeycomb/data/impl/ReadableDataTreeDelegator.java | 5 +++-- 5 files changed, 10 insertions(+), 26 deletions(-) (limited to 'infra/data-impl') diff --git a/infra/data-impl/pom.xml b/infra/data-impl/pom.xml index f90c7cd84..341378192 100644 --- a/infra/data-impl/pom.xml +++ b/infra/data-impl/pom.xml @@ -51,30 +51,13 @@ org.opendaylight.controller sal-core-api - - 1.3.2-Beryllium-SR2 - - - org.opendaylight.netconf - ietf-netconf-monitoring - 1.0.2-Beryllium-SR2 - - - - org.opendaylight.netconf - ietf-netconf-monitoring-extension - 1.0.2-Beryllium-SR2 - - - junit junit test - org.mockito mockito-all diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegator.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegator.java index d5d810e0a..7af9847d7 100644 --- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegator.java +++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegator.java @@ -60,7 +60,7 @@ public final class ModifiableDataTreeDelegator extends ModifiableDataTreeManager private final WriterRegistry writerRegistry; private final org.opendaylight.controller.md.sal.binding.api.DataBroker contextBroker; - // TODO what to use instead of deprecated BindingNormalizedNodeSerializer ? + // TODO HONEYCOMB-161 what to use instead of deprecated BindingNormalizedNodeSerializer ? private final BindingNormalizedNodeSerializer serializer; /** @@ -145,7 +145,7 @@ public final class ModifiableDataTreeDelegator extends ModifiableDataTreeManager throw e; // fail with success revert } catch (TransactionCommitFailedException e) { - // FIXME revert should probably occur when context is not written successfully + // TODO HONEYCOMB-162 revert should probably occur when context is not written successfully final String msg = "Error while updating mapping context data"; LOG.error(msg, e); throw new TranslationException(msg, e); diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java index 710f8a053..1c87bc03a 100644 --- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java +++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java @@ -114,7 +114,7 @@ final class ModificationDiff { // Check if there are any modified leaves and if so, consider current node as modified final Boolean directLeavesModified = currentCandidate.getChildNodes().stream() .filter(ModificationDiff::isLeaf) - // For some reason, we get modifications on unmodified list keys TODO debug and report ODL bug + // For some reason, we get modifications on unmodified list keys // and that messes up our modifications collection here, so we need to skip .filter(ModificationDiff::isBeforeAndAfterDifferent) .filter(child -> LEAF_MODIFICATIONS.contains(child.getModificationType())) diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/PersistingDataTreeAdapter.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/PersistingDataTreeAdapter.java index 94c5e4446..459971436 100644 --- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/PersistingDataTreeAdapter.java +++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/PersistingDataTreeAdapter.java @@ -103,17 +103,17 @@ public class PersistingDataTreeAdapter implements DataTree, AutoCloseable { delegateDependency.commit(dataTreeCandidate); LOG.debug("Delegate commit successful. Persisting data"); - // FIXME doing full read and full write might not be the fastest way of persisting data here + // TODO HONEYCOMB-163 doing full read and full write might not be the fastest way of persisting data here final DataTreeSnapshot dataTreeSnapshot = delegateDependency.takeSnapshot(); - // TODO this can be handled in background by a dedicated thread + a limited blocking queue - // TODO enable configurable granularity for persists. Maybe doing write on every modification is too much + // TODO HONEYCOMB-163 this can be handled in background by a dedicated thread + a limited blocking queue + // TODO HONEYCOMB-163 enable configurable granularity for persists. Maybe doing write on every modification is too much // and we could do bulk persist persistCurrentData(dataTreeSnapshot.readNode(YangInstanceIdentifier.EMPTY)); } private void persistCurrentData(final Optional> currentRoot) { - if(currentRoot.isPresent()) { + if (currentRoot.isPresent()) { try { LOG.trace("Persisting current data: {} into: {}", currentRoot.get(), path); JsonUtils.writeJsonRoot(currentRoot.get(), schemaServiceDependency.getGlobalContext(), diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegator.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegator.java index 775f6326c..ae29fa08b 100644 --- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegator.java +++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegator.java @@ -91,7 +91,7 @@ public final class ReadableDataTreeDelegator implements ReadableDataManager { org.opendaylight.controller.md.sal.common.api.data.ReadFailedException> read( @Nonnull final YangInstanceIdentifier yangInstanceIdentifier) { - try(TransactionMappingContext mappingContext = new TransactionMappingContext(contextBroker.newReadWriteTransaction()); + try (TransactionMappingContext mappingContext = new TransactionMappingContext(contextBroker.newReadWriteTransaction()); ReadContext ctx = new ReadContextImpl(mappingContext)) { final Optional> value; @@ -113,7 +113,8 @@ public final class ReadableDataTreeDelegator implements ReadableDataManager { return Futures.immediateFailedCheckedFuture( new org.opendaylight.controller.md.sal.common.api.data.ReadFailedException("Failed to read data", e)); } catch (TransactionCommitFailedException e) { - // FIXME revert should probably occur when context is not written successfully + // Context write failed. This should not happen, but if it does, there's not much that can be done here + // ... try to read again final String msg = "Error while updating mapping context data"; LOG.error(msg, e); return Futures.immediateFailedCheckedFuture( -- cgit 1.2.3-korg