Turning on consistent and ordered notification support for multi-partition usecase
Change-Id: I450737bcfd4f1480c60223a84785f35325bf21d2
Showing
2 changed files
with
29 additions
and
1 deletions
| ... | @@ -367,14 +367,16 @@ public class PartitionedDatabase implements Database { | ... | @@ -367,14 +367,16 @@ public class PartitionedDatabase implements Database { |
| 367 | 367 | ||
| 368 | @Override | 368 | @Override |
| 369 | public boolean hasChangeNotificationSupport() { | 369 | public boolean hasChangeNotificationSupport() { |
| 370 | - return false; | 370 | + return true; |
| 371 | } | 371 | } |
| 372 | 372 | ||
| 373 | @Override | 373 | @Override |
| 374 | public void registerConsumer(Consumer<StateMachineUpdate> consumer) { | 374 | public void registerConsumer(Consumer<StateMachineUpdate> consumer) { |
| 375 | + partitions.forEach(p -> p.registerConsumer(consumer)); | ||
| 375 | } | 376 | } |
| 376 | 377 | ||
| 377 | @Override | 378 | @Override |
| 378 | public void unregisterConsumer(Consumer<StateMachineUpdate> consumer) { | 379 | public void unregisterConsumer(Consumer<StateMachineUpdate> consumer) { |
| 380 | + partitions.forEach(p -> p.unregisterConsumer(consumer)); | ||
| 379 | } | 381 | } |
| 380 | } | 382 | } | ... | ... |
| 1 | +/* | ||
| 2 | + * Copyright 2015 Open Networking Laboratory | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + */ | ||
| 1 | package org.onosproject.store.consistent.impl; | 16 | package org.onosproject.store.consistent.impl; |
| 2 | 17 | ||
| 18 | +import static com.google.common.base.MoreObjects.toStringHelper; | ||
| 19 | + | ||
| 3 | /** | 20 | /** |
| 4 | * Representation of a state machine update. | 21 | * Representation of a state machine update. |
| 5 | */ | 22 | */ |
| ... | @@ -48,4 +65,13 @@ public class StateMachineUpdate { | ... | @@ -48,4 +65,13 @@ public class StateMachineUpdate { |
| 48 | public <T> T output() { | 65 | public <T> T output() { |
| 49 | return (T) output; | 66 | return (T) output; |
| 50 | } | 67 | } |
| 68 | + | ||
| 69 | + @Override | ||
| 70 | + public String toString() { | ||
| 71 | + return toStringHelper(this) | ||
| 72 | + .add("name", operationName) | ||
| 73 | + .add("input", input) | ||
| 74 | + .add("output", output) | ||
| 75 | + .toString(); | ||
| 76 | + } | ||
| 51 | } | 77 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment