/** * DataMap for Coarse Grain level, see {@link org.apache.carbondata.core.datamap.DataMapLevel#CG} */ @InterfaceAudience.Developer("DataMap") @InterfaceStability.Evolving public abstract class CoarseGrainDataMap implements DataMap<Blocklet> { @Override public List<Blocklet> prune(Expression expression, SegmentProperties segmentProperties, List<PartitionSpec> partitions, AbsoluteTableIdentifier identifier) throws IOException { throw new UnsupportedOperationException("Filter expression not supported"); } }
/** * This exception will be thrown when loading option is invalid for SQL * loading statement (LOAD DATA, INSERT INTO) */ @InterfaceAudience.User @InterfaceStability.Stable public class InvalidLoadOptionException extends MalformedCarbonCommandException { public InvalidLoadOptionException(String msg) { super(msg); } }
@InterfaceAudience.Internal @InterfaceStability.Stable public abstract class AbstractNonDictionaryVectorFiller { protected int numberOfRows; public AbstractNonDictionaryVectorFiller(int numberOfRows) { this.numberOfRows = numberOfRows; } public abstract void fillVector(byte[] data, CarbonColumnVector vector); }
/** * This class is going to save the the Index files which are taken snapshot * from the readCommitter Interface. */ @InterfaceAudience.Internal @InterfaceStability.Evolving public class ReadCommittedIndexFileSnapShot implements Serializable { /** * Segment Numbers are mapped with list of Index Files. */ private Map<String, List<String>> segmentIndexFileMap; private Map<String, SegmentRefreshInfo> segmentTimestampUpdaterMap; public ReadCommittedIndexFileSnapShot(Map<String, List<String>> segmentIndexFileMap, Map<String, SegmentRefreshInfo> segmentTimestampUpdaterMap) { this.segmentIndexFileMap = segmentIndexFileMap; this.segmentTimestampUpdaterMap = segmentTimestampUpdaterMap; } public Map<String, List<String>> getSegmentIndexFileMap() { return segmentIndexFileMap; } public Map<String, SegmentRefreshInfo> getSegmentTimestampUpdaterMap() { return segmentTimestampUpdaterMap; } }
/** * interface for column range information. Currently we treat bucket and sort_column_range as * value ranges for a column. */ @InterfaceAudience.Internal public interface ColumnRangeInfo { int getNumOfRanges(); }
/** * Writer to write row data to carbondata file. Call {@link #builder()} to get * a build to create instance of writer. */ @InterfaceAudience.User @InterfaceStability.Unstable public abstract class CarbonWriter { /** * Write an object to the file, the format of the object depends on the * implementation. * Note: This API is not thread safe */ public abstract void write(Object object) throws IOException; /** * Flush and close the writer */ public abstract void close() throws IOException; /** * Create a {@link CarbonWriterBuilder} to build a {@link CarbonWriter} */ public static CarbonWriterBuilder builder() { return new CarbonWriterBuilder(); } }
/** * DataMapBuilder is used to implement REBUILD DATAMAP command, it reads all existing * data in main table and load them into the DataMap. All existing index data will be deleted * if there are existing data in the datamap. */ @InterfaceAudience.Developer("DataMap") public interface DataMapBuilder { void initialize() throws IOException; void addRow(int blockletId, int pageId, int rowId, Object[] values) throws IOException; void finish() throws IOException; void close() throws IOException; /** * whether create index on internal carbon bytes (such as dictionary encoded) or original value */ boolean isIndexForCarbonRawBytes(); }
@InterfaceAudience.Internal public class Maps { /** * Return value if key is contained in the map, else return defauleValue. * This is added to avoid JDK 8 dependency */ public static <K, V> V getOrDefault(Map<K, V> map, K key, V defaultValue) { V value = map.get(key); if (value != null) { return value; } else { return defaultValue; } } }
/** * ReadCommitted interface that defines a read scope. */ @InterfaceAudience.Internal @InterfaceStability.Stable public interface ReadCommittedScope extends Serializable { LoadMetadataDetails[] getSegmentList() throws IOException; /** * @param segment * @return map of Absolute path of index file as key and null as value -- without mergeIndex * map of AbsolutePath with fileName of MergeIndex parent file as key and mergeIndexFileName * as value -- with mergeIndex * @throws IOException */ Map<String, String> getCommittedIndexFile(Segment segment) throws IOException; SegmentRefreshInfo getCommittedSegmentRefreshInfo(Segment segment, UpdateVO updateVo) throws IOException; void takeCarbonIndexFileSnapShot() throws IOException; Configuration getConfiguration(); void setConfiguration(Configuration configuration); }
/** * DataMap for Fine Grain level, see {@link org.apache.carbondata.core.datamap.DataMapLevel#FG} */ @InterfaceAudience.Developer("DataMap") @InterfaceStability.Evolving public abstract class FineGrainDataMap implements DataMap<FineGrainBlocklet> { @Override public List<FineGrainBlocklet> prune(Expression filter, SegmentProperties segmentProperties, List<PartitionSpec> partitions, AbsoluteTableIdentifier identifier) throws IOException { throw new UnsupportedOperationException("Filter expression not supported"); } }
@InterfaceAudience.User @InterfaceStability.Stable public class NoSuchStreamException extends Exception { /** * default serial version ID. */ private static final long serialVersionUID = 133241232L; public NoSuchStreamException(String streamName) { super("stream '" + streamName + "' not found"); } }
/** * This exception will be thrown when failed to process metadata while executing * carbon command */ @InterfaceAudience.User @InterfaceStability.Evolving public class MetadataProcessException extends RuntimeException { public MetadataProcessException(String message) { super(message); } public MetadataProcessException(String message, Throwable cause) { super(message + ": " + cause.getMessage(), cause); } }
@InterfaceAudience.Internal class LuceneDataMapDistributable extends DataMapDistributable { // TODO: seems no one use this? private String dataPath; private String indexPath; LuceneDataMapDistributable(String dataPath, String indexPath) { this.dataPath = dataPath; this.indexPath = indexPath; } public String getDataPath() { return dataPath; } public String getIndexPath() { return indexPath; } public void setIndexPath(String indexPath) { this.indexPath = indexPath; } }
/** * Factory for {@link CoarseGrainDataMap} * 1. Any filter query which hits the table with datamap will call prune method of CGdatamap. * 2. The prune method of CGDatamap return list Blocklet , these blocklets contain the * information of block and blocklet. * 3. Based on the splits scanrdd schedule the tasks. */ @InterfaceAudience.Developer("DataMap") @InterfaceStability.Evolving public abstract class CoarseGrainDataMapFactory extends DataMapFactory<CoarseGrainDataMap> { public CoarseGrainDataMapFactory(CarbonTable carbonTable, DataMapSchema dataMapSchema) { super(carbonTable, dataMapSchema); } @Override public DataMapLevel getDataMapLevel() { return DataMapLevel.CG; } }
/** * This exception will be thrown if datamap is not found when executing datamap * related SQL statement */ @InterfaceAudience.User @InterfaceStability.Stable public class NoSuchDataMapException extends MalformedCarbonCommandException { /** * default serial version ID. */ private static final long serialVersionUID = 1L; public NoSuchDataMapException(String dataMapName, String tableName) { super("Datamap with name " + dataMapName + " does not exist under table " + tableName); } public NoSuchDataMapException(String dataMapName) { super("Datamap with name " + dataMapName + " does not exist"); } }
@InterfaceAudience.Internal class BloomDataMapDistributable extends DataMapDistributable { /** * parent folder of the bloomindex file */ private String indexPath; /** * List of index shards which are already got filtered through CG index operation. * This is used for merge shard which cannot prune shard in `toDistributable` function. * Other case will be set to Null */ private Set<String> filteredShards; BloomDataMapDistributable(String indexPath, Set<String> filteredShards) { this.indexPath = indexPath; this.filteredShards = filteredShards; } public String getIndexPath() { return indexPath; } public Set<String> getFilteredShards() { return filteredShards; } }
/** * Factory for {@link FineGrainDataMap} * * 1. Any filter query which hits the table with datamap will call prune method of FGdatamap. * 2. The prune method of FGDatamap return list FineGrainBlocklet , these blocklets contain the * information of block, blocklet, page and rowids information as well. * 3. The pruned blocklets are internally wriitten to file and returns only the block , * blocklet and filepath information as part of Splits. * 4. Based on the splits scanrdd schedule the tasks. * 5. In filterscanner we check the datamapwriterpath from split and reNoteads the * bitset if exists. And pass this bitset as input to it. */ @InterfaceAudience.Developer("DataMap") @InterfaceStability.Evolving public abstract class FineGrainDataMapFactory extends DataMapFactory<FineGrainDataMap> { public FineGrainDataMapFactory(CarbonTable carbonTable, DataMapSchema dataMapSchema) { super(carbonTable, dataMapSchema); } @Override public DataMapLevel getDataMapLevel() { return DataMapLevel.FG; } }
/** * This exception will be thrown when Datamap related SQL statement is invalid */ @InterfaceAudience.User @InterfaceStability.Stable public class MalformedDataMapCommandException extends MalformedCarbonCommandException { /** * default serial version ID. */ private static final long serialVersionUID = 1L; public MalformedDataMapCommandException(String msg) { super(msg); } public MalformedDataMapCommandException(String msg, Throwable e) { super(msg, e); } }