commit | a89f8f95d4d76b7cffa48221ddd4db2d5c93738a | [log] [tgz] |
---|---|---|
author | Madan Jampani <madan@onlab.us> | Wed Apr 01 14:39:54 2015 -0700 |
committer | Madan Jampani <madan@onlab.us> | Thu Apr 02 17:48:58 2015 +0000 |
tree | eb9be5161900a047176ca648fa703ce06547036f | |
parent | a36f03bf8f17c0c7c2d7d87b08f50dab9894cd40 [diff] [blame] |
Added support for "maps" cli command that displays meta information for various consistent maps in the system Change-Id: I63e590a8520ac9d1238efe4ad0033dcba939e472
diff --git a/core/store/dist/src/main/java/org/onosproject/store/consistent/impl/PartitionedDatabase.java b/core/store/dist/src/main/java/org/onosproject/store/consistent/impl/PartitionedDatabase.java index cb4ddfc..ad049e6 100644 --- a/core/store/dist/src/main/java/org/onosproject/store/consistent/impl/PartitionedDatabase.java +++ b/core/store/dist/src/main/java/org/onosproject/store/consistent/impl/PartitionedDatabase.java
@@ -78,6 +78,17 @@ } @Override + public CompletableFuture<Set<String>> tableNames() { + checkState(isOpen.get(), DB_NOT_OPEN); + Set<String> tableNames = Sets.newConcurrentHashSet(); + return CompletableFuture.allOf(partitions + .stream() + .map(db -> db.tableNames().thenApply(tableNames::addAll)) + .toArray(CompletableFuture[]::new)) + .thenApply(v -> tableNames); + } + + @Override public CompletableFuture<Integer> size(String tableName) { checkState(isOpen.get(), DB_NOT_OPEN); AtomicInteger totalSize = new AtomicInteger(0);