GithubHelp home page GithubHelp logo

aholyoke / traildb-java Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 4.0 140 KB

Java bindings for TrailDB

License: MIT License

C 64.42% Java 34.67% Makefile 0.92%
circleci docker java java-bindings jni traildb traildb-java

traildb-java's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

traildb-java's Issues

Reuse or get rid of TrailDBEvent

Currently, TrailDBCursor.next creates a new TrailDBEvent and sets the fields of it with the internal values of tdb_event. TrailDBCursor.next will probably one of the hottest method call in codebase since we need to call it for each event.

Therefore, I believe that we should optimize it in a way that it should use minimum amount of memory and CPU. Specifically, I think we can provide two set of optimizations:

  1. Add an extra TrailDBEvent parameter to TrailDBCursor.next and if it's not null, reuse that object instead of creating one. Avro is already using this method in order to minimize GC pressure: https://github.com/apache/avro/blob/17f2d75132021fafeca29edbdcade40df960fdc9/lang/java/avro/src/main/java/org/apache/avro/io/DatumReader.java#L35

  2. Change the signature of TrailDBCursor.next to return void instead of TrailDBEvent and add getCurrentItem(), getCurrentTimesamp(), getCurrentNumberOfItems() to TrailDBCursor. We can store the reference of native tdb_event object inside TrailDBCursor and use the proxy methods instead of TrailDBEvent. The overhead of Java will be minimum in this case.

TrailDBCursor.getTrailLength returns 0

TrailDB tdb = new TrailDB("tiny.tdb");
TrailDBCursor cur = new TrailDBCursor(tdb);

cur.getTrail(trailId);
cur.getTrailLength(); // returns the correct value
cur.getTrailLength() // always returns 0

TrailDBCursor.getTrailLength should always return the same value for a specific trail.

Error while building

/Users/buremba/Code/dummy/traildb-java/native/src/main/native/TrailDB.c:1:10: fatal error: 'traildb.h' file not found
#include <traildb.h>
         ^
1 error generated.

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.