Search in sources :

Example 1 with RowCountDetailsVO

use of org.apache.carbondata.core.mutate.data.RowCountDetailsVO in project carbondata by apache.

the class CarbonUpdateUtil method createBlockDetailsMap.

/**
 * @param blockMappingVO
 * @param segmentUpdateStatusManager
 */
public static void createBlockDetailsMap(BlockMappingVO blockMappingVO, SegmentUpdateStatusManager segmentUpdateStatusManager) {
    Map<String, Long> blockRowCountMap = blockMappingVO.getBlockRowCountMapping();
    Map<String, RowCountDetailsVO> outputMap = new HashMap<>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
    for (Map.Entry<String, Long> blockRowEntry : blockRowCountMap.entrySet()) {
        String key = blockRowEntry.getKey();
        long alreadyDeletedCount = 0;
        SegmentUpdateDetails detail = segmentUpdateStatusManager.getDetailsForABlock(key);
        if (null != detail) {
            alreadyDeletedCount = Long.parseLong(detail.getDeletedRowsInBlock());
        }
        RowCountDetailsVO rowCountDetailsVO = new RowCountDetailsVO(blockRowEntry.getValue(), alreadyDeletedCount);
        outputMap.put(key, rowCountDetailsVO);
    }
    blockMappingVO.setCompleteBlockRowDetailVO(outputMap);
}
Also used : RowCountDetailsVO(org.apache.carbondata.core.mutate.data.RowCountDetailsVO) HashMap(java.util.HashMap) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 RowCountDetailsVO (org.apache.carbondata.core.mutate.data.RowCountDetailsVO)1