Exemplo n.º 1
0
  /**
   * Flushes every internal buffer if buffer was flushed before passed in threshold.
   *
   * <p>Does not wait for result and does not fail on errors assuming that this method should be
   * called periodically.
   */
  @Override
  public void tryFlush() throws GridInterruptedException {
    if (!busyLock.enterBusy()) return;

    try {
      for (Buffer buf : bufMappings.values()) buf.flush();

      lastFlushTime = U.currentTimeMillis();
    } finally {
      leaveBusy();
    }
  }
Exemplo n.º 2
0
 /** Enters busy lock. */
 private void enterBusy() {
   if (!busyLock.enterBusy()) throw new IllegalStateException("Data loader has been closed.");
 }