Ejemplo n.º 1
0
  /** {@inheritDoc} */
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    boolean done;
    boolean cancelled;
    Object res;
    Throwable err;
    boolean syncNotify;
    boolean concurNotify;

    synchronized (mux) {
      done = this.done;
      cancelled = this.cancelled;
      res = this.res;
      err = this.err;
      syncNotify = this.syncNotify;
      concurNotify = this.concurNotify;
    }

    out.writeBoolean(done);
    out.writeBoolean(syncNotify);
    out.writeBoolean(concurNotify);

    // Don't write any further if not done, as deserialized future
    // will be invalid anyways.
    if (done) {
      out.writeBoolean(cancelled);
      out.writeObject(res);
      out.writeObject(err);
    }
  }
Ejemplo n.º 2
0
  /** {@inheritDoc} */
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    U.writeString(out, jobName);
    U.writeString(out, user);

    out.writeBoolean(hasCombiner);
    out.writeInt(numReduces);

    U.writeStringMap(out, props);
  }
Ejemplo n.º 3
0
  /** {@inheritDoc} */
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    out.writeInt(id);

    boolean writable = innerSplit instanceof Writable;

    out.writeUTF(writable ? innerSplit.getClass().getName() : null);

    if (writable) ((Writable) innerSplit).write(out);
    else out.writeObject(innerSplit);
  }
  /** {@inheritDoc} */
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    GridUtils.writeUuid(out, nodeId);

    CU.writeVersion(out, ver);

    out.writeLong(timeout);
    out.writeLong(threadId);
    out.writeLong(id);
    out.writeShort(flags());
  }
Ejemplo n.º 5
0
  /** {@inheritDoc} */
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    out.writeBoolean(depEnabled);

    if (depEnabled) {
      U.writeByteArray(out, topicBytes);
      U.writeByteArray(out, predBytes);
      U.writeString(out, clsName);
      out.writeObject(depInfo);
    } else {
      out.writeObject(topic);
      out.writeObject(pred);
    }
  }
 /**
  * @param out Output stream.
  * @param err Error cause.
  */
 private void sendErrorResponse(ObjectOutput out, Exception err) {
   try {
     out.writeObject(new IpcSharedMemoryInitResponse(err));
   } catch (IOException e) {
     U.error(log, "Failed to send error response to client.", e);
   }
 }
Ejemplo n.º 7
0
  /**
   * @param out Object output.
   * @throws IOException If failed.
   */
  @SuppressWarnings("TypeMayBeWeakened")
  private void writeFieldsCollection(ObjectOutput out) throws IOException {
    assert fields;

    out.writeInt(data != null ? data.size() : -1);

    if (data == null) return;

    for (Object o : data) {
      List<GridIndexingEntity<?>> list = (List<GridIndexingEntity<?>>) o;

      out.writeInt(list.size());

      for (GridIndexingEntity<?> idxEnt : list) {
        try {
          out.writeObject(idxEnt.value());
        } catch (GridSpiException e) {
          throw new IOException("Failed to write indexing entity: " + idxEnt, e);
        }
      }
    }
  }
  /** {@inheritDoc} */
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    super.writeExternal(out);

    out.writeLong(topVer);
    out.writeBoolean(implicitTx);
    out.writeBoolean(implicitSingleTx);
    out.writeBoolean(syncCommit);
    out.writeBoolean(syncRollback);
    out.writeObject(filterBytes);

    U.writeArray(out, dhtVers);

    assert miniId != null;

    U.writeGridUuid(out, miniId);
  }
 /** {@inheritDoc} */
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeUTF(grp);
   out.writeUTF(name);
   writeValue(out);
 }
Ejemplo n.º 10
0
 /** {@inheritDoc} */
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeObject(key);
   out.writeObject(val);
 }
 /** {@inheritDoc} */
 @Override
 public void writeExternal(ObjectOutput out) throws IOException {
   out.writeObject(ctx);
   out.writeUTF(name);
 }
Ejemplo n.º 12
0
  /** {@inheritDoc} */
  @Override
  public void writeExternal(ObjectOutput out) throws IOException {
    out.writeLong(createTime);
    out.writeLong(readTime);
    out.writeLong(writeTime);
    out.writeLong(commitTime);
    out.writeLong(rollbackTime);

    out.writeInt(reads);
    out.writeInt(writes);
    out.writeInt(hits);
    out.writeInt(misses);
    out.writeInt(txCommits);
    out.writeInt(txRollbacks);
  }