Giter Club home page Giter Club logo

btree4j's Introduction

Hi there ๐Ÿ‘‹

trophy

btree4j's People

Contributors

myui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

btree4j's Issues

Exception with message: range scan failled... bug?

Hi,

This is pretty easy to produce: Modify the BtreeIndexTest.testBtreeIndex test. Increase the repeat in the invokeTest method (multiply by 10)
final int repeat = 10000000;

=>

java.lang.IllegalStateException: range scan failed... bug?

at btree4j.BTree.scanRange(BTree.java:365)
at btree4j.BTree.search(BTree.java:333)
at btree4j.BTreeIndex.search(BTreeIndex.java:136)
at btree4j.BTreeIndexTest.invokeTest(BTreeIndexTest.java:181)
at btree4j.BTreeIndexTest.testBTreeIndex(BTreeIndexTest.java:147)
...

By the way, thanks for the great work ๐Ÿ‘.

Primitives.toBytes

image

why need convert to byte ?

since 129 convert to -127. how to identify 129 and -127 ?

Atomicity and consistency

Hey MyUi,

less an issue, but more a question: How ACID compliant are the methods on the tree (especially atomicity)?

If for example the JVM shuts down (planned or as a fault) during the following method call

btree.addValue(k, v);

would then there be a risk that the whole tree might (a) or parts of the tree (b) might be corrupt or is there no such risk (c)? Any hints regarding the ACID level compliance in the description would be greatly appreciated.

Kind regards,
Borbarad13

there's an exception when key is greater than 127

    for (int i = 0; i < 1000; i++) {
        Value k = new Value(i);
        btree.addValue(k, i);

}

    IndexConditionBW bw = new IndexConditionBW(new Value(100), new Value(128));

btree.search(bw, callback) will throw exception

            throw new IllegalStateException("range scan failed... bug?");

With 10 million keys finds only first few million keys

I have tried the following code:

      BTreeIndex btree = new BTreeIndex(indexFile, false);
      btree.init(false);

      Random rand = new Random();
      for (int i = 0; i < 10000000; i++) {
        long nt = System.nanoTime(), val = rand.nextLong();
        Value key = new Value(String.valueOf(nt) + val);
        Value value = new Value(val);
        if (i % 10000 == 0) {
          System.out.println(i + " " + key + " " + btree.addValue(key, value));
        } else {
          btree.addValue(key, value);
        }
      }

Then in another method I open index file and try to search for keys:

       BTreeIndex btree = new BTreeIndex(indexFile, false);
       Value val = btree.getValue(new Value("205388120935395-497341292157541218"));
       System.out.println(Primitives.getLong(val.getData()));

On first few million, it works, but then throws NullPointerException inside Value class. Am I doing something wrong?

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.