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

Function get_num_cache_requests_util

tests/query_test/test_hdfs_caching.py:334–352  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

332 to return a stable result by making several attempts to stabilize it within a
333 reasonable timeout."""
334 def get_num_cache_requests_util():
335 rc, stdout, stderr = exec_process("hdfs cacheadmin -listDirectives -stats")
336 assert rc == 0, 'Error executing hdfs cacheadmin: %s %s' % (stdout, stderr)
337 # remove blank new lines from output count
338 lines = [line for line in stdout.split('\n') if line.strip()]
339 count = None
340 for line in lines:
341 if line.startswith("Found "):
342 # the line should say "Found <int> entries"
343 # if we find this line we parse the number of entries
344 # from this line.
345 count = int(re.search(r'\d+', line).group())
346 break
347 # if count is available we return it else we just
348 # return the total number of lines
349 if count is not None:
350 return count
351 else:
352 return len(stdout.split('\n'))
353
354 # IMPALA-3040: This can take time, especially under slow builds like ASAN.
355 wait_time_in_sec = build_flavor_timeout(5, slow_build_timeout=20)

Callers 1

get_num_cache_requestsFunction · 0.85

Calls 2

exec_processFunction · 0.90
searchMethod · 0.45

Tested by

no test coverage detected