use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class PostJoinProxyOperation method run.
@Override
public void run() throws Exception {
if (proxies == null || proxies.size() <= 0) {
return;
}
NodeEngine nodeEngine = getNodeEngine();
ProxyServiceImpl proxyService = getService();
ExecutionService executionService = nodeEngine.getExecutionService();
for (final ProxyInfo proxy : proxies) {
final ProxyRegistry registry = proxyService.getOrCreateRegistry(proxy.getServiceName());
try {
executionService.execute(ExecutionService.SYSTEM_EXECUTOR, new CreateProxyTask(registry, proxy));
} catch (Throwable t) {
logProxyCreationFailure(proxy, t);
}
}
}
use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class XAResourceImpl method finalizeTransactionRemotely.
private void finalizeTransactionRemotely(Xid xid, boolean isCommit) throws XAException {
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);
FinalizeRemoteTransactionOperation operation = new FinalizeRemoteTransactionOperation(xidData, isCommit);
InternalCompletableFuture<Integer> future = operationService.invokeOnPartition(SERVICE_NAME, operation, partitionId);
Integer errorCode;
try {
errorCode = future.get();
} catch (Exception e) {
throw ExceptionUtil.rethrow(e);
}
if (errorCode != null) {
throw new XAException(errorCode);
}
}
use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class CollectRemoteTransactionsOperation method run.
@Override
public void run() throws Exception {
XAService xaService = getService();
NodeEngine nodeEngine = getNodeEngine();
Set<SerializableXID> xids = xaService.getPreparedXids();
List<Data> xidSet = new ArrayList<Data>();
for (SerializableXID xid : xids) {
xidSet.add(nodeEngine.toData(xid));
}
this.xidSet = new SerializableList(xidSet);
}
use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class PutRemoteTransactionOperation method run.
@Override
public void run() throws Exception {
XAService xaService = getService();
NodeEngine nodeEngine = getNodeEngine();
XATransaction transaction = new XATransaction(nodeEngine, records, txnId, xid, txOwnerUuid, timeoutMillis, startTime);
xaService.putTransaction(transaction);
}
use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class CacheRecordStoreTestSupport method createCacheRecordStore.
protected ICacheRecordStore createCacheRecordStore(HazelcastInstance instance, String cacheName, int partitionId, InMemoryFormat inMemoryFormat) {
NodeEngine nodeEngine = getNodeEngineImpl(instance);
ICacheService cacheService = getCacheService(instance);
CacheConfig cacheConfig = createCacheConfig(cacheName, inMemoryFormat);
cacheService.putCacheConfigIfAbsent(cacheConfig);
return new CacheRecordStore(CACHE_NAME_PREFIX + cacheName, partitionId, nodeEngine, (AbstractCacheService) cacheService);
}
Aggregations