diff --git a/event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/AstyanaxEventReaderDAO.java b/event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/AstyanaxEventReaderDAO.java index b66a46d413..0304af2ded 100644 --- a/event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/AstyanaxEventReaderDAO.java +++ b/event/src/main/java/com/bazaarvoice/emodb/event/db/astyanax/AstyanaxEventReaderDAO.java @@ -341,12 +341,14 @@ public void readNewer(String channel, EventSink sink) { private Iterator> readManifestForChannel(final String channel, final boolean weak) { final ByteBuffer oldestSlab = weak ? _oldestSlab.getIfPresent(channel) : null; final ConsistencyLevel consistency; + RangeBuilder range = new RangeBuilder().setLimit(50); + if (oldestSlab != null) { range.setStart(oldestSlab); - consistency = ConsistencyLevel.CL_LOCAL_ONE; + consistency = ConsistencyLevel.CL_LOCAL_ONE; } else { - consistency = ConsistencyLevel.CL_TWO; + consistency = ConsistencyLevel.CL_TWO; } final Iterator> manifestColumns = executePaginated( @@ -398,8 +400,11 @@ private boolean readSlab(String channel, ByteBuffer slabId, SlabCursor cursor, b // Event add and delete write with local quorum, so read with local quorum to get a consistent view of things. // Using a lower consistency level could result in (a) duplicate events because we miss deletes and (b) // incorrectly closing or deleting slabs when slabs look empty if we miss adds. + + ColumnList eventColumns = execute( - _keyspace.prepareQuery(ColumnFamilies.SLAB, ConsistencyLevel.CL_TWO) + + _keyspace.prepareQuery(ColumnFamilies.SLAB, ConsistencyLevel.CL_TWO) .getKey(slabId) .withColumnRange(start, Constants.OPEN_SLAB_MARKER, false, Integer.MAX_VALUE));