db.getAtomicLong("checksum").set(checksum);
public void applyDiffs(List<Diff> workQueue) { try { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); SAXParser saxParser = factory.newSAXParser(); DefaultHandler handler = new OSMChangeParser(osm); for (Diff state : workQueue) { LOG.info("Applying {} update for {}", state.timescale, getDateString(state.timestamp * 1000)); InputStream inputStream = new GZIPInputStream(state.url.openStream()); saxParser.parse(inputStream, handler); // Move the DB timestamp forward to that of the update that was applied osm.timestamp.set(state.timestamp); // Record the last update applied so we can jump straight to the next one lastApplied = state; } } catch (Exception e) { e.printStackTrace(); } }
db.getAtomicLong("checksum").set(checksum);
@Override public void setReplicationTimestamp(long secondsSinceEpoch) { // TODO handle the case where multiple files are loaded (oldest timestamp should be used) timestamp.set(secondsSinceEpoch); }