Skip to content
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 mtbl_reader_get_* functions to retrieve trailer metadata #5

Closed
wants to merge 1 commit into from

Conversation

snarkmaster
Copy link
Contributor

My goal was to create an in-memory representation of the original data in an MTBL file. To do this, it's very helpful to know the size of the source data, namely the key & value bytes, and the number of entries.

I added the other getters so that the "mtbl_info" program wouldn't have to use private APIs to do its job.

Test Plan:

./autogen.sh && ./configure && make
sudo make install
(for f in t/*.data; do /usr/bin/mtbl_info $f ; done) &> UBUNTU_SYS_OUTPUT 
(for f in t/*.data; do /usr/local/bin/mtbl_info $f ; done) &> NEW_OUTPUT
diff UBUNTU_SYS_OUTPUT NEW_OUTPUT 

The difference in error message seems acceptable:

1c1
< Error: lseek() failed: Invalid argument

---
> Error: mtbl_reader_init() on t/test-deb716628.data failed

My goal was to create an in-memory representation of the original data.  To
do this, it's very helpful to know the size of the source data, namely the
key & value bytes, and the number of entries.

I added the other getters so that the "mtbl_info" program wouldn't have to
use private APIs to do its job.
@edmonds
Copy link
Contributor

edmonds commented Jan 22, 2015

Hi, Alexey:

Thanks for this! Though, could you re-open this pull request against the next branch, not master? We do development on next and ff-only merge to master only for releases (so that the tip of master always matches the latest tagged release).

Also, on first glance I notice a misspelling "mtrbl" (should be "mtbl") in the doc updates. And as mentioned in issue #4 I'd like to have these getters in a separate mtbl_trailer interface, not directly in the mtbl_reader interface.

@snarkmaster
Copy link
Contributor Author

Ok, will reopen against next

@snarkmaster snarkmaster deleted the mtbl_reader_get branch January 23, 2015 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants