public HBaseLookupTable(TableDesc tableDesc, ExtTableSnapshotInfo extTableSnapshot) { String tableName = extTableSnapshot.getStorageLocationIdentifier(); this.lookupTableName = TableName.valueOf(tableName); KylinConfig kylinConfig = KylinConfig.getInstanceFromEnv(); Connection connection = HBaseConnection.get(kylinConfig.getStorageUrl()); try { table = connection.getTable(lookupTableName); } catch (IOException e) { throw new RuntimeException("error when connect HBase", e); } String[] keyColumns = extTableSnapshot.getKeyColumns(); encoder = new HBaseLookupRowEncoder(tableDesc, keyColumns, extTableSnapshot.getShardNum()); }
@Override public ILookupTable getCachedLookupTable(TableDesc tableDesc, ExtTableSnapshotInfo extTableSnapshotInfo, boolean buildIfNotExist) { String resourcePath = extTableSnapshotInfo.getResourcePath(); if (inBuildingTables.containsKey(resourcePath)) { logger.info("cache is in building for snapshot:" + resourcePath); return null; } CachedTableInfo cachedTableInfo = tablesCache.getIfPresent(resourcePath); if (cachedTableInfo == null) { if (buildIfNotExist) { buildSnapshotCache(tableDesc, extTableSnapshotInfo, getSourceLookupTable(tableDesc, extTableSnapshotInfo)); } logger.info("no available cache ready for the table snapshot:" + extTableSnapshotInfo.getResourcePath()); return null; } String[] keyColumns = extTableSnapshotInfo.getKeyColumns(); String dbPath = getSnapshotStorePath(extTableSnapshotInfo.getTableName(), extTableSnapshotInfo.getId()); return new RocksDBLookupTable(tableDesc, keyColumns, dbPath); }
return; final String[] keyColumns = extTableSnapshotInfo.getKeyColumns(); final String cachePath = getSnapshotCachePath(extTableSnapshotInfo.getTableName(), extTableSnapshotInfo.getId()); final String dbPath = getSnapshotStorePath(extTableSnapshotInfo.getTableName(), extTableSnapshotInfo.getId());
public HBaseLookupTable(TableDesc tableDesc, ExtTableSnapshotInfo extTableSnapshot) { String tableName = extTableSnapshot.getStorageLocationIdentifier(); this.lookupTableName = TableName.valueOf(tableName); KylinConfig kylinConfig = KylinConfig.getInstanceFromEnv(); Connection connection = HBaseConnection.get(kylinConfig.getStorageUrl()); try { table = connection.getTable(lookupTableName); } catch (IOException e) { throw new RuntimeException("error when connect HBase", e); } String[] keyColumns = extTableSnapshot.getKeyColumns(); encoder = new HBaseLookupRowEncoder(tableDesc, keyColumns, extTableSnapshot.getShardNum()); }
@Override public ILookupTable getCachedLookupTable(TableDesc tableDesc, ExtTableSnapshotInfo extTableSnapshotInfo, boolean buildIfNotExist) { String resourcePath = extTableSnapshotInfo.getResourcePath(); if (inBuildingTables.containsKey(resourcePath)) { logger.info("cache is in building for snapshot:" + resourcePath); return null; } CachedTableInfo cachedTableInfo = tablesCache.getIfPresent(resourcePath); if (cachedTableInfo == null) { if (buildIfNotExist) { buildSnapshotCache(tableDesc, extTableSnapshotInfo, getSourceLookupTable(tableDesc, extTableSnapshotInfo)); } logger.info("no available cache ready for the table snapshot:" + extTableSnapshotInfo.getResourcePath()); return null; } String[] keyColumns = extTableSnapshotInfo.getKeyColumns(); String dbPath = getSnapshotStorePath(extTableSnapshotInfo.getTableName(), extTableSnapshotInfo.getId()); return new RocksDBLookupTable(tableDesc, keyColumns, dbPath); }
return; final String[] keyColumns = extTableSnapshotInfo.getKeyColumns(); final String cachePath = getSnapshotCachePath(extTableSnapshotInfo.getTableName(), extTableSnapshotInfo.getId()); final String dbPath = getSnapshotStorePath(extTableSnapshotInfo.getTableName(), extTableSnapshotInfo.getId());