1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shardingsphere.sqlfederation.optimizer;
19
20 import org.apache.shardingsphere.sql.parser.api.CacheOption;
21 import org.apache.shardingsphere.sqlfederation.optimizer.planner.cache.ExecutionPlanCacheKey;
22 import org.apache.shardingsphere.sqlfederation.optimizer.statement.SQLStatementCompilerEngine;
23 import org.apache.shardingsphere.sqlfederation.optimizer.statement.SQLStatementCompilerEngineFactory;
24
25
26
27
28 public final class SQLFederationCompilerEngine {
29
30 private final SQLStatementCompilerEngine sqlStatementCompilerEngine;
31
32 public SQLFederationCompilerEngine(final String databaseName, final String schemaName, final CacheOption cacheOption) {
33 sqlStatementCompilerEngine = SQLStatementCompilerEngineFactory.getSQLStatementCompilerEngine(databaseName, schemaName, cacheOption);
34 }
35
36
37
38
39
40
41
42
43 public SQLFederationExecutionPlan compile(final ExecutionPlanCacheKey cacheKey, final boolean useCache) {
44 return sqlStatementCompilerEngine.compile(cacheKey, useCache);
45 }
46 }