import org.opendaylight.controller.cluster.datastore.messages.FindLocalShard;
import org.opendaylight.controller.cluster.datastore.messages.FindPrimary;
import org.opendaylight.controller.cluster.datastore.messages.LocalShardFound;
import org.opendaylight.controller.cluster.datastore.messages.FindLocalShard;
import org.opendaylight.controller.cluster.datastore.messages.FindPrimary;
import org.opendaylight.controller.cluster.datastore.messages.LocalShardFound;
import org.opendaylight.controller.cluster.datastore.messages.PrimaryFound;
import org.opendaylight.controller.cluster.datastore.messages.PrimaryNotFound;
import org.opendaylight.controller.cluster.datastore.messages.UpdateSchemaContext;
import org.opendaylight.controller.cluster.datastore.messages.PrimaryFound;
import org.opendaylight.controller.cluster.datastore.messages.PrimaryNotFound;
import org.opendaylight.controller.cluster.datastore.messages.UpdateSchemaContext;
import org.opendaylight.controller.cluster.datastore.utils.MockClusterWrapper;
import org.opendaylight.controller.cluster.datastore.utils.MockConfiguration;
import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
import org.opendaylight.controller.cluster.datastore.utils.MockClusterWrapper;
import org.opendaylight.controller.cluster.datastore.utils.MockConfiguration;
import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
myJournal.put("class", "org.opendaylight.controller.cluster.datastore.ShardManagerTest$MyJournal");
myJournal.put("plugin-dispatcher", "akka.actor.default-dispatcher");
Config config = ConfigFactory.load()
myJournal.put("class", "org.opendaylight.controller.cluster.datastore.ShardManagerTest$MyJournal");
myJournal.put("plugin-dispatcher", "akka.actor.default-dispatcher");
Config config = ConfigFactory.load()
- .withValue("akka.persistence.journal.plugin",
- ConfigValueFactory.fromAnyRef("my-journal"))
- .withValue("my-journal", ConfigValueFactory.fromMap(myJournal));
+ .withValue("akka.persistence.journal.plugin",
+ ConfigValueFactory.fromAnyRef("my-journal"))
+ .withValue("my-journal", ConfigValueFactory.fromMap(myJournal));
- .props("config", new MockClusterWrapper(),
- new MockConfiguration(), new DatastoreContext());
+ .props("config", new MockClusterWrapper(),
+ new MockConfiguration(), new DatastoreContext());
final ActorRef subject = getSystem().actorOf(props);
subject.tell(new FindPrimary("inventory").toSerializable(), getRef());
expectMsgEquals(duration("2 seconds"),
final ActorRef subject = getSystem().actorOf(props);
subject.tell(new FindPrimary("inventory").toSerializable(), getRef());
expectMsgEquals(duration("2 seconds"),
- .props("config", new MockClusterWrapper(),
- new MockConfiguration(), new DatastoreContext());
+ .props("config", new MockClusterWrapper(),
+ new MockConfiguration(), new DatastoreContext());
final ActorRef subject = getSystem().actorOf(props);
subject.tell(new UpdateSchemaContext(TestModel.createTestContext()), getRef());
final ActorRef subject = getSystem().actorOf(props);
subject.tell(new UpdateSchemaContext(TestModel.createTestContext()), getRef());
subject.tell(new FindPrimary(Shard.DEFAULT_NAME).toSerializable(), getRef());
expectMsgClass(duration("1 seconds"), PrimaryFound.SERIALIZABLE_CLASS);
subject.tell(new FindPrimary(Shard.DEFAULT_NAME).toSerializable(), getRef());
expectMsgClass(duration("1 seconds"), PrimaryFound.SERIALIZABLE_CLASS);
- .props("config", new MockClusterWrapper(),
- new MockConfiguration(), new DatastoreContext());
+ .props("config", new MockClusterWrapper(),
+ new MockConfiguration(), new DatastoreContext());
- .props("config", mockClusterWrapper,
- new MockConfiguration(), new DatastoreContext());
+ .props("config", mockClusterWrapper,
+ new MockConfiguration(), new DatastoreContext());
final ActorRef subject = getSystem().actorOf(props);
subject.tell(new UpdateSchemaContext(TestModel.createTestContext()), getRef());
final ActorRef subject = getSystem().actorOf(props);
subject.tell(new UpdateSchemaContext(TestModel.createTestContext()), getRef());
}.get(); // this extracts the received message
assertTrue(out.path().toString(),
}.get(); // this extracts the received message
assertTrue(out.path().toString(),
- .props("config", new MockClusterWrapper(),
- new MockConfiguration(), new DatastoreContext());
+ .props("config", new MockClusterWrapper(),
+ new MockConfiguration(), new DatastoreContext());
- .props("config", new MockClusterWrapper(),
- new MockConfiguration(), new DatastoreContext());
+ .props("config", new MockClusterWrapper(),
+ new MockConfiguration(), new DatastoreContext());
@Test
public void testOnRecoveryJournalIsEmptied(){
MyJournal.addToJournal(1L, new ShardManager.SchemaContextModules(
@Test
public void testOnRecoveryJournalIsEmptied(){
MyJournal.addToJournal(1L, new ShardManager.SchemaContextModules(
assertEquals(1, MyJournal.get().size());
new JavaTestKit(system) {{
final Props props = ShardManager
assertEquals(1, MyJournal.get().size());
new JavaTestKit(system) {{
final Props props = ShardManager
- .props("config", new MockClusterWrapper(),
- new MockConfiguration(), new DatastoreContext());
+ .props("config", new MockClusterWrapper(),
+ new MockConfiguration(), new DatastoreContext());
public void testOnRecoveryPreviouslyKnownModulesAreDiscovered() throws Exception {
new JavaTestKit(system) {{
final Props props = ShardManager
public void testOnRecoveryPreviouslyKnownModulesAreDiscovered() throws Exception {
new JavaTestKit(system) {{
final Props props = ShardManager
- .props("config", new MockClusterWrapper(),
- new MockConfiguration(), new DatastoreContext());
+ .props("config", new MockClusterWrapper(),
+ new MockConfiguration(), new DatastoreContext());
- .props("config", new MockClusterWrapper(),
- new MockConfiguration(), new DatastoreContext());
+ .props("config", new MockClusterWrapper(),
+ new MockConfiguration(), new DatastoreContext());
- .props("config", new MockClusterWrapper(),
- new MockConfiguration(), new DatastoreContext());
+ .props("config", new MockClusterWrapper(),
+ new MockConfiguration(), new DatastoreContext());
}
@Override public Future<Void> doAsyncReplayMessages(final String persistenceId, long fromSequenceNr, long toSequenceNr, long max,
}
@Override public Future<Void> doAsyncReplayMessages(final String persistenceId, long fromSequenceNr, long toSequenceNr, long max,
public Void call() throws Exception {
for (Map.Entry<Long, Object> entry : journal.entrySet()) {
PersistentRepr persistentMessage =
public Void call() throws Exception {
for (Map.Entry<Long, Object> entry : journal.entrySet()) {
PersistentRepr persistentMessage =
- new PersistentImpl(entry.getValue(), entry.getKey(), persistenceId,
- false, null, null);
+ new PersistentImpl(entry.getValue(), entry.getKey(), persistenceId,
+ false, null, null);
return Futures.successful(null);
}
@Override public Future<Void> doAsyncDeleteMessages(Iterable<PersistentId> persistentIds,
return Futures.successful(null);
}
@Override public Future<Void> doAsyncDeleteMessages(Iterable<PersistentId> persistentIds,