diff options
author | Maros Marsalek <mmarsale@cisco.com> | 2016-09-05 12:10:26 +0200 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2016-09-07 06:50:30 +0000 |
commit | 1326e9fa5cffe326b82aeee9d82d008526aff947 (patch) | |
tree | f8ca808f3aa3a9338573d8892b83305210a664a1 /infra/data-impl/src/main | |
parent | 6e77db8e850be8ad8a3d91bf43fb8986125ae60f (diff) |
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 <mmarsale@cisco.com>
Diffstat (limited to 'infra/data-impl/src/main')
4 files changed, 10 insertions, 9 deletions
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<NormalizedNode<?, ?>> 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<NormalizedNode<?, ?>> 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( |