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

Method __test_data_cache

tests/custom_cluster/test_data_cache.py:106–125  ·  view source on GitHub ↗

This test scans the same table twice and verifies the cache hit count metrics are correct. The exact number of bytes hit is non-deterministic between runs due to different mtime of files and multiple shards in the cache.

(self)

Source from the content-addressed store, hash-verified

104 self.__test_data_cache_deterministic(vector, unique_database)
105
106 def __test_data_cache(self):
107 """ This test scans the same table twice and verifies the cache hit count metrics
108 are correct. The exact number of bytes hit is non-deterministic between runs due
109 to different mtime of files and multiple shards in the cache.
110 """
111 QUERY = "select * from tpch_parquet.lineitem"
112 # Do a first run to warm up the cache. Expect no hits.
113 self.execute_query(QUERY)
114 assert self.get_data_cache_metric('hit-bytes') == 0
115 assert self.get_data_cache_metric('hit-count') == 0
116 assert self.get_data_cache_metric('miss-bytes') > 0
117 assert self.get_data_cache_metric('miss-count') > 0
118 assert self.get_data_cache_metric('total-bytes') > 0
119 assert self.get_data_cache_metric('num-entries') > 0
120 assert self.get_data_cache_metric('num-writes') > 0
121
122 # Do a second run. Expect some hits.
123 self.execute_query(QUERY)
124 assert self.get_data_cache_metric('hit-bytes') > 0
125 assert self.get_data_cache_metric('hit-count') > 0
126
127 @pytest.mark.execute_serially
128 @CustomClusterTestSuite.with_args(

Callers 2

test_data_cache_lruMethod · 0.95
test_data_cache_lirsMethod · 0.95

Calls 2

get_data_cache_metricMethod · 0.95
execute_queryMethod · 0.45

Tested by

no test coverage detected