]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Hadoop: libhadoopcephfs now links against libceph
authorGreg Farnum <gregf@hq.newdream.net>
Thu, 6 Aug 2009 23:04:25 +0000 (16:04 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Thu, 6 Aug 2009 23:05:30 +0000 (16:05 -0700)
rather than incorporating it; the Java code accounts for this and
loads based on a configuration setting -- no more worries
about java.library.path.

src/Makefile.am
src/client/hadoop/ceph/CephFileSystem.java
src/client/hadoop/ceph/CephInputStream.java
src/client/hadoop/ceph/CephOutputStream.java

index 9e96e76f7035e3b2a4d7f5e360ee2bcc4ca0c567..0dfbac719792f1e0aff9c737a4923fbefdcd7199 100644 (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_.*'
index 98d5c518c4ba03c130dd725a96f741d4640f05f0..326dd16be06fc11e1a76e7cca2463377e2500abf 100644 (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);
index 2324872b39235cb1c249911f5f682e43500a25d2..b6954d0bafaa5b594846edd9f6f563cde90cc57b 100644 (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;
index 1d37637ccb57ee97832e2dd3ef8c2dc761f86ccb..0df04882638e4c3d66fa7b2b303b20fcdaf3215e 100644 (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;