protected boolean doStoreCheckpoint( DispatcherState curState, DbusEvent nextEvent, Checkpoint cp, SCN endWinScn) throws SharedCheckpointException { // drain all the callbacks ; if there are errors; then return false; prepare to rollback boolean success = processDataEventsBatch(curState); if (!success) { _log.error( "Consumers did not process callback successfully (callback did not return success). The current checkpoint= " + nextEvent.isCheckpointMessage() + " end of period marker=" + nextEvent.isEndOfPeriodMarker()); } else { try { // try to store checkpoint; if this doesn't succeed then still return true storeCheckpoint(curState, cp, endWinScn); } catch (IOException e) { _log.error("Checkpoint persisting failed, the checkpoint is : " + cp); if (isSharedCheckpoint()) { handleErrStoringSharedCheckpoint(); throw new SharedCheckpointException(e); } } } return success; }
protected boolean processDataEvent(DispatcherState curState, DbusEvent event) { ConsumerCallbackResult callbackResult = getAsyncCallback().onDataEvent(event, curState.getEventDecoder()); boolean success = ConsumerCallbackResult.isSuccess(callbackResult); if (!success) { _log.error("Method onDataEvent failed on consumer callback returned an error."); } else { _log.debug("Event queued: " + event.toString()); } return success; }
public static Checkpoint createOnlineConsumptionCheckpoint( long lastCompleteWindowScn, long lastEowTsNsecs, DispatcherState curState, DbusEvent event) { // TODO: What does this mean? "For online consumption ; this means that a complete event window // hasn't been read yet." // So until we have support from RelayPuller resuming from mid-window ; there is no point in // trying to save a parital window long windowScn = lastCompleteWindowScn; if (windowScn < 0) { if (event.isCheckpointMessage()) { // control event; then safe to set to sequence; useful when relayPuller writes checkpoint to // buffer to // be passed on to bootstrapPuller windowScn = event.sequence(); // TODO: According to DbusEventFactory.createCheckpointEvent, event,sequence() is always 0! // Is this even executed? If we send a checkpoint event from the relay, we could be screwed! } else { // there's no sufficient data: not a single window has been processed. windowScn = event.sequence() > 0 ? event.sequence() - 1 : 0; // TODO Can't do this math for timestamp. See DDSDBUS-3149 } } return Checkpoint.createOnlineConsumptionCheckpoint(windowScn, lastEowTsNsecs); }
protected boolean processSysEvent(DispatcherState curState, DbusEvent event) { _log.warn("Unknown system event: srcid=" + event.srcId()); return true; }
public void dumpEventValue(DbusEvent event, DbusEventDecoder eventDecoder) { if (!event.isEndOfPeriodMarker()) { eventDecoder.dumpEventValueInJSON(event, _writeChannel); } }