Search in sources :

Example 1 with DataMapModel

use of org.apache.carbondata.core.datamap.dev.DataMapModel in project carbondata by apache.

the class MinMaxIndexDataMapFactory method getDataMaps.

/**
 * getDataMaps Factory method Initializes the Min Max Data Map and returns.
 *
 * @param segment
 * @return
 * @throws IOException
 */
@Override
public List<CoarseGrainDataMap> getDataMaps(Segment segment) throws IOException {
    List<CoarseGrainDataMap> dataMapList = new ArrayList<>();
    // Form a dataMap of Type MinMaxIndexDataMap.
    MinMaxIndexDataMap dataMap = new MinMaxIndexDataMap();
    try {
        dataMap.init(new DataMapModel(CarbonTablePath.getSegmentPath(identifier.getTablePath(), segment.getSegmentNo())));
    } catch (MemoryException ex) {
        throw new IOException(ex);
    }
    dataMapList.add(dataMap);
    return dataMapList;
}
Also used : MemoryException(org.apache.carbondata.core.memory.MemoryException) DataMapModel(org.apache.carbondata.core.datamap.dev.DataMapModel) CoarseGrainDataMap(org.apache.carbondata.core.datamap.dev.cgdatamap.CoarseGrainDataMap) ArrayList(java.util.ArrayList) IOException(java.io.IOException)

Example 2 with DataMapModel

use of org.apache.carbondata.core.datamap.dev.DataMapModel in project carbondata by apache.

the class LuceneCoarseGrainDataMapFactory method getDataMaps.

/**
 * Get the datamap for segmentid
 */
@Override
public List<CoarseGrainDataMap> getDataMaps(Segment segment) throws IOException {
    List<CoarseGrainDataMap> lstDataMap = new ArrayList<>();
    CoarseGrainDataMap dataMap = new LuceneCoarseGrainDataMap(analyzer);
    try {
        dataMap.init(new DataMapModel(LuceneDataMapWriter.genDataMapStorePath(tableIdentifier.getTablePath(), segment.getSegmentNo(), dataMapName)));
    } catch (MemoryException e) {
        LOGGER.error("failed to get lucene datamap , detail is {}" + e.getMessage());
        return lstDataMap;
    }
    lstDataMap.add(dataMap);
    return lstDataMap;
}
Also used : MemoryException(org.apache.carbondata.core.memory.MemoryException) DataMapModel(org.apache.carbondata.core.datamap.dev.DataMapModel) CoarseGrainDataMap(org.apache.carbondata.core.datamap.dev.cgdatamap.CoarseGrainDataMap) ArrayList(java.util.ArrayList)

Example 3 with DataMapModel

use of org.apache.carbondata.core.datamap.dev.DataMapModel in project carbondata by apache.

the class LuceneFineGrainDataMapFactory method getDataMaps.

/**
 * Get the datamap for segmentid
 */
@Override
public List<FineGrainDataMap> getDataMaps(Segment segment) throws IOException {
    List<FineGrainDataMap> lstDataMap = new ArrayList<>();
    FineGrainDataMap dataMap = new LuceneFineGrainDataMap(analyzer);
    try {
        dataMap.init(new DataMapModel(LuceneDataMapWriter.genDataMapStorePath(tableIdentifier.getTablePath(), segment.getSegmentNo(), dataMapName)));
    } catch (MemoryException e) {
        LOGGER.error("failed to get lucene datamap , detail is {}" + e.getMessage());
        return lstDataMap;
    }
    lstDataMap.add(dataMap);
    return lstDataMap;
}
Also used : FineGrainDataMap(org.apache.carbondata.core.datamap.dev.fgdatamap.FineGrainDataMap) MemoryException(org.apache.carbondata.core.memory.MemoryException) DataMapModel(org.apache.carbondata.core.datamap.dev.DataMapModel) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)3 DataMapModel (org.apache.carbondata.core.datamap.dev.DataMapModel)3 MemoryException (org.apache.carbondata.core.memory.MemoryException)3 CoarseGrainDataMap (org.apache.carbondata.core.datamap.dev.cgdatamap.CoarseGrainDataMap)2 IOException (java.io.IOException)1 FineGrainDataMap (org.apache.carbondata.core.datamap.dev.fgdatamap.FineGrainDataMap)1