public PartitionScanRunner(MapServiceContext mapServiceContext) { this.mapServiceContext = mapServiceContext; this.nodeEngine = mapServiceContext.getNodeEngine(); this.serializationService = (InternalSerializationService) nodeEngine.getSerializationService(); this.partitionService = nodeEngine.getPartitionService(); this.logger = nodeEngine.getLogger(getClass()); this.operationService = nodeEngine.getOperationService(); this.clusterService = nodeEngine.getClusterService(); }
@Override public void put(K key, V value) { Data keyData = nodeEngine.toData(key); Data valueData = nodeEngine.toData(value); PutOperation operation = new PutOperation(name, keyData, valueData); int partitionId = nodeEngine.getPartitionService().getPartitionId(key); OperationService operationService = HazelcastTestUtils.getOperationService(nodeEngine.getHazelcastInstance()); operationService .<V>invokeOnPartition(SyntheticMapService.SERVICE_NAME, operation, partitionId) .getSafely(); }
private List<Integer> getOwnedPartitions() { IPartitionService partitionService = getNodeEngine().getPartitionService(); Map<Address, List<Integer>> memberPartitionsMap = partitionService.getMemberPartitionsMap(); List<Integer> ownedPartitions = memberPartitionsMap.get(getNodeEngine().getThisAddress()); return ownedPartitions == null ? Collections.<Integer>emptyList() : ownedPartitions; }
public MapIndexSynchronizer(MapServiceContext mapServiceContext, NodeEngine nodeEngine) { this.mapServiceContext = mapServiceContext; this.operationService = nodeEngine.getOperationService(); this.serializationService = nodeEngine.getSerializationService(); this.nodeEngine = nodeEngine; this.logger = nodeEngine.getLogger(getClass()); }
@Override public void init(NodeEngine nodeEngine, Properties properties) { this.nodeEngine = nodeEngine; this.localAddress = nodeEngine.getThisAddress(); for (int i = 0; i < orderingLocks.length; i++) { orderingLocks[i] = new ReentrantLock(); } eventService = nodeEngine.getEventService(); }
private void clearRemoteTransactions(Xid xid) { NodeEngine nodeEngine = getNodeEngine(); IPartitionService partitionService = nodeEngine.getPartitionService(); OperationService operationService = nodeEngine.getOperationService(); SerializableXID serializableXID = new SerializableXID(xid.getFormatId(), xid.getGlobalTransactionId(), xid.getBranchQualifier()); Data xidData = nodeEngine.toData(serializableXID); int partitionId = partitionService.getPartitionId(xidData); ClearRemoteTransactionOperation operation = new ClearRemoteTransactionOperation(xidData); operationService.invokeOnPartition(SERVICE_NAME, operation, partitionId); }
public ReplicatedMapService(NodeEngine nodeEngine) { this.nodeEngine = nodeEngine; this.config = nodeEngine.getConfig(); this.partitionService = (InternalPartitionServiceImpl) nodeEngine.getPartitionService(); this.clusterService = nodeEngine.getClusterService(); this.operationService = nodeEngine.getOperationService(); this.partitionContainers = new PartitionContainer[nodeEngine.getPartitionService().getPartitionCount()]; this.eventPublishingService = new ReplicatedMapEventPublishingService(this); this.splitBrainHandlerService = new ReplicatedMapSplitBrainHandlerService(this); this.quorumService = nodeEngine.getQuorumService(); this.mergePolicyProvider = new MergePolicyProvider(nodeEngine); }
ReplicatedMapProxy(NodeEngine nodeEngine, String name, ReplicatedMapService service, ReplicatedMapConfig config) { super(nodeEngine, service); this.name = name; this.nodeEngine = nodeEngine; this.service = service; this.eventPublishingService = service.getEventPublishingService(); this.serializationService = nodeEngine.getSerializationService(); this.partitionService = (InternalPartitionServiceImpl) nodeEngine.getPartitionService(); this.config = config; }
private void submit(UnlockOperation operation, Data key) { int partitionId = nodeEngine.getPartitionService().getPartitionId(key); OperationService operationService = nodeEngine.getOperationService(); operation.setPartitionId(partitionId); operation.setOperationResponseHandler(unlockResponseHandler); operation.setValidateTarget(false); operation.setAsyncBackup(true); operationService.invokeOnTarget(SERVICE_NAME, operation, nodeEngine.getThisAddress()); }
protected AbstractContainerCollector(NodeEngine nodeEngine) { this.operationExecutor = ((OperationServiceImpl) nodeEngine.getOperationService()).getOperationExecutor(); this.partitionService = nodeEngine.getPartitionService(); this.mergePolicyProvider = nodeEngine.getSplitBrainMergePolicyProvider(); }
TransactionalMultiMapProxySupport(NodeEngine nodeEngine, MultiMapService service, String name, Transaction tx) { super(nodeEngine, service, tx); this.name = name; this.config = nodeEngine.getConfig().findMultiMapConfig(name); this.operationService = nodeEngine.getOperationService(); this.partitionService = nodeEngine.getPartitionService(); }
public AbstractTransactionalCollectionProxy(String name, Transaction tx, NodeEngine nodeEngine, S service) { super(nodeEngine, service, tx); this.name = name; this.partitionId = nodeEngine.getPartitionService().getPartitionId(getNameAsPartitionAwareData()); this.operationService = nodeEngine.getOperationService(); }
@Override public void init(NodeEngine nodeEngine, Properties properties) { this.nodeEngine = checkNotNull(nodeEngine, "nodeEngine can't be null"); this.serializationService = nodeEngine.getSerializationService(); this.partitionService = nodeEngine.getPartitionService(); this.quorumService = nodeEngine.getQuorumService(); }
@Override protected InvocationBuilder createInvocationBuilder(Operation op) { OperationService operationService = getNodeEngine().getOperationService(); return operationService.createInvocationBuilder(SERVICE_NAME, op, getNodeEngine().getThisAddress()); }
@Override public boolean contains(Object o) { final NodeEngine nodeEngine = getNodeEngine(); final Data data = nodeEngine.toData(o); List<Data> dataSet = new ArrayList<Data>(1); dataSet.add(data); return containsInternal(dataSet); }
public Invalidator(String serviceName, IFunction<EventRegistration, Boolean> eventFilter, NodeEngine nodeEngine) { this.serviceName = serviceName; this.eventFilter = eventFilter; this.nodeEngine = nodeEngine; this.logger = nodeEngine.getLogger(getClass()); this.partitionService = nodeEngine.getPartitionService(); this.eventService = nodeEngine.getEventService(); this.partitionCount = nodeEngine.getPartitionService().getPartitionCount(); this.metaDataGenerator = new MetaDataGenerator(partitionCount); }
private boolean initCurrentMap() { if (currentMap == null) { String mapName = snapshotContext.currentMapName(); if (mapName == null) { return false; } currentMap = nodeEngine.getHazelcastInstance().getMap(mapName); this.currentSnapshotId = snapshotContext.currentSnapshotId(); } return true; }
public LocalMapStatsProvider(MapServiceContext mapServiceContext) { this.mapServiceContext = mapServiceContext; this.nodeEngine = mapServiceContext.getNodeEngine(); this.logger = nodeEngine.getLogger(getClass()); this.mapNearCacheManager = mapServiceContext.getMapNearCacheManager(); this.clusterService = nodeEngine.getClusterService(); this.partitionService = nodeEngine.getPartitionService(); this.localAddress = clusterService.getThisAddress(); }
public MultiMapService(NodeEngine nodeEngine) { this.nodeEngine = nodeEngine; int partitionCount = nodeEngine.getPartitionService().getPartitionCount(); this.partitionContainers = new MultiMapPartitionContainer[partitionCount]; this.dispatcher = new MultiMapEventsDispatcher(this, nodeEngine.getClusterService()); this.publisher = new MultiMapEventsPublisher(nodeEngine); this.quorumService = nodeEngine.getQuorumService(); }
@Override public void shutdown() { NodeEngine nodeEngine = getNodeEngine(); Collection<Member> members = nodeEngine.getClusterService().getMembers(); OperationService operationService = nodeEngine.getOperationService(); Collection<Future> calls = new LinkedList<Future>(); for (Member member : members) { Future f = submitShutdownOperation(operationService, member); calls.add(f); } waitWithDeadline(calls, 3, TimeUnit.SECONDS, shutdownExceptionHandler); }