Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2254#discussion_r185429305
--- Diff:
core/src/main/java/org/apache/carbondata/core/datamap/DataMapProvider.java ---
@@ -42,67 +43,80 @@
*
* <br>Currently CarbonData supports following provider:
* <ol>
- * <li> preaggregate: one type of MVDataMap that do pre-aggregate of
single table </li>
- * <li> timeseries: one type of MVDataMap that do pre-aggregate based on
time dimension
- * of the table </li>
- * <li> class name of {@link
org.apache.carbondata.core.datamap.dev.DataMapFactory}
- * implementation: Developer can implement new type of DataMap by extending
- * {@link org.apache.carbondata.core.datamap.dev.DataMapFactory} </li>
+ * <li> preaggregate: pre-aggregate table of single table </li>
+ * <li> timeseries: pre-aggregate table based on time dimension of the
table </li>
+ * <li> lucene: index backed by Apache Lucene </li>
+ * <li> bloomfilter: index backed by Bloom Filter </li>
* </ol>
*
* @since 1.4.0
*/
@InterfaceAudience.Internal
-public interface DataMapProvider {
+public abstract class DataMapProvider {
+
+ private CarbonTable mainTable;
+ private DataMapSchema dataMapSchema;
+
+ public DataMapProvider(CarbonTable mainTable, DataMapSchema
dataMapSchema) {
+ this.mainTable = mainTable;
+ this.dataMapSchema = dataMapSchema;
+ }
+
+ protected final CarbonTable getMainTable() {
+ return mainTable;
+ }
+
+ protected final DataMapSchema getDataMapSchema() {
+ return dataMapSchema;
+ }
/**
* Initialize a datamap's metadata.
* This is called when user creates datamap, for example "CREATE DATAMAP
dm ON TABLE mainTable"
* Implementation should initialize metadata for datamap, like creating
table
*/
- void initMeta(CarbonTable mainTable, DataMapSchema dataMapSchema, String
ctasSqlStatement)
- throws MalformedDataMapCommandException, IOException;
+ public abstract void initMeta(String ctasSqlStatement) throws
MalformedDataMapCommandException,
+ IOException;
/**
* Initialize a datamap's data.
* This is called when user creates datamap, for example "CREATE DATAMAP
dm ON TABLE mainTable"
* Implementation should initialize data for datamap, like creating data
folders
*/
- void initData(CarbonTable mainTable);
+ public abstract void initData();
/**
- * Opposite operation of {@link #initMeta(CarbonTable, DataMapSchema,
String)}.
+ * Opposite operation of {@link #initMeta(String)}.
* This is called when user drops datamap, for example "DROP DATAMAP dm
ON TABLE mainTable"
* Implementation should clean all meta for the datamap
*/
- void freeMeta(CarbonTable mainTable, DataMapSchema dataMapSchema) throws
IOException;
+ public abstract void freeMeta() throws IOException;
--- End diff --
I changed to `cleanMeta` and `cleanData`
---