-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support jvm version libhdfs in velox #9835
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for meta-velox canceled.
|
@mbasmanova @majetideepak Can you help to review? Thanks. |
fbb5763
to
a33070c
Compare
@JkSelf CI is red. Please, take a look. |
CMakeLists.txt
Outdated
find_library( | ||
LIBJVM | ||
NAMES libjvm.so | ||
HINTS "${JAVA_HOME}/jre/lib/amd64/server/" REQUIRED) |
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.
Does the java path is same for all the Velox supported platform? Mac?
arrow) | ||
target_include_directories(velox_hdfs PRIVATE ${HADOOP_HOME}/include/) | ||
if(${VELOX_BUILD_TESTING}) | ||
add_subdirectory(tests) |
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 we may add_subdirectory(tests) twice when both VELOX_ENABLE_HDFS and VELOX_ENABLE_HDFS3 is ON
@@ -31,12 +35,17 @@ class HdfsFileSystem::Impl { | |||
hdfsBuilderSetNameNode(builder, endpoint.host.c_str()); | |||
hdfsBuilderSetNameNodePort(builder, atoi(endpoint.port.data())); | |||
hdfsClient_ = hdfsBuilderConnect(builder); | |||
#ifdef VELOX_ENABLE_HDFS3 |
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.
Which definition has high priority? Do we need to check this tow definitions conflict?
#elif VELOX_ENABLE_HDFS | ||
|
||
auto errMsg = | ||
fmt::format("Unable to get file path info for file: {}", filePath_); |
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.
Use this format VELOX_FAIL("Write past Buffer capacity() {}", capacity_);
@@ -33,19 +37,28 @@ struct HdfsFile { | |||
void open(hdfsFS client, const std::string& path) { | |||
client_ = client; | |||
handle_ = hdfsOpenFile(client, path.data(), O_RDONLY, 0, 0, 0); | |||
#ifdef VELOX_ENABLE_HDFS3 | |||
VELOX_CHECK_NOT_NULL( | |||
handle_, | |||
"Unable to open file {}. got error: {}", | |||
path, | |||
hdfsGetLastError()); |
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.
Can we just check `` in hdfsGetLastError
, return "" or "Can not get error message when VELOX_ENABLE_HDFS3" when #ifdef VELOX_ENABLE_HDFS3, then we don't need to modify so much code
@@ -19,8 +19,18 @@ add_library(velox_hdfs RegisterHdfsFileSystem.cpp) | |||
if(VELOX_ENABLE_HDFS) | |||
target_sources(velox_hdfs PRIVATE HdfsFileSystem.cpp HdfsReadFile.cpp | |||
HdfsWriteFile.cpp) | |||
target_link_libraries(velox_hdfs Folly::folly ${LIBHDFS3} xsimd) | |||
target_link_libraries(velox_hdfs Folly::folly ${LIBHDFS} ${LIBJVM} xsimd | |||
arrow) |
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.
Why need to link arrow?
cc: @majetideepak |
It seems Arrow's HDFS filesystem depends on some hdfs dynamic library to be present in the system and dynamically links against it. I see this PR does something similar as well.
|
We do dynamically link against LIBHDFS3(hawk) as well. It should not hurt to support it? |
Well it is unmaintained so it should'nt be the default and we should probably mark it deprecated and remove it in the future. |
Switching the default makes sense since hawq is not maintained. But I wonder if the hawq implementation provides additional benefits (say performance) compared to the Java implementation. |
@majetideepak Yes, that makes sense to me. If we proceed this way, we can avoid the need to ensure that the user's system has HDFS and JVM installed during the build phase. |
|
While better performance is of course great, in this case it comes with the considerable drawback that the library in question has been unmaintained for several years and the parent project is currently in the process of being 'archived' as well. My vote would be to remove it entirely but I am not a user so I'll let others decide :) |
@assignUser Agree to remove hawa implementation entirely. @majetideepak What do you think? |
I am not a user as well :). Let's open a discussion on this and get input from the wider community. |
@assignUser @majetideepak Thank you for your response. I have initiated a poll in the community at #9969. Your participation and vote would be greatly appreciated. |
CMakeLists.txt
Outdated
find_library( | ||
LIBHDFS3 | ||
NAMES libhdfs3.so libhdfs3.dylib | ||
HINTS "${CMAKE_SOURCE_DIR}/hawq/depends/libhdfs3/_build/src/" REQUIRED) | ||
add_definitions(-DVELOX_ENABLE_HDFS3) |
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.
use add_definitions(-DVELOX_ENABLE_HDFS)?
@JkSelf can you resolve the conflict? |
@JkSelf Thank you for your work. Is there any progress? It would be a really nice feature for me to replace with libhdfs so that we can support more file systems based on Hadoop FileSystem. |
e7e3f29
to
a77234d
Compare
@majetideepak I resolved all your comments. Can you help to review again? Thanks. |
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.
@JkSelf some comments.
2dac11f
to
701cbec
Compare
@majetideepak Thanks for your review. I have resolved all your comments. Can you help to review again. Thanks. |
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.
@JkSelf two more comments. Thanks for the changes. The hdfs headers are cleaner now.
velox/connectors/hive/storage_adapters/hdfs/tests/HdfsFileSystemTest.cpp
Outdated
Show resolved
Hide resolved
@majetideepak I have resolved all your comments. Can you help to review again? Thanks. |
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.
@JkSelf one last comment.
// This prevents a scenario where the first pread call in the | ||
// checkReadErrorMessages method might succeed, while a subsequent call fails, | ||
// leading to a mismatch in readFailErrorMessage. | ||
sleep(10); |
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.
@JkSelf Why do we need to add this sleep now which was previously not present?
Instead of sleep, can we query if the miniCluster is down?
sleep is usually a recipe for non-deterministic failures and wasted CI time.
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.
@majetideepak Yes. Updated. Can you help to review again? Thanks.
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.
@JkSelf Some comments and Linux adapters CI is failing. Can you check? Thanks.
velox/connectors/hive/storage_adapters/hdfs/tests/HdfsFileSystemTest.cpp
Show resolved
Hide resolved
velox/connectors/hive/storage_adapters/hdfs/tests/HdfsFileSystemTest.cpp
Show resolved
Hide resolved
efbe37b
to
3f87095
Compare
@majetideepak Can you help to review again? Thanks. |
velox/connectors/hive/storage_adapters/hdfs/tests/HdfsFileSystemTest.cpp
Outdated
Show resolved
Hide resolved
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.
Thanks @JkSelf! Appreciate for addressing all the feedback.
I will add the merge label once CI is passing. |
CMAKE_ARGS -DCMAKE_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl | ||
-DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib) |
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.
No hard coding of paths please. Does curl cmake not find openssl on it's own?
velox_hdfs_insert_test | ||
velox_file | ||
velox_hdfs | ||
velox_core | ||
velox_exec_test_lib | ||
velox_hive_connector | ||
velox_dwio_common_exception | ||
velox_exec |
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.
nit: I only see folly, hdfs, gtest and exec being used. Please only link used libs.
Currently, Gluten will throw hdfs connection failures when executing queries if their HDFS system employs Kerberos authentication and Viewfs support. This is due to the fact that the existing libhdfs3 API does not support Kerberos authentication, whereas the JVM version of libhdfs is capable of invoking APIs that support Kerberos authentication. If the user's system has the
HADOOP_HOME
environment variable set, the JVM version of libhdfs will be used during the compilation of Gluten; if not set, the default libhdfs3 will be used instead.