Package io.aeron
Class LogBuffers
java.lang.Object
io.aeron.LogBuffers
- All Implemented Interfaces:
AutoCloseable
Takes a log file name and maps the file into memory and wraps it with
UnsafeBuffers as appropriate.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLogBuffers(String logFileName) Construct the log buffers for a given log file. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intdecRef()Decrement reference count.Duplicate the underlyingByteBuffers and wrap them for thread local access.TheFileChannelfor the mapped log.intincRef()Increment reference count.longThe deadline for how long to linger around once unreferenced.voidlingerDeadlineNs(long timeNs) Set the deadline for how long to linger around once unreferenced.Get the buffer which holds the log metadata.voidpreTouch()Pre touch memory pages, so they are faulted in to be available before access.intThe length of the term buffer in each log partition.
-
Constructor Details
-
LogBuffers
Construct the log buffers for a given log file.- Parameters:
logFileName- to be mapped.
-
-
Method Details
-
duplicateTermBuffers
Duplicate the underlyingByteBuffers and wrap them for thread local access.- Returns:
- duplicates of the wrapped underlying
ByteBuffers.
-
metaDataBuffer
Get the buffer which holds the log metadata.- Returns:
- the buffer which holds the log metadata.
-
fileChannel
TheFileChannelfor the mapped log.- Returns:
- the
FileChannelfor the mapped log.
-
preTouch
public void preTouch()Pre touch memory pages, so they are faulted in to be available before access. -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
termLength
public int termLength()The length of the term buffer in each log partition.- Returns:
- length of the term buffer in each log partition.
-
incRef
public int incRef()Increment reference count.- Returns:
- current reference count after increment.
-
decRef
public int decRef()Decrement reference count.- Returns:
- current reference counter after decrement.
-
lingerDeadlineNs
public void lingerDeadlineNs(long timeNs) Set the deadline for how long to linger around once unreferenced.- Parameters:
timeNs- the deadline for how long to linger around once unreferenced.
-
lingerDeadlineNs
public long lingerDeadlineNs()The deadline for how long to linger around once unreferenced.- Returns:
- the deadline for how long to linger around once unreferenced.
-