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


Java CostBasedOptimizer類代碼示例

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


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

示例1: optimizerInit

import com.taobao.tddl.optimizer.costbased.CostBasedOptimizer; //導入依賴的package包/類
public void optimizerInit() throws TddlException {
    CostBasedOptimizer optimizer = new CostBasedOptimizer(optimizerRule);
    optimizer.setExpireTime(GeneralUtil.getExtraCmdLong(this.connectionProperties,
        ConnectionProperties.OPTIMIZER_CACHE_EXPIRE_TIME,
        TddlConstants.DEFAULT_OPTIMIZER_EXPIRE_TIME));
    optimizer.setCacheSize(GeneralUtil.getExtraCmdLong(this.connectionProperties,
        ConnectionProperties.OPTIMIZER_CACHE_SIZE,
        TddlConstants.DEFAULT_OPTIMIZER_CACHE_SIZE));
    optimizer.init();

    this.optimizer = optimizer;
    this.sqlParseManager = optimizer.getSqlParseManager();

    // RuleStatManager statManager = new RuleStatManager(optimizerRule,
    // topologyHandler.getMatrix());
    LocalStatManager statManager = new LocalStatManager();
    statManager.init();

    this.statManager = statManager;
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:21,代碼來源:MatrixConfigHolder.java

示例2: optimizerInit

import com.taobao.tddl.optimizer.costbased.CostBasedOptimizer; //導入依賴的package包/類
public void optimizerInit() throws TddlException {
    CostBasedOptimizer optimizer = new CostBasedOptimizer();
    optimizer.setExpireTime(GeneralUtil.getExtraCmdLong(this.connectionProperties,
        ExtraCmd.OPTIMIZER_CACHE_EXPIRE_TIME,
        TddlConstants.DEFAULT_OPTIMIZER_EXPIRE_TIME));
    optimizer.init();

    this.optimizer = optimizer;

    // RuleStatManager statManager = new RuleStatManager(optimizerRule,
    // topologyHandler.getMatrix());
    LocalStatManager statManager = new LocalStatManager();
    statManager.init();

    this.statManager = statManager;
}
 
開發者ID:beebeandwer,項目名稱:TDDL,代碼行數:17,代碼來源:MatrixConfigHolder.java

示例3: initial

import com.taobao.tddl.optimizer.costbased.CostBasedOptimizer; //導入依賴的package包/類
@BeforeClass
public static void initial() throws TddlException {
    parser.init();

    OptimizerContext context = new OptimizerContext();
    TddlRule tddlRule = new TddlRule();
    tddlRule.setAppRuleFile("classpath:" + rule_file);
    tddlRule.setAppName(APPNAME);
    tddlRule.init();

    rule = new OptimizerRule(tddlRule);

    StaticSchemaManager localSchemaManager = StaticSchemaManager.parseSchema(Thread.currentThread()
        .getContextClassLoader()
        .getResourceAsStream(table_file));

    Matrix matrix = MatrixParser.parse(Thread.currentThread()
        .getContextClassLoader()
        .getResourceAsStream(matrix_file));

    schemaManager = new RepoSchemaManager();
    schemaManager.setLocal(localSchemaManager);
    schemaManager.setGroup(matrix.getGroup("andor_mysql_group_0"));
    schemaManager.init();

    statManager = new LocalStatManager();
    statManager.init();

    context.setMatrix(matrix);
    context.setRule(rule);
    context.setSchemaManager(schemaManager);
    context.setStatManager(statManager);
    context.setIndexManager(new RuleIndexManager(schemaManager));

    OptimizerContext.setContext(context);

    optimizer = new CostBasedOptimizer(rule);
    optimizer.setSqlParseManager(parser);
    optimizer.init();
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:41,代碼來源:BaseSqlOptimizerTest.java

示例4: initial

import com.taobao.tddl.optimizer.costbased.CostBasedOptimizer; //導入依賴的package包/類
@BeforeClass
public static void initial() throws TddlException {
    parser.init();

    OptimizerContext context = new OptimizerContext();
    TddlRule tddlRule = new TddlRule();
    tddlRule.setAppRuleFile("classpath:" + rule_file);
    tddlRule.setAppName(APPNAME);
    tddlRule.init();

    rule = new OptimizerRule(tddlRule);

    StaticSchemaManager localSchemaManager = StaticSchemaManager.parseSchema(Thread.currentThread()
        .getContextClassLoader()
        .getResourceAsStream(table_file));

    Matrix matrix = MatrixParser.parse(Thread.currentThread()
        .getContextClassLoader()
        .getResourceAsStream(matrix_file));

    schemaManager = new RepoSchemaManager();
    schemaManager.setLocal(localSchemaManager);
    schemaManager.setGroup(matrix.getGroup("andor_mysql_group_0"));
    schemaManager.init();

    statManager = new LocalStatManager();
    statManager.init();

    context.setMatrix(matrix);
    context.setRule(rule);
    context.setSchemaManager(schemaManager);
    context.setStatManager(statManager);
    context.setIndexManager(new RuleIndexManager(schemaManager));

    OptimizerContext.setContext(context);

    optimizer = new CostBasedOptimizer();
    optimizer.setSqlParseManager(parser);
    optimizer.init();
}
 
開發者ID:beebeandwer,項目名稱:TDDL,代碼行數:41,代碼來源:BaseSqlOptimizerTest.java

示例5: initial

import com.taobao.tddl.optimizer.costbased.CostBasedOptimizer; //導入依賴的package包/類
@BeforeClass
public static void initial() throws TddlException {
    parser.init();

    OptimizerContext context = new OptimizerContext();
    TddlRule tddlRule = new TddlRule();
    tddlRule.setAppRuleFile("classpath:" + rule_file);
    tddlRule.setAppName(APPNAME);
    tddlRule.init();

    rule = new OptimizerRule(tddlRule);

    StaticSchemaManager localSchemaManager = StaticSchemaManager.parseSchema(Thread.currentThread()
        .getContextClassLoader()
        .getResourceAsStream(table_file));

    Matrix matrix = MatrixParser.parse(Thread.currentThread()
        .getContextClassLoader()
        .getResourceAsStream(matrix_file));

    schemaManager = new RepoSchemaManager();
    schemaManager.setLocal(localSchemaManager);
    schemaManager.setGroup(matrix.getGroup("andor_group_0"));
    schemaManager.init();

    statManager = LocalStatManager.parseConfig(GeneralUtil.getInputStream(table_stat_file),
        GeneralUtil.getInputStream(table_index_stat_file));

    // statManager = new RepoStatManager();
    // statManager.setLocal(local);
    // statManager.setUseCache(true);
    // statManager.setGroup(matrix.getGroup("andor_group_0"));
    // statManager.init();

    context.setMatrix(matrix);
    context.setRule(rule);
    context.setSchemaManager(schemaManager);
    context.setStatManager(statManager);
    context.setIndexManager(new RuleIndexManager(schemaManager));

    OptimizerContext.setContext(context);

    optimizer = new CostBasedOptimizer(rule);
    optimizer.setSqlParseManager(parser);
    optimizer.init();
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:47,代碼來源:BaseOptimizerTest.java

示例6: initial

import com.taobao.tddl.optimizer.costbased.CostBasedOptimizer; //導入依賴的package包/類
@BeforeClass
public static void initial() throws TddlException {
    parser.init();

    OptimizerContext context = new OptimizerContext();
    TddlRule tddlRule = new TddlRule();
    tddlRule.setAppRuleFile("classpath:" + rule_file);
    tddlRule.setAppName(APPNAME);
    tddlRule.init();

    rule = new OptimizerRule(tddlRule);

    StaticSchemaManager localSchemaManager = StaticSchemaManager.parseSchema(Thread.currentThread()
        .getContextClassLoader()
        .getResourceAsStream(table_file));

    Matrix matrix = MatrixParser.parse(Thread.currentThread()
        .getContextClassLoader()
        .getResourceAsStream(matrix_file));

    schemaManager = new RepoSchemaManager();
    schemaManager.setLocal(localSchemaManager);
    schemaManager.setGroup(matrix.getGroup("andor_group_0"));
    schemaManager.init();

    statManager = LocalStatManager.parseConfig(Thread.currentThread()
        .getContextClassLoader()
        .getResourceAsStream(table_stat_file),
        Thread.currentThread().getContextClassLoader().getResourceAsStream(table_index_stat_file));

    // statManager = new RepoStatManager();
    // statManager.setLocal(local);
    // statManager.setUseCache(true);
    // statManager.setGroup(matrix.getGroup("andor_group_0"));
    // statManager.init();

    context.setMatrix(matrix);
    context.setRule(rule);
    context.setSchemaManager(schemaManager);
    context.setStatManager(statManager);
    context.setIndexManager(new RuleIndexManager(schemaManager));

    OptimizerContext.setContext(context);

    optimizer = new CostBasedOptimizer();
    optimizer.setSqlParseManager(parser);
    optimizer.init();
}
 
開發者ID:beebeandwer,項目名稱:TDDL,代碼行數:49,代碼來源:BaseOptimizerTest.java


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