public boolean isExtSnapshotTable(String tableName) { SnapshotTableDesc desc = getSnapshotTableDesc(tableName); if (desc == null) { return false; } return desc.isExtSnapshotTable(); }
public List<String> getAllExtLookupSnapshotTypes() { List<String> result = Lists.newArrayList(); for (SnapshotTableDesc snapshotTableDesc : snapshotTableDescList) { if (snapshotTableDesc.isExtSnapshotTable()) { result.add(snapshotTableDesc.getStorageType()); } } return result; }
public LookupSnapshotBuildJob build() { logger.info("new job to build lookup snapshot:{} for cube:{}", lookupTable, cube.getName()); LookupSnapshotBuildJob result = LookupSnapshotBuildJob.createJob(cube, lookupTable, submitter, kylinConfig); CubeDesc cubeDesc = cube.getDescriptor(); SnapshotTableDesc snapshotTableDesc = cubeDesc.getSnapshotTableDesc(lookupTable); if (snapshotTableDesc != null && snapshotTableDesc.isExtSnapshotTable()) { addExtMaterializeLookupTableSteps(result, snapshotTableDesc); } else { addInMetaStoreMaterializeLookupTableSteps(result); } return result; }
private void saveExtSnapshotIfNeeded(CubeManager cubeManager, CubeInstance cube, CubeSegment segment) throws IOException { String extLookupSnapshotStr = this.getParam(BatchConstants.ARG_EXT_LOOKUP_SNAPSHOTS_INFO); if (extLookupSnapshotStr == null || extLookupSnapshotStr.isEmpty()) { return; } Map<String, String> extLookupSnapshotMap = LookupMaterializeContext.parseLookupSnapshots(extLookupSnapshotStr); logger.info("update ext lookup snapshots:{}", extLookupSnapshotMap); List<SnapshotTableDesc> snapshotTableDescList = cube.getDescriptor().getSnapshotTableDescList(); for (SnapshotTableDesc snapshotTableDesc : snapshotTableDescList) { String tableName = snapshotTableDesc.getTableName(); if (snapshotTableDesc.isExtSnapshotTable()) { String newSnapshotResPath = extLookupSnapshotMap.get(tableName); if (newSnapshotResPath == null || newSnapshotResPath.isEmpty()) { continue; } if (snapshotTableDesc.isGlobal()) { if (!newSnapshotResPath.equals(cube.getSnapshotResPath(tableName))) { cubeManager.updateCubeLookupSnapshot(cube, tableName, newSnapshotResPath); } } else { segment.putSnapshotResPath(tableName, newSnapshotResPath); } } } }
public ILookupTable getLookupTable(CubeSegment cubeSegment, JoinDesc join) { String tableName = join.getPKSide().getTableIdentity(); CubeDesc cubeDesc = cubeSegment.getCubeDesc(); SnapshotTableDesc snapshotTableDesc = cubeDesc.getSnapshotTableDesc(tableName); if (snapshotTableDesc == null || !snapshotTableDesc.isExtSnapshotTable()) { return getInMemLookupTable(cubeSegment, join, snapshotTableDesc); } else { return getExtLookupTable(cubeSegment, tableName, snapshotTableDesc); } }
public List<String> getAllExtLookupSnapshotTypes() { List<String> result = Lists.newArrayList(); for (SnapshotTableDesc snapshotTableDesc : snapshotTableDescList) { if (snapshotTableDesc.isExtSnapshotTable()) { result.add(snapshotTableDesc.getStorageType()); } } return result; }
public boolean isExtSnapshotTable(String tableName) { SnapshotTableDesc desc = getSnapshotTableDesc(tableName); if (desc == null) { return false; } return desc.isExtSnapshotTable(); }
public LookupSnapshotBuildJob build() { logger.info("new job to build lookup snapshot:{} for cube:{}", lookupTable, cube.getName()); LookupSnapshotBuildJob result = LookupSnapshotBuildJob.createJob(cube, lookupTable, submitter, kylinConfig); CubeDesc cubeDesc = cube.getDescriptor(); SnapshotTableDesc snapshotTableDesc = cubeDesc.getSnapshotTableDesc(lookupTable); if (snapshotTableDesc != null && snapshotTableDesc.isExtSnapshotTable()) { addExtMaterializeLookupTableSteps(result, snapshotTableDesc); } else { addInMetaStoreMaterializeLookupTableSteps(result); } return result; }
private void saveExtSnapshotIfNeeded(CubeManager cubeManager, CubeInstance cube, CubeSegment segment) throws IOException { String extLookupSnapshotStr = this.getParam(BatchConstants.ARG_EXT_LOOKUP_SNAPSHOTS_INFO); if (extLookupSnapshotStr == null || extLookupSnapshotStr.isEmpty()) { return; } Map<String, String> extLookupSnapshotMap = LookupMaterializeContext.parseLookupSnapshots(extLookupSnapshotStr); logger.info("update ext lookup snapshots:{}", extLookupSnapshotMap); List<SnapshotTableDesc> snapshotTableDescList = cube.getDescriptor().getSnapshotTableDescList(); for (SnapshotTableDesc snapshotTableDesc : snapshotTableDescList) { String tableName = snapshotTableDesc.getTableName(); if (snapshotTableDesc.isExtSnapshotTable()) { String newSnapshotResPath = extLookupSnapshotMap.get(tableName); if (newSnapshotResPath == null || newSnapshotResPath.isEmpty()) { continue; } if (snapshotTableDesc.isGlobal()) { if (!newSnapshotResPath.equals(cube.getSnapshotResPath(tableName))) { cubeManager.updateCubeLookupSnapshot(cube, tableName, newSnapshotResPath); } } else { segment.putSnapshotResPath(tableName, newSnapshotResPath); } } } }
public ILookupTable getLookupTable(CubeSegment cubeSegment, JoinDesc join) { String tableName = join.getPKSide().getTableIdentity(); CubeDesc cubeDesc = cubeSegment.getCubeDesc(); SnapshotTableDesc snapshotTableDesc = cubeDesc.getSnapshotTableDesc(tableName); if (snapshotTableDesc == null || !snapshotTableDesc.isExtSnapshotTable()) { return getInMemLookupTable(cubeSegment, join, snapshotTableDesc); } else { return getExtLookupTable(cubeSegment, tableName, snapshotTableDesc); } }