<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-singleton-common-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-singleton-dom-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
}
protected static void verifyNoNotifications(final MockEntityOwnershipListener listener) {
- await().pollDelay(2, TimeUnit.SECONDS).until(() -> listener.getChanges().isEmpty());
+ verifyNoNotifications(listener, 2);
+ }
+
+ protected static void verifyNoNotifications(final MockEntityOwnershipListener listener, long delaySeconds) {
+ await().pollDelay(delaySeconds, TimeUnit.SECONDS).until(() -> listener.getChanges().isEmpty());
+ }
+
+ protected static void verifyNoAdditionalNotifications(
+ final MockEntityOwnershipListener listener, long delaySeconds) {
+ listener.resetListener();
+ verifyNoNotifications(listener, delaySeconds);
}
protected static final class ClusterNode {
public List<DOMEntityOwnershipChange> getChanges() {
return changes;
}
+
+ public void resetListener() {
+ changes.clear();
+ }
}
protected static final class MockNativeEntityOwnershipService extends AkkaEntityOwnershipService {
registerCandidates(clusterNode, ENTITY_1, "member-2", "member-3");
verifyListenerState(listener, ENTITY_1, true, true, false);
+ verifyNoAdditionalNotifications(listener, 5);
unregisterCandidates(clusterNode, ENTITY_1, "member-1");
verifyListenerState(listener, ENTITY_1, true, false, true);
final MockEntityOwnershipListener listener = registerListener(clusterNode, ENTITY_1);
verifyListenerState(listener, ENTITY_1, true, true, false);
+ verifyNoAdditionalNotifications(listener, 5);
unregisterCandidates(clusterNode, ENTITY_1, "member-1", "member-2");
verifyListenerState(listener, ENTITY_1, true, false, true);
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.cluster.akka.eos.service;
+package org.opendaylight.controller.eos.akka.service;
import static org.awaitility.Awaitility.await;
import static org.junit.Assert.assertFalse;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.opendaylight.controller.cluster.akka.eos.AbstractNativeEosTest;
+import org.opendaylight.controller.eos.akka.AbstractNativeEosTest;
import org.opendaylight.mdsal.eos.dom.api.DOMEntityOwnershipService;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
private static final Logger LOG = LoggerFactory.getLogger(ClusterSingletonIntegrationTest.class);
- private MockNativeEntityOwnershipService node1;
+ private AbstractNativeEosTest.MockNativeEntityOwnershipService node1;
private MockNativeEntityOwnershipService node2;
private MockNativeEntityOwnershipService node3;
"member-1"
]
downing-provider-class = "akka.cluster.sbr.SplitBrainResolverProvider"
+
+ distributed-data {
+ # How often the Replicator should send out gossip information.
+ # This value controls how quickly Entity Ownership Service data is replicated
+ # across cluster nodes.
+ gossip-interval = 100 ms
+
+ # How often the subscribers will be notified of changes, if any.
+ # This value controls how quickly Entity Ownership Service decisions are
+ # propagated within a node.
+ notify-subscribers-interval = 20 ms
+ }
}
}
use-dispatcher = cluster-dispatcher
failure-detector.acceptable-heartbeat-pause = 3 s
+
+ distributed-data {
+ # How often the Replicator should send out gossip information.
+ # This value controls how quickly Entity Ownership Service data is replicated
+ # across cluster nodes.
+ gossip-interval = 100 ms
+
+ # How often the subscribers will be notified of changes, if any.
+ # This value controls how quickly Entity Ownership Service decisions are
+ # propagated within a node.
+ notify-subscribers-interval = 20 ms
+ }
}
persistence {