|
@ -10,6 +10,7 @@ import java.util.HashMap;
|
|
|
* @author l4qiang
|
|
|
*/
|
|
|
public class FormulaExecutor {
|
|
|
static HashMap<String, Functioner> functionerHashMap;
|
|
|
|
|
|
/**
|
|
|
* @param clazz 算法类名,包含完整路径,在配置时维护。如:com.yihu.quota.etl.formula.DivisionFunc
|
|
@ -18,7 +19,12 @@ public class FormulaExecutor {
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public void run(String clazz, String args, HashMap<String, String> values) throws Exception {
|
|
|
Functioner functioner = (Functioner) Class.forName(clazz).newInstance();
|
|
|
Functioner functioner = functionerHashMap.get(clazz);
|
|
|
if (functioner == null) {
|
|
|
functioner = (Functioner) Class.forName(clazz).newInstance();
|
|
|
functionerHashMap.put(clazz, functioner);
|
|
|
}
|
|
|
|
|
|
if (functioner != null) {
|
|
|
String[] metaList = args.split(";");
|
|
|
Object[] parameter = new Object[metaList.length];
|