org.apache.cassandra.utils
Class CLibrary

java.lang.Object
  extended by org.apache.cassandra.utils.CLibrary

public final class CLibrary
extends java.lang.Object


Method Summary
static int close(int fd)
           
static void createHardLink(java.io.File sourceFile, java.io.File destinationFile)
          Create a hard link for a given file.
static void createHardLinkWithExec(java.io.File sourceFile, java.io.File destinationFile)
           
static int fcntl(int fd, int command, long flags)
           
static int fsync(int fd)
           
static int getfd(java.io.FileDescriptor descriptor)
          Get system file descriptor from FileDescriptor object.
static int open(java.lang.String path, int flags)
           
static int posix_fadvise(int fd, long offset, int len, int flag)
           
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)
           
static void trySync(int fd)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fcntl

public static int fcntl(int fd,
                        int command,
                        long flags)
                 throws com.sun.jna.LastErrorException
Throws:
com.sun.jna.LastErrorException

posix_fadvise

public static int posix_fadvise(int fd,
                                long offset,
                                int len,
                                int flag)
                         throws com.sun.jna.LastErrorException
Throws:
com.sun.jna.LastErrorException

open

public static int open(java.lang.String path,
                       int flags)
                throws com.sun.jna.LastErrorException
Throws:
com.sun.jna.LastErrorException

fsync

public static int fsync(int fd)
                 throws com.sun.jna.LastErrorException
Throws:
com.sun.jna.LastErrorException

close

public static int close(int fd)
                 throws com.sun.jna.LastErrorException
Throws:
com.sun.jna.LastErrorException

tryMlockall

public static void tryMlockall()

createHardLink

public static void createHardLink(java.io.File sourceFile,
                                  java.io.File destinationFile)
                           throws java.io.IOException
Create a hard link for a given file.

Parameters:
sourceFile - The name of the source file.
destinationFile - The name of the destination file.
Throws:
java.io.IOException - if an error has occurred while creating the link.

createHardLinkWithExec

public static void createHardLinkWithExec(java.io.File sourceFile,
                                          java.io.File destinationFile)
                                   throws java.io.IOException
Throws:
java.io.IOException

trySkipCache

public static void trySkipCache(int fd,
                                long offset,
                                int len)

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.io.FileDescriptor descriptor)
Get system file descriptor from FileDescriptor object.

Parameters:
descriptor - - FileDescriptor objec to get fd from
Returns:
file descriptor, -1 or error


Copyright © 2012 The Apache Software Foundation