use of org.apache.ignite.internal.processors.cache.mvcc.MvccSnapshotFuture in project ignite by apache.
the class GridNearTxLocal method requestSnapshot.
/**
* Requests version on coordinator.
*
* @return Future to wait for result.
*/
public IgniteInternalFuture<MvccSnapshot> requestSnapshot() {
if (isRollbackOnly())
return new GridFinishedFuture<>(rollbackException());
MvccSnapshot mvccSnapshot0 = mvccSnapshot;
if (mvccSnapshot0 != null)
return new GridFinishedFuture<>(mvccSnapshot0);
MvccProcessor prc = cctx.coordinators();
MvccCoordinator crd = prc.currentCoordinator();
synchronized (this) {
this.crdVer = crd.version();
}
if (crd.local())
mvccSnapshot0 = prc.requestWriteSnapshotLocal();
if (mvccSnapshot0 == null) {
MvccSnapshotFuture fut = new MvccTxSnapshotFuture();
prc.requestWriteSnapshotAsync(crd, fut);
return fut;
}
GridFutureAdapter<MvccSnapshot> fut = new GridFutureAdapter<>();
onResponse0(mvccSnapshot0, fut);
return fut;
}
Aggregations