use of com.hazelcast.collection.impl.set.SetService 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.collection.impl.set.SetService in project hazelcast by hazelcast.
the class PartitionControlledIdTest method testSet.
@Test
public void testSet() {
String partitionKey = "hazelcast";
HazelcastInstance hz = getHazelcastInstance(partitionKey);
ISet<String> set = hz.getSet("set@" + partitionKey);
set.add("");
assertEquals("set@" + partitionKey, set.getName());
assertEquals(partitionKey, set.getPartitionKey());
SetService service = getNodeEngine(hz).getService(SetService.SERVICE_NAME);
assertTrue(service.getContainerMap().containsKey(set.getName()));
}
use of com.hazelcast.collection.impl.set.SetService in project hazelcast by hazelcast.
the class SetKeyValueSource method open.
@Override
public boolean open(NodeEngine nodeEngine) {
NodeEngineImpl nei = (NodeEngineImpl) nodeEngine;
ss = nei.getSerializationService();
Address thisAddress = nei.getThisAddress();
InternalPartitionService ps = nei.getPartitionService();
Data data = ss.toData(setName, StringAndPartitionAwarePartitioningStrategy.INSTANCE);
int partitionId = ps.getPartitionId(data);
Address partitionOwner = ps.getPartitionOwner(partitionId);
if (partitionOwner == null) {
return false;
}
if (thisAddress.equals(partitionOwner)) {
SetService setService = nei.getService(SetService.SERVICE_NAME);
SetContainer setContainer = setService.getOrCreateContainer(setName, false);
List<CollectionItem> items = new ArrayList<CollectionItem>(setContainer.getCollection());
iterator = items.iterator();
}
return true;
}
Aggregations