Search in sources :

Example 1 with FilePathMinMaxVO

use of org.apache.carbondata.core.mutate.FilePathMinMaxVO in project carbondata by apache.

the class ExtendedBlocklet method deserializeFields.

/**
 * Method to deserialize extended blocklet and input split for index server
 * @param in data input stream to read the primitives of extended blocklet
 * @param locations locations of the input split
 * @param tablePath carbon table path
 * @throws IOException
 */
public void deserializeFields(DataInput in, String[] locations, String tablePath, boolean isCountJob, CdcVO cdcVO) throws IOException {
    super.readFields(in);
    if (isCountJob) {
        count = in.readLong();
        segmentNo = in.readUTF();
        return;
    } else if (cdcVO != null) {
        filePath = in.readUTF();
        this.columnToMinMaxMapping = new HashMap<>();
        for (String column : cdcVO.getColumnToIndexMap().keySet()) {
            List<FilePathMinMaxVO> minMaxOfColumnInList = new ArrayList<>();
            int minLength = in.readInt();
            byte[] minValuesForBlocklets = new byte[minLength];
            in.readFully(minValuesForBlocklets);
            int maxLength = in.readInt();
            byte[] maxValuesForBlocklets = new byte[maxLength];
            in.readFully(maxValuesForBlocklets);
            minMaxOfColumnInList.add(new FilePathMinMaxVO(filePath, minValuesForBlocklets, maxValuesForBlocklets));
            this.columnToMinMaxMapping.put(column, minMaxOfColumnInList);
        }
        return;
    }
    if (in.readBoolean()) {
        indexUniqueId = in.readUTF();
    }
    boolean isSplitPresent = in.readBoolean();
    if (isSplitPresent) {
        String filePath = getPath();
        boolean isExternalPath = in.readBoolean();
        if (!isExternalPath) {
            setFilePath(tablePath + filePath);
        } else {
            setFilePath(filePath);
        }
        // getting the length of the data
        final int serializeLen = in.readInt();
        this.inputSplit = new CarbonInputSplit(serializeLen, in, getFilePath(), locations, getBlockletId());
    }
}
Also used : FilePathMinMaxVO(org.apache.carbondata.core.mutate.FilePathMinMaxVO) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) List(java.util.List) CarbonInputSplit(org.apache.carbondata.hadoop.CarbonInputSplit)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 FilePathMinMaxVO (org.apache.carbondata.core.mutate.FilePathMinMaxVO)1 CarbonInputSplit (org.apache.carbondata.hadoop.CarbonInputSplit)1