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

Function OverrideBytesFreeWithTestingFlags

be/src/kudu/util/env_util.cc:157–168  ·  view source on GitHub ↗

If any of the override gflags specifies an override for the given path, then override the free bytes to match what is specified in the flag. See the definitions of these test-only flags for more information.

Source from the content-addressed store, hash-verified

155// override the free bytes to match what is specified in the flag. See the
156// definitions of these test-only flags for more information.
157static void OverrideBytesFreeWithTestingFlags(const string& path, int64_t* bytes_free) {
158 const string* prefixes[] = { &FLAGS_disk_reserved_override_prefix_1_path_for_testing,
159 &FLAGS_disk_reserved_override_prefix_2_path_for_testing };
160 const int64_t* overrides[] = { &FLAGS_disk_reserved_override_prefix_1_bytes_free_for_testing,
161 &FLAGS_disk_reserved_override_prefix_2_bytes_free_for_testing };
162 for (int i = 0; i < arraysize(prefixes); i++) {
163 if (*overrides[i] != -1 && !prefixes[i]->empty() && HasPrefixString(path, *prefixes[i])) {
164 *bytes_free = *overrides[i];
165 return;
166 }
167 }
168}
169
170Status VerifySufficientDiskSpace(Env *env, const std::string& path, int64_t requested_bytes,
171 int64_t reserved_bytes, int64_t* available_bytes) {

Callers 1

Calls 2

HasPrefixStringFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected