-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add bitset.size() and version to index file header #69
Conversation
Had a crash when running example with this PR |
What was the crash? And did you delete all index files so they get recreated with the new headers? |
Somewhere in slowEqual. There is something there if you specify a path it can't find I think. This is unrelated to this PR, but something that would be nice to fix. |
|
To reproduce the problem comment out the first example in example.js, the one with the ship. Then make sure indexes are deleted and run node example. Then second run will fail with:
|
Updated this PR to not save bitsetSize, but note that this PR now fails tests. There's one big change I made, which was the header fields So that's what I'm gonna do in this PR, tackle also #71 in a new commit soon. The reason why I changed to unsigned 32: we don't need negative numbers for these fields, and we gain a lot more range with unsigned. It seems we will need that larger range especially for |
Ready for review |
|
* ## File format for tarr files | ||
* | ||
* Each header field is 4 bytes in size. | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
I tried this branch using the recipe here and still have the same problem. Its really wierd, the diff looks good. Have to double check it |
Ah, version and seq is switched for some reason |
I'll take a look at that problem, I'll try to fix it in this PR |
In save it seems:
|
Added test that fails because of swapped version and seq. |
|
Working now :) |
|
For issues #8 and #65, this adds two new fields to the file header:
version
andbitsetSize
. Note it's a breaking change for any system currently deploying jitdb indexes.So far there is no
bitset.size()
optimization (that old idea of not storing indexes that are too small), but if we ever want to implement that idea, this new header would make it easier.