Giter VIP home page Giter VIP logo

liballuxio's Introduction

liballuxio

C/C++ API for Alluxio (formerly Tachyon)

Requirement:

  • JDK 1.7+
  • Autoconf, Automake, and Libtool (for maintainer)
    • On Ubuntu, sudo apt-get install autoconf automake libtool.
    • On Mac OS X, use package manager like brew (e.g., brew install autoconf automake libtool)

Compatibility:

The library currently supports Alluxio 1.2.0.

Compilation:

If you are a maintainer, you need to first invoke the boostrap script to generate the necessary configure script.

Then invoke configure following the GNU conventions, which does some basic testing, tries to setup the JNI CFLAGS and LDFLAGS automatically, and then generate a Makefile.

It is recommended that you build the project in a separate directory. For example,

cd liballuxio
./boostrap  # if you are a maintainer
mkdir build
cd build
../configure --prefix=$(dirname $(pwd))/dist
make
make install

Under dist/lib you should see both a static library liballuxio.a and a dynamic library liballuxio.so generated (or liballuxio.dylib in Mac). The header file is in dist/include.

In your Alluxio client C/C++ code, include the Alluxio.h header to use the available APIs. Then link the liballuxio library to your object files to compile an executable.

Usage:

To run the client executable, make sure that:

  1. libjvm.so is in the LD_LIBRARY_PATH
  2. Alluxio Java client jar is in the CLASSPATH or modify the CLASSPATH constants at the top of src/JNIHelper.h.

Example settings of the environment variables are:

  1. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server.
  2. export CLASSPATH=$CLASSPATH:$HOME/alluxio/core/client/target/alluxio-core-client-1.2.0-jar-with-dependencies.jar.

Lazy way: Modify script bin/alluxio-client-env.sh (especially clientjarpath) and then source bin/alluxio-client-env.sh before running the client executable.

Sample Client:

alluxiotest is a sample client executable that test the implemented C/C++ Alluxio APIs.

Example run: dist/bin/alluxiotest localhost 19998

If successful, the client will output:

$ dist/bin/alluxiotest localhost 19998

log4j:WARN No appenders could be found for logger (alluxio.logger.type).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

TEST - CREATE FILE: SUCCESS - Created alluxio file: /hello.txt

TEST - DELETE FILE: SUCCESS - Deleted path /hello.txt

TEST - CREATE FILE WITH OPTIONS: SUCCESS - Created alluxio file: /hello.txt

TEST - WRITE FILE: SUCCESS - Wrote "hello, alluxio!!" to file

TEST - OPEN FILE: SUCCESS - Opened file: /hello.txt

TEST - READ FILE: SUCCESS - Content of the created file:hello, alluxio!!

TEST - LS COMMAND: SUCCESS - ls command found the path /hello.txt

TEST - DELETE FILE: SUCCESS - Deleted path /hello.txt

TEST - CREATE DIRECTORY: SUCCESS - Created alluxio dir /alluxiotest

TEST - DIRECTORY EXISTS: SUCCESS - Alluxio dir /alluxiotest exists

TEST - LS COMMAND: SUCCESS - ls command found the path /alluxiotest

TEST - DELETE FILE: SUCCESS - Deleted path /alluxiotest

liballuxio's People

Contributors

ryanphuang avatar tianyin avatar

Watchers

 avatar  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.