use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class MultiMapKeyValueSource method open.
@Override
public boolean open(NodeEngine nodeEngine) {
NodeEngineImpl nei = (NodeEngineImpl) nodeEngine;
IPartitionService ps = nei.getPartitionService();
MultiMapService multiMapService = nei.getService(MultiMapService.SERVICE_NAME);
ss = nei.getSerializationService();
Address partitionOwner = ps.getPartitionOwner(partitionId);
if (partitionOwner == null) {
return false;
}
multiMapContainer = multiMapService.getOrCreateCollectionContainer(partitionId, multiMapName);
isBinary = multiMapContainer.getConfig().isBinary();
keyIterator = multiMapContainer.keySet().iterator();
return true;
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class ParkedOperation method isCallTimedOut.
public boolean isCallTimedOut() {
final NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
InternalOperationService operationService = nodeEngine.getOperationService();
if (operationService.isCallTimedOut(op)) {
cancel(new CallTimeoutResponse(op.getCallId(), op.isUrgent()));
return true;
}
return false;
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class Backup method afterRun.
@Override
public void afterRun() throws Exception {
if (!valid || !sync || getCallId() == 0 || originalCaller == null) {
return;
}
NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
long callId = getCallId();
OperationServiceImpl operationService = (OperationServiceImpl) nodeEngine.getOperationService();
if (nodeEngine.getThisAddress().equals(originalCaller)) {
operationService.getInboundResponseHandler().notifyBackupComplete(callId);
} else {
BackupAckResponse backupAckResponse = new BackupAckResponse(callId, backupOp.isUrgent());
operationService.getOutboundResponseHandler().send(backupAckResponse, originalCaller);
}
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class PostJoinRegistrationOperation method run.
@Override
public void run() throws Exception {
if (registrations == null || registrations.size() <= 0) {
return;
}
NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
EventServiceImpl eventService = (EventServiceImpl) nodeEngine.getEventService();
for (Registration reg : registrations) {
eventService.handleRegistration(reg);
}
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class InternalCacheRecordStoreTest method verifyPrimaryState.
private void verifyPrimaryState(Node node, String fullCacheName, int partitionId, boolean expectedState) throws Exception {
NodeEngineImpl nodeEngine = node.getNodeEngine();
InternalOperationService operationService = nodeEngine.getOperationService();
Future<Boolean> isPrimaryOnNode = operationService.invokeOnTarget(ICacheService.SERVICE_NAME, createCacheOwnerStateGetterOperation(fullCacheName, partitionId), node.getThisAddress());
assertEquals(expectedState, isPrimaryOnNode.get());
}
Aggregations