GithubHelp home page GithubHelp logo

classicvalues / traildb-java Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adroll/traildb-java

1.0 1.0 0.0 89 KB

Java bindings for TrailDB

License: MIT License

Makefile 1.32% Java 25.82% C 72.87%

traildb-java's Introduction

TrailDB Java CircleCI

Java Bindings for TrailDB

Installation

mvn install -P Linux

or

mvn install -P Mac

Only Linux and OS X are supported for the time being. Windows is on the way.

Run

Compile and run the example by adding the jar to your classpath and setting java.library.path to the object file.

javac -cp native/linux/target/lib/traildbJava.jar examples/Example.java

java -Djava.library.path=`pwd`/native/linux/target/ -cp examples:native/linux/target/lib/traildbJava.jar Example

Architecture

├── java
│   ├── pom.xml (TrailDB Java Classes)
│   ├── src
│   │   └── main
│   │       └── java
│   │           └── traildb
│   │               ├── TrailDBConstructor.java
│   │               ├── TrailDBCursor.java
│   │               ├── TrailDBEventFilter.java
│   │               ├── TrailDBEvent.java
│   │               ├── TrailDBItem.java
│   │               ├── TrailDB.java
│   │               ├── TrailDBMultiCursor.java
│   │               └── TrailDBMultiEvent.java
│   └── target
│        └── classes
│        	└── traildb
│        		├── TrailDB.class
│   			├── TrailDBConstructor.class
│   			├── TrailDBConstructor$TDB_OPT_CONS_KEY.class
│   			├── TrailDBConstructor$TDB_OPT_CONS_VALUE.class
│   			├── TrailDBCursor.class
│   			├── TrailDBEvent.class
│   			├── TrailDBEventFilter.class
│   			├── TrailDBItem.class
│   			├── TrailDBMultiCursor.class
│   			├── TrailDBMultiEvent.class
│   			├── TrailDB$TDB_OPT_KEY.class
│   			└── TrailDB$TDB_OPT_VALUE.class
├── native
│   ├── linux
│   │   ├── pom.xml (Linux Build)
│   │   └── target
│   │       ├── custom-javah
│   │       │   └── traildb-java.h
│   │       ├── lib
│   │       │   └── traildbJava.jar
│   │       ├── libTraildbJavaNative.so
│   │       └── objs
│   │           ├── TrailDBConstructor.o
│   │           ├── TrailDBCursor.o
│   │           ├── TrailDBEventFilter.o
│   │           ├── TrailDBEvent.o
│   │           ├── TrailDBItem.o
│   │           ├── TrailDBMultiCursor.o
│   │           └── TrailDB.o
│   ├── pom.xml (Native Build)
│   └── src
│       └── main
│           └── native
│               ├── TrailDB.c
│               ├── TrailDBConstructor.c
│               ├── TrailDBCursor.c
│               ├── TrailDBEvent.c
│               ├── TrailDBEventFilter.c
│               ├── TrailDBItem.c
│               └── TrailDBMultiCursor.c
└── pom.xml (TrailDB)
  1. Java sources under java/src/main/java/traildb are compiled using javac to their .class files under java/target/classes/traildb

  2. Java classes are jarred together into native/<platform>/target/lib/traildbJava.jar

  3. javah is used on the .class files to automatically generate the header file native/<platform>/target/custom-javah/traildb-java.h

  4. The header file is included in every c source under native/src/main/native. Each c source is compiled with gcc to their .o object files under native/<platform>/target/objs.

  5. Each object file is linked into a shared object file native/<platform>/target/libTraildbJavaNative.so. The TrailDB library is linked at this stage.

Images

  • The base image is defined in Dockerfile. It is an ubuntu image with the jdk and traildb installed. It can be built using make build

  • The installed image is defined in Dockerfile.installed. It is the base image with traildb-java bindings installed. It can be built using make install

Development

  • Implement exception raising

  • Unit tests

  • Set up maven or gradle or something so people can install

  • Benchmark relative to other language bindings

  • Audit multithreaded support

  • Cache field and method lookups

  • Benchmark again to evaluate efficacy of field caching

  • Finish implementing everything else

  • Enable -Wall and -Werr and fix issues

Functions

TrailDBConstructor

  • Constructor

  • add

  • append

  • finalize

  • close

  • setOpt

  • getOpt

TrailDB

  • Constructor

  • dontNeed

  • willNeed

  • numTrails

  • numEvents

  • numFields

  • minTimestamp

  • maxTimestamp

  • version

  • setOpt

  • getOpt

  • setTrailOpt

  • getTrailOpt

  • lexiconSize

  • getField

  • getFieldName

  • getItem

  • close

  • getUUID

  • getTrailId

  • cursorNew

TrailDBCursor

  • free

  • getTrail

  • getTrailLength

  • setEventFilter

  • unsetEventFilter

  • next

  • peek

TrailDBEvent

  • getItem

TrailDBEventFilter

  • free

  • addTerm

  • addTimeRange

  • newClause

  • numClauses

  • numTerms

  • isNegative

  • getItem

  • getStartTime

  • getEndTime

TrailDBMultiCursor

  • free

  • reset

  • next

  • nextBatch

  • peek

traildb-java's People

Stargazers

Classic Values 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.