當前位置: 首頁>>代碼示例>>Java>>正文


Java ExtraFunctionManager類代碼示例

本文整理匯總了Java中com.taobao.tddl.optimizer.core.expression.ExtraFunctionManager的典型用法代碼示例。如果您正苦於以下問題:Java ExtraFunctionManager類的具體用法?Java ExtraFunctionManager怎麽用?Java ExtraFunctionManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ExtraFunctionManager類屬於com.taobao.tddl.optimizer.core.expression包,在下文中一共展示了ExtraFunctionManager類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handle

import com.taobao.tddl.optimizer.core.expression.ExtraFunctionManager; //導入依賴的package包/類
@Override
public ISchematicCursor handle(IDataNodeExecutor executor, ExecutionContext executionContext) throws TddlException {
    ShowWithoutTable show = (ShowWithoutTable) executor;
    ArrayResultCursor result = new ArrayResultCursor("TABLES", executionContext);
    result.addColumn("Tables_in_" + executor.getDataNode(), DataType.StringType);
    result.initMeta();

    Set<String> tableNames = OptimizerContext.getContext().getRule().mergeTableRule(new ArrayList<String>());
    Like like = null;
    String likeExpr = null;
    boolean full = show.isFull();
    if (StringUtils.isNotEmpty(show.getPattern())) {
        like = (Like) ExtraFunctionManager.getExtraFunction("LIKE");
        if (show.getPattern().charAt(0) == '\'' && show.getPattern().charAt(show.getPattern().length() - 1) == '\'') {
            likeExpr = show.getPattern().substring(1, show.getPattern().length() - 1);
        } else {
            likeExpr = show.getPattern();
        }
    }
    for (String table : tableNames) {
        if (like != null) {
            boolean bool = (Boolean) like.compute(new Object[] { table, likeExpr }, executionContext);
            if (!bool) {
                continue;
            }
        }

        if (full) {
            String type = "BASE TABLE";
            result.addRow(new Object[] { table, type });
        } else {
            result.addRow(new Object[] { table });
        }
    }
    return result;
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:37,代碼來源:ShowTablesHandler.java

示例2: getExtraFunction

import com.taobao.tddl.optimizer.core.expression.ExtraFunctionManager; //導入依賴的package包/類
@Override
public IExtraFunction getExtraFunction() {
    if (extraFunction == null) {
        extraFunction = ExtraFunctionManager.getExtraFunction(getFunctionName());
        extraFunction.setFunction(this);// 不可能為null
    }
    return extraFunction;
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:9,代碼來源:Function.java

示例3: test_extension

import com.taobao.tddl.optimizer.core.expression.ExtraFunctionManager; //導入依賴的package包/類
@Test
public void test_extension() {
    IExtraFunction func = ExtraFunctionManager.getExtraFunction("DUMMY");
    Assert.assertEquals(DummyTest.class, func.getClass());

    func = ExtraFunctionManager.getExtraFunction("NOT_EXIST");
    Assert.assertEquals(DummyTest.class, func.getClass());
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:9,代碼來源:ExtraFunctionManagerTest.java


注:本文中的com.taobao.tddl.optimizer.core.expression.ExtraFunctionManager類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。