Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -1052,3 +1052,14 @@ http_archive(
"https://pilotfiber.dl.sourceforge.net/project/giflib/giflib-5.2.1.tar.gz",
],
)

http_archive(
name = "hadoop",
build_file = "//third_party:hadoop.BUILD",
sha256 = "5fd5831b12b1e0999bd352d6cca11ef80f883c81ffa898e53c68d8fe8d170e9f",
strip_prefix = "hadoop-3.3.0-src",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/downloads.apache.org/hadoop/common/hadoop-3.3.0/hadoop-3.3.0-src.tar.gz",
"https://downloads.apache.org/hadoop/common/hadoop-3.3.0/hadoop-3.3.0-src.tar.gz",
],
)
1 change: 1 addition & 0 deletions tensorflow_io/core/plugins/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ cc_library(
linkstatic = True,
deps = [
"//tensorflow_io/core/plugins/az",
"//tensorflow_io/core/plugins/hdfs",
"//tensorflow_io/core/plugins/http",
"//tensorflow_io/core/plugins/s3",
],
Expand Down
3 changes: 2 additions & 1 deletion tensorflow_io/core/plugins/file_system_plugins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ limitations under the License.
void TF_InitPlugin(TF_FilesystemPluginInfo* info) {
info->plugin_memory_allocate = tensorflow::io::plugin_memory_allocate;
info->plugin_memory_free = tensorflow::io::plugin_memory_free;
info->num_schemes = 3;
info->num_schemes = 4;
info->ops = static_cast<TF_FilesystemPluginOps*>(
tensorflow::io::plugin_memory_allocate(info->num_schemes *
sizeof(info->ops[0])));
tensorflow::io::az::ProvideFilesystemSupportFor(&info->ops[0], "az");
tensorflow::io::http::ProvideFilesystemSupportFor(&info->ops[1], "http");
tensorflow::io::s3::ProvideFilesystemSupportFor(&info->ops[2], "s3e");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[3], "hdfse");
}
6 changes: 6 additions & 0 deletions tensorflow_io/core/plugins/file_system_plugins.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ void ProvideFilesystemSupportFor(TF_FilesystemPluginOps* ops, const char* uri);

} // namespace az

namespace hdfs {

void ProvideFilesystemSupportFor(TF_FilesystemPluginOps* ops, const char* uri);

} // namespace hdfs

namespace http {

void ProvideFilesystemSupportFor(TF_FilesystemPluginOps* ops, const char* uri);
Expand Down
22 changes: 22 additions & 0 deletions tensorflow_io/core/plugins/hdfs/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
licenses(["notice"]) # Apache 2.0

package(default_visibility = ["//visibility:public"])

load(
"//:tools/build/tensorflow_io.bzl",
"tf_io_copts",
)

cc_library(
name = "hdfs",
srcs = [
"hadoop_filesystem.cc",
],
copts = tf_io_copts(),
linkstatic = True,
deps = [
"//tensorflow_io/core/plugins:plugins_header",
"@hadoop",
],
alwayslink = 1,
)
Loading