コード例 #1
0
  /**
   * @param nodeId Node ID.
   * @param res Response.
   */
  private void processLockResponse(UUID nodeId, GridNearLockResponse<K, V> res) {
    assert nodeId != null;
    assert res != null;

    GridNearLockFuture<K, V> fut =
        (GridNearLockFuture<K, V>) ctx.mvcc().<Boolean>future(res.version().id(), res.futureId());

    if (fut != null) fut.onResult(nodeId, res);
  }
コード例 #2
0
  /** {@inheritDoc} */
  @Override
  protected GridFuture<Boolean> lockAllAsync(
      Collection<? extends K> keys,
      long timeout,
      GridCacheTxLocalEx<K, V> tx,
      boolean isInvalidate,
      boolean isRead,
      boolean retval,
      GridCacheTxIsolation isolation,
      GridPredicate<? super GridCacheEntry<K, V>>[] filter) {
    GridNearLockFuture<K, V> fut =
        new GridNearLockFuture<K, V>(
            ctx, keys, (GridNearTxLocal<K, V>) tx, isRead, retval, timeout, filter);

    if (!ctx.mvcc().addFuture(fut)) throw new IllegalStateException("Duplicate future ID: " + fut);

    fut.map();

    return fut;
  }