| 106 | |
| 107 | |
| 108 | public static IHandleConfig getConfigHandler() { |
| 109 | if (sConfigHandler == null) { |
| 110 | String configFileName = System.getenv(ConfigConstant.DDF_INI_ENV_VAR.toString()); |
| 111 | if (Strings.isNullOrEmpty(configFileName)) configFileName = ConfigConstant.DDF_INI_FILE_NAME.toString(); |
| 112 | sConfigHandler = new ConfigHandler(ConfigConstant.DDF_CONFIG_DIR.toString(), configFileName); |
| 113 | |
| 114 | if (sConfigHandler.getConfig() == null) { |
| 115 | // HACK: prep a basic default config! |
| 116 | Configuration config = new Configuration(); |
| 117 | |
| 118 | config.getSection(ConfigConstant.SECTION_GLOBAL.toString()) // |
| 119 | .set("Namespace", "adatao") // |
| 120 | .set("RuntimeDir", "ddf-runtime") // |
| 121 | .set("BasicPersistenceDir", "basic-ddf-db") // |
| 122 | .set("DDF", "io.ddf.DDF") // |
| 123 | .set("io.ddf.DDF", "io.ddf.DDFManager") // |
| 124 | .set("ISupportStatistics", "io.ddf.analytics.AStatisticsSupporter") // |
| 125 | .set("IHandleRepresentations", "io.ddf.content.RepresentationHandler") // |
| 126 | .set("IHandleSchema", "io.ddf.content.SchemaHandler") // |
| 127 | .set("IHandleViews", "io.ddf.content.ViewHandler") // |
| 128 | .set("IHandlePersistence", "io.basic.ddf.content.PersistenceHandler") // |
| 129 | .set("IHandleMetaData", "io.ddf.content.MetaDataHandler") // |
| 130 | ; |
| 131 | |
| 132 | config.getSection("basic") // |
| 133 | .set("DDF", "io.basic.ddf.BasicDDF") // |
| 134 | .set("DDFManager", "io.basic.ddf.BasicDDFManager") // |
| 135 | ; |
| 136 | |
| 137 | config.getSection("spark") // |
| 138 | .set("DDF", "io.ddf.spark.SparkDDF") // |
| 139 | .set("DDFManager", "io.ddf.spark.SparkDDFManager") // |
| 140 | .set("ISupportStatistics", "io.ddf.spark.analytics.BasicStatisticsSupporter") // |
| 141 | .set("IHandleMetaData", "io.ddf.spark.content.MetaDataHandler") // |
| 142 | .set("IHandleRepresentations", "io.ddf.spark.content.RepresentationHandler") // |
| 143 | .set("IHandleSchema", "io.ddf.spark.content.SchemaHandler") // |
| 144 | .set("IHandleSql", "io.ddf.spark.etl.SqlHandler") // |
| 145 | .set("IHandleViews", "io.ddf.spark.content.ViewHandler") // |
| 146 | .set("ISupportML", "io.ddf.spark.ml.MLSupporter") // |
| 147 | ; |
| 148 | |
| 149 | // TODO |
| 150 | config.getSection("jdbc") // |
| 151 | .set("DDF", "io.ddf.jdbc.JDBCDDF") // |
| 152 | .set("DDFManager", "io.ddf.jdbc.JDBCDDFManager") // |
| 153 | .set("IHandleSql", "io.ddf.jdbc.etl.SqlHandler") // |
| 154 | ; |
| 155 | |
| 156 | sConfigHandler.setConfig(config); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | return sConfigHandler; |
| 161 | } |
| 162 | |
| 163 | |
| 164 | /** |