Can you ensure that your keys are unique/well ordered by having a 2nd
sequence number in them (eg, using an atomic integer/long count) ?
I doesn't sound like you actually need to bucket by time stamp, just
that time stamp isn't unique enough for you.
If you could ever risk overflow of the sequence number (> 2^64 items
seems unlikely) then you'd have to reset it at some time stamp
boundary, but apart from that it should work.
public static class UniqueTimeStamp implements Comparable<UniqueTimeStamp> {
private final long timestamp;
private final int/long sequenceNumber; // unique per time stamp
... you know the rest ...
}
Just a thought,
David
--
David Beaumont :: Africa Mobile Engineering :: Google
Google Switzerland GmbH., Brandschenkestrasse 110, CH-8002, Zürich - Switzerland
Tel
+41 44 668 1800 :: Fax
+41 44 668 1818