MCPcopy Create free account
hub / github.com/apache/impala / Close

Method Close

be/src/runtime/io/data-cache.cc:212–225  ·  view source on GitHub ↗

Close the underlying file so it cannot be read or written to anymore.

Source from the content-addressed store, hash-verified

210
211 // Close the underlying file so it cannot be read or written to anymore.
212 void Close() {
213 // Explicitly hold the lock in write mode to block all readers. This ensures that
214 // setting 'file_' to NULL and 'allow_append_' to false below is atomic.
215 std::unique_lock<percpu_rwlock> lock(lock_);
216 // If the file is already closed, nothing to do.
217 if (!file_) return;
218 kudu::Status status = file_->Close();
219 if (!status.ok()) {
220 LOG(WARNING) << Substitute("Failed to close cache file $0: $1", path_,
221 status.ToString());
222 }
223 file_.reset();
224 allow_append_ = false;
225 }
226
227 // Close the underlying file and delete it from the filesystem.
228 void DeleteFile() {

Callers 1

Calls 4

SubstituteFunction · 0.85
resetMethod · 0.65
okMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected