Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
23 changes: 12 additions & 11 deletions tensorflow_io/core/plugins/file_system_plugins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,25 @@ 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 = 7;
info->num_schemes = 8;
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::http::ProvideFilesystemSupportFor(&info->ops[2], "https");
// Load plugins only when the environment variable is set
if (load_plugin == "true" || load_plugin == "1") {
tensorflow::io::s3::ProvideFilesystemSupportFor(&info->ops[2], "s3");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[3], "hdfs");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[4], "viewfs");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[5], "har");
tensorflow::io::gs::ProvideFilesystemSupportFor(&info->ops[6], "gs");
tensorflow::io::s3::ProvideFilesystemSupportFor(&info->ops[3], "s3");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[4], "hdfs");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[5], "viewfs");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[6], "har");
tensorflow::io::gs::ProvideFilesystemSupportFor(&info->ops[7], "gs");
} else {
tensorflow::io::s3::ProvideFilesystemSupportFor(&info->ops[2], "s3e");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[3], "hdfse");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[4], "viewfse");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[5], "hare");
tensorflow::io::gs::ProvideFilesystemSupportFor(&info->ops[6], "gse");
tensorflow::io::s3::ProvideFilesystemSupportFor(&info->ops[3], "s3e");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[4], "hdfse");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[5], "viewfse");
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[6], "hare");
tensorflow::io::gs::ProvideFilesystemSupportFor(&info->ops[7], "gse");
}
}
2 changes: 1 addition & 1 deletion tests/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, methodName="runTest"): # pylint: disable=invalid-name
self.local_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "test_http", "LICENSE-2.0.txt"
)
self.remote_filename = "http://www.apache.org/licenses/LICENSE-2.0.txt"
self.remote_filename = "https://www.apache.org/licenses/LICENSE-2.0.txt"
super().__init__(methodName)

def setUp(self): # pylint: disable=invalid-name
Expand Down