Package org.apache.cassandra.utils
Class NativeLibrary
- java.lang.Object
-
- org.apache.cassandra.utils.NativeLibrary
-
public final class NativeLibrary extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NativeLibrary.OSType
-
Field Summary
Fields Modifier and Type Field Description static NativeLibrary.OSType
osType
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getfd(java.io.FileDescriptor descriptor)
Get system file descriptor from FileDescriptor object.static int
getfd(java.nio.channels.FileChannel channel)
static long
getProcessID()
static boolean
isAvailable()
Checks if the library has been successfully linked.static boolean
jnaMemoryLockable()
static void
tryCloseFD(int fd)
static int
tryFcntl(int fd, int command, int flags)
static void
tryMlockall()
static int
tryOpenDirectory(java.lang.String path)
static void
trySkipCache(int fd, long offset, int len, java.lang.String path)
static void
trySkipCache(int fd, long offset, long len, java.lang.String path)
static void
trySkipCache(java.lang.String path, long offset, long len)
static void
trySync(int fd)
-
-
-
Field Detail
-
osType
public static final NativeLibrary.OSType osType
-
-
Method Detail
-
isAvailable
public static boolean isAvailable()
Checks if the library has been successfully linked.- Returns:
true
if the library has been successfully linked,false
otherwise.
-
jnaMemoryLockable
public static boolean jnaMemoryLockable()
-
tryMlockall
public static void tryMlockall()
-
trySkipCache
public static void trySkipCache(java.lang.String path, long offset, long len)
-
trySkipCache
public static void trySkipCache(int fd, long offset, long len, java.lang.String path)
-
trySkipCache
public static void trySkipCache(int fd, long offset, int len, java.lang.String path)
-
tryFcntl
public static int tryFcntl(int fd, int command, int flags)
-
tryOpenDirectory
public static int tryOpenDirectory(java.lang.String path)
-
trySync
public static void trySync(int fd)
-
tryCloseFD
public static void tryCloseFD(int fd)
-
getfd
public static int getfd(java.nio.channels.FileChannel channel)
-
getfd
public static int getfd(java.io.FileDescriptor descriptor)
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
-
-