use of org.apache.ignite.internal.processors.cache.CacheStoppedException in project ignite by apache.
the class IgniteTxStateImpl method topologyReadLock.
/**
* {@inheritDoc}
*/
@Override
public GridDhtTopologyFuture topologyReadLock(GridCacheSharedContext cctx, GridFutureAdapter<?> fut) {
if (activeCacheIds.isEmpty())
return cctx.exchange().lastTopologyFuture();
GridCacheContext<?, ?> nonLocCtx = null;
for (int i = 0; i < activeCacheIds.size(); i++) {
int cacheId = activeCacheIds.get(i);
GridCacheContext<?, ?> cacheCtx = cctx.cacheContext(cacheId);
if (!cacheCtx.isLocal()) {
nonLocCtx = cacheCtx;
break;
}
}
if (nonLocCtx == null)
return cctx.exchange().lastTopologyFuture();
nonLocCtx.topology().readLock();
if (nonLocCtx.topology().stopping()) {
fut.onDone(new CacheStoppedException(nonLocCtx.name()));
return null;
}
return nonLocCtx.topology().topologyVersionFuture();
}
Aggregations