@Test public void testSkipCache_minColsGreaterThanChosenColumns() { CacheConfig.setCacheDataEnabled(conf, true); CacheConfig.setCacheDataLocationWhitelist(conf, ".*test.*"); CacheConfig.setCacheDataTable(conf, "testTable"); CacheConfig.setCacheDataTableWhitelist(conf, ".*testTable.*"); CacheConfig.setCacheDataMinColumns(conf, 5); CacheConfig.setCacheDataChosenColumns(conf, 3); String testPath = "/test/path"; boolean skipCache = CacheUtil.skipCache(testPath, conf); assertTrue(skipCache, "Cache is not being skipped!"); }
public static boolean skipCache(String path, Configuration conf) { if (!CacheConfig.isCacheDataEnabled(conf)) { return true; } if (!isLocationAllowedToCache(path, conf)) { return true; } if (!isTableAllowedToCache(conf)) { return true; } if (!minColumnsSelected(conf)) { return true; } return false; }
CacheUtil { public static boolean skipCache(String path, Configuration conf) { if (!CacheConfig.isCacheDataEnabled(conf)) { return true; } if (!isLocationAllowedToCache(path, conf)) { return true; } if (!isTableAllowedToCache(conf)) { return true; } if (!minColumnsSelected(conf)) { return true; } return false; } }
CacheUtil { public static boolean skipCache(String path, Configuration conf) { if (!CacheConfig.isCacheDataEnabled(conf)) { return true; } if (!isLocationAllowedToCache(path, conf)) { return true; } if (!isTableAllowedToCache(conf)) { return true; } if (!minColumnsSelected(conf)) { return true; } return false; } private  CacheUtil(); }
CacheUtil { public static boolean skipCache(String path, Configuration conf) { if (!CacheConfig.isCacheDataEnabled(conf)) { return true; } if (!isLocationAllowedToCache(path, conf)) { return true; } if (!isTableAllowedToCache(conf)) { return true; } if (!minColumnsSelected(conf)) { return true; } return false; } private  CacheUtil(); static void createCacheDirectories(Configuration conf); static int getCacheDiskCount(Configuration conf); static HashMap<Integer, String> getCacheDiskPathsMap(final Configuration conf); static String getDirPath(int dirIndex, Configuration conf); static String getLocalPath(String remotePath, Configuration conf, int generationNumber); static String getMetadataFilePath(String remotePath, Configuration conf, int generationNumber); static boolean isMetadataFile(String filePath, Configuration conf); static boolean skipCache(String path, Configuration conf); static List<String> getDirPrefixList(Configuration conf); static String getName(String remotePath); }
CacheUtil { public static boolean skipCache(String path, Configuration conf) { if (!CacheConfig.isCacheDataEnabled(conf)) { return true; } if (!isLocationAllowedToCache(path, conf)) { return true; } if (!isTableAllowedToCache(conf)) { return true; } if (!minColumnsSelected(conf)) { return true; } return false; } private  CacheUtil(); static void createCacheDirectories(Configuration conf); static int getCacheDiskCount(Configuration conf); static HashMap<Integer, String> getCacheDiskPathsMap(final Configuration conf); static String getDirPath(int dirIndex, Configuration conf); static String getLocalPath(String remotePath, Configuration conf, int generationNumber); static String getMetadataFilePath(String remotePath, Configuration conf, int generationNumber); static boolean isMetadataFile(String filePath, Configuration conf); static boolean skipCache(String path, Configuration conf); static List<String> getDirPrefixList(Configuration conf); static String getName(String remotePath); static final int UNKONWN_GENERATION_NUMBER; static final int DUMMY_MODE_GENERATION_NUMBER; }