-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Synchronize statistic enumeration values between statistics.h and java API #2209
Conversation
@bentorfs This looks good to me in that it fixes the issue. However, as a more robust solution we should not rely on implicit enumeration values. For other enums that are similar in C++ and Java we have used an explicit mapping in |
@adamretter @bentorfs It would be really great to see this merged, since it improves the current situation, and then we can talk about a nicer way of keeping things in sync later. I'm not convinced that the status code example solves the problem because it relies on there not being anybody who tampers with the Java |
da4d8d8
to
46a37e4
Compare
@bentorfs updated the pull request - view changes |
Rebased to master |
I recently had to fix something like this in #2429. I wasn't aware of this PR while working on #2429, and got to know about this only today when it got bumped to the top due to today's comments and updates. I do acknowledge @adamretter 's concern that there could be a more robust solution, but until someone implements it, this looks good to me. #UpForGrabs. |
@sagar0 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
…a API Summary: Closes #2209 Differential Revision: D5251951 Pulled By: sagar0 fbshipit-source-id: 03a73d025a7b4a322bb8d8d86f5d249fcd7dd00e
(Copied from #2171 ).
Problem: The enumerations of tickers and histogram types for retrieving statistics are not in sync between the C++ source and the java API:
Java version:
https://github.com/facebook/rocksdb/blob/master/java/src/main/java/org/rocksdb/TickerType.java
https://github.com/facebook/rocksdb/blob/master/java/src/main/java/org/rocksdb/HistogramType.java
C++ version:
https://github.com/facebook/rocksdb/blob/master/include/rocksdb/statistics.h
The java Enumeration is missing a lot of declarations, and their values do not correspond to the (implicit) order of values in the C++ enum.
Impact: for example, retrieving the
BLOOM_FILTER_USEFUL
statistic through the java API, actually returns the data forBLOCK_CACHE_FILTER_MISS
.