use of com.hazelcast.internal.partition.NonFragmentedServiceNamespace in project hazelcast by hazelcast.
the class AbstractPartitionOperation method createFragmentReplicationOperationsOffload.
/**
* Used for partition replica sync, supporting
* offloaded replication-operation preparation
*/
final Collection<Operation> createFragmentReplicationOperationsOffload(PartitionReplicationEvent event, ServiceNamespace ns) {
assert !(ns instanceof NonFragmentedServiceNamespace) : ns + " should be used only for fragmented services!";
Collection<Operation> operations = emptySet();
NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
Collection<ServiceInfo> services = nodeEngine.getServiceInfos(FragmentedMigrationAwareService.class);
for (ServiceInfo serviceInfo : services) {
FragmentedMigrationAwareService service = serviceInfo.getService();
if (!service.isKnownServiceNamespace(ns)) {
continue;
}
operations = collectReplicationOperations(event, ns, isRunningOnPartitionThread(), operations, serviceInfo.getName(), service);
}
return operations;
}
use of com.hazelcast.internal.partition.NonFragmentedServiceNamespace in project hazelcast by hazelcast.
the class AbstractPartitionOperation method createFragmentReplicationOperationsOffload.
/**
* Used for offloaded replication-operation
* preparation while executing a migration request
*/
final Collection<Operation> createFragmentReplicationOperationsOffload(PartitionReplicationEvent event, ServiceNamespace ns, Collection<String> serviceNames) {
assert !(ns instanceof NonFragmentedServiceNamespace) : ns + " should be used only for fragmented services!";
Collection<Operation> operations = emptySet();
NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
for (String serviceName : serviceNames) {
FragmentedMigrationAwareService service = nodeEngine.getService(serviceName);
assert service.isKnownServiceNamespace(ns) : ns + " should be known by " + service;
operations = collectReplicationOperations(event, ns, isRunningOnPartitionThread(), operations, serviceName, service);
}
return operations;
}
use of com.hazelcast.internal.partition.NonFragmentedServiceNamespace in project hazelcast by hazelcast.
the class AbstractPartitionOperation method createFragmentReplicationOperations.
final Collection<Operation> createFragmentReplicationOperations(PartitionReplicationEvent event, ServiceNamespace ns) {
assert !(ns instanceof NonFragmentedServiceNamespace) : ns + " should be used only for fragmented services!";
assertRunningOnPartitionThread();
Collection<Operation> operations = emptySet();
NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
Collection<ServiceInfo> services = nodeEngine.getServiceInfos(FragmentedMigrationAwareService.class);
for (ServiceInfo serviceInfo : services) {
FragmentedMigrationAwareService service = serviceInfo.getService();
if (!service.isKnownServiceNamespace(ns)) {
continue;
}
operations = prepareAndAppendReplicationOperation(event, ns, service, serviceInfo.getName(), operations);
}
return operations;
}
use of com.hazelcast.internal.partition.NonFragmentedServiceNamespace in project hazelcast by hazelcast.
the class AbstractPartitionOperation method collectChunkSuppliers.
@Nonnull
final Collection<ChunkSupplier> collectChunkSuppliers(PartitionReplicationEvent event, ServiceNamespace ns) {
assert !(ns instanceof NonFragmentedServiceNamespace) : ns + " should be used only for chunked migrations enabled services!";
ILogger logger = getLogger();
logger.fine("Collecting chunk chunk suppliers...");
Collection<ChunkSupplier> chunkSuppliers = Collections.emptyList();
NodeEngine nodeEngine = getNodeEngine();
Collection<ChunkedMigrationAwareService> services = nodeEngine.getServices(ChunkedMigrationAwareService.class);
for (ChunkedMigrationAwareService service : services) {
if (!service.isKnownServiceNamespace(ns)) {
continue;
}
chunkSuppliers = collectChunkSuppliers(event, ns, isRunningOnPartitionThread(), chunkSuppliers, service);
if (logger.isFineEnabled()) {
logger.fine(String.format("Created chunk supplier:[%s, partitionId:%d]", ns, event.getPartitionId()));
}
}
return chunkSuppliers;
}
Aggregations