Hadoop: libhadoopcephfs now links against libceph

rather than incorporating it; the Java code accounts for this and
loads based on a configuration setting -- no more worries
about java.library.path.
This commit is contained in:
Greg Farnum 2009-08-06 16:04:25 -07:00
parent 360834b652
commit e15c40a7c0
4 changed files with 9 additions and 5 deletions

View File

@ -171,7 +171,8 @@ BUILT_SOURCES += libcls_acl.so
## hadoop client
if WITH_HADOOPCLIENT
JAVA_BASE = /usr/lib/jvm/java-6-sun
libhadoopcephfs_la_SOURCES = client/hadoop/CephFSInterface.cc ${libceph_la_SOURCES}
libhadoopcephfs_la_SOURCES = client/hadoop/CephFSInterface.cc
libhadoopcephfs_la_LIBADD = libceph.la libcrush.la
libhadoopcephfs_la_CFLAGS = ${AM_CFLAGS}
libhadoopcephfs_la_CXXFLAGS = ${AM_CXXFLAGS}
libhadoopcephfs_la_LDFLAGS = -version-info 1:0:0 -export-symbols-regex 'hadoopcephfs_.*'

View File

@ -34,9 +34,7 @@ public class CephFileSystem extends FileSystem {
private static final long DEFAULT_BLOCK_SIZE = 8 * 1024 * 1024;
static {
System.loadLibrary("hadoopcephfs");
}
private URI uri;
@ -96,6 +94,8 @@ public class CephFileSystem extends FileSystem {
@Override
public void initialize(URI uri, Configuration conf) throws IOException {
debug("initialize:enter");
System.load(conf.get("fs.ceph.libDir")+"/libhadoopcephfs.so");
System.load(conf.get("fs.ceph.libDir")+"/libceph.so");
super.initialize(uri, conf);
//store.initialize(uri, conf);
setConf(conf);

View File

@ -53,7 +53,8 @@ class CephInputStream extends FSInputStream {
*/
public CephInputStream(Configuration conf, int fh, long flength) {
System.load(conf.get("fs.ceph.libDir")+"/libhadoopcephfs.so");
System.load(conf.get("fs.ceph.libDir")+"/libceph.so");
// Whoever's calling the constructor is responsible for doing the actual ceph_open
// call and providing the file handle.
fileLength = flength;

View File

@ -78,6 +78,8 @@ class CephOutputStream extends OutputStream {
// The file handle
public CephOutputStream(Configuration conf, int fh) {
System.load(conf.get("fs.ceph.libDir")+"/libhadoopcephfs.so");
System.load(conf.get("fs.ceph.libDir")+"/libceph.so");
fileHandle = fh;
//fileLength = flength;
closed = false;