@Override public void initialize(Map<String, Object> metaData) { if (lockObtained) { throw new OsmosisRuntimeException("initialize has already been called"); } // Lock the working directory. fileLock.lock(); lockObtained = true; // Get the replication state from the upstream task. if (!metaData.containsKey(ReplicationState.META_DATA_KEY)) { throw new OsmosisRuntimeException("No replication state has been provided in metadata key " + ReplicationState.META_DATA_KEY + "."); } state = (ReplicationState) metaData.get(ReplicationState.META_DATA_KEY); // Populate the state from the existing state if it exists. if (statePersistor.exists()) { state.load(statePersistor.loadMap()); // The current sequence number must now be incremented. state.setSequenceNumber(state.getSequenceNumber() + 1); if (LOG.isLoggable(Level.FINER)) { LOG.finer("Replication sequence number is " + state.getSequenceNumber() + "."); } } }
@Override public void initialize(Map<String, Object> metaData) { if (lockObtained) { throw new OsmosisRuntimeException("initialize has already been called"); } // Lock the working directory. fileLock.lock(); lockObtained = true; // Get the replication state from the upstream task. if (!metaData.containsKey(ReplicationState.META_DATA_KEY)) { throw new OsmosisRuntimeException("No replication state has been provided in metadata key " + ReplicationState.META_DATA_KEY + "."); } state = (ReplicationState) metaData.get(ReplicationState.META_DATA_KEY); // Populate the state from the existing state if it exists. if (statePersistor.exists()) { state.load(statePersistor.loadMap()); // The current sequence number must now be incremented. state.setSequenceNumber(state.getSequenceNumber() + 1); if (LOG.isLoggable(Level.FINER)) { LOG.finer("Replication sequence number is " + state.getSequenceNumber() + "."); } } }
/** * {@inheritDoc} */ public void initialize(Map<String, Object> metaData) { // Get the replication state from the upstream task. if (!metaData.containsKey(ReplicationState.META_DATA_KEY)) { throw new OsmosisRuntimeException( "No replication state has been provided in metadata key " + ReplicationState.META_DATA_KEY + "."); } currentState = (ReplicationState) metaData.get(ReplicationState.META_DATA_KEY); // Initialise the state from the stored state if it exists and increment // the sequence number. if (stateExists) { currentState.load(storedState); currentState.setSequenceNumber(currentState.getSequenceNumber() + 1); } }
currentDataState.setSequenceNumber(currentDataState.getSequenceNumber() + 1); currentDataState.setSequenceNumber(currentDataState.getSequenceNumber() + 1); currentDataState.setTimestamp(new Date(currentDataState.getTimestamp().getTime() + configuration.getIntervalLength()));
currentDataState.setSequenceNumber(currentDataState.getSequenceNumber() + 1); currentDataState.setSequenceNumber(currentDataState.getSequenceNumber() + 1); currentDataState.setTimestamp(new Date(currentDataState.getTimestamp().getTime() + configuration.getIntervalLength()));