24424845 : 104903910484869178 : 2016-06-09 16:45:57
24424845 : 104903910484869179 : 2016-06-09 16:45:58
24424845 : 104903910484869180 : 2016-06-09 16:45:59
2016-06-10 00:46:09,002 DEBUG[main] net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts : moveToIndex: 174b18e 0
24424846 : 104903914779836417 : 2016-06-09 16:46:00
24424846 : 104903914779836418 : 2016-06-09 16:46:01
24424846 : 104903914779836419 : 2016-06-09 16:46:02
--
You received this message because you are subscribed to the Google Groups "Chronicle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-chronicl...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The top bits of the index are in cycles since epoch by default. This is shifted by N bits, often 32 in most cases.
You can use RollCycle.toIndex (cycle, sequence) to get any individual index. Eg.
long minuteCycle = System.currentTimeMillis () / 60_000;
This assume you have minutely cycles. You can have other cycles like 5 minutely.
Regards, Peter.
--
RollCycles.MINUTELY.toIndex(cycle, 1)
while (true) {
// todo : find out how to calculate right id for given long timestamp
val message = tl.readText() ?: break
val cycle = tl.cycle()
if (lastCycle != cycle) {
println("cycle : " + RollCycles.MINUTELY.toIndex(tl.cycle(), 0))
lastCycle = cycle
}
println("${tl.cycle()} : ${tl.index()} : $message")
}
24425694 : 104907556912103482 : 2016-06-10 06:54:57
24425694 : 104907556912103483 : 2016-06-10 06:54:58
24425694 : 104907556912103484 : 2016-06-10 06:54:59
2016-06-10 15:31:52,774 DEBUG[main] net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts : moveToIndex: 174b4df 0
cycle : 104907561207070720
24425695 : 104907561207070721 : 2016-06-10 06:55:00
24425695 : 104907561207070722 : 2016-06-10 06:55:01
24425695 : 104907561207070723 : 2016-06-10 06:55:02
fun RollCycles.firstIdOfCycleContaining(timestamp: Long): Int
--
--