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

Make FileType Public and Replace kLogFile with kWalFile #7580

Closed
wants to merge 1 commit into from

Conversation

zhichao-cao
Copy link
Contributor

As suggested by @pdillinger ,The name of kLogFile is misleading, in some tests, kLogFile is defined as info log. Replace it with kWalFile and move it to public, which will be used in #7523

Test plan: make check

Copy link
Contributor

@mrambacher mrambacher left a comment

Choose a reason for hiding this comment

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

LGTM once comments are added.

@@ -57,6 +57,21 @@ class FileSystem;
struct Options;
struct DbPath;

// To indicate the file types
enum FileType {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is not public, can you add a brief comment as to what all of these mean?

Also, should there be a kUnknownFile for types that we do not know about?

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. Totally agree, some of the name does not directly indicate the file type. I will add the comments. Since I move it from file_name.h to options.h, I prefer not to add kUnknownFile at this moment. In the future, if we have the use case, we can add it easily.

kCurrentFile,
kTempFile,
kInfoLogFile, // Either the current one, or an old one
kMetaDatabase,
Copy link
Contributor

Choose a reason for hiding this comment

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

What is a "kMetaDatabase"? Is this something that has not been developed or is it dead code? Not sure if this belongs in the public API...

Copy link
Contributor

@pdillinger pdillinger left a comment

Choose a reason for hiding this comment

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

FileType is touching implementation details, so it is definitely of the "advanced options" flavor. Users should rarely need FileType. Even if checksum_handoff_file_types belongs in DBOptions, can we put this in some header included by options.h? Or we could even consider a forward declaration in options.h. If we get the enum definition out of options.h, I don't think it's so critical to get clear comments on all the enumerators. This enum is for advanced usage.

I think we generally prefer 'enum class' for new enums (or in this case, newly-public enums). What do you think?

@@ -57,6 +57,21 @@ class FileSystem;
struct Options;
struct DbPath;

// To indicate the file types
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps

// The types of files RocksDB uses in a DB directory. (Available for advanced options.)

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps the enum should be defined in "advanced_options.h" instead of options.h?

I am not in favor of classes that are defined in the public API only having forward declarations.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we want to expose file type as public, how about considering the file "include/rocksdb/types.h"? According to the file's comment, it is for all public custom types.

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, I will move to "include/rocksdb/types.h", it makes more sense for me.

Copy link
Contributor

@riversand963 riversand963 left a comment

Choose a reason for hiding this comment

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

LGTM with one minor comment.

@@ -57,6 +57,21 @@ class FileSystem;
struct Options;
struct DbPath;

// To indicate the file types
Copy link
Contributor

Choose a reason for hiding this comment

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

If we want to expose file type as public, how about considering the file "include/rocksdb/types.h"? According to the file's comment, it is for all public custom types.

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.

@zhichao-cao has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@zhichao-cao merged this pull request in d8ec0a7.

codingrhythm pushed a commit to SafetyCulture/rocksdb that referenced this pull request Mar 5, 2021
Summary:
As suggested by pdillinger ,The name of kLogFile is misleading, in some tests, kLogFile is defined as info log. Replace it with kWalFile and move it to public, which will be used in facebook#7523

Pull Request resolved: facebook#7580

Test Plan: make check

Reviewed By: riversand963

Differential Revision: D24485420

Pulled By: zhichao-cao

fbshipit-source-id: 955e3dacc1021bb590fde93b0a568ffe9ad80799
levichen94 pushed a commit to bytedance/terarkdb that referenced this pull request Jun 18, 2021
Summary:
As suggested by pdillinger ,The name of kLogFile is misleading, in some tests, kLogFile is defined as info log. Replace it with kWalFile and move it to public, which will be used in facebook/rocksdb#7523

Pull Request resolved: facebook/rocksdb#7580

Test Plan: make check

Reviewed By: riversand963

Differential Revision: D24485420

Pulled By: zhichao-cao

fbshipit-source-id: 955e3dacc1021bb590fde93b0a568ffe9ad80799
Signed-off-by: Changlong Chen <levisonchen@live.cn>
mm304321141 pushed a commit to bytedance/terarkdb that referenced this pull request Jun 23, 2021
Summary:
As suggested by pdillinger ,The name of kLogFile is misleading, in some tests, kLogFile is defined as info log. Replace it with kWalFile and move it to public, which will be used in facebook/rocksdb#7523

Pull Request resolved: facebook/rocksdb#7580

Test Plan: make check

Reviewed By: riversand963

Differential Revision: D24485420

Pulled By: zhichao-cao

fbshipit-source-id: 955e3dacc1021bb590fde93b0a568ffe9ad80799
Signed-off-by: Changlong Chen <levisonchen@live.cn>
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

5 participants