@@ -15,7 +15,58 @@ limitations under the License.
1515#ifndef TENSORFLOW_C_EXPERIMENTAL_FILESYSTEM_PLUGINS_HADOOP_HADOOP_FILESYSTEM_H_
1616#define TENSORFLOW_C_EXPERIMENTAL_FILESYSTEM_PLUGINS_HADOOP_HADOOP_FILESYSTEM_H_
1717
18+ #include < string>
19+
1820#include " tensorflow/c/experimental/filesystem/filesystem_interface.h"
1921#include " tensorflow/c/tf_status.h"
2022
23+ void ParseHadoopPath (const std::string& fname, std::string* scheme,
24+ std::string* namenode, std::string* path);
25+ class LibHDFS ;
26+
27+ namespace tf_random_access_file {
28+ void Cleanup (TF_RandomAccessFile* file);
29+ int64_t Read (const TF_RandomAccessFile* file, uint64_t offset, size_t n,
30+ char * buffer, TF_Status* status);
31+ } // namespace tf_random_access_file
32+
33+ namespace tf_writable_file {
34+ void Cleanup (TF_WritableFile* file);
35+ void Append (const TF_WritableFile* file, const char * buffer, size_t n,
36+ TF_Status* status);
37+ int64_t Tell (const TF_WritableFile* file, TF_Status* status);
38+ void Sync (const TF_WritableFile* file, TF_Status* status);
39+ void Flush (const TF_WritableFile* file, TF_Status* status);
40+ void Close (const TF_WritableFile* file, TF_Status* status);
41+ } // namespace tf_writable_file
42+
43+ namespace tf_hadoop_filesystem {
44+ void Init (TF_Filesystem* filesystem, TF_Status* status);
45+ void Cleanup (TF_Filesystem* filesystem);
46+ void NewRandomAccessFile (const TF_Filesystem* filesystem, const char * path,
47+ TF_RandomAccessFile* file, TF_Status* status);
48+ void NewWritableFile (const TF_Filesystem* filesystem, const char * path,
49+ TF_WritableFile* file, TF_Status* status);
50+ void NewReadOnlyMemoryRegionFromFile (const TF_Filesystem* filesystem,
51+ const char * path,
52+ TF_ReadOnlyMemoryRegion* region,
53+ TF_Status* status);
54+ void PathExists (const TF_Filesystem* filesystem, const char * path,
55+ TF_Status* status);
56+ void Stat (const TF_Filesystem* filesystem, const char * path,
57+ TF_FileStatistics* stats, TF_Status* status);
58+ int64_t GetFileSize (const TF_Filesystem* filesystem, const char * path,
59+ TF_Status* status);
60+ void DeleteFile (const TF_Filesystem* filesystem, const char * path,
61+ TF_Status* status);
62+ void CreateDir (const TF_Filesystem* filesystem, const char * path,
63+ TF_Status* status);
64+ void DeleteDir (const TF_Filesystem* filesystem, const char * path,
65+ TF_Status* status);
66+ void RenameFile (const TF_Filesystem* filesystem, const char * src,
67+ const char * dst, TF_Status* status);
68+ int GetChildren (const TF_Filesystem* filesystem, const char * path,
69+ char *** entries, TF_Status* status);
70+ } // namespace tf_hadoop_filesystem
71+
2172#endif // TENSORFLOW_C_EXPERIMENTAL_FILESYSTEM_PLUGINS_HADOOP_HADOOP_FILESYSTEM_H_
0 commit comments