private void onCleanup() { mappedBytes.release(); }
private void onCleanup() { Closeable.closeQuietly(writePosition); Closeable.closeQuietly(indexing); mappedBytes.release(); }
@NotNull @Override public String dump() { MappedBytes bytes = MappedBytes.mappedBytes(mappedFile); try { bytes.readLimit(bytes.realCapacity()); return Wires.fromSizePrefixedBlobs(bytes); } finally { bytes.release(); } }
@NotNull @Override public String dump() { MappedBytes bytes = MappedBytes.mappedBytes(mappedFile); try { bytes.readLimit(bytes.realCapacity()); return Wires.fromSizePrefixedBlobs(bytes); } finally { bytes.release(); } }
public void checkFileContents(@NotNull File file, String expected) throws FileNotFoundException { @NotNull MappedBytes bytes = MappedBytes.mappedBytes(file, ChronicleQueue.TEST_BLOCK_SIZE); bytes.readLimit(bytes.realCapacity()); assertEquals(expected, Wires.fromSizePrefixedBlobs(bytes)); bytes.release(); }
bytes.release(); try (@NotNull ChronicleQueue queue = binary(dir) .rollCycle(RollCycles.TEST4_DAILY)
" }\n" + "}\n", Wires.fromSizePrefixedBlobs(bytes.readPosition(0))); bytes.release();
" lastAcknowledgedIndexReplicated: 0\n" + "}\n", Wires.fromSizePrefixedBlobs(bytes.readPosition(0))); bytes.release();
private void removeEOF(Path path) throws IOException { long blockSize = 64 << 10; long chunkSize = OS.pageAlign(blockSize); long overlapSize = OS.pageAlign(blockSize / 4); final MappedBytes mappedBytes = MappedBytes.mappedBytes(path.toFile(), chunkSize, overlapSize, false); mappedBytes.reserve(); try { final Wire wire = WireType.BINARY_LIGHT.apply(mappedBytes); final Bytes<?> bytes = wire.bytes(); bytes.readLimit(bytes.capacity()); bytes.readSkip(4); // move past header try (final SingleChronicleQueueStore qs = loadStore(wire)) { assertNotNull(qs); long l = qs.writePosition(); long len = Wires.lengthOf(bytes.readVolatileInt(l)); long eofOffset = l + len + 4L; bytes.writePosition(eofOffset); bytes.writeInt(0); } } finally { mappedBytes.release(); } }
mappedBytes.release();
private void onCleanup() { mappedBytes.release(); }
@Override public void close() { this.release(); }
@NotNull public MappedBytes withSizes(long chunkSize, long overlapSize) { @NotNull MappedFile mappedFile2 = this.mappedFile.withSizes(chunkSize, overlapSize); if (mappedFile2 == this.mappedFile) return this; try { return mappedBytes(mappedFile2); } finally { mappedFile2.release(); release(); } }
private void onCleanup() { Closeable.closeQuietly(writePosition); Closeable.closeQuietly(indexing); mappedBytes.release(); }
@NotNull @Override public String dump() { MappedBytes bytes = MappedBytes.mappedBytes(mappedFile); try { bytes.readLimit(bytes.realCapacity()); return Wires.fromSizePrefixedBlobs(bytes); } finally { bytes.release(); } }
@NotNull @Override public String dump() { MappedBytes bytes = MappedBytes.mappedBytes(mappedFile); try { bytes.readLimit(bytes.realCapacity()); return Wires.fromSizePrefixedBlobs(bytes); } finally { bytes.release(); } }
mappedBytes.release();