You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by me...@apache.org on 2020/07/30 11:20:49 UTC
[shardingsphere] branch master updated: Refactor sqlStatement
context converter
This is an automated email from the ASF dual-hosted git repository.
menghaoran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new aa4b91a Refactor sqlStatement context converter
new 25eb6c3 Merge pull request #6535 from tristaZero/new
aa4b91a is described below
commit aa4b91a9756938390480028c2ca3d3367b256d24
Author: tristaZero <ha...@163.com>
AuthorDate: Thu Jul 30 19:06:19 2020 +0800
Refactor sqlStatement context converter
---
.../shardingsphere-sharding-common/pom.xml | 2 +-
...reateShardingRuleStatementContextConverter.java | 9 +++++----
...eShardingRuleStatementContextConverterTest.java | 6 +++---
.../jdbc/execute/RegistryCenterExecuteEngine.java | 8 ++++----
.../execute/RegistryCenterExecuteEngineTest.java | 2 +-
.../shardingsphere-proxy-common/pom.xml | 5 +++++
...reateDataSourcesStatementContextConverter.java} | 13 ++++++------
...eDataSourcesStatementContextConverterTest.java} | 19 +++++++++---------
.../context/CreateDataSourcesStatementContext.java | 23 +++++++++++-----------
.../generator/SQLStatementContextConverter.java | 10 +++++-----
10 files changed, 53 insertions(+), 44 deletions(-)
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/pom.xml b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/pom.xml
index bbbb2be..305ef9a 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/pom.xml
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/pom.xml
@@ -34,7 +34,7 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-sql-parser-binder</artifactId>
+ <artifactId>shardingsphere-rdl-parser-binder</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/generator/YamlShardingRuleConfigurationGenerator.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/convert/CreateShardingRuleStatementContextConverter.java
similarity index 88%
rename from shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/generator/YamlShardingRuleConfigurationGenerator.java
rename to shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/convert/CreateShardingRuleStatementContextConverter.java
index 99908ee..61c9ceb 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/generator/YamlShardingRuleConfigurationGenerator.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/convert/CreateShardingRuleStatementContextConverter.java
@@ -15,23 +15,24 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.proxy.backend.communication.jdbc.execute.generator;
+package org.apache.shardingsphere.sharding.convert;
import com.google.common.base.Joiner;
import org.apache.shardingsphere.infra.yaml.config.algorithm.YamlShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.rdl.parser.binder.context.CreateShardingRuleStatementContext;
+import org.apache.shardingsphere.rdl.parser.binder.generator.SQLStatementContextConverter;
import org.apache.shardingsphere.sharding.yaml.config.YamlShardingRuleConfiguration;
import org.apache.shardingsphere.sharding.yaml.config.rule.YamlShardingAutoTableRuleConfiguration;
import org.apache.shardingsphere.sharding.yaml.config.strategy.sharding.YamlShardingStrategyConfiguration;
import org.apache.shardingsphere.sharding.yaml.config.strategy.sharding.YamlStandardShardingStrategyConfiguration;
/**
- * Yaml sharding rule configuration generator.
+ * Create sharding rule statement context converter.
*/
-public class YamlShardingRuleConfigurationGenerator implements YamlConfigurationGenerator<CreateShardingRuleStatementContext, YamlShardingRuleConfiguration> {
+public final class CreateShardingRuleStatementContextConverter implements SQLStatementContextConverter<CreateShardingRuleStatementContext, YamlShardingRuleConfiguration> {
@Override
- public YamlShardingRuleConfiguration generate(final CreateShardingRuleStatementContext sqlStatement) {
+ public YamlShardingRuleConfiguration convert(final CreateShardingRuleStatementContext sqlStatement) {
YamlShardingRuleConfiguration result = new YamlShardingRuleConfiguration();
addYamlShardingSphereAlgorithmConfiguration(sqlStatement, result);
addYamlShardingAutoTableRuleConfiguration(sqlStatement, result);
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/generator/YamlShardingRuleConfigurationGeneratorTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/convert/CreateShardingRuleStatementContextConverterTest.java
similarity index 91%
rename from shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/generator/YamlShardingRuleConfigurationGeneratorTest.java
rename to shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/convert/CreateShardingRuleStatementContextConverterTest.java
index 637e846..ad6f9ad 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/generator/YamlShardingRuleConfigurationGeneratorTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/convert/CreateShardingRuleStatementContextConverterTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.proxy.backend.communication.jdbc.execute.generator;
+package org.apache.shardingsphere.sharding.convert;
import org.apache.shardingsphere.rdl.parser.binder.context.CreateShardingRuleStatementContext;
import org.apache.shardingsphere.sharding.yaml.config.YamlShardingRuleConfiguration;
@@ -31,7 +31,7 @@ import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-public class YamlShardingRuleConfigurationGeneratorTest {
+public class CreateShardingRuleStatementContextConverterTest {
private CreateShardingRuleStatementContext context;
@@ -49,7 +49,7 @@ public class YamlShardingRuleConfigurationGeneratorTest {
@Test
public void generate() {
- YamlShardingRuleConfiguration rule = new YamlShardingRuleConfigurationGenerator().generate(context);
+ YamlShardingRuleConfiguration rule = new CreateShardingRuleStatementContextConverter().convert(context);
assertTrue(rule.getTables().isEmpty());
assertThat(rule.getAutoTables().size(), is(1));
assertThat(rule.getAutoTables().get(context.getLogicTable()).getActualDataSources(), is("ds0,ds1"));
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/RegistryCenterExecuteEngine.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/RegistryCenterExecuteEngine.java
index f07a1a6..b0a3e1d 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/RegistryCenterExecuteEngine.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/RegistryCenterExecuteEngine.java
@@ -25,8 +25,8 @@ import org.apache.shardingsphere.infra.config.RuleConfiguration;
import org.apache.shardingsphere.infra.executor.sql.context.ExecutionContext;
import org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapperEngine;
import org.apache.shardingsphere.kernel.context.SchemaContexts;
-import org.apache.shardingsphere.proxy.backend.communication.jdbc.execute.generator.YamlDataSourceConfigurationGenerator;
-import org.apache.shardingsphere.proxy.backend.communication.jdbc.execute.generator.YamlShardingRuleConfigurationGenerator;
+import org.apache.shardingsphere.proxy.convert.CreateDataSourcesStatementContextConverter;
+import org.apache.shardingsphere.sharding.convert.CreateShardingRuleStatementContextConverter;
import org.apache.shardingsphere.proxy.backend.response.BackendResponse;
import org.apache.shardingsphere.proxy.backend.response.error.ErrorResponse;
import org.apache.shardingsphere.proxy.backend.response.update.UpdateResponse;
@@ -72,7 +72,7 @@ public class RegistryCenterExecuteEngine implements SQLExecuteEngine {
if (!isRegistryCenterExisted()) {
return new ErrorResponse(new SQLException("No Registry center to execute `%s` SQL", context.getClass().getSimpleName()));
}
- Map<String, YamlDataSourceParameter> parameters = new YamlDataSourceConfigurationGenerator().generate(context);
+ Map<String, YamlDataSourceParameter> parameters = new CreateDataSourcesStatementContextConverter().convert(context);
Map<String, DataSourceConfiguration> dataSources = DataSourceConverter.getDataSourceConfigurationMap(DataSourceConverter.getDataSourceParameterMap2(parameters));
// TODO Need to get the executed feedback from registry center for returning.
DataSourceCallback.getInstance().run(schemaName, dataSources);
@@ -85,7 +85,7 @@ public class RegistryCenterExecuteEngine implements SQLExecuteEngine {
if (!isRegistryCenterExisted()) {
return new ErrorResponse(new SQLException("No Registry center to execute `%s` SQL", context.getClass().getSimpleName()));
}
- YamlShardingRuleConfiguration configurations = new YamlShardingRuleConfigurationGenerator().generate(context);
+ YamlShardingRuleConfiguration configurations = new CreateShardingRuleStatementContextConverter().convert(context);
Collection<RuleConfiguration> rules = new YamlRuleConfigurationSwapperEngine().swapToRuleConfigurations(Collections.singleton(configurations));
// TODO Need to get the executed feedback from registry center for returning.
RuleCallback.getInstance().run(schemaName, rules);
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/RegistryCenterExecuteEngineTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/RegistryCenterExecuteEngineTest.java
index a308976..c1d12cd 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/RegistryCenterExecuteEngineTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/RegistryCenterExecuteEngineTest.java
@@ -57,7 +57,7 @@ public final class RegistryCenterExecuteEngineTest {
private void createDataSourcesContext() {
dataSourcesContext = mock(CreateDataSourcesStatementContext.class);
- when(dataSourcesContext.getDataSourceContexts()).thenReturn(Collections.emptyList());
+ when(dataSourcesContext.getUrls()).thenReturn(Collections.emptyList());
}
private void createRuleContext() {
diff --git a/shardingsphere-proxy/shardingsphere-proxy-common/pom.xml b/shardingsphere-proxy/shardingsphere-proxy-common/pom.xml
index 7182f93..67e5ad9 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-common/pom.xml
+++ b/shardingsphere-proxy/shardingsphere-proxy-common/pom.xml
@@ -79,6 +79,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.shardingsphere</groupId>
+ <artifactId>shardingsphere-rdl-parser-binder</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<scope>compile</scope>
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/generator/YamlDataSourceConfigurationGenerator.java b/shardingsphere-proxy/shardingsphere-proxy-common/src/main/java/org/apache/shardingsphere/proxy/convert/CreateDataSourcesStatementContextConverter.java
similarity index 71%
rename from shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/generator/YamlDataSourceConfigurationGenerator.java
rename to shardingsphere-proxy/shardingsphere-proxy-common/src/main/java/org/apache/shardingsphere/proxy/convert/CreateDataSourcesStatementContextConverter.java
index 447b340..95e2741 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/generator/YamlDataSourceConfigurationGenerator.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-common/src/main/java/org/apache/shardingsphere/proxy/convert/CreateDataSourcesStatementContextConverter.java
@@ -15,24 +15,25 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.proxy.backend.communication.jdbc.execute.generator;
+package org.apache.shardingsphere.proxy.convert;
import org.apache.shardingsphere.proxy.config.yaml.YamlDataSourceParameter;
import org.apache.shardingsphere.rdl.parser.binder.context.CreateDataSourcesStatementContext;
-import org.apache.shardingsphere.rdl.parser.binder.context.CreateDataSourcesStatementContext.DataSourceContext;
+import org.apache.shardingsphere.rdl.parser.binder.context.CreateDataSourcesStatementContext.DataSourceConnectionUrl;
+import org.apache.shardingsphere.rdl.parser.binder.generator.SQLStatementContextConverter;
import java.util.LinkedHashMap;
import java.util.Map;
/**
- * Yaml dataSource configuration generator.
+ * Create dataSource statement context converter.
*/
-public class YamlDataSourceConfigurationGenerator implements YamlConfigurationGenerator<CreateDataSourcesStatementContext, Map<String, YamlDataSourceParameter>> {
+public class CreateDataSourcesStatementContextConverter implements SQLStatementContextConverter<CreateDataSourcesStatementContext, Map<String, YamlDataSourceParameter>> {
@Override
- public Map<String, YamlDataSourceParameter> generate(final CreateDataSourcesStatementContext sqlStatement) {
+ public Map<String, YamlDataSourceParameter> convert(final CreateDataSourcesStatementContext sqlStatement) {
Map<String, YamlDataSourceParameter> result = new LinkedHashMap<>();
- for (DataSourceContext each : sqlStatement.getDataSourceContexts()) {
+ for (DataSourceConnectionUrl each : sqlStatement.getUrls()) {
YamlDataSourceParameter dataSource = new YamlDataSourceParameter();
dataSource.setUrl(each.getUrl());
dataSource.setUsername(each.getUserName());
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/generator/YamlDataSourceConfigurationGeneratorTest.java b/shardingsphere-proxy/shardingsphere-proxy-common/src/test/java/org/apache/shardingsphere/proxy/convert/CreateDataSourcesStatementContextConverterTest.java
similarity index 72%
rename from shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/generator/YamlDataSourceConfigurationGeneratorTest.java
rename to shardingsphere-proxy/shardingsphere-proxy-common/src/test/java/org/apache/shardingsphere/proxy/convert/CreateDataSourcesStatementContextConverterTest.java
index 527e0d8..e200958 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/generator/YamlDataSourceConfigurationGeneratorTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-common/src/test/java/org/apache/shardingsphere/proxy/convert/CreateDataSourcesStatementContextConverterTest.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.proxy.backend.communication.jdbc.execute.generator;
+package org.apache.shardingsphere.proxy.convert;
import org.apache.shardingsphere.proxy.config.yaml.YamlDataSourceParameter;
import org.apache.shardingsphere.rdl.parser.binder.context.CreateDataSourcesStatementContext;
-import org.apache.shardingsphere.rdl.parser.binder.context.CreateDataSourcesStatementContext.DataSourceContext;
+import org.apache.shardingsphere.rdl.parser.binder.context.CreateDataSourcesStatementContext.DataSourceConnectionUrl;
import org.junit.Before;
import org.junit.Test;
@@ -27,27 +27,28 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedList;
import java.util.Map;
+
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-public final class YamlDataSourceConfigurationGeneratorTest {
+public final class CreateDataSourcesStatementContextConverterTest {
private CreateDataSourcesStatementContext sqlStatement;
@Before
public void setUp() {
sqlStatement = mock(CreateDataSourcesStatementContext.class);
- when(sqlStatement.getDataSourceContexts()).thenReturn(createDataSourceContexts());
+ when(sqlStatement.getUrls()).thenReturn(createDataSourceContexts());
}
- private Collection<DataSourceContext> createDataSourceContexts() {
- Collection<DataSourceContext> result = new LinkedList<>();
+ private Collection<DataSourceConnectionUrl> createDataSourceContexts() {
+ Collection<DataSourceConnectionUrl> result = new LinkedList<>();
for (int i = 0; i < 2; i++) {
- DataSourceContext context =
- new DataSourceContext("ds" + i, "jdbc:mysql://127.0.0.1:3306/demo_ds_" + i + "?serverTimezone=UTC&useSSL=false", "root" + i, "root" + i);
+ DataSourceConnectionUrl context =
+ new DataSourceConnectionUrl("ds" + i, "jdbc:mysql://127.0.0.1:3306/demo_ds_" + i + "?serverTimezone=UTC&useSSL=false", "root" + i, "root" + i);
result.add(context);
}
return result;
@@ -55,7 +56,7 @@ public final class YamlDataSourceConfigurationGeneratorTest {
@Test
public void assertGenerate() {
- Map<String, YamlDataSourceParameter> result = new YamlDataSourceConfigurationGenerator().generate(sqlStatement);
+ Map<String, YamlDataSourceParameter> result = new CreateDataSourcesStatementContextConverter().convert(sqlStatement);
assertThat(result.size(), is(2));
assertTrue(result.keySet().containsAll(Arrays.asList("ds0", "ds1")));
assertThat(result.values().iterator().next().getUsername(), is("root0"));
diff --git a/shardingsphere-rdl-parser/shardingsphere-rdl-parser-binder/src/main/java/org/apache/shardingsphere/rdl/parser/binder/context/CreateDataSourcesStatementContext.java b/shardingsphere-rdl-parser/shardingsphere-rdl-parser-binder/src/main/java/org/apache/shardingsphere/rdl/parser/binder/context/CreateDataSourcesStatementContext.java
index 7a89fab..49abdae 100644
--- a/shardingsphere-rdl-parser/shardingsphere-rdl-parser-binder/src/main/java/org/apache/shardingsphere/rdl/parser/binder/context/CreateDataSourcesStatementContext.java
+++ b/shardingsphere-rdl-parser/shardingsphere-rdl-parser-binder/src/main/java/org/apache/shardingsphere/rdl/parser/binder/context/CreateDataSourcesStatementContext.java
@@ -19,7 +19,10 @@ package org.apache.shardingsphere.rdl.parser.binder.context;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.infra.database.type.DatabaseType;
+import org.apache.shardingsphere.rdl.parser.binder.util.DataSourceConnectionUrlUtil;
import org.apache.shardingsphere.rdl.parser.statement.rdl.CreateDataSourcesStatement;
+import org.apache.shardingsphere.rdl.parser.statement.rdl.DataSourceConnectionSegment;
import org.apache.shardingsphere.sql.parser.binder.statement.CommonSQLStatementContext;
import java.util.Collection;
@@ -28,24 +31,22 @@ import java.util.LinkedList;
/**
* Create dataSource statement context.
*/
+@Getter
public final class CreateDataSourcesStatementContext extends CommonSQLStatementContext<CreateDataSourcesStatement> {
- public CreateDataSourcesStatementContext(final CreateDataSourcesStatement sqlStatement) {
- super(sqlStatement);
- }
+ private final Collection<DataSourceConnectionUrl> urls;
- /**
- * Get dataSource contexts.
- *
- * @return dataSource contexts
- */
- public Collection<DataSourceContext> getDataSourceContexts() {
- return new LinkedList<>();
+ public CreateDataSourcesStatementContext(final CreateDataSourcesStatement sqlStatement, final DatabaseType databaseType) {
+ super(sqlStatement);
+ urls = new LinkedList<>();
+ for (DataSourceConnectionSegment each : sqlStatement.getConnectionInfos()) {
+ urls.add(new DataSourceConnectionUrl(each.getName(), DataSourceConnectionUrlUtil.getUrl(each, databaseType), each.getUser(), each.getPassword()));
+ }
}
@RequiredArgsConstructor
@Getter
- public static final class DataSourceContext {
+ public static final class DataSourceConnectionUrl {
private final String name;
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/generator/YamlConfigurationGenerator.java b/shardingsphere-rdl-parser/shardingsphere-rdl-parser-binder/src/main/java/org/apache/shardingsphere/rdl/parser/binder/generator/SQLStatementContextConverter.java
similarity index 78%
rename from shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/generator/YamlConfigurationGenerator.java
rename to shardingsphere-rdl-parser/shardingsphere-rdl-parser-binder/src/main/java/org/apache/shardingsphere/rdl/parser/binder/generator/SQLStatementContextConverter.java
index 1240986..5ab968a 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/execute/generator/YamlConfigurationGenerator.java
+++ b/shardingsphere-rdl-parser/shardingsphere-rdl-parser-binder/src/main/java/org/apache/shardingsphere/rdl/parser/binder/generator/SQLStatementContextConverter.java
@@ -15,20 +15,20 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.proxy.backend.communication.jdbc.execute.generator;
+package org.apache.shardingsphere.rdl.parser.binder.generator;
import org.apache.shardingsphere.sql.parser.binder.statement.SQLStatementContext;
/**
- * Yaml configuration generator.
+ * SQL statement context converter.
*/
-public interface YamlConfigurationGenerator<I extends SQLStatementContext, O> {
+public interface SQLStatementContextConverter<I extends SQLStatementContext, O> {
/**
- * Generate yaml configuration.
+ * Convert sql statement.
*
* @param sqlStatement sql statement
* @return yaml configurations
*/
- O generate(I sqlStatement);
+ O convert(I sqlStatement);
}