long local = localState.getTimestamp().getTime(); long server = serverState.getTimestamp().getTime();
long local = localState.getTimestamp().getTime(); long server = serverState.getTimestamp().getTime();
if (maximumTimestamp.compareTo(currentDataState.getTimestamp()) <= 0) { maximumTimestamp = new Date(maximumTimestamp.getTime() - intervalLength); && (maximumTimestamp.compareTo(currentDataState.getTimestamp()) <= 0)) { maximumTimestamp = localTimestamp;
if (maximumTimestamp.compareTo(currentDataState.getTimestamp()) <= 0) { maximumTimestamp = new Date(maximumTimestamp.getTime() - intervalLength); && (maximumTimestamp.compareTo(currentDataState.getTimestamp()) <= 0)) { maximumTimestamp = localTimestamp;
if (lastDate.compareTo(getReplicationState(endBound).getTimestamp()) >= 0) { return endBound; int comparison = lastDate.compareTo(getReplicationState(midPoint).getTimestamp()); if (comparison == 0) { && lastDate.compareTo(getReplicationState(startBound).getTimestamp()) >= 0) { return startBound; } else {
/** * {@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); }
calculateMaximumTimestamp(configuration, serverState.getTimestamp(), localState.getTimestamp()); LOG.fine("The maximum timestamp to be downloaded is " + maximumDownloadTimestamp + "."); if (localState.getTimestamp().compareTo(maximumDownloadTimestamp) >= 0) { break; if (fileReplicationState.getTimestamp().compareTo(maximumDownloadTimestamp) > 0) {
calculateMaximumTimestamp(configuration, serverState.getTimestamp(), localState.getTimestamp()); LOG.fine("The maximum timestamp to be downloaded is " + maximumDownloadTimestamp + "."); if (localState.getTimestamp().compareTo(maximumDownloadTimestamp) >= 0) { break; if (fileReplicationState.getTimestamp().compareTo(maximumDownloadTimestamp) > 0) {
Date intervalEnd; intervalEnd = new Date(currentDataState.getTimestamp().getTime() + intervalLength); intervalEnd = alignDateToIntervalBoundary(intervalEnd, intervalLength); currentDataState.setTimestamp(intervalEnd); while (replicationState.getTimestamp().compareTo(currentDataState.getTimestamp()) > 0) { currentDataState.setTimestamp(new Date(currentDataState.getTimestamp().getTime() + configuration.getIntervalLength())); LOG.finer("End of current interval is " + replicationState.getTimestamp()); currentDataState.setTimestamp(replicationState.getTimestamp());
Date intervalEnd; intervalEnd = new Date(currentDataState.getTimestamp().getTime() + intervalLength); intervalEnd = alignDateToIntervalBoundary(intervalEnd, intervalLength); currentDataState.setTimestamp(intervalEnd); while (replicationState.getTimestamp().compareTo(currentDataState.getTimestamp()) > 0) { currentDataState.setTimestamp(new Date(currentDataState.getTimestamp().getTime() + configuration.getIntervalLength())); LOG.finer("End of current interval is " + replicationState.getTimestamp()); currentDataState.setTimestamp(replicationState.getTimestamp());
replicationState.setTimestamp(serverReplicationState.getTimestamp()); replicationStateReceived = true;