Java Bindings for TrailDB
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.
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
├── java
│ ├── pom.xml (TrailDB Java Classes)
│ ├── src
│ │ └── main
│ │ └── java
│ │ └── traildb ───┐
│ │ ├── TrailDB.java │
│ │ ├── TrailDBConstructor.java │
│ │ ├── TrailDBTrail.java │
│ │ ├── TrailDBMultiTrail.java │ 1
│ │ └── TrailDBEventFilter.java │
│ └── target │
│ └── classes │
│ └── traildb <──┘
│ ├── TrailDB.class ─────┐
│ ├── TrailDBConstructor.class ───┐ │
│ ├── TrailDBTrail.class │ │
│ ├── TrailDBMultiTrail.class │ │
│ └── TrailDBEventFilter.class │ │
├── native │ │
│ ├── linux 3 │ │ 2
│ │ ├── pom.xml (Linux Build) │ │
│ │ └── target │ │
│ │ ├── custom-javah │ │
│ │ │ └── traildb-java.h <──┘ │
│ │ ├── lib │
│ │ │ └── traildbJava.jar <────┘
│ │ ├── libTraildbJavaNative.so <──┐
│ │ └── objs ───┘ 5
│ │ ├── TrailDB.o <──┐
│ │ ├── TrailDBConstructor.o │
│ │ ├── TrailDBTrail.o │
│ │ ├── TrailDBMultiTrail.o │ 4
│ │ └── TrailDBEventFilter.o │
│ ├── pom.xml (Native Build) │
│ └── src │
│ └── main │
│ └── native ───┘
│ ├── TrailDB.c
│ ├── TrailDBConstructor.c
│ ├── TrailDBTrail.c
│ ├── TrailDBMultiTrail.c
│ └── TrailDBEventFilter.c
└── pom.xml (TrailDB)
-
Java sources under
java/src/main/java/traildb
are compiled usingjavac
to their.class
files underjava/target/classes/traildb
-
Java classes are jarred together into
native/<platform>/target/lib/traildbJava.jar
-
javah
is used on the.class
files to automatically generate the header filenative/<platform>/target/custom-javah/traildb-java.h
-
The header file is included in every c source under
native/src/main/native
. Each c source is compiled withgcc
to their.o
object files undernative/<platform>/target/objs
. -
Each object file is linked into a shared object file
native/<platform>/target/libTraildbJavaNative.so
. The TrailDB library is linked at this stage.
-
The base image is defined in
Dockerfile
. It is an ubuntu image with the jdk and traildb installed. It can be built usingmake build
-
The installed image is defined in
Dockerfile.installed
. It is the base image with traildb-java bindings installed. It can be built usingmake install
-
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
-
Constructor
-
add
-
append
-
finalize
-
close
-
setOpt
-
getOpt
-
Constructor
-
dontNeed
-
willNeed
-
numTrails
-
numEvents
-
numFields
-
minTimestamp
-
maxTimestamp
-
version
-
setOpt
-
getOpt
-
setTrailOpt
-
getTrailOpt
-
lexiconSize
-
getField
-
getFieldName
-
close
-
getUUID
-
getTrailId
-
getTrail
-
getTrailLength
-
setEventFilter
-
unsetEventFilter
-
next
-
peek
-
getItem
-
setEventFilter
-
unsetEventFilter
-
next
-
peek
-
getItem
-
addTerm
-
addTimeRange
-
newClause
-
numClauses
-
numTerms
-
isNegative