-
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
Added SizeApproximationOptions to DB::GetApproximateSizes #5626
Conversation
3967281
to
ce65d9b
Compare
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.
@elipoz has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
include/rocksdb/db.h
Outdated
// data in the mem-tables (if the mem-table type supports it), data | ||
// serialized to disk, or both. | ||
SizeApproximationFlags include_flags = INCLUDE_FILES; | ||
}; |
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.
We put all those options in file options.h. Maybe we should find a good home to all those in the future, but right now I suggest we keep it there.
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.
ok
include/rocksdb/db.h
Outdated
// Defines whether the returned size should include the recently written | ||
// data in the mem-tables (if the mem-table type supports it), data | ||
// serialized to disk, or both. | ||
SizeApproximationFlags include_flags = INCLUDE_FILES; |
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.
It's annoying that we started with a bitmap. Now looks like what we should do is to have variable bool include_memtables
and bool include_files
in SizeApproximationOptions
, other than this two levels of data structures. Can we do something like that?
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.
sure
ce65d9b
to
4a3f386
Compare
@elipoz has updated the pull request. Re-import the pull request |
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.
@elipoz has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
include/rocksdb/db.h
Outdated
virtual void GetApproximateSizes(ColumnFamilyHandle* column_family, | ||
const Range* range, int n, uint64_t* sizes, | ||
uint8_t include_flags = INCLUDE_FILES) = 0; | ||
const SizeApproximationOptions& options) = 0; |
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.
Option is usually the first argument of the function. We should keep it there too. Since we are changing the function, it's very odd that we don't return Status while there can be underlying I/O error. How about add a return Status to this function?
4a3f386
to
a9920b4
Compare
const Range* range, int n, uint64_t* sizes) { | ||
if (!options.include_memtabtles && !options.include_files) { | ||
return Status::InvalidArgument("Invalid options"); | ||
} |
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.
Since we change the behavior from asserting to return a status, we should mention it as a public interface change in HISTORY.md
a9920b4
to
ebdc21e
Compare
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.
@elipoz has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
) Summary: The new DB::GetApproximateSizes with SizeApproximationOptions argument, which allows to add more options/knobs to the DB::GetApproximateSizes call (beyond only the include_flags) Pull Request resolved: facebook#5626 Differential Revision: D16496913 Pulled By: elipoz fbshipit-source-id: ee8c6c182330a285fa056ecfc3905a592b451720
The new DB::GetApproximateSizes with SizeApproximationOptions argument, which allows to add more options/knobs to the DB::GetApproximateSizes call (beyond only the include_flags)