/** * {@inheritDoc} */ @Override protected void processComplete() { if (sinkActive) { LOG.finer("Closing change sink for interval with sequence number " + currentDataState.getSequenceNumber()); changeSink.complete(); replicationStore.saveState(currentDataState); changeSink.close(); changeSink = null; sinkActive = false; } }
/** * {@inheritDoc} */ @Override protected void processComplete() { if (sinkActive) { LOG.finer("Closing change sink for interval with sequence number " + currentDataState.getSequenceNumber()); changeSink.complete(); replicationStore.saveState(currentDataState); changeSink.close(); changeSink = null; sinkActive = false; } }
@Override public void complete() { if (state.getSequenceNumber() > 0) { // Complete the writing of the change file. changeWriter.complete(); changeWriter.close(); changeWriter = null; } // Write the sequenced state file. replicationStore.saveState(state); // We must only complete the state writer after we've finished writing // the replication data and sequence numbered state. stateWriter.complete(); }
/** * {@inheritDoc} */ @Override protected void processInitializeState(ReplicationState initialState) { Date initialDate; Date alignedDate; long intervalLength; intervalLength = getConfiguration().getIntervalLength(); initialDate = initialState.getTimestamp(); // Align the date to an interval boundary. alignedDate = alignDateToIntervalBoundary(initialDate, intervalLength); // If the date has been moved, then advance it to the next interval. We // do this because // during replication we never claim to have covered a time period that // we haven't received // data for. We may include extra data from a previous interval. By // advancing the stated // initial timestamp to the next interval our first replication will // include some data from // the previous interval. if (alignedDate.compareTo(initialDate) < 0) { alignedDate = new Date(alignedDate.getTime() + intervalLength); } // Create an initial replication state object. currentDataState = new ReplicationState(alignedDate, 0); // Write out the initial "0" state file. replicationStore.saveState(currentDataState); }
/** * {@inheritDoc} */ @Override protected void processInitializeState(ReplicationState initialState) { Date initialDate; Date alignedDate; long intervalLength; intervalLength = getConfiguration().getIntervalLength(); initialDate = initialState.getTimestamp(); // Align the date to an interval boundary. alignedDate = alignDateToIntervalBoundary(initialDate, intervalLength); // If the date has been moved, then advance it to the next interval. We // do this because // during replication we never claim to have covered a time period that // we haven't received // data for. We may include extra data from a previous interval. By // advancing the stated // initial timestamp to the next interval our first replication will // include some data from // the previous interval. if (alignedDate.compareTo(initialDate) < 0) { alignedDate = new Date(alignedDate.getTime() + intervalLength); } // Create an initial replication state object. currentDataState = new ReplicationState(alignedDate, 0); // Write out the initial "0" state file. replicationStore.saveState(currentDataState); }
@Override public void complete() { if (state.getSequenceNumber() > 0) { // Complete the writing of the change file. changeWriter.complete(); changeWriter.close(); changeWriter = null; } // Write the sequenced state file. replicationStore.saveState(state); // We must only complete the state writer after we've finished writing // the replication data and sequence numbered state. stateWriter.complete(); }
changeSink.close(); replicationStore.saveState(currentDataState);
changeSink.close(); replicationStore.saveState(currentDataState);