Beispiel #1
0
  @Override
  protected void handleExceptionOnWrite(Exception e, Continuation<?, Exception> continuation) {
    LOG.debug(
        String.format(
            "handleExceptionOnWrite(Exception - %s, Continuation - %s)", e, continuation));
    if (!(e instanceof KoalaContentVersionMismatchException)) {
      LOG.debug(String.format("Processing version mismatch and passing it on to the parent."));
      super.handleExceptionOnWrite(e, continuation);
      return;
    }

    versionMismatchRetriesLeft--;
    if (versionMismatchRetriesLeft < 1) {
      String idInfoStr = null;
      if (updateStateObject != null && updateStateObject.getId() != null) {
        idInfoStr = updateStateObject.getId().toStringFull();
      }
      LOG.debug(String.format("No more retries left for write of %s", idInfoStr));
      super.handleExceptionOnWrite(
          new DhtOperationMaximumRetriesExceededException(
              String.format(
                  "Write of %s exceeded %d retries", idInfoStr, maxNumVersionMismatchRetries)),
          continuation);
      return;
    }

    try {
      Thread.sleep(getWaitTimeMillis());
    } catch (InterruptedException ie) {
      LOG.error(ie.getMessage(), ie);
    }
    doUpdate(updateStateObject);
  }
Beispiel #2
0
 @Override
 @Blocking
 public <T extends PiEntity> void put(PId id, T entity) {
   super.put(id, entity);
 }