java.lang.Object
me.ahoo.cosid.internal.RangeCursor
me.ahoo.cosid.internal.ExpiringRangeCursor
A cursor with a deadline, for
BatchPolicy.rangeTtl (04-segment.md ยง2): past it the rest of the range is
dropped. A separate class, so generators without a time to live pay nothing for it.-
Field Summary
Fields inherited from class me.ahoo.cosid.internal.RangeCursor
HEADROOM -
Constructor Summary
ConstructorsConstructorDescriptionExpiringRangeCursor(long start, long end, long expiresAtMillis, TimeSource time) A cursor on[start, end)untilexpiresAtMillis. -
Method Summary
-
Constructor Details
-
ExpiringRangeCursor
A cursor on[start, end)untilexpiresAtMillis.- Parameters:
start- the first valueend- the end, exclusive, already cappedexpiresAtMillis- from this time on nothing is issuedtime- the time source
-
-
Method Details
-
expiresAtMillis
public long expiresAtMillis() -
take
public long take()Description copied from class:RangeCursorTakes the next value.- Overrides:
takein classRangeCursor- Returns:
- the value, or
-1if the cursor is used up (or expired)
-
remaining
public long remaining(long nowMillis) Description copied from class:RangeCursorThe values not taken yet.- Overrides:
remainingin classRangeCursor- Parameters:
nowMillis- the current time- Returns:
- the values left, 0 if none or expired
-