Package org.apache.cassandra.utils
Class NativeLibrary
java.lang.Object
org.apache.cassandra.utils.NativeLibrary
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetfd(FileDescriptor descriptor) Get system file descriptor from FileDescriptor object.static intgetfd(FileChannel channel) static longstatic booleanChecks if the library has been successfully linked.static booleanstatic voidtryCloseFD(int fd) static inttryFcntl(int fd, int command, int flags) static voidstatic inttryOpenDirectory(String path) static voidtrySkipCache(int fd, long offset, int len, String path) static voidtrySkipCache(int fd, long offset, long len, String path) static voidtrySkipCache(String path, long offset, long len) static voidtrySync(int fd)
-
Field Details
-
osType
-
-
Method Details
-
isAvailable
public static boolean isAvailable()Checks if the library has been successfully linked.- Returns:
trueif the library has been successfully linked,falseotherwise.
-
jnaMemoryLockable
public static boolean jnaMemoryLockable() -
tryMlockall
public static void tryMlockall() -
trySkipCache
-
trySkipCache
-
trySkipCache
-
tryFcntl
public static int tryFcntl(int fd, int command, int flags) -
tryOpenDirectory
-
trySync
public static void trySync(int fd) -
tryCloseFD
public static void tryCloseFD(int fd) -
getfd
-
getfd
Get system file descriptor from FileDescriptor object.- Parameters:
descriptor- - FileDescriptor objec to get fd from- Returns:
- file descriptor, -1 or error
-
getProcessID
public static long getProcessID()- Returns:
- the PID of the JVM or -1 if we failed to get the PID
-