Skip to content

Commit f919434

Browse files
authored
Make OSSFileSystem works again (#1723)
* make ossfs work again * make ossfs work again * make ossfs work again * fix code style
1 parent 1d05ab5 commit f919434

File tree

10 files changed

+882
-104
lines changed

10 files changed

+882
-104
lines changed

tensorflow_io/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ cc_binary(
4646
"//tensorflow_io/core:elasticsearch_ops",
4747
"//tensorflow_io/core:genome_ops",
4848
"//tensorflow_io/core:optimization",
49-
"//tensorflow_io/core:oss_ops",
5049
"//tensorflow_io/core/kernels/gsmemcachedfs:gs_memcached_file_system",
5150
],
5251
}) + select({

tensorflow_io/core/BUILD

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -707,22 +707,6 @@ cc_library(
707707
alwayslink = 1,
708708
)
709709

710-
cc_library(
711-
name = "oss_ops",
712-
srcs = [
713-
"kernels/oss/oss_file_system.cc",
714-
"kernels/oss/oss_file_system.h",
715-
],
716-
copts = tf_io_copts(),
717-
linkstatic = True,
718-
deps = [
719-
"@aliyun_oss_c_sdk",
720-
"@local_config_tf//:libtensorflow_framework",
721-
"@local_config_tf//:tf_header_lib",
722-
],
723-
alwayslink = 1,
724-
)
725-
726710
cc_library(
727711
name = "sql_ops",
728712
srcs = [

tensorflow_io/core/filesystems/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ cc_library(
3838
"//tensorflow_io/core/filesystems/az",
3939
"//tensorflow_io/core/filesystems/hdfs",
4040
"//tensorflow_io/core/filesystems/http",
41+
"//tensorflow_io/core/filesystems/oss",
4142
"//tensorflow_io/core/filesystems/s3",
4243
],
4344
alwayslink = 1,

tensorflow_io/core/filesystems/filesystem_plugins.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ limitations under the License.
2929
TFIO_PLUGIN_EXPORT void TF_InitPlugin(TF_FilesystemPluginInfo* info) {
3030
info->plugin_memory_allocate = tensorflow::io::plugin_memory_allocate;
3131
info->plugin_memory_free = tensorflow::io::plugin_memory_free;
32-
info->num_schemes = 7;
32+
info->num_schemes = 8;
3333
info->ops = static_cast<TF_FilesystemPluginOps*>(
3434
tensorflow::io::plugin_memory_allocate(info->num_schemes *
3535
sizeof(info->ops[0])));
@@ -40,4 +40,5 @@ TFIO_PLUGIN_EXPORT void TF_InitPlugin(TF_FilesystemPluginInfo* info) {
4040
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[4], "hdfs");
4141
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[5], "viewfs");
4242
tensorflow::io::hdfs::ProvideFilesystemSupportFor(&info->ops[6], "har");
43+
tensorflow::io::oss::ProvideFilesystemSupportFor(&info->ops[7], "oss");
4344
}

tensorflow_io/core/filesystems/filesystem_plugins.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ void ProvideFilesystemSupportFor(TF_FilesystemPluginOps* ops, const char* uri);
5050

5151
} // namespace s3
5252

53+
namespace oss {
54+
55+
void ProvideFilesystemSupportFor(TF_FilesystemPluginOps* ops, const char* uri);
56+
57+
} // namespace oss
58+
5359
} // namespace io
5460
} // namespace tensorflow
5561

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
licenses(["notice"]) # Apache 2.0
2+
3+
package(default_visibility = ["//visibility:public"])
4+
5+
load(
6+
"//:tools/build/tensorflow_io.bzl",
7+
"tf_io_copts",
8+
)
9+
10+
cc_library(
11+
name = "oss",
12+
srcs = [
13+
"oss_filesystem.cc",
14+
"oss_filesystem.h",
15+
],
16+
copts = tf_io_copts(),
17+
linkstatic = True,
18+
deps = [
19+
"//tensorflow_io/core/filesystems:filesystem_plugins_header",
20+
"@aliyun_oss_c_sdk",
21+
"@local_config_tf//:tf_header_lib",
22+
],
23+
alwayslink = 1,
24+
)
File renamed without changes.

0 commit comments

Comments
 (0)