org.xerial.snappy
Class SnappyLoader

java.lang.Object
  extended by org.xerial.snappy.SnappyLoader

public class SnappyLoader
extends Object

This class loads a native library of snappy-java (snappyjava.dll, libsnappy.so, etc.) according to the user platform (os.name and os.arch). The natively compiled libraries bundled to snappy-java contain the codes of the original snappy and JNI programs to access Snappy. In default, no configuration is required to use snappy-java, but you can load your own native library created by 'make native' command. LoadSnappy searches for native libraries (snappyjava.dll, libsnappy.so, etc.) in the following order:

  1. (System property: org.xerial.snappy.lib.path)/(System property: org.xerial.lib.name)
  2. One of the libraries embedded in snappy-java-(version).jar extracted into (System property: java.io.tempdir or if org.xerial.snappy.tempdir is set, use this folder.)
  3. Folders specified by java.lib.path system property (This is the default path that JVM searches for native libraries)

If you do not want to use folder java.io.tempdir, set the System property org.xerial.snappy.tempdir. For example, to use /tmp/leo as a temporary folder to copy native libraries, use -D option of JVM:

 
 java -Dorg.xerial.snappy.tempdir="/tmp/leo" ...
 
 

Author:
leo

Field Summary
static String KEY_SNAPPY_DISABLE_BUNDLED_LIBS
           
static String KEY_SNAPPY_LIB_NAME
           
static String KEY_SNAPPY_LIB_PATH
           
static String KEY_SNAPPY_TEMPDIR
           
 
Constructor Summary
SnappyLoader()
           
 
Method Summary
static int getMajorVersion()
           
static int getMinorVersion()
           
static String getVersion()
           
static boolean isNativeLibraryLoaded()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_SNAPPY_LIB_PATH

public static final String KEY_SNAPPY_LIB_PATH
See Also:
Constant Field Values

KEY_SNAPPY_LIB_NAME

public static final String KEY_SNAPPY_LIB_NAME
See Also:
Constant Field Values

KEY_SNAPPY_TEMPDIR

public static final String KEY_SNAPPY_TEMPDIR
See Also:
Constant Field Values

KEY_SNAPPY_DISABLE_BUNDLED_LIBS

public static final String KEY_SNAPPY_DISABLE_BUNDLED_LIBS
See Also:
Constant Field Values
Constructor Detail

SnappyLoader

public SnappyLoader()
Method Detail

isNativeLibraryLoaded

public static boolean isNativeLibraryLoaded()

getMajorVersion

public static int getMajorVersion()

getMinorVersion

public static int getMinorVersion()

getVersion

public static String getVersion()


Copyright © 2011. All Rights Reserved.