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

Method NewAppendableFile

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

Source from the content-addressed store, hash-verified

123}
124
125Status IGFS::NewAppendableFile(const string &file_name,
126 std::unique_ptr<WritableFile> *result) {
127 std::unique_ptr<IGFSClient> client = CreateClient();
128
129 CtrlResponse<HandshakeResponse> handshake_response(true);
130 TF_RETURN_IF_ERROR(client->Handshake(&handshake_response));
131
132 CtrlResponse<ExistsResponse> exists_response(false);
133 TF_RETURN_IF_ERROR(client->Exists(&exists_response, file_name));
134
135 if (exists_response.res.exists) {
136 CtrlResponse<DeleteResponse> del_response(false);
137 TF_RETURN_IF_ERROR(client->Delete(&del_response, file_name, false));
138 }
139
140 CtrlResponse<OpenAppendResponse> open_append_resp(false);
141 TF_RETURN_IF_ERROR(client->OpenAppend(&open_append_resp, file_name));
142
143 result->reset(new IGFSWritableFile(TranslateName(file_name),
144 open_append_resp.res.stream_id,
145 std::move(client)));
146
147 LOG(INFO) << "New appendable file completed successfully [file_name="
148 << file_name << "]";
149
150 return Status::OK();
151}
152
153Status IGFS::NewReadOnlyMemoryRegionFromFile(
154 const string &file_name, std::unique_ptr<ReadOnlyMemoryRegion> *result) {

Callers

nothing calls this directly

Calls 5

OpenAppendMethod · 0.80
HandshakeMethod · 0.45
ExistsMethod · 0.45
DeleteMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected