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

Added SizeApproximationOptions to DB::GetApproximateSizes #5626

Closed
wants to merge 1 commit into from

Conversation

elipoz
Copy link
Contributor

@elipoz elipoz commented Jul 25, 2019

The new DB::GetApproximateSizes with SizeApproximationOptions argument, which allows to add more options/knobs to the DB::GetApproximateSizes call (beyond only the include_flags)

@elipoz elipoz changed the title Added GetApproximateSizesOptions to DB::GetApproximateSizes Added SizeApproximationOptions to DB::GetApproximateSizes Jul 25, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

// data in the mem-tables (if the mem-table type supports it), data
// serialized to disk, or both.
SizeApproximationFlags include_flags = INCLUDE_FILES;
};
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

// 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;
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@facebook-github-bot
Copy link
Contributor

@elipoz has updated the pull request. Re-import the pull request

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

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;
Copy link
Contributor

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?

const Range* range, int n, uint64_t* sizes) {
if (!options.include_memtabtles && !options.include_files) {
return Status::InvalidArgument("Invalid options");
}
Copy link
Contributor

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

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

@facebook-github-bot
Copy link
Contributor

@elipoz merged this pull request in 9625a2b.

merryChris pushed a commit to merryChris/rocksdb that referenced this pull request Nov 18, 2019
)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants