diff --git a/src/retention/java/krati/retention/Position.java b/src/retention/java/krati/retention/Position.java index 16bb5e6..23aadfa 100644 --- a/src/retention/java/krati/retention/Position.java +++ b/src/retention/java/krati/retention/Position.java @@ -42,7 +42,7 @@ public interface Position extends Serializable { public long getOffset(); /** - * @return the index to snapshot. + * @return the index to the underlying snapshot or store. */ public int getIndex(); diff --git a/src/retention/java/krati/retention/SimpleRetentionStoreReader.java b/src/retention/java/krati/retention/SimpleRetentionStoreReader.java index 14e2bbc..cf79b0e 100644 --- a/src/retention/java/krati/retention/SimpleRetentionStoreReader.java +++ b/src/retention/java/krati/retention/SimpleRetentionStoreReader.java @@ -38,6 +38,7 @@ * 08/23, 2011 - Created
* 11/20, 2011 - Updated for SimpleRetention
* 01/25, 2012 - Fixed bootstrap scan logging info
+ * 02/08, 2012 - Update the clock of position upon finishing bootstrap
*/ public class SimpleRetentionStoreReader implements RetentionStoreReader { private final static Logger _logger = Logger.getLogger(SimpleRetentionStoreReader.class); @@ -171,9 +172,14 @@ public Position get(Position pos, List> list) { _logger.info("Read[" + pos.getIndex() + "," + index + ") " + cnt); } - return iter.hasNext() ? - new SimplePosition(_retention.getId(), pos.getOffset(), index, pos.getClock()) : - new SimplePosition(_retention.getId(), pos.getOffset(), pos.getClock()); + if(iter.hasNext()) { + return new SimplePosition(_retention.getId(), pos.getOffset(), index, pos.getClock()); + } else { + Clock newClock; + newClock = _retention.getClock(pos.getOffset()); + if (newClock == null) newClock = pos.getClock(); + return new SimplePosition(_retention.getId(), pos.getOffset(), newClock); + } } else { return nextPos; }