/**
   * {@inheritDoc}
   *
   * @param ctx
   */
  @Override
  public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException {
    super.prepareMarshal(ctx);

    GridCacheContext cctx = ctx.cacheContext(cacheId);

    prepareMarshalCacheObjects(keys, cctx);

    if (op == TRANSFORM) entryProcessorsBytes = marshalCollection(entryProcessors, ctx);
    else prepareMarshalCacheObjects(vals, cctx);

    if (filter != null) {
      boolean hasFilter = false;

      for (CacheEntryPredicate p : filter) {
        if (p != null) {
          hasFilter = true;

          p.prepareMarshal(cctx);
        }
      }

      if (!hasFilter) filter = null;
    }

    invokeArgsBytes = marshalInvokeArguments(invokeArgs, ctx);

    if (expiryPlc != null)
      expiryPlcBytes = CU.marshal(ctx, new IgniteExternalizableExpiryPolicy(expiryPlc));
  }
  /** {@inheritDoc} */
  @Override
  public void prepareMarshal(GridCacheContext<K, V> ctx) throws GridException {
    super.prepareMarshal(ctx);

    if (entries != null) {
      if (ctx.deploymentEnabled()) prepareObjects(entries, ctx);

      entriesBytes = ctx.marshaller().marshal(entries);
    }
  }
示例#3
0
  /** {@inheritDoc} */
  @Override
  protected void clone0(GridTcpCommunicationMessageAdapter _msg) {
    super.clone0(_msg);

    GridCacheDgcRequest _clone = (GridCacheDgcRequest) _msg;

    _clone.map = map;
    _clone.mapBytes = mapBytes;
    _clone.rmvLocks = rmvLocks;
  }
  /** {@inheritDoc} */
  @Override
  protected void clone0(GridTcpCommunicationMessageAdapter _msg) {
    super.clone0(_msg);

    GridCacheEvictionRequest _clone = (GridCacheEvictionRequest) _msg;

    _clone.futId = futId;
    _clone.entries = entries;
    _clone.entriesBytes = entriesBytes;
    _clone.topVer = topVer;
  }
  /** {@inheritDoc} */
  @Override
  protected void clone0(GridTcpCommunicationMessageAdapter _msg) {
    super.clone0(_msg);

    GridCacheEvictionResponse _clone = (GridCacheEvictionResponse) _msg;

    _clone.futId = futId;
    _clone.rejectedKeys = rejectedKeys;
    _clone.rejectedKeyBytes = rejectedKeyBytes;
    _clone.err = err;
  }
  /** {@inheritDoc} */
  @Override
  public void finishUnmarshal(GridCacheContext<K, V> ctx, ClassLoader ldr) throws GridException {
    super.finishUnmarshal(ctx, ldr);

    if (errBytes != null) err = ctx.marshaller().unmarshal(errBytes, ldr);

    metadata = unmarshalCollection(metaDataBytes, ctx, ldr);
    data =
        fields
            ? unmarshalFieldsCollection(dataBytes, ctx, ldr)
            : unmarshalCollection(dataBytes, ctx, ldr);
  }
示例#7
0
  /** {@inheritDoc} */
  @Override
  public void prepareMarshal(GridCacheContext<K, V> ctx) throws GridException {
    super.prepareMarshal(ctx);

    if (map != null) {
      if (ctx.deploymentEnabled()) {
        for (K key : map.keySet()) prepareObject(key, ctx);
      }

      mapBytes = CU.marshal(ctx, map);
    }
  }
  /** {@inheritDoc} */
  @Override
  protected void clone0(GridTcpCommunicationMessageAdapter _msg) {
    super.clone0(_msg);

    GridCacheQueryResponse _clone = (GridCacheQueryResponse) _msg;

    _clone.finished = finished;
    _clone.reqId = reqId;
    _clone.err = err;
    _clone.errBytes = errBytes;
    _clone.fields = fields;
    _clone.metaDataBytes = metaDataBytes;
    _clone.metadata = metadata;
    _clone.dataBytes = dataBytes;
    _clone.data = data;
  }
  /** {@inheritDoc} */
  @Override
  public void prepareMarshal(GridCacheContext<K, V> ctx) throws GridException {
    super.prepareMarshal(ctx);

    if (err != null) errBytes = ctx.marshaller().marshal(err);

    metaDataBytes = marshalCollection(metadata, ctx);
    dataBytes = fields ? marshalFieldsCollection(data, ctx) : marshalCollection(data, ctx);

    if (ctx.deploymentEnabled() && !F.isEmpty(data)) {
      for (Object o : data) {
        if (o instanceof Map.Entry) {
          Map.Entry e = (Map.Entry) o;

          prepareObject(e.getKey(), ctx);
          prepareObject(e.getValue(), ctx);
        }
      }
    }
  }
  /** {@inheritDoc} */
  @Override
  public void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr)
      throws IgniteCheckedException {
    super.finishUnmarshal(ctx, ldr);

    GridCacheContext cctx = ctx.cacheContext(cacheId);

    finishUnmarshalCacheObjects(keys, cctx, ldr);

    if (op == TRANSFORM) entryProcessors = unmarshalCollection(entryProcessorsBytes, ctx, ldr);
    else finishUnmarshalCacheObjects(vals, cctx, ldr);

    if (filter != null) {
      for (CacheEntryPredicate p : filter) {
        if (p != null) p.finishUnmarshal(cctx, ldr);
      }
    }

    invokeArgs = unmarshalInvokeArguments(invokeArgsBytes, ctx, ldr);

    if (expiryPlcBytes != null) expiryPlc = ctx.marshaller().unmarshal(expiryPlcBytes, ldr);
  }
  /** {@inheritDoc} */
  @Override
  public void finishUnmarshal(GridCacheContext<K, V> ctx, ClassLoader ldr) throws GridException {
    super.finishUnmarshal(ctx, ldr);

    if (entriesBytes != null) entries = ctx.marshaller().unmarshal(entriesBytes, ldr);
  }
  /** {@inheritDoc} */
  @Override
  public void finishUnmarshal(GridCacheContext<K, V> ctx, ClassLoader ldr) throws GridException {
    super.finishUnmarshal(ctx, ldr);

    rejectedKeys = unmarshalCollection(rejectedKeyBytes, ctx, ldr);
  }
  /** {@inheritDoc} */
  @Override
  public void prepareMarshal(GridCacheContext<K, V> ctx) throws GridException {
    super.prepareMarshal(ctx);

    rejectedKeyBytes = marshalCollection(rejectedKeys, ctx);
  }