private boolean shouldCheckpoint() { return !recovering && !checkpointStepInProgress && (curTxState.getState() != CheckPointState.State.COMMITTED || checkpointIntervalElapsed()); }
private void handleCheckpointAck() { CheckPointState nextState = curTxState.nextState(false); saveTxState(nextState); }
@Override public void ack(Object msgId) { try { _spout.ack(msgId); } catch (AbstractMethodError ignored) { } }
/** * Emits a tuple to the specified output stream with a null message id. * Storm will not track this message so ack and fail will never be called * for this tuple. The emitted values must be immutable. */ public List<Integer> emit(String streamId, List<Object> tuple) { return emit(streamId, tuple, null); }
/** * Emits a tuple to the specified task on the default output stream. This * output stream must have been declared as a direct stream, and the * specified task must use a direct grouping on this stream to receive the * message. The emitted values must be immutable. */ public void emitDirect(int taskId, List<Object> tuple, Object messageId) { emitDirect(taskId, Utils.DEFAULT_STREAM_ID, tuple, messageId); }
@Override public Fields getOutputFields() { return scheme.getOutputFields(); } }
@Override public void reportError(Throwable error) { _collector.reportError(error); } }
@Override public void close() { try { _spout.close(); } catch (AbstractMethodError ignored) { } }
@Override public void fail(Object msgId) { try { _spout.fail(msgId); } catch (AbstractMethodError ignored) { } }
@Override public void nextTuple() { try { _spout.nextTuple(); } catch (AbstractMethodError ignored) { } }
private void handleRecovery() { LOG.debug("In recovery"); Action action = curTxState.nextAction(true); emit(curTxState.getTxid(), action); }
@Override public void activate() { try { _spout.activate(); } catch (AbstractMethodError ignored) { } }
@Override public void deactivate() { try { _spout.deactivate(); } catch (AbstractMethodError ignored) { } } }
@Override public int hashCode() { int result = (int) (txid ^ (txid >>> 32)); result = 31 * result + (state != null ? state.hashCode() : 0); return result; }
@Override public void emitBarrier() { _delegate.emitBarrier(); } }
/** * Emits a tuple to the specified task on the specified output stream. This * output stream must have been declared as a direct stream, and the * specified task must use a direct grouping on this stream to receive the * message. The emitted values must be immutable. */ public void emitDirect(int taskId, String streamId, List<Object> tuple, Object messageId) { _delegate.emitDirect(taskId, streamId, tuple, messageId); }
@Override public int hashCode() { int result = action != null ? action.hashCode() : 0; result = 31 * result + (int) (txid ^ (txid >>> 32)); return result; }
@Override public List<Integer> emitCtrl(String streamId, List<Object> tuple, Object messageId) { return delegate.emitCtrl(streamId, tuple, messageId); } }
/** * Emits a tuple to the default output stream with a null message id. Storm * will not track this message so ack and fail will never be called for this * tuple. The emitted values must be immutable. */ public List<Integer> emit(List<Object> tuple) { return emit(tuple, null); }
private void handleRecoveryAck() { CheckPointState nextState = curTxState.nextState(true); if (curTxState != nextState) { saveTxState(nextState); } else { LOG.debug("Recovery complete, current state {}", curTxState); recovering = false; } }