@NotNull @Override public WireStore writePosition(long position) { assert singleThreadedAccess(); assert writePosition.getVolatileValue() + mappedFile.chunkSize() > position; assert Wires.isReadyData(mappedBytes.readVolatileInt(position)); writePosition.setMaxValue(position); return this; }
private void resetPosition() throws UnrecoverableTimeoutException { try { if (store == null || wire == null) return; position(store.writePosition()); assert position == 0 || Wires.isReadyData(wire.bytes().readVolatileInt(position)); final long headerNumber = store.lastSequenceNumber(this); wire.headerNumber(queue.rollCycle().toIndex(cycle, headerNumber + 1) - 1); assert wire.headerNumber() != -1 || checkIndex(wire.headerNumber(), position); } catch (@NotNull BufferOverflowException | StreamCorruptedException e) { throw new AssertionError(e); } assert checkWritePositionHeaderNumber(); }
@NotNull @Override public WireStore writePosition(long position) { assert singleThreadedAccess(); assert writePosition.getVolatileValue() + mappedFile.chunkSize() > position; assert Wires.isReadyData(mappedBytes.readVolatileInt(position)); writePosition.setMaxValue(position); return this; }
private void resetPosition() throws UnrecoverableTimeoutException { try { if (store == null || wire == null) return; position(store.writePosition()); assert position == 0 || Wires.isReadyData(wire.bytes().readVolatileInt(position)); final long headerNumber = store.lastSequenceNumber(this); wire.headerNumber(queue.rollCycle().toIndex(cycle, headerNumber + 1) - 1); assert wire.headerNumber() != -1 || checkIndex(wire.headerNumber(), position); } catch (@NotNull BufferOverflowException | StreamCorruptedException e) { throw new AssertionError(e); } assert checkWritePositionHeaderNumber(); }