@Test public void testCheckCacheState() throws Exception { ExtTableSnapshotInfo snapshotInfo = buildSnapshotCache(RandomUtil.randomUUID().toString(), 1000); RocksDBLookupTableCache cache = RocksDBLookupTableCache.getInstance(kylinConfig); ILookupTable cachedLookupTable = cache.getCachedLookupTable(tableDesc, snapshotInfo, false); assertNotNull(cachedLookupTable); cachedLookupTable.close(); ExtTableSnapshotInfoManager.getInstance(kylinConfig).removeSnapshot(snapshotInfo.getTableName(), snapshotInfo.getId()); cache.checkCacheState(); String cacheLocalPath = cache.getSnapshotCachePath(snapshotInfo.getTableName(), snapshotInfo.getId()); assertTrue(new File(cacheLocalPath).exists()); kylinConfig.setProperty("kylin.snapshot.ext.local.cache.check.volatile", "0"); cache.checkCacheState(); assertFalse(new File(cacheLocalPath).exists()); cachedLookupTable = cache.getCachedLookupTable(tableDesc, snapshotInfo, false); assertNull(cachedLookupTable); }
public void checkCacheState() { cacheStateChecker.run(); }
RocksDBLookupTableCache implements IExtLookupTableCache { public void checkCacheState() { cacheStateChecker.run(); } }
RocksDBLookupTableCache implements IExtLookupTableCache { public void checkCacheState() { cacheStateChecker.run(); } private  RocksDBLookupTableCache(KylinConfig config); }
RocksDBLookupTableCache implements IExtLookupTableCache { public void checkCacheState() { cacheStateChecker.run(); } private  RocksDBLookupTableCache(KylinConfig config); static RocksDBLookupTableCache getInstance(KylinConfig config); static void clearCache(); @Override ILookupTable getCachedLookupTable(TableDesc tableDesc, ExtTableSnapshotInfo extTableSnapshotInfo,
            boolean buildIfNotExist); @Override void buildSnapshotCache(final TableDesc tableDesc, final ExtTableSnapshotInfo extTableSnapshotInfo,
            final ILookupTable sourceTable); @Override void removeSnapshotCache(ExtTableSnapshotInfo extTableSnapshotInfo); @Override CacheState getCacheState(ExtTableSnapshotInfo extTableSnapshotInfo); long getTotalCacheSize(); void checkCacheState(); }
RocksDBLookupTableCache implements IExtLookupTableCache { public void checkCacheState() { cacheStateChecker.run(); } private  RocksDBLookupTableCache(KylinConfig config); static RocksDBLookupTableCache getInstance(KylinConfig config); static void clearCache(); @Override ILookupTable getCachedLookupTable(TableDesc tableDesc, ExtTableSnapshotInfo extTableSnapshotInfo,
            boolean buildIfNotExist); @Override void buildSnapshotCache(final TableDesc tableDesc, final ExtTableSnapshotInfo extTableSnapshotInfo,
            final ILookupTable sourceTable); @Override void removeSnapshotCache(ExtTableSnapshotInfo extTableSnapshotInfo); @Override CacheState getCacheState(ExtTableSnapshotInfo extTableSnapshotInfo); long getTotalCacheSize(); void checkCacheState();  }