本文整理匯總了Java中com.taobao.tddl.optimizer.costbased.esitimater.stat.LocalStatManager.parseConfig方法的典型用法代碼示例。如果您正苦於以下問題:Java LocalStatManager.parseConfig方法的具體用法?Java LocalStatManager.parseConfig怎麽用?Java LocalStatManager.parseConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.taobao.tddl.optimizer.costbased.esitimater.stat.LocalStatManager
的用法示例。
在下文中一共展示了LocalStatManager.parseConfig方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initial
import com.taobao.tddl.optimizer.costbased.esitimater.stat.LocalStatManager; //導入方法依賴的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();
}
示例2: initial
import com.taobao.tddl.optimizer.costbased.esitimater.stat.LocalStatManager; //導入方法依賴的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();
}