Exemplo n.º 1
0
  protected boolean storeCheckpoint(DispatcherState curState, Checkpoint cp, SCN winScn)
      throws IOException {
    boolean debugEnabled = _log.isDebugEnabled();

    if (debugEnabled) _log.debug("About to store checkpoint");

    boolean success = true;

    // processBatch - returns false ; then
    ConsumerCallbackResult callbackResult = getAsyncCallback().onCheckpoint(winScn);
    boolean persistCheckpoint =
        !ConsumerCallbackResult.isSkipCheckpoint(callbackResult)
            && ConsumerCallbackResult.isSuccess(callbackResult);
    if (persistCheckpoint) {
      if (null != getCheckpointPersistor()) {
        getCheckpointPersistor().storeCheckpointV3(getSubsciptionsList(), cp, _registrationId);
        ++_numCheckPoints;
      }
      curState.storeCheckpoint(cp, winScn);
      removeEvents(curState);
      if (debugEnabled) _log.debug("Checkpoint saved: " + cp.toString());
    } else {
      if (debugEnabled)
        _log.debug("Checkpoint " + cp + " not saved as callback returned " + callbackResult);
    }
    return success;
  }