@NotNull private ScanResult moveToIndexFromTheStart(@NotNull ExcerptContext ec, long index) { try { Wire wire = ec.wire(); wire.bytes().readPositionUnlimited(0); if (wire.readDataHeader()) return linearScan(wire, index, 0, wire.bytes().readPosition()); } catch (EOFException fallback) { return ScanResult.END_OF_FILE; } return ScanResult.NOT_FOUND; }
if (wire.readDataHeader()) { if (i == toIndex) { return ScanResult.FOUND;
WireIn.HeaderType headerType; try { headerType = wire.readDataHeader(true); } catch (EOFException e) { if (toPosition == Long.MAX_VALUE)
private boolean inACycle(boolean includeMetaData) throws EOFException { Jvm.optionalSafepoint(); if (readAfterReplicaAcknowledged && inACycleCheckRep()) return false; Jvm.optionalSafepoint(); if (direction != TailerDirection.FORWARD && !inACycleNotForward()) return false; Jvm.optionalSafepoint(); Wire wire = wire(); Bytes<?> bytes = wire.bytes(); bytes.readLimit(bytes.capacity()); switch (wire.readDataHeader(includeMetaData)) { case NONE: Jvm.optionalSafepoint(); // no more polling - appender will always write (or recover) EOF return false; case META_DATA: Jvm.optionalSafepoint(); context.metaData(true); break; case DATA: Jvm.optionalSafepoint(); context.metaData(false); break; } Jvm.optionalSafepoint(); inACycleFound(bytes); Jvm.optionalSafepoint(); return true; }
mappedBytes.readPosition(0); mappedBytes.readLimit(mappedBytes.realCapacity()); while (mappedWire.readDataHeader()) { int header = mappedBytes.readVolatileInt(); if (Wires.isNotComplete(header))
@NotNull private ScanResult moveToIndexFromTheStart(@NotNull ExcerptContext ec, long index) { try { Wire wire = ec.wire(); wire.bytes().readPositionUnlimited(0); if (wire.readDataHeader()) return linearScan(wire, index, 0, wire.bytes().readPosition()); } catch (EOFException fallback) { return ScanResult.END_OF_FILE; } return ScanResult.NOT_FOUND; }
if (wire.readDataHeader()) { if (i == toIndex) { return ScanResult.FOUND;
WireIn.HeaderType headerType; try { headerType = wire.readDataHeader(true); } catch (EOFException e) { if (toPosition == Long.MAX_VALUE)
private boolean inACycle(boolean includeMetaData) throws EOFException { Jvm.optionalSafepoint(); if (readAfterReplicaAcknowledged && inACycleCheckRep()) return false; Jvm.optionalSafepoint(); if (direction != TailerDirection.FORWARD && !inACycleNotForward()) return false; Jvm.optionalSafepoint(); Wire wire = wire(); Bytes<?> bytes = wire.bytes(); bytes.readLimit(bytes.capacity()); switch (wire.readDataHeader(includeMetaData)) { case NONE: Jvm.optionalSafepoint(); // no more polling - appender will always write (or recover) EOF return false; case META_DATA: Jvm.optionalSafepoint(); context.metaData(true); break; case DATA: Jvm.optionalSafepoint(); context.metaData(false); break; } Jvm.optionalSafepoint(); inACycleFound(bytes); Jvm.optionalSafepoint(); return true; }
mappedBytes.readPosition(0); mappedBytes.readLimit(mappedBytes.realCapacity()); while (mappedWire.readDataHeader()) { int header = mappedBytes.readVolatileInt(); if (Wires.isNotComplete(header))