MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / NewWritableFile

Method NewWritableFile

tensorflow/contrib/ignite/kernels/igfs/igfs.cc:97–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97Status IGFS::NewWritableFile(const string &file_name,
98 std::unique_ptr<WritableFile> *result) {
99 std::unique_ptr<IGFSClient> client = CreateClient();
100 string path = TranslateName(file_name);
101
102 CtrlResponse<HandshakeResponse> handshake_response(true);
103 TF_RETURN_IF_ERROR(client->Handshake(&handshake_response));
104
105 CtrlResponse<ExistsResponse> exists_response(false);
106 TF_RETURN_IF_ERROR(client->Exists(&exists_response, path));
107
108 if (exists_response.res.exists) {
109 CtrlResponse<DeleteResponse> del_response(false);
110 TF_RETURN_IF_ERROR(client->Delete(&del_response, path, false));
111 }
112
113 CtrlResponse<OpenCreateResponse> open_create_resp(false);
114 TF_RETURN_IF_ERROR(client->OpenCreate(&open_create_resp, path));
115
116 int64 resource_id = open_create_resp.res.stream_id;
117 result->reset(new IGFSWritableFile(path, resource_id, std::move(client)));
118
119 LOG(INFO) << "New writable file completed successfully [file_name="
120 << file_name << "]";
121
122 return Status::OK();
123}
124
125Status IGFS::NewAppendableFile(const string &file_name,
126 std::unique_ptr<WritableFile> *result) {

Callers 1

WriteFileFunction · 0.45

Calls 5

OpenCreateMethod · 0.80
HandshakeMethod · 0.45
ExistsMethod · 0.45
DeleteMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected