private void moveToSpecifiedPosition(final ChronicleQueue ic, final ExcerptTailer tailer, final boolean isFirstIteration) { if (isSet(startIndex) && isFirstIteration) { if (startIndex < ic.firstIndex()) { throw new IllegalArgumentException(String.format("startIndex %d is less than first index %d", startIndex, ic.firstIndex())); } messageSink.accept("Waiting for startIndex " + startIndex); for (; ; ) { if (tailer.moveToIndex(startIndex)) break; Jvm.pause(100); } } if (isSet(maxHistoryRecords) && isFirstIteration) { tailer.toEnd(); tailer.moveToIndex(Math.max(ic.firstIndex(), tailer.index() - maxHistoryRecords)); } else if (tailInputSource && isFirstIteration) { tailer.toEnd(); } }
System.out.println("first index : " + queue.firstIndex()); Assert.assertEquals(Long.MAX_VALUE, queue.firstIndex()); long firstIndex = queue.firstIndex(); Assert.assertEquals(queue.firstIndex(), firstIndexOfSecondCycle);
public long firstOffset(int partition) { long ret = partitions.get(partition).firstIndex(); if (ret == Long.MAX_VALUE) { return 0; } return ret; }
private void moveToSpecifiedPosition(final ChronicleQueue ic, final ExcerptTailer tailer, final boolean isFirstIteration) { if (isSet(startIndex) && isFirstIteration) { if (startIndex < ic.firstIndex()) { throw new IllegalArgumentException(String.format("startIndex %d is less than first index %d", startIndex, ic.firstIndex())); } messageSink.accept("Waiting for startIndex " + startIndex); for (; ; ) { if (tailer.moveToIndex(startIndex)) break; Jvm.pause(100); } } if (isSet(maxHistoryRecords) && isFirstIteration) { tailer.toEnd(); tailer.moveToIndex(Math.max(ic.firstIndex(), tailer.index() - maxHistoryRecords)); } else if (tailInputSource && isFirstIteration) { tailer.toEnd(); } }