-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Fix statistics in RocksJava sample #2674
Conversation
@@ -31,6 +31,7 @@ public static void main(final String[] args) { | |||
final Filter bloomFilter = new BloomFilter(10); | |||
final ReadOptions readOptions = new ReadOptions() | |||
.setFillCache(false); | |||
final Statistics stats = new Statistics(); |
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.
Looks good. However Statistics
is a RocksObject
and so should ideally be manually closed, along with ReadOptions
. Probably best to put them in a try-with-resources
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.
But both Statistics and ReadOptions are already in try-with-resources here.
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.
Sorry you are of course correct. I did not see it initially in the GitHub diff view. Sorry.
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.
Just needs a try-with-resources
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.
Looks good.
@sagar0 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
I observed while doing a
make jtest
that the java sample was broken, due to the changes in #2551 .Test Plan:
Before the fix:
After the fix:
No errors on doing a
make jtest
ormake sample