GithubHelp home page GithubHelp logo

lcarstensen / libgfapi-jni Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fabiolissi/libgfapi-jni

0.0 1.0 0.0 227 KB

Java Native Interface (JNI) bindings for libgfapi (the GlusterFS client API)

Home Page: https://forge.gluster.org/libgfapi-jni

License: Other

XML 3.37% Java 91.74% C 4.89%

libgfapi-jni's Introduction

libgfapi-jni

Java Native Interface (JNI) bindings for libgfapi, the GlusterFS client API.

instructions

groundwork

Prerequisites

  • gluster 3.4 or newer - installed from source or a gluster development package installed.
  • maven 3.0.3 or newer
  • auto tool chain
  • Ubuntu packages: build-essential libtool pkg-config automake

Compiling without tests

If you have installed gluster to non-standard location then you export GLFS_HOME so we know where it's at:

export GLFS_HOME=/path/to/gluster/prefix

Building without tests is simple. Just run:

mvn -Pdownlaod -Plinux64 -Dmaven.test.skip=true install

Compiling and Testing

To really test this you'll need a running glusterfs volume called foo.

  • Set up a loopback interface alias, because glusterfs refuses to create a volume with a brick on localhost or 127.0.0.1

      ifconfig lo:0 127.0.2.1
    
  • Create a glusterfs volume called foo

      gluster volume create foo 127.0.2.1:/var/tmp/foo
      gluster volume start foo
    
  • Gluster requires that clients communicate from privileged source ports by default, so we need to disable this feature before testing.

    • First we need to manually fix glusterd. Edit /etc/glusterfs/glusterd.vol and add this line after the other option statements in the volume management stanza

        option rpc-auth-allow-insecure on
      

      Then restart glusterd (or glusterfs-server, as the case may be)

    • Second we need to allow insecure clients to access the bricks

        gluster volume set foo server.allow-insecure on
      
    • Finally, since our clients will not be privileged, we need to make the volume world writable the usual way

        mkdir /mnt/foo
        mount -t glusterfs localhost:foo /mnt/foo
        chmod ugo+rwx /mnt/foo
        umount /mnt/foo
        rmdir /mnt/foo
      
  • Make sure that the gluster libs are on the LD_LIBRARY_PATH.

      export LD_LIBRARY_PATH=${GLUSTER_PREFIX}/lib
    
  • Now run the test

      mvn -Pdownload -Plinux64 install
    
  • If successful, the test will have created a file called bar in the volume, and written hello world into it.

      ls -la /var/tmp/foo
      cat /var/tmp/foo/bar
    
  • There should also be a log file generated by libgfapi in the test program, check it out

      cat glfsjni/glfsjni-linux64/target/glfsjni.log
    

Testing notes

mvn test

After doing a mvn install as described above the test suite can be re-run with the following command run in the top libgfapi-jni directory

mvn -Dnative-src-url=file:glfsjni/target/glfsjni-1.0-SNAPSHOT-native-src.zip -Plinux64 test

When using a test runner in your IDE you'll need to add the following Java system property

-Djava.library.path=glfsjni-linux64/target/native-build/target/lib

Project License

Until further notice (made here and in LICENSE.txt) this project is licensed under the terms of the 3-clause BSD license, as written in LICENSE.txt (and copied in several source files).

The licensing is likely to change in the near future as the project matures.

libgfapi-jni's People

Contributors

louiszuckerman avatar chirino avatar maylem avatar iherbig avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.