public static ILookupTable getExtLookupTableWithoutCache(TableDesc tableDesc, ExtTableSnapshotInfo extTableSnapshot) { IExtLookupProvider provider = getExtLookupProvider(extTableSnapshot.getStorageType()); return provider.getLookupTable(tableDesc, extTableSnapshot); }
public static CacheState getCacheState(ExtTableSnapshotInfo extTableSnapshotInfo) { IExtLookupTableCache tablesCache = getExtLookupProvider(extTableSnapshotInfo.getStorageType()).getLocalCache(); if (tablesCache != null) { return tablesCache.getCacheState(extTableSnapshotInfo); } return CacheState.NONE; }
public static void removeLocalCache(ExtTableSnapshotInfo extTableSnapshotInfo) { IExtLookupTableCache tablesCache = getExtLookupProvider(extTableSnapshotInfo.getStorageType()).getLocalCache(); if (tablesCache != null) { tablesCache.removeSnapshotCache(extTableSnapshotInfo); } }
private static List<String> getAllUsedExtLookupTables() throws IOException { List<String> result = Lists.newArrayList(); KylinConfig config = KylinConfig.getInstanceFromEnv(); final Set<String> activeSnapshotSet = ExtTableSnapshotInfoManager.getInstance(config).getAllExtSnapshotResPaths(); for (String extSnapshotResource : activeSnapshotSet) { try { ExtTableSnapshotInfo extTableSnapshot = ExtTableSnapshotInfoManager.getInstance(config).getSnapshot( extSnapshotResource); if (extTableSnapshot != null) { if (ExtTableSnapshotInfo.STORAGE_TYPE_HBASE.equals(extTableSnapshot.getStorageType())) { result.add(extTableSnapshot.getStorageLocationIdentifier()); } } } catch (Exception e) { logger.error("error fetch ext table snapshot:" + extSnapshotResource, e); } } return result; }
public static void rebuildLocalCache(TableDesc tableDesc, ExtTableSnapshotInfo extTableSnapshotInfo) { IExtLookupTableCache tablesCache = getExtLookupProvider(extTableSnapshotInfo.getStorageType()).getLocalCache(); if (tablesCache != null) { tablesCache.buildSnapshotCache(tableDesc, extTableSnapshotInfo, getExtLookupTableWithoutCache(tableDesc, extTableSnapshotInfo)); } }
public static ILookupTable getExtLookupTable(TableDesc tableDesc, ExtTableSnapshotInfo extTableSnapshot) { IExtLookupTableCache extLookupTableCache = getExtLookupProvider(extTableSnapshot.getStorageType()).getLocalCache(); if (extLookupTableCache == null) { return getExtLookupTableWithoutCache(tableDesc, extTableSnapshot); } ILookupTable cachedLookupTable = extLookupTableCache.getCachedLookupTable(tableDesc, extTableSnapshot, true); if (cachedLookupTable != null) { logger.info("try to use cached lookup table:{}", extTableSnapshot.getResourcePath()); return cachedLookupTable; } logger.info("use ext lookup table:{}", extTableSnapshot.getResourcePath()); return getExtLookupTableWithoutCache(tableDesc, extTableSnapshot); }
response.setSnapshotType(TableSnapshotResponse.TYPE_EXT); response.setLastBuildTime(extTableSnapshot.getLastBuildTime()); response.setStorageType(extTableSnapshot.getStorageType()); response.setSourceTableSize(extTableSnapshot.getSignature().getSize()); response.setSourceTableLastModifyTime(extTableSnapshot.getSignature().getLastModifiedTime());
public static ILookupTable getExtLookupTableWithoutCache(TableDesc tableDesc, ExtTableSnapshotInfo extTableSnapshot) { IExtLookupProvider provider = getExtLookupProvider(extTableSnapshot.getStorageType()); return provider.getLookupTable(tableDesc, extTableSnapshot); }
public static void removeLocalCache(ExtTableSnapshotInfo extTableSnapshotInfo) { IExtLookupTableCache tablesCache = getExtLookupProvider(extTableSnapshotInfo.getStorageType()).getLocalCache(); if (tablesCache != null) { tablesCache.removeSnapshotCache(extTableSnapshotInfo); } }
public static CacheState getCacheState(ExtTableSnapshotInfo extTableSnapshotInfo) { IExtLookupTableCache tablesCache = getExtLookupProvider(extTableSnapshotInfo.getStorageType()).getLocalCache(); if (tablesCache != null) { return tablesCache.getCacheState(extTableSnapshotInfo); } return CacheState.NONE; }
public static void rebuildLocalCache(TableDesc tableDesc, ExtTableSnapshotInfo extTableSnapshotInfo) { IExtLookupTableCache tablesCache = getExtLookupProvider(extTableSnapshotInfo.getStorageType()).getLocalCache(); if (tablesCache != null) { tablesCache.buildSnapshotCache(tableDesc, extTableSnapshotInfo, getExtLookupTableWithoutCache(tableDesc, extTableSnapshotInfo)); } }
public static ILookupTable getExtLookupTable(TableDesc tableDesc, ExtTableSnapshotInfo extTableSnapshot) { IExtLookupTableCache extLookupTableCache = getExtLookupProvider(extTableSnapshot.getStorageType()).getLocalCache(); if (extLookupTableCache == null) { return getExtLookupTableWithoutCache(tableDesc, extTableSnapshot); } ILookupTable cachedLookupTable = extLookupTableCache.getCachedLookupTable(tableDesc, extTableSnapshot, true); if (cachedLookupTable != null) { logger.info("try to use cached lookup table:{}", extTableSnapshot.getResourcePath()); return cachedLookupTable; } logger.info("use ext lookup table:{}", extTableSnapshot.getResourcePath()); return getExtLookupTableWithoutCache(tableDesc, extTableSnapshot); }