commit | 35a02eaa85ac8ebf813e017e4262ff9651183191 | [log] [tgz] |
---|---|---|
author | Jordan Halterman <jordan@opennetworking.org> | Wed Aug 22 11:57:32 2018 -0700 |
committer | Thomas Vachuska <tom@opennetworking.org> | Tue Aug 28 19:28:14 2018 +0000 |
tree | 11e73c3337483beb408927bb7ad09278af0a30fd | |
parent | 9281593e8bc6c0f7875c6192bf2551ab99fa10a5 [diff] |
Implement destroy() method for certain primitives to preserve backwards compatibility Change-Id: I64e5790d531bf538bbfd886419362b14967331e6
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixAtomicValue.java b/core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixAtomicValue.java index 0843f9c..48c524a 100644 --- a/core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixAtomicValue.java +++ b/core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixAtomicValue.java
@@ -81,4 +81,9 @@ } return CompletableFuture.completedFuture(null); } + + @Override + public CompletableFuture<Void> destroy() { + return adaptFuture(atomixValue.delete()); + } }
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixDocumentTree.java b/core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixDocumentTree.java index 206da04..b191356 100644 --- a/core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixDocumentTree.java +++ b/core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixDocumentTree.java
@@ -145,6 +145,11 @@ throw new UnsupportedOperationException(); } + @Override + public CompletableFuture<Void> destroy() { + return adaptTreeFuture(atomixTree.delete()); + } + private DocumentPath toOnosPath(io.atomix.core.tree.DocumentPath path) { List<String> pathElements = Lists.newArrayList(path.pathElements()); pathElements.set(0, DocumentPath.ROOT.pathElements().get(0));
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixWorkQueue.java b/core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixWorkQueue.java index 9125b4d..89ffd4c 100644 --- a/core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixWorkQueue.java +++ b/core/store/primitives/src/main/java/org/onosproject/store/atomix/primitives/impl/AtomixWorkQueue.java
@@ -80,4 +80,9 @@ .withTotalPending(stats.totalPending()) .build()); } + + @Override + public CompletableFuture<Void> destroy() { + return adaptFuture(atomixWorkQueue.delete()); + } }