Chronicle v4 moveToNext()

51 views
Skip to first unread message

Sergey Nekoval

unread,
May 18, 2016, 10:53:55 AM5/18/16
to Chronicle
For Chronicle v4, what would be the correct way for a tailer to move to the next entry given the index?
i.e.
long idx = appender.lastIndexAppended();
...
ExcerptTailer tailer = queue.createTailer();
tailer
.moveToIndex(idx + 1);

is idx + 1 enough, including situations when next entry is in another cycle, etc. ??

Peter Lawrey

unread,
May 18, 2016, 10:56:30 AM5/18/16
to java-ch...@googlegroups.com

The simplest way to move to an entry is to use index (idx). If you want to move to the end you can use toEnd ()

--
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.

Sergey Nekoval

unread,
May 18, 2016, 12:40:36 PM5/18/16
to Chronicle
Thanks, what I'm trying to do is moving to the next entry, immediately after idx.
I understand that I can call tailer.moveToIndex(idx) and read an entry. Is there any way to skip an entry without reading it?

Peter Lawrey

unread,
May 18, 2016, 12:43:39 PM5/18/16
to java-ch...@googlegroups.com

The problem as you say is that if the entry doesn't exist it won't find that index.

Serge++

unread,
May 18, 2016, 1:06:36 PM5/18/16
to java-ch...@googlegroups.com
Hmm. Looking at how toEnd() is implemented, it simply uses moveToIndex(queue.lastIndex() + 1). So this answers my question :)
 

--
You received this message because you are subscribed to a topic in the Google Groups "Chronicle" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/java-chronicle/mwzTtyNNCzk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to java-chronicl...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages