Search in sources :

Example 1 with ERJoinChooser

use of com.actiontech.dble.plan.optimizer.ERJoinChooser in project dble by actiontech.

the class ConfigTest method testERjoin.

private boolean testERjoin(ERTable er0, ERTable er1) {
    Class<ERJoinChooser> classERJoin = ERJoinChooser.class;
    try {
        Constructor<ERJoinChooser> construtor = classERJoin.getConstructor(new Class[] { JoinNode.class, Map.class });
        Object instance = construtor.newInstance(new Object[] { new JoinNode(), this.erRealtions });
        Method isERRelstionMethod = classERJoin.getDeclaredMethod("isErRelation", new Class[] { ERTable.class, ERTable.class });
        isERRelstionMethod.setAccessible(true);
        Object result = isERRelstionMethod.invoke(instance, new Object[] { er0, er1 });
        return (Boolean) result;
    } catch (Exception e) {
        System.out.println(e);
        return false;
    }
}
Also used : JoinNode(com.actiontech.dble.plan.node.JoinNode) Method(java.lang.reflect.Method) ERJoinChooser(com.actiontech.dble.plan.optimizer.ERJoinChooser)

Aggregations

JoinNode (com.actiontech.dble.plan.node.JoinNode)1 ERJoinChooser (com.actiontech.dble.plan.optimizer.ERJoinChooser)1 Method (java.lang.reflect.Method)1