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

Function ValidateAndOpenFile

be/src/exec/tuple-text-file-util.cc:131–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131static Status ValidateAndOpenFile(const string& path, TupleTextFileReader& reader) {
132 if (!reader.Open().ok()) {
133 return Status(TErrorCode::TUPLE_CACHE_INCONSISTENCY,
134 Substitute("Failed to open file '$0'", path + DEBUG_TUPLE_CACHE_BAD_POSTFIX));
135 }
136
137 if (reader.GetFileSize() == TUPLE_TEXT_FILE_SIZE_ERROR) {
138 return Status(TErrorCode::TUPLE_CACHE_INCONSISTENCY,
139 Substitute("Size of file '$0' is invalid", path + DEBUG_TUPLE_CACHE_BAD_POSTFIX));
140 }
141 return Status::OK();
142}
143
144static Status CacheFileCmp(
145 const std::string& path_a, const std::string& path_b, bool* passed) {

Callers 1

CacheFileCmpFunction · 0.85

Calls 6

SubstituteFunction · 0.85
OKFunction · 0.85
StatusClass · 0.70
okMethod · 0.45
OpenMethod · 0.45
GetFileSizeMethod · 0.45

Tested by

no test coverage detected