use of com.hazelcast.cardinality.impl.CardinalityEstimatorService in project hazelcast by hazelcast.
the class ServiceManagerImpl method registerDefaultServices.
private void registerDefaultServices(ServicesConfig servicesConfig) {
if (!servicesConfig.isEnableDefaults()) {
return;
}
logger.finest("Registering default services...");
registerService(MapService.SERVICE_NAME, createService(MapService.class));
registerService(LockSupportService.SERVICE_NAME, new LockSupportServiceImpl(nodeEngine));
registerService(QueueService.SERVICE_NAME, new QueueService(nodeEngine));
registerService(TopicService.SERVICE_NAME, new TopicService());
registerService(ReliableTopicService.SERVICE_NAME, new ReliableTopicService(nodeEngine));
registerService(MultiMapService.SERVICE_NAME, new MultiMapService(nodeEngine));
registerService(ListService.SERVICE_NAME, new ListService(nodeEngine));
registerService(SetService.SERVICE_NAME, new SetService(nodeEngine));
registerService(DistributedExecutorService.SERVICE_NAME, new DistributedExecutorService());
registerService(DistributedDurableExecutorService.SERVICE_NAME, new DistributedDurableExecutorService(nodeEngine));
registerService(FlakeIdGeneratorService.SERVICE_NAME, new FlakeIdGeneratorService(nodeEngine));
registerService(ReplicatedMapService.SERVICE_NAME, new ReplicatedMapService(nodeEngine));
registerService(RingbufferService.SERVICE_NAME, new RingbufferService(nodeEngine));
registerService(XAService.SERVICE_NAME, new XAService(nodeEngine));
registerService(CardinalityEstimatorService.SERVICE_NAME, new CardinalityEstimatorService());
registerService(PNCounterService.SERVICE_NAME, new PNCounterService());
registerService(CRDTReplicationMigrationService.SERVICE_NAME, new CRDTReplicationMigrationService());
registerService(DistributedScheduledExecutorService.SERVICE_NAME, new DistributedScheduledExecutorService());
registerService(MetricsService.SERVICE_NAME, new MetricsService(nodeEngine));
registerCacheServiceIfAvailable();
readServiceDescriptors();
}
use of com.hazelcast.cardinality.impl.CardinalityEstimatorService in project hazelcast by hazelcast.
the class CardinalityEstimatorBackupTest method readEstimate.
private long readEstimate(final HazelcastInstance instance) {
final OperationServiceImpl operationService = (OperationServiceImpl) getOperationService(instance);
final CardinalityEstimatorService cardinalityEstimatorService = getNodeEngineImpl(instance).getService(CardinalityEstimatorService.SERVICE_NAME);
final CardinalityEstimatorBackupTest.GetEstimate task = new CardinalityEstimatorBackupTest.GetEstimate(cardinalityEstimatorService);
operationService.execute(task);
assertOpenEventually(task.latch);
return task.value;
}
use of com.hazelcast.cardinality.impl.CardinalityEstimatorService in project hazelcast by hazelcast.
the class ReplicationOperation method run.
@Override
public void run() throws Exception {
CardinalityEstimatorService service = getService();
for (Map.Entry<String, CardinalityEstimatorContainer> entry : migrationData.entrySet()) {
String name = entry.getKey();
service.addCardinalityEstimator(name, entry.getValue());
}
}
use of com.hazelcast.cardinality.impl.CardinalityEstimatorService in project hazelcast by hazelcast.
the class CardinalityEstimatorTestUtil method getBackupEstimate.
/**
* Returns the backup estimation of an {@link CardinalityEstimator} by a given cardinality estimator name.
* <p>
* Note: You have to provide the {@link HazelcastInstance} you want to retrieve the backups from.
* Use {@link getBackupInstance} to retrieve the backup instance for a given replica index.
*
* @param backupInstance the {@link HazelcastInstance} to retrieve the backup estimation from
* @param estimatorName the cardinality estimator name
* @return the backup estimation
*/
static long getBackupEstimate(HazelcastInstance backupInstance, String estimatorName) {
NodeEngineImpl nodeEngine = getNodeEngineImpl(backupInstance);
CardinalityEstimatorService service = nodeEngine.getService(CardinalityEstimatorService.SERVICE_NAME);
CardinalityEstimatorContainer container = service.getCardinalityEstimatorContainer(estimatorName);
return container.estimate();
}
Aggregations