This is an automated email from the ASF dual-hosted git repository.
wuweijie 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 d892ebc Rename standard and feature package names to resource and
rule (#10805)
d892ebc is described below
commit d892ebc8239465c9ec7bb6af8e4741e50849d709
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Jun 14 16:31:21 2021 +0800
Rename standard and feature package names to resource and rule (#10805)
* Rename standard package to resource
* Rename feature package to rule
---
.../parser/api/DistSQLStatementParserEngine.java | 8 +++---
.../ResourceDistSQLLexer.java} | 8 +++---
.../ResourceDistSQLParser.java} | 8 +++---
.../ResourceDistSQLStatementVisitor.java} | 6 ++---
.../ResourceSQLStatementParserEngine.java} | 10 ++++----
.../RuleParseASTNode.java} | 8 +++---
.../RuleSQLStatementParserEngine.java} | 30 +++++++++++-----------
...LParserFacade.java => RuleSQLParserFacade.java} | 10 ++++----
...ade.java => RuleSQLStatementVisitorFacade.java} | 10 ++++----
9 files changed, 49 insertions(+), 49 deletions(-)
diff --git
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/api/DistSQLStatementParserEngine.java
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/api/DistSQLStatementParserEngine.java
index 49920db..1ff6b25 100644
---
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/api/DistSQLStatementParserEngine.java
+++
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/api/DistSQLStatementParserEngine.java
@@ -18,8 +18,8 @@
package org.apache.shardingsphere.distsql.parser.api;
import org.antlr.v4.runtime.misc.ParseCancellationException;
-import
org.apache.shardingsphere.distsql.parser.core.feature.FeatureTypedSQLStatementParserEngine;
-import
org.apache.shardingsphere.distsql.parser.core.standard.StandardSQLStatementParserEngine;
+import
org.apache.shardingsphere.distsql.parser.core.rule.RuleSQLStatementParserEngine;
+import
org.apache.shardingsphere.distsql.parser.core.resource.ResourceSQLStatementParserEngine;
import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
/**
@@ -35,9 +35,9 @@ public final class DistSQLStatementParserEngine {
*/
public SQLStatement parse(final String sql) {
try {
- return new StandardSQLStatementParserEngine().parse(sql);
+ return new ResourceSQLStatementParserEngine().parse(sql);
} catch (final ParseCancellationException ignored) {
- return new FeatureTypedSQLStatementParserEngine().parse(sql);
+ return new RuleSQLStatementParserEngine().parse(sql);
}
}
}
diff --git
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/standard/StandardDistSQLLexer.java
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/resource/ResourceDistSQLLexer.java
similarity index 82%
rename from
shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/standard/StandardDistSQLLexer.java
rename to
shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/resource/ResourceDistSQLLexer.java
index 9702860..828a864 100644
---
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/standard/StandardDistSQLLexer.java
+++
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/resource/ResourceDistSQLLexer.java
@@ -15,18 +15,18 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.distsql.parser.core.standard;
+package org.apache.shardingsphere.distsql.parser.core.resource;
import org.antlr.v4.runtime.CharStream;
import org.apache.shardingsphere.distsql.parser.autogen.DistSQLStatementLexer;
import org.apache.shardingsphere.sql.parser.api.parser.SQLLexer;
/**
- * SQL lexer for standard dist SQL.
+ * SQL lexer for resource dist SQL.
*/
-public final class StandardDistSQLLexer extends DistSQLStatementLexer
implements SQLLexer {
+public final class ResourceDistSQLLexer extends DistSQLStatementLexer
implements SQLLexer {
- public StandardDistSQLLexer(final CharStream input) {
+ public ResourceDistSQLLexer(final CharStream input) {
super(input);
}
}
diff --git
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/standard/StandardDistSQLParser.java
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/resource/ResourceDistSQLParser.java
similarity index 85%
rename from
shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/standard/StandardDistSQLParser.java
rename to
shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/resource/ResourceDistSQLParser.java
index 7342de2..5989ecb 100644
---
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/standard/StandardDistSQLParser.java
+++
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/resource/ResourceDistSQLParser.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.distsql.parser.core.standard;
+package org.apache.shardingsphere.distsql.parser.core.resource;
import org.antlr.v4.runtime.TokenStream;
import org.apache.shardingsphere.distsql.parser.autogen.DistSQLStatementParser;
@@ -24,11 +24,11 @@ import
org.apache.shardingsphere.sql.parser.api.visitor.ASTNode;
import org.apache.shardingsphere.sql.parser.core.ParseASTNode;
/**
- * SQL parser for standard dist SQL.
+ * SQL parser for resource dist SQL.
*/
-public final class StandardDistSQLParser extends DistSQLStatementParser
implements SQLParser {
+public final class ResourceDistSQLParser extends DistSQLStatementParser
implements SQLParser {
- public StandardDistSQLParser(final TokenStream input) {
+ public ResourceDistSQLParser(final TokenStream input) {
super(input);
}
diff --git
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/standard/StandardDistSQLStatementVisitor.java
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/resource/ResourceDistSQLStatementVisitor.java
similarity index 99%
rename from
shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/standard/StandardDistSQLStatementVisitor.java
rename to
shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/resource/ResourceDistSQLStatementVisitor.java
index 82c4328..4c75a35 100644
---
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/standard/StandardDistSQLStatementVisitor.java
+++
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/resource/ResourceDistSQLStatementVisitor.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.distsql.parser.core.standard;
+package org.apache.shardingsphere.distsql.parser.core.resource;
import com.google.common.base.Joiner;
import org.antlr.v4.runtime.RuleContext;
@@ -125,9 +125,9 @@ import java.util.Properties;
import java.util.stream.Collectors;
/**
- * SQL statement visitor for standard dist SQL.
+ * SQL statement visitor for resource dist SQL.
*/
-public final class StandardDistSQLStatementVisitor extends
DistSQLStatementBaseVisitor<ASTNode> implements SQLVisitor {
+public final class ResourceDistSQLStatementVisitor extends
DistSQLStatementBaseVisitor<ASTNode> implements SQLVisitor {
@Override
public ASTNode visitAddResource(final AddResourceContext ctx) {
diff --git
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/standard/StandardSQLStatementParserEngine.java
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/resource/ResourceSQLStatementParserEngine.java
similarity index 82%
rename from
shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/standard/StandardSQLStatementParserEngine.java
rename to
shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/resource/ResourceSQLStatementParserEngine.java
index e46519b..3e72d56 100644
---
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/standard/StandardSQLStatementParserEngine.java
+++
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/resource/ResourceSQLStatementParserEngine.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.distsql.parser.core.standard;
+package org.apache.shardingsphere.distsql.parser.core.resource;
import org.antlr.v4.runtime.tree.ErrorNode;
import org.apache.shardingsphere.sql.parser.api.visitor.ASTNode;
@@ -25,9 +25,9 @@ import
org.apache.shardingsphere.sql.parser.exception.SQLParsingException;
import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
/**
- * Standard SQL statement parser engine.
+ * SQL statement parser engine for resource dist SQL.
*/
-public final class StandardSQLStatementParserEngine {
+public final class ResourceSQLStatementParserEngine {
/**
* Parse SQL.
@@ -36,7 +36,7 @@ public final class StandardSQLStatementParserEngine {
* @return SQL statement
*/
public SQLStatement parse(final String sql) {
- ASTNode astNode = SQLParserFactory.newInstance(sql,
StandardDistSQLLexer.class, StandardDistSQLParser.class).parse();
+ ASTNode astNode = SQLParserFactory.newInstance(sql,
ResourceDistSQLLexer.class, ResourceDistSQLParser.class).parse();
return getSQLStatement(sql, (ParseASTNode) astNode);
}
@@ -44,6 +44,6 @@ public final class StandardSQLStatementParserEngine {
if (parseASTNode.getRootNode() instanceof ErrorNode) {
throw new SQLParsingException("Unsupported SQL of `%s`", sql);
}
- return (SQLStatement) (new
StandardDistSQLStatementVisitor()).visit(parseASTNode.getRootNode());
+ return (SQLStatement) (new
ResourceDistSQLStatementVisitor()).visit(parseASTNode.getRootNode());
}
}
diff --git
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/feature/FeatureTypedParseASTNode.java
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/rule/RuleParseASTNode.java
similarity index 84%
rename from
shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/feature/FeatureTypedParseASTNode.java
rename to
shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/rule/RuleParseASTNode.java
index 4515bee..133b9b4 100644
---
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/feature/FeatureTypedParseASTNode.java
+++
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/rule/RuleParseASTNode.java
@@ -15,20 +15,20 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.distsql.parser.core.feature;
+package org.apache.shardingsphere.distsql.parser.core.rule;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.sql.parser.core.ParseASTNode;
/**
- * Feature type based parse AST node.
+ * Rule parse AST node.
*/
@RequiredArgsConstructor
@Getter
-public final class FeatureTypedParseASTNode {
+public final class RuleParseASTNode {
- private final String featureType;
+ private final String ruleType;
private final ParseASTNode parseASTNode;
}
diff --git
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/feature/FeatureTypedSQLStatementParserEngine.java
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/rule/RuleSQLStatementParserEngine.java
similarity index 67%
rename from
shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/feature/FeatureTypedSQLStatementParserEngine.java
rename to
shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/rule/RuleSQLStatementParserEngine.java
index b49e631..eb763ce 100644
---
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/feature/FeatureTypedSQLStatementParserEngine.java
+++
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/core/rule/RuleSQLStatementParserEngine.java
@@ -15,14 +15,14 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.distsql.parser.core.feature;
+package org.apache.shardingsphere.distsql.parser.core.rule;
import lombok.SneakyThrows;
import org.antlr.v4.runtime.misc.ParseCancellationException;
import org.antlr.v4.runtime.tree.ErrorNode;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
-import
org.apache.shardingsphere.distsql.parser.spi.FeatureTypedSQLParserFacade;
-import
org.apache.shardingsphere.distsql.parser.spi.FeatureTypedSQLStatementVisitorFacade;
+import org.apache.shardingsphere.distsql.parser.spi.RuleSQLParserFacade;
+import
org.apache.shardingsphere.distsql.parser.spi.RuleSQLStatementVisitorFacade;
import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitor;
import org.apache.shardingsphere.sql.parser.core.ParseASTNode;
import org.apache.shardingsphere.sql.parser.core.SQLParserFactory;
@@ -36,20 +36,20 @@ import java.util.Map;
import java.util.ServiceLoader;
/**
- * Feature type based SQL statement parser engine.
+ * Rule SQL statement parser engine.
*/
-public final class FeatureTypedSQLStatementParserEngine {
+public final class RuleSQLStatementParserEngine {
- private static final Collection<FeatureTypedSQLParserFacade>
PARSER_FACADES = new LinkedList<>();
+ private static final Collection<RuleSQLParserFacade> PARSER_FACADES = new
LinkedList<>();
- private static final Map<String, FeatureTypedSQLStatementVisitorFacade>
VISITOR_FACADES = new HashMap<>();
+ private static final Map<String, RuleSQLStatementVisitorFacade>
VISITOR_FACADES = new HashMap<>();
static {
- for (FeatureTypedSQLParserFacade each :
ServiceLoader.load(FeatureTypedSQLParserFacade.class)) {
+ for (RuleSQLParserFacade each :
ServiceLoader.load(RuleSQLParserFacade.class)) {
PARSER_FACADES.add(each);
}
- for (FeatureTypedSQLStatementVisitorFacade each :
ServiceLoader.load(FeatureTypedSQLStatementVisitorFacade.class)) {
- VISITOR_FACADES.put(each.getFeatureType(), each);
+ for (RuleSQLStatementVisitorFacade each :
ServiceLoader.load(RuleSQLStatementVisitorFacade.class)) {
+ VISITOR_FACADES.put(each.getRuleType(), each);
}
}
@@ -60,15 +60,15 @@ public final class FeatureTypedSQLStatementParserEngine {
* @return SQL statement
*/
public SQLStatement parse(final String sql) {
- FeatureTypedParseASTNode featureTypedParseASTNode =
parseToASTNode(sql);
- return getSQLStatement(sql, featureTypedParseASTNode.getFeatureType(),
featureTypedParseASTNode.getParseASTNode());
+ RuleParseASTNode ruleParseASTNode = parseToASTNode(sql);
+ return getSQLStatement(sql, ruleParseASTNode.getRuleType(),
ruleParseASTNode.getParseASTNode());
}
- private FeatureTypedParseASTNode parseToASTNode(final String sql) {
- for (FeatureTypedSQLParserFacade each : PARSER_FACADES) {
+ private RuleParseASTNode parseToASTNode(final String sql) {
+ for (RuleSQLParserFacade each : PARSER_FACADES) {
try {
ParseASTNode parseASTNode = (ParseASTNode)
SQLParserFactory.newInstance(sql, each.getLexerClass(),
each.getParserClass()).parse();
- return new FeatureTypedParseASTNode(each.getFeatureType(),
parseASTNode);
+ return new RuleParseASTNode(each.getRuleType(), parseASTNode);
} catch (final ParseCancellationException ignored) {
}
}
diff --git
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/spi/FeatureTypedSQLParserFacade.java
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/spi/RuleSQLParserFacade.java
similarity index 83%
rename from
shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/spi/FeatureTypedSQLParserFacade.java
rename to
shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/spi/RuleSQLParserFacade.java
index 4d11bd3..648f1b8 100644
---
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/spi/FeatureTypedSQLParserFacade.java
+++
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/spi/RuleSQLParserFacade.java
@@ -20,14 +20,14 @@ package org.apache.shardingsphere.distsql.parser.spi;
import org.apache.shardingsphere.sql.parser.spi.SQLParserFacade;
/**
- * Feature type based SQL parser facade.
+ * Rule SQL parser facade.
*/
-public interface FeatureTypedSQLParserFacade extends SQLParserFacade {
+public interface RuleSQLParserFacade extends SQLParserFacade {
/**
- * Get feature type.
+ * Get rule type.
*
- * @return feature type
+ * @return rule type
*/
- String getFeatureType();
+ String getRuleType();
}
diff --git
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/spi/FeatureTypedSQLStatementVisitorFacade.java
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/spi/RuleSQLStatementVisitorFacade.java
similarity index 85%
rename from
shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/spi/FeatureTypedSQLStatementVisitorFacade.java
rename to
shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/spi/RuleSQLStatementVisitorFacade.java
index 6fe5dee..423ee68 100644
---
a/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/spi/FeatureTypedSQLStatementVisitorFacade.java
+++
b/shardingsphere-distsql-parser/shardingsphere-distsql-parser-engine/src/main/java/org/apache/shardingsphere/distsql/parser/spi/RuleSQLStatementVisitorFacade.java
@@ -20,9 +20,9 @@ package org.apache.shardingsphere.distsql.parser.spi;
import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitor;
/**
- * Feature type based SQL statement visitor facade.
+ * Rule SQL statement visitor facade.
*/
-public interface FeatureTypedSQLStatementVisitorFacade {
+public interface RuleSQLStatementVisitorFacade {
/**
* Get visitor class.
@@ -32,9 +32,9 @@ public interface FeatureTypedSQLStatementVisitorFacade {
Class<? extends SQLVisitor> getVisitorClass();
/**
- * Get feature type.
+ * Get rule type.
*
- * @return feature type
+ * @return rule type
*/
- String getFeatureType();
+ String getRuleType();
}