use of com.hazelcast.internal.partition.ChunkedMigrationAwareService in project hazelcast by hazelcast.
the class AbstractPartitionOperation method collectChunkSuppliers.
@Nonnull
final Collection<ChunkSupplier> collectChunkSuppliers(PartitionReplicationEvent event, Collection<String> serviceNames, ServiceNamespace namespace) {
ILogger logger = getLogger();
logger.fine("Collecting chunk suppliers...");
Collection<ChunkSupplier> chunkSuppliers = emptyList();
NodeEngine nodeEngine = getNodeEngine();
for (String serviceName : serviceNames) {
Object service = nodeEngine.getService(serviceName);
if (!(service instanceof ChunkedMigrationAwareService)) {
// skip not chunked services
continue;
}
chunkSuppliers = collectChunkSuppliers(event, namespace, isRunningOnPartitionThread(), chunkSuppliers, ((ChunkedMigrationAwareService) service));
if (logger.isFineEnabled()) {
logger.fine(String.format("Created chunk supplier:[%s, partitionId:%d]", namespace, event.getPartitionId()));
}
}
return chunkSuppliers;
}
use of com.hazelcast.internal.partition.ChunkedMigrationAwareService 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