in src/main/java/org/apache/activemq/artemis/nativo/jlibaio/LibaioContext.java [427:469]
native void submitWrite(int fd,
ByteBuffer libaioContext,
long position,
int size,
ByteBuffer bufferWrite,
Callback callback) throws IOException;
/**
* Documented at {@link LibaioFile#read(long, int, java.nio.ByteBuffer, SubmitInfo)}.
*/
native void submitRead(int fd,
ByteBuffer libaioContext,
long position,
int size,
ByteBuffer bufferWrite,
Callback callback) throws IOException;
/**
* Note: this shouldn't be done concurrently.
* This method will block until the min condition is satisfied on the poll.
* <p/>
* The callbacks will include the original callback sent at submit (read or write).
*/
native int poll(ByteBuffer libaioContext, Callback[] callbacks, int min, int max);
/**
* This method will block as long as the context is open.
*/
native void blockedPoll(ByteBuffer libaioContext, boolean useFdatasync);
static native int getNativeVersion();
public static native boolean lock(int fd);
public static native void memsetBuffer(ByteBuffer buffer, int size);
static native long getSize(int fd);
static native int getBlockSizeFD(int fd);
public static int getBlockSize(File path) {
return getBlockSize(path.getAbsolutePath());
}