use of com.hazelcast.replicatedmap.impl.ReplicatedMapService in project hazelcast by hazelcast.
the class TimedMemberStateFactory method createMemState.
private void createMemState(MemberStateImpl memberState, Collection<StatisticsAwareService> services) {
Config config = instance.getConfig();
for (StatisticsAwareService service : services) {
if (service instanceof MapService) {
handleMap(memberState, ((MapService) service).getStats());
} else if (service instanceof MultiMapService) {
handleMultiMap(memberState, ((MultiMapService) service).getStats());
} else if (service instanceof QueueService) {
handleQueue(memberState, ((QueueService) service).getStats());
} else if (service instanceof TopicService) {
handleTopic(memberState, ((TopicService) service).getStats());
} else if (service instanceof ReliableTopicService) {
handleReliableTopic(memberState, ((ReliableTopicService) service).getStats());
} else if (service instanceof DistributedExecutorService) {
handleExecutorService(memberState, config, ((DistributedExecutorService) service).getStats());
} else if (service instanceof DistributedScheduledExecutorService) {
handleScheduledExecutorService(memberState, config, ((DistributedScheduledExecutorService) service).getStats());
} else if (service instanceof DistributedDurableExecutorService) {
handleDurableExecutorService(memberState, config, ((DistributedDurableExecutorService) service).getStats());
} else if (service instanceof ReplicatedMapService) {
handleReplicatedMap(memberState, config, ((ReplicatedMapService) service).getStats());
} else if (service instanceof PNCounterService) {
handlePNCounter(memberState, config, ((PNCounterService) service).getStats());
} else if (service instanceof FlakeIdGeneratorService) {
handleFlakeIdGenerator(memberState, config, ((FlakeIdGeneratorService) service).getStats());
} else if (service instanceof CacheService) {
handleCache(memberState, (CacheService) service);
}
}
WanReplicationService wanReplicationService = instance.node.nodeEngine.getWanReplicationService();
Map<String, LocalWanStats> wanStats = wanReplicationService.getStats();
if (wanStats != null) {
handleWan(memberState, wanStats);
}
}
use of com.hazelcast.replicatedmap.impl.ReplicatedMapService in project hazelcast by hazelcast.
the class ReplicationOperation method run.
@Override
public void run() throws Exception {
ILogger logger = getLogger();
if (logger.isFineEnabled()) {
logger.fine("Moving replicated map (partitionId " + getPartitionId() + ") from " + getCallerAddress() + " to the new owner " + getNodeEngine().getThisAddress());
}
ReplicatedMapService service = getService();
if (data == null) {
return;
}
fillRecordStoreWithRecords(service);
}
use of com.hazelcast.replicatedmap.impl.ReplicatedMapService in project hazelcast by hazelcast.
the class SizeOperation method run.
@Override
public void run() throws Exception {
ReplicatedMapService service = getService();
Collection<ReplicatedRecordStore> stores = service.getAllReplicatedRecordStores(name);
int size = 0;
for (ReplicatedRecordStore store : stores) {
size += store.size();
}
response = size;
}
use of com.hazelcast.replicatedmap.impl.ReplicatedMapService in project hazelcast by hazelcast.
the class PutAllOperation method run.
@Override
public void run() throws Exception {
ReplicatedMapService service = getService();
ReplicatedRecordStore store = service.getReplicatedRecordStore(name, true, getPartitionId());
int partitionId = getPartitionId();
IPartitionService partitionService = getNodeEngine().getPartitionService();
ReplicatedMapEventPublishingService eventPublishingService = service.getEventPublishingService();
for (int i = 0; i < entries.size(); i++) {
Data key = entries.getKey(i);
Data value = entries.getValue(i);
if (partitionId != partitionService.getPartitionId(key)) {
continue;
}
Object putResult = store.put(key, value);
Data oldValue = getNodeEngine().toData(putResult);
eventPublishingService.fireEntryListenerEvent(key, oldValue, value, name, getCallerAddress());
VersionResponsePair response = new VersionResponsePair(putResult, store.getVersion());
publishReplicationMessage(key, value, response);
}
}
use of com.hazelcast.replicatedmap.impl.ReplicatedMapService in project hazelcast by hazelcast.
the class RequestMapDataOperation method run.
@Override
public void run() throws Exception {
ILogger logger = getLogger();
Address callerAddress = getCallerAddress();
int partitionId = getPartitionId();
NodeEngine nodeEngine = getNodeEngine();
if (logger.isFineEnabled()) {
logger.fine("Caller " + callerAddress + " requested copy of replicated map '" + name + "' (partitionId " + partitionId + ") from " + nodeEngine.getThisAddress());
}
ReplicatedMapService service = getService();
PartitionContainer container = service.getPartitionContainer(partitionId);
ReplicatedRecordStore store = container.getOrCreateRecordStore(name);
store.setLoaded(true);
if (nodeEngine.getThisAddress().equals(callerAddress)) {
return;
}
long version = store.getVersion();
Set<RecordMigrationInfo> recordSet = getRecordSet(store);
Operation op = new SyncReplicatedMapDataOperation(name, recordSet, version).setPartitionId(partitionId).setValidateTarget(false);
OperationService operationService = nodeEngine.getOperationService();
operationService.createInvocationBuilder(SERVICE_NAME, op, callerAddress).setTryCount(INVOCATION_TRY_COUNT).invoke();
}
Aggregations