/** {@inheritDoc} */
  @Override
  public void printMemoryStats(int threshold) {
    X.println(
        ">>>  Cache partition topology stats [grid="
            + cctx.gridName()
            + ", cache="
            + cctx.name()
            + ']');

    for (GridDhtLocalPartition part : locParts.values()) {
      int size = part.size();

      if (size >= threshold)
        X.println(">>>   Local partition [part=" + part.id() + ", size=" + size + ']');
    }
  }
Esempio n. 2
0
    /**
     * Closes the pipe. No more data will be allowed to be written to this Pipe's WriteHead. Any
     * blocked {@link DataPipe.Source#readAll()} will return whatever data they can, and other
     * blocked {@link DataPipe.Source#read()} will immediately return null following this call even
     * if they cannot get data (these two processes still happen in fair order). All subsequent
     * reads (blocking or nonblocking) will either return data immediately as long as any is still
     * buffered in the pipe, and then forevermore immediately return null once all buffered data is
     * depleted.
     */
    public void close() {
      lockWrite();
      try {
        $gate.close();
      } finally {
        unlockWrite();
      }
      X.notifyAll($gate); // trigger the return of any final readAll calls

      // give our listener a chance to notice our closure.
      invokeListener($el);
    }
  /** @return {@code True} if succeeded. */
  private boolean spreadPartitions() {
    try {
      sendAllPartitions(rmtNodes, exchId);

      return true;
    } catch (IgniteCheckedException e) {
      scheduleRecheck();

      if (!X.hasCause(e, InterruptedException.class))
        U.error(
            log,
            "Failed to send full partition map to nodes (will retry after timeout) [nodes="
                + F.nodeId8s(rmtNodes)
                + ", exchangeId="
                + exchId
                + ']',
            e);

      return false;
    }
  }