Search in sources :

Example 1 with CardinalityEstimatorService

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();
}
Also used : DistributedDurableExecutorService(com.hazelcast.durableexecutor.impl.DistributedDurableExecutorService) XAService(com.hazelcast.transaction.impl.xa.XAService) CRDTReplicationMigrationService(com.hazelcast.internal.crdt.CRDTReplicationMigrationService) MetricsService(com.hazelcast.internal.metrics.impl.MetricsService) MultiMapService(com.hazelcast.multimap.impl.MultiMapService) SetService(com.hazelcast.collection.impl.set.SetService) ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) QueueService(com.hazelcast.collection.impl.queue.QueueService) FlakeIdGeneratorService(com.hazelcast.flakeidgen.impl.FlakeIdGeneratorService) ListService(com.hazelcast.collection.impl.list.ListService) TopicService(com.hazelcast.topic.impl.TopicService) ReliableTopicService(com.hazelcast.topic.impl.reliable.ReliableTopicService) DistributedScheduledExecutorService(com.hazelcast.scheduledexecutor.impl.DistributedScheduledExecutorService) ReliableTopicService(com.hazelcast.topic.impl.reliable.ReliableTopicService) LockSupportServiceImpl(com.hazelcast.internal.locksupport.LockSupportServiceImpl) DistributedExecutorService(com.hazelcast.executor.impl.DistributedExecutorService) RingbufferService(com.hazelcast.ringbuffer.impl.RingbufferService) MultiMapService(com.hazelcast.multimap.impl.MultiMapService) ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) MapService(com.hazelcast.map.impl.MapService) PNCounterService(com.hazelcast.internal.crdt.pncounter.PNCounterService) CardinalityEstimatorService(com.hazelcast.cardinality.impl.CardinalityEstimatorService)

Example 2 with CardinalityEstimatorService

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;
}
Also used : OperationServiceImpl(com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl) CardinalityEstimatorService(com.hazelcast.cardinality.impl.CardinalityEstimatorService)

Example 3 with CardinalityEstimatorService

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());
    }
}
Also used : Map(java.util.Map) MapUtil.createHashMap(com.hazelcast.internal.util.MapUtil.createHashMap) CardinalityEstimatorService(com.hazelcast.cardinality.impl.CardinalityEstimatorService) CardinalityEstimatorContainer(com.hazelcast.cardinality.impl.CardinalityEstimatorContainer)

Example 4 with CardinalityEstimatorService

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();
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) Accessors.getNodeEngineImpl(com.hazelcast.test.Accessors.getNodeEngineImpl) CardinalityEstimatorService(com.hazelcast.cardinality.impl.CardinalityEstimatorService) CardinalityEstimatorContainer(com.hazelcast.cardinality.impl.CardinalityEstimatorContainer)

Aggregations

CardinalityEstimatorService (com.hazelcast.cardinality.impl.CardinalityEstimatorService)4 CardinalityEstimatorContainer (com.hazelcast.cardinality.impl.CardinalityEstimatorContainer)2 ListService (com.hazelcast.collection.impl.list.ListService)1 QueueService (com.hazelcast.collection.impl.queue.QueueService)1 SetService (com.hazelcast.collection.impl.set.SetService)1 DistributedDurableExecutorService (com.hazelcast.durableexecutor.impl.DistributedDurableExecutorService)1 DistributedExecutorService (com.hazelcast.executor.impl.DistributedExecutorService)1 FlakeIdGeneratorService (com.hazelcast.flakeidgen.impl.FlakeIdGeneratorService)1 CRDTReplicationMigrationService (com.hazelcast.internal.crdt.CRDTReplicationMigrationService)1 PNCounterService (com.hazelcast.internal.crdt.pncounter.PNCounterService)1 LockSupportServiceImpl (com.hazelcast.internal.locksupport.LockSupportServiceImpl)1 MetricsService (com.hazelcast.internal.metrics.impl.MetricsService)1 MapUtil.createHashMap (com.hazelcast.internal.util.MapUtil.createHashMap)1 MapService (com.hazelcast.map.impl.MapService)1 MultiMapService (com.hazelcast.multimap.impl.MultiMapService)1 ReplicatedMapService (com.hazelcast.replicatedmap.impl.ReplicatedMapService)1 RingbufferService (com.hazelcast.ringbuffer.impl.RingbufferService)1 DistributedScheduledExecutorService (com.hazelcast.scheduledexecutor.impl.DistributedScheduledExecutorService)1 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)1 OperationServiceImpl (com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl)1