use of org.apache.ignite.internal.processors.cache.persistence.wal.SegmentedRingByteBuffer in project ignite by apache.
the class FileHandleManagerImpl method nextHandle.
/**
* {@inheritDoc}
*/
@Override
public FileWriteHandle nextHandle(SegmentIO fileIO, RecordSerializer serializer) throws IOException {
SegmentedRingByteBuffer rbuf;
if (mmap) {
MappedByteBuffer buf = fileIO.map((int) maxWalSegmentSize);
rbuf = new SegmentedRingByteBuffer(buf, metrics);
} else
rbuf = currentHandle().buf.reset();
try {
return new FileWriteHandleImpl(cctx, fileIO, rbuf, serializer, metrics, walWriter, 0, mode, mmap, false, fsyncDelay, maxWalSegmentSize);
} catch (ClosedByInterruptException e) {
if (rbuf != null)
rbuf.free();
}
return null;
}
use of org.apache.ignite.internal.processors.cache.persistence.wal.SegmentedRingByteBuffer in project ignite by apache.
the class FileHandleManagerImpl method initHandle.
/**
* {@inheritDoc}
*/
@Override
public FileWriteHandle initHandle(SegmentIO fileIO, long position, RecordSerializer serializer) throws IOException {
SegmentedRingByteBuffer rbuf;
if (mmap) {
MappedByteBuffer buf = fileIO.map((int) maxWalSegmentSize);
rbuf = new SegmentedRingByteBuffer(buf, metrics);
} else
rbuf = new SegmentedRingByteBuffer(walBufferSize, maxWalSegmentSize, DIRECT, metrics);
rbuf.init(position);
return new FileWriteHandleImpl(cctx, fileIO, rbuf, serializer, metrics, walWriter, position, mode, mmap, true, fsyncDelay, maxWalSegmentSize);
}
Aggregations