/** * check the block whether is valid * * @param segName segment name * @param blockName block name * @return the status of block whether is valid */ public boolean isBlockValid(String segName, String blockName) { SegmentUpdateDetails details = getDetailsForABlock(segName, blockName); return details == null || !CarbonUpdateUtil.isBlockInvalid(details.getSegmentStatus()); } /**
/** * This method returns the list of Blocks associated with the segment * from the SegmentUpdateDetails List. * @param segmentName * @return */ public List<String> getBlockNameFromSegment(String segmentName) { List<String> blockNames = new ArrayList<String>(); for (SegmentUpdateDetails block : updateDetails) { if (block.getSegmentName().equalsIgnoreCase(segmentName) && !CarbonUpdateUtil .isBlockInvalid(block.getSegmentStatus())) { blockNames.add(block.getBlockName()); } } return blockNames; }
&& CarbonUpdateUtil.isBlockInvalid(blockDetails.getSegmentStatus())) { validBlock = false;
/** * Returns all delta file paths of specified block * * @param blockDir block directory with CarbonFile format * @param blockNameFromTuple block name from tuple * @param extension the file extension name * @param segment the segment name * @return the list of delete file */ private List<String> getDeltaFiles(CarbonFile blockDir, final String blockNameFromTuple, final String extension, String segment) throws IOException { List<String> deleteFileList = new ArrayList<>(); for (SegmentUpdateDetails block : updateDetails) { if (block.getBlockName().equalsIgnoreCase(blockNameFromTuple) && block.getSegmentName() .equalsIgnoreCase(segment) && !CarbonUpdateUtil .isBlockInvalid(block.getSegmentStatus())) { final long deltaStartTimestamp = getStartTimeOfDeltaFile(extension, block); // If there is no delete delete file , then return null if (deltaStartTimestamp == 0) { return deleteFileList; } final long deltaEndTimeStamp = getEndTimeOfDeltaFile(extension, block); // final long deltaEndTimeStamp = block.getDeleteDeltaEndTimeAsLong(); // final long deltaStartTimestamp = block.getDeleteDeltaStartTimeAsLong(); return getFilePaths(blockDir, blockNameFromTuple, extension, deleteFileList, deltaStartTimestamp, deltaEndTimeStamp); } } return deleteFileList; }
if ((block.getBlockName().equalsIgnoreCase(blockName)) && (block.getSegmentName().equalsIgnoreCase(segmentId.getSegmentNo())) && !CarbonUpdateUtil.isBlockInvalid((block.getSegmentStatus()))) { final long deltaStartTimestamp = getStartTimeOfDeltaFile(CarbonCommonConstants.DELETE_DELTA_FILE_EXT, block);
if (null == details || !CarbonUpdateUtil.isBlockInvalid(details.getSegmentStatus())) { Long blockCount = blockRowCountMapping.get(key); if (blockCount == null) {
if (CarbonUpdateUtil.isBlockInvalid(block.getSegmentStatus())) { completeListOfDeleteDeltaFiles = updateStatusManager .getDeleteDeltaInvalidFilesList(block, true,