-
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
[RFC] Move HDFS support to separate repo #9170
Conversation
@adamretter, is it possible to move HDFS-related JNI code from main repo to https://github.com/riversand963/rocksdb-hdfs-env as well? |
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.
While I agree with most of this change, is there a reason we should move HDFS under plugins/hdfs in the main repo? HDFS is one (of several) plugins that are currently in the source that should be moved into their own "untested" and "unsupported" place (like LUA and Rados and Cassandra).
For those tools that currently use them, it would make it simpler if we kept the code in one place. It would also simplify testing that we can do the right thing in building the plugins and getting the infrastructure working (regardless of if we ever actually RUN them).
Makefile
Outdated
@@ -250,6 +250,7 @@ include $(ROCKSDB_PLUGIN_MKS) | |||
ROCKSDB_PLUGIN_SOURCES = $(foreach plugin, $(ROCKSDB_PLUGINS), $(foreach source, $($(plugin)_SOURCES), plugin/$(plugin)/$(source))) | |||
ROCKSDB_PLUGIN_HEADERS = $(foreach plugin, $(ROCKSDB_PLUGINS), $(foreach header, $($(plugin)_HEADERS), plugin/$(plugin)/$(header))) | |||
PLATFORM_LDFLAGS += $(foreach plugin, $(ROCKSDB_PLUGINS), $($(plugin)_LDFLAGS)) | |||
CXXFLAGS += $(foreach plugin, $(ROCKSDB_PLUGINS), $($(plugin)_CXXFLAGS)) |
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.
Shouldn't this be PLATFORM_CXXFLAGS?
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.
Do you mind updating plugin/README.md to mention how plugins can bring their own compiler flags?
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.
The example repo should register a name matching the whole URI like "hdfs://.*" instead of "hdfs". Other than that it worked great!
We can clarify the temporary repo is meant as a starting (forking) point for whoever wants to take ownership assuming that is the intent.
Makefile
Outdated
@@ -250,6 +250,7 @@ include $(ROCKSDB_PLUGIN_MKS) | |||
ROCKSDB_PLUGIN_SOURCES = $(foreach plugin, $(ROCKSDB_PLUGINS), $(foreach source, $($(plugin)_SOURCES), plugin/$(plugin)/$(source))) | |||
ROCKSDB_PLUGIN_HEADERS = $(foreach plugin, $(ROCKSDB_PLUGINS), $(foreach header, $($(plugin)_HEADERS), plugin/$(plugin)/$(header))) | |||
PLATFORM_LDFLAGS += $(foreach plugin, $(ROCKSDB_PLUGINS), $($(plugin)_LDFLAGS)) | |||
CXXFLAGS += $(foreach plugin, $(ROCKSDB_PLUGINS), $($(plugin)_CXXFLAGS)) |
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.
Do you mind updating plugin/README.md to mention how plugins can bring their own compiler flags?
@mrambacher After removing the hdfs-specific code from main repo and ensuring there is a workaround solution as described in this PR, I currently do not have strong opinion on next step w.r.t #7949, and I don't think this PR should be blocked on a WIP feature. Even after HdfsEnv or HdfsFS and/or Env becomes Customizable, I think the approach in this PR should still work, and it does not prevent the development of #7949. |
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 like Java bindings need to be deleted too.
@ajkr Yes indeed, it is on my TODO list (nearish the top) |
221f4c0
to
ddf9483
Compare
Hi @adamretter, |
Maybe HDFS is not the only option. Would support be more optional in the future? |
@riversand963 As part of HDFS support, or as something else in RocksDB? |
The Customizable infrastructure (e.g. XXX::CreateFromString) will work for all of the extension classes (Env is still pending). I believe that is the interface that needs to be added to Java, for all of the Customizable classes Having said that, I am not sure I understand how HDFS (or other plugins) can be accessed in Java unless they are built into the initial shared library, which means we will either be distributing a lot of Maven packages for the possible combinations (2 plugins means 4 packages, 3 means 8, etc) or have a means of dynamically adding them to the Java project. |
@mrambacher The approach taken in https://github.com/riversand963/rocksdb-hdfs-env/ is to build everything from source, so I doubt we will distribute those binaries. Otherwise with that approach we would have one complete binary of RocksDB for each plugin - and then what happens if you want two plugins?!? |
@adamretter correct, I don't think we will distribute binaries for different combinations of RocksDB + (HDFS + RADOS).
Something else in RocksDB as a public Java API. |
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.
LGTM, just need to remove Java binding.
Summary: Not a CMake expert, and the current CMake build support added by this PR is unlikely the best way of doing it. Sending out the PR to demonstrate it can work. Test Plan: Will need to update https://github.com/ajkr/dedupfs with CMake build. Also, PR facebook#9170 and PR facebook#9206 both include CMake support for their plugins, and can be used as a proof of concept.
Thanks @ajkr for the review! Yeah, we will merge this after Java bindings for HDFS are deleted from main repo and we have an alternative. |
@darionyaphet Not sure if I understand. Do you mean "support for more file systems"? |
yep such as alluxio |
I am happy with what you are proposing. My concern is, if somebody wants two plugins, then your design is impossible... Or did I misunderstand? |
Summary: Not a CMake expert, and the current CMake build support added by this PR is unlikely the best way of doing it. Sending out the PR to demonstrate it can work. Pull Request resolved: #9214 Test Plan: Will need to update https://github.com/ajkr/dedupfs with CMake build. Also, PR #9170 and PR #9206 both include CMake support for their plugins, and can be used as a proof of concept. Reviewed By: ajkr Differential Revision: D32738273 Pulled By: riversand963 fbshipit-source-id: da87fb4377c716bbbd577a69763b48d22483f845
1d5c8d6
to
1e2fa46
Compare
@darionyaphet no, we do not have such plans at the moment. |
I assume you are replying to my prior comment. |
Right it is possible for users who build from source to include as many plugins as they want. IMO the Java release should include zero plugins. I suspect the Java release already does not include a functioning HdfsEnv since (before this PR) that required compiling with |
@ajkr correct, current Java release does not include HDFS. |
1e2fa46
to
24ef466
Compare
404f988
to
b1a4618
Compare
@riversand963 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
b1a4618
to
3dde51c
Compare
@riversand963 has updated the pull request. You must reimport the pull request before landing. |
@riversand963 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Hi @alanpaxton, I have merged this PR to main, would it be possible for you to rebase riversand963#4 onto facebook/main? Thanks! |
Done. |
This PR moves HDFS support from RocksDB repo to a separate repo. The new (temporary?) repo
in this PR serves as an example before we finalize the decision on where and who to host hdfs support. At this point,
people can start from the example repo and fork.
Java/JNI is not included yet, and needs to be done later if necessary.
The goal is to include this commit in RocksDB 7.0 release.
Reference:
https://github.com/ajkr/dedupfs by @ajkr
Test plan:
Follow the instructions in https://github.com/riversand963/rocksdb-hdfs-env/blob/master/README.md. Build and run db_bench and db_stress.
make check