@Before public void setUp() throws Exception {
    Configuration conf = new Configuration();
    // Set lambda to 1 so the heap size becomes 1 (LRU).
    conf.setDouble(HiveConf.ConfVars.LLAP_LRFU_LAMBDA.varname, 1.0f);
    conf.setInt(HiveConf.ConfVars.LLAP_LRFU_BP_WRAPPER_SIZE.varname, 1);
    int minBufferSize = 1;
    cachePolicy = new LowLevelLrfuCachePolicy(minBufferSize, maxSize, conf);
    memoryManager = new LowLevelCacheMemoryManager(maxSize, cachePolicy, CACHE_METRICS);
    int maxAllocationSize = 1024;
    int minAllocationSize = 8;
    allocator =
        new BuddyAllocator(true,
            false,
            minAllocationSize,
            maxAllocationSize,
            1,
            maxSize,
            0,
            null,
            memoryManager, CACHE_METRICS,
            "no-force-eviction",
            true);
    EvictionDispatcher evictionDispatcher = new EvictionDispatcher(dataCache, serdCache, metaDataCache, allocator);
    evictionTracker = new EvictionTracker(evictionDispatcher);
    cachePolicy.setEvictionListener(evictionTracker);
  }
Test the full cycle of allocation/accounting/eviction interactions.
llap-server/src/test/org/apache/hadoop/hive/llap/cache/TestCacheAllocationsEvictionsCycles.java