use of com.hazelcast.internal.partition.service.TestIncrementOperation in project hazelcast by hazelcast.
the class MigrationCommitServiceTest method setup.
@Before
public void setup() throws Exception {
blockMigrationStartLatch = new CountDownLatch(1);
factory = createHazelcastInstanceFactory(NODE_COUNT);
instances = factory.newInstances(createConfig(), NODE_COUNT);
warmUpPartitions(instances);
waitAllForSafeState(instances);
InternalOperationService operationService = getOperationService(instances[0]);
for (int partitionId = 0; partitionId < PARTITION_COUNT; partitionId++) {
operationService.invokeOnPartition(null, new TestIncrementOperation(), partitionId).get();
}
assertTrueEventually(new AssertTask() {
@Override
public void run() throws Exception {
for (int partitionId = 0; partitionId < PARTITION_COUNT; partitionId++) {
InternalPartitionService partitionService = getPartitionService(instances[0]);
InternalPartition partition = partitionService.getPartition(partitionId);
for (int i = 0; i <= BACKUP_COUNT; i++) {
Address replicaAddress = partition.getReplicaAddress(i);
if (replicaAddress != null) {
TestMigrationAwareService service = getService(replicaAddress);
assertNotNull(service.get(partitionId));
}
}
}
}
});
for (HazelcastInstance instance : instances) {
TestMigrationAwareService service = getNodeEngineImpl(instance).getService(TestMigrationAwareService.SERVICE_NAME);
service.clearEvents();
}
}
Aggregations