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

Function is_path_fully_cached

tests/query_test/test_hdfs_caching.py:302–310  ·  view source on GitHub ↗

Returns true if all the bytes of the path are cached, false otherwise

(path)

Source from the content-addressed store, hash-verified

300
301
302def is_path_fully_cached(path):
303 """Returns true if all the bytes of the path are cached, false otherwise"""
304 rc, stdout, stderr = exec_process(
305 "hdfs cacheadmin -listDirectives -stats -path %s" % path)
306 assert rc == 0
307 caching_stats = stdout.strip("\n").split("\n")[-1].split()
308 # Compare BYTES_NEEDED and BYTES_CACHED, the output format is as follows
309 # "ID POOL REPL EXPIRY PATH BYTES_NEEDED BYTES_CACHED FILES_NEEDED FILES_CACHED"
310 return len(caching_stats) > 0 and caching_stats[5] == caching_stats[6]
311
312
313def get_cache_directive_for_path(path):

Callers 1

Calls 1

exec_processFunction · 0.90

Tested by

no test coverage detected