Class AlignedBuffers
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.file.AlignedBuffers
-
public class AlignedBuffers extends Object
Utility class for work with aligned buffers.
-
-
Constructor Summary
Constructors Constructor Description AlignedBuffers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ByteBufferallocate(int fsBlockSize, int size)Allocates align memory for use with O_DIRECT and returns native byte buffer.static voidfree(long addr)Frees the memory space pointed to byaddr- address of buffer, which must have been returned by a previous callallocate(int, int).static voidfree(ByteBuffer buf)Frees the memory space used by direct buffer, which must have been returned by a previous callallocate(int, int).
-
-
-
Method Detail
-
allocate
public static ByteBuffer allocate(int fsBlockSize, int size)
Allocates align memory for use with O_DIRECT and returns native byte buffer.- Parameters:
fsBlockSize- alignment, FS ans OS block size.size- capacity.- Returns:
- byte buffer, to be released by
free(ByteBuffer).
-
free
public static void free(ByteBuffer buf)
Frees the memory space used by direct buffer, which must have been returned by a previous callallocate(int, int).- Parameters:
buf- direct buffer to free.
-
free
public static void free(long addr)
Frees the memory space pointed to byaddr- address of buffer, which must have been returned by a previous callallocate(int, int).- Parameters:
addr- direct buffer address to free.
-
-