/** {@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);
  }
  /** {@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);
        }
      }
    }
  }