This is an automated email from the ASF dual-hosted git repository.
panjuan 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 a164726cb75 Rename PureListInlineExpressionParser to
LiteralInlineExpressionParser (#28562)
a164726cb75 is described below
commit a164726cb753fd6ae74c4e339d4401f6895c7c50
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Sep 24 13:32:42 2023 +0800
Rename PureListInlineExpressionParser to LiteralInlineExpressionParser
(#28562)
---
docs/document/content/dev-manual/sharding.cn.md | 8 ++++----
docs/document/content/dev-manual/sharding.en.md | 8 ++++----
.../common-config/builtin-algorithm/expr.cn.md | 4 ++--
.../common-config/builtin-algorithm/expr.en.md | 4 ++--
.../startup/graalvm-native-image.cn.md | 4 ++--
.../startup/graalvm-native-image.en.md | 6 +++---
infra/expr/core/pom.xml | 2 +-
.../expr/core/InlineExpressionParserFactoryTest.java | 4 ++--
infra/expr/type/{purelist => literal}/pom.xml | 2 +-
.../expr/literal/LiteralInlineExpressionParser.java} | 8 ++++----
....shardingsphere.infra.expr.spi.InlineExpressionParser | 2 +-
.../expr/literal/LiteralInlineExpressionParserTest.java} | 16 ++++++++--------
infra/expr/type/pom.xml | 2 +-
13 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/docs/document/content/dev-manual/sharding.cn.md
b/docs/document/content/dev-manual/sharding.cn.md
index e419ccafd2b..4458ff94ee3 100644
--- a/docs/document/content/dev-manual/sharding.cn.md
+++ b/docs/document/content/dev-manual/sharding.cn.md
@@ -92,7 +92,7 @@ chapter = true
### 已知实现
-| *配置标识* | *详细说明* | *全限定类名*
|
-|----------|-------------------|--------------------------------------------------------------------------------|
-| GROOVY | 使用 Groovy 语法的行表达式 |
`org.apache.shardingsphere.infra.expr.groovy.GroovyInlineExpressionParser` |
-| PURELIST | 使用标准列表的行表达式 |
`org.apache.shardingsphere.infra.expr.purelist.PureListInlineExpressionParser` |
+| *配置标识* | *详细说明* | *全限定类名*
|
+|---------|-------------------|------------------------------------------------------------------------------|
+| GROOVY | 使用 Groovy 语法的行表达式 |
`org.apache.shardingsphere.infra.expr.groovy.GroovyInlineExpressionParser` |
+| LITERAL | 使用标准列表的行表达式 |
`org.apache.shardingsphere.infra.expr.literal.LiteralInlineExpressionParser` |
diff --git a/docs/document/content/dev-manual/sharding.en.md
b/docs/document/content/dev-manual/sharding.en.md
index 0463e27c40c..6721258529a 100644
--- a/docs/document/content/dev-manual/sharding.en.md
+++ b/docs/document/content/dev-manual/sharding.en.md
@@ -92,7 +92,7 @@ Row Value Expressions definition
### Implementation classes
-| *Configuration Type* | *Description* |
*Fully-qualified class name* |
-|----------------------|---------------------------------------------------|--------------------------------------------------------------------------------|
-| GROOVY | Row Value Expressions that uses the Groovy syntax |
`org.apache.shardingsphere.infra.expr.groovy.GroovyInlineExpressionParser` |
-| PURELIST | Row Value Expressions that uses a standard list |
`org.apache.shardingsphere.infra.expr.purelist.PureListInlineExpressionParser` |
+| *Configuration Type* | *Description* |
*Fully-qualified class name* |
+|----------------------|---------------------------------------------------|------------------------------------------------------------------------------|
+| GROOVY | Row Value Expressions that uses the Groovy syntax |
`org.apache.shardingsphere.infra.expr.groovy.GroovyInlineExpressionParser` |
+| LITERAL | Row Value Expressions that uses a standard list |
`org.apache.shardingsphere.infra.expr.literal.LiteralInlineExpressionParser` |
diff --git
a/docs/document/content/user-manual/common-config/builtin-algorithm/expr.cn.md
b/docs/document/content/user-manual/common-config/builtin-algorithm/expr.cn.md
index c55718e6b57..2f67d5c1e95 100644
---
a/docs/document/content/user-manual/common-config/builtin-algorithm/expr.cn.md
+++
b/docs/document/content/user-manual/common-config/builtin-algorithm/expr.cn.md
@@ -13,7 +13,7 @@ weight = 7
## 使用标准列表的行表达式
-类型:PURELIST
+类型:LITERAL
可配置属性:
@@ -32,7 +32,7 @@ rules:
- !SHARDING
tables:
t_order:
- actualDataNodes: <PURELIST>ds_0.t_order_0, ds_0.t_order_1,
ds_1.t_order_0, ds_1.t_order_1
+ actualDataNodes: <LITERAL>ds_0.t_order_0, ds_0.t_order_1,
ds_1.t_order_0, ds_1.t_order_1
tableStrategy:
standard:
shardingColumn: order_id
diff --git
a/docs/document/content/user-manual/common-config/builtin-algorithm/expr.en.md
b/docs/document/content/user-manual/common-config/builtin-algorithm/expr.en.md
index 216ce754d39..5bd773d392e 100644
---
a/docs/document/content/user-manual/common-config/builtin-algorithm/expr.en.md
+++
b/docs/document/content/user-manual/common-config/builtin-algorithm/expr.en.md
@@ -13,7 +13,7 @@ None
## Row Value Expressions that uses a standard list
-Type: PURELIST
+Type: LITERAL
Attributes:
@@ -34,7 +34,7 @@ rules:
- !SHARDING
tables:
t_order:
- actualDataNodes: <PURELIST>ds_0.t_order_0, ds_0.t_order_1,
ds_1.t_order_0, ds_1.t_order_1
+ actualDataNodes: <LITERAL>ds_0.t_order_0, ds_0.t_order_1,
ds_1.t_order_0, ds_1.t_order_1
tableStrategy:
standard:
shardingColumn: order_id
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.cn.md
b/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.cn.md
index 501f9f99d00..d8e8486109d 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.cn.md
@@ -39,8 +39,8 @@ services:
- 当前阶段,GraalVM Native Image 形态的 ShardingSphere Proxy 不支持使用
`InlineExpressionParser` SPI 的默认实现的 `行表达式`,
这首先导致 `数据分片` 功能的`actualDataNodes` 属性只能使用其他 `InlineExpressionParser` SPI
的实现来配置, 例如使用
- `InlineExpressionParser` SPI 实现为 `PURELIST` 的 `行表达式`, 即
`<PURELIST>ds_0.t_order_0, ds_0.t_order_1`
- 或 `<PURELIST>ds_0.t_user_0, ds_15.t_user_1023`。
+ `InlineExpressionParser` SPI 实现为 `LITERAL` 的 `行表达式`, 即
`<LITERAL>ds_0.t_order_0, ds_0.t_order_1`
+ 或 `<LITERAL>ds_0.t_user_0, ds_15.t_user_1023`。
- 本节假定处于 Linux(amd64,aarch64), MacOS(amd64)或 Windows(amd64)环境。
如果你位于 MacOS(aarch64/M1) 环境,你需要关注尚未关闭的
https://github.com/oracle/graal/issues/2666 。
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.en.md
b/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.en.md
index fe0d38acfa8..12ffccfa253 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.en.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/startup/graalvm-native-image.en.md
@@ -45,9 +45,9 @@ services:
- At this stage, ShardingSphere Proxy in the form of GraalVM Native Image does
not support `row expressions` using the
default implementation of the `InlineExpressionParser` SPI.
This first results in the `actualDataNodes` property of the `data sharding`
feature that can only be configured using
- other implementations of the `InlineExpressionParser` SPI, for example using
`PURELIST` implemented
- `InlineExpressionParser` SPI for `row expression`, i.e.
`<PURELIST>ds_0.t_order_0, ds_0.t_order_1`
- or `<PURELIST>ds_0.t_user_0, ds_15.t_user_1023`.
+ other implementations of the `InlineExpressionParser` SPI, for example using
`LITERAL` implemented
+ `InlineExpressionParser` SPI for `row expression`, i.e.
`<LITERAL>ds_0.t_order_0, ds_0.t_order_1`
+ or `<LITERAL>ds_0.t_user_0, ds_15.t_user_1023`.
- This section assumes a Linux (amd64, aarch64), MacOS (amd64) or Windows
(amd64) environment.
If you are on MacOS (aarch64/M1) environment, you need to follow
https://github.com/oracle/graal/issues/2666 which is
diff --git a/infra/expr/core/pom.xml b/infra/expr/core/pom.xml
index a5fafdeba9e..dc998ba8560 100644
--- a/infra/expr/core/pom.xml
+++ b/infra/expr/core/pom.xml
@@ -39,7 +39,7 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-infra-expr-purelist</artifactId>
+ <artifactId>shardingsphere-infra-expr-literal</artifactId>
<version>${project.version}</version>
</dependency>
diff --git
a/infra/expr/core/src/test/java/org/apache/shardingsphere/infra/expr/core/InlineExpressionParserFactoryTest.java
b/infra/expr/core/src/test/java/org/apache/shardingsphere/infra/expr/core/InlineExpressionParserFactoryTest.java
index 4ade13127fe..88b96845095 100644
---
a/infra/expr/core/src/test/java/org/apache/shardingsphere/infra/expr/core/InlineExpressionParserFactoryTest.java
+++
b/infra/expr/core/src/test/java/org/apache/shardingsphere/infra/expr/core/InlineExpressionParserFactoryTest.java
@@ -36,8 +36,8 @@ class InlineExpressionParserFactoryTest {
assertThat(InlineExpressionParserFactory.newInstance("t_order_0,
t_order_1").handlePlaceHolder(), is("t_order_0, t_order_1"));
assertThat(InlineExpressionParserFactory.newInstance("<GROOVY>t_order_0,
t_order_1").getType(), is("GROOVY"));
assertThat(InlineExpressionParserFactory.newInstance("<GROOVY>t_order_0,
t_order_1").handlePlaceHolder(), is("t_order_0, t_order_1"));
-
assertThat(InlineExpressionParserFactory.newInstance("<PURELIST>t_order_0,
t_order_1").getType(), is("PURELIST"));
-
assertThat(InlineExpressionParserFactory.newInstance("<PURELIST>t_order_0,
t_order_1").handlePlaceHolder(), is("t_order_0, t_order_1"));
+
assertThat(InlineExpressionParserFactory.newInstance("<LITERAL>t_order_0,
t_order_1").getType(), is("LITERAL"));
+
assertThat(InlineExpressionParserFactory.newInstance("<LITERAL>t_order_0,
t_order_1").handlePlaceHolder(), is("t_order_0, t_order_1"));
}
@Test
diff --git a/infra/expr/type/purelist/pom.xml b/infra/expr/type/literal/pom.xml
similarity index 96%
rename from infra/expr/type/purelist/pom.xml
rename to infra/expr/type/literal/pom.xml
index 0ac0438b150..9505aab5145 100644
--- a/infra/expr/type/purelist/pom.xml
+++ b/infra/expr/type/literal/pom.xml
@@ -23,7 +23,7 @@
<artifactId>shardingsphere-infra-expr-type</artifactId>
<version>5.4.1-SNAPSHOT</version>
</parent>
- <artifactId>shardingsphere-infra-expr-purelist</artifactId>
+ <artifactId>shardingsphere-infra-expr-literal</artifactId>
<name>${project.artifactId}</name>
<dependencies>
diff --git
a/infra/expr/type/purelist/src/main/java/org/apache/shardingsphere/infra/expr/purelist/PureListInlineExpressionParser.java
b/infra/expr/type/literal/src/main/java/org/apache/shardingsphere/infra/expr/literal/LiteralInlineExpressionParser.java
similarity index 91%
rename from
infra/expr/type/purelist/src/main/java/org/apache/shardingsphere/infra/expr/purelist/PureListInlineExpressionParser.java
rename to
infra/expr/type/literal/src/main/java/org/apache/shardingsphere/infra/expr/literal/LiteralInlineExpressionParser.java
index f84e5a7fee1..c286e2c8b87 100644
---
a/infra/expr/type/purelist/src/main/java/org/apache/shardingsphere/infra/expr/purelist/PureListInlineExpressionParser.java
+++
b/infra/expr/type/literal/src/main/java/org/apache/shardingsphere/infra/expr/literal/LiteralInlineExpressionParser.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.expr.purelist;
+package org.apache.shardingsphere.infra.expr.literal;
import com.google.common.base.Strings;
import org.apache.shardingsphere.infra.expr.spi.InlineExpressionParser;
@@ -26,9 +26,9 @@ import java.util.List;
import java.util.Properties;
/**
- * Pure List inline expression parser.
+ * literal inline expression parser.
*/
-public final class PureListInlineExpressionParser implements
InlineExpressionParser {
+public final class LiteralInlineExpressionParser implements
InlineExpressionParser {
private static final char SPLITTER = ',';
@@ -69,6 +69,6 @@ public final class PureListInlineExpressionParser implements
InlineExpressionPar
@Override
public String getType() {
- return "PURELIST";
+ return "LITERAL";
}
}
diff --git
a/infra/expr/type/purelist/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.expr.spi.InlineExpressionParser
b/infra/expr/type/literal/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.expr.spi.InlineExpressionParser
similarity index 91%
rename from
infra/expr/type/purelist/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.expr.spi.InlineExpressionParser
rename to
infra/expr/type/literal/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.expr.spi.InlineExpressionParser
index 9f038f1b9fb..92c32bf922d 100644
---
a/infra/expr/type/purelist/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.expr.spi.InlineExpressionParser
+++
b/infra/expr/type/literal/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.expr.spi.InlineExpressionParser
@@ -15,4 +15,4 @@
# limitations under the License.
#
-org.apache.shardingsphere.infra.expr.purelist.PureListInlineExpressionParser
+org.apache.shardingsphere.infra.expr.literal.LiteralInlineExpressionParser
diff --git
a/infra/expr/type/purelist/src/test/java/org/apache/shardingsphere/infra/expr/purelist/PureListInlineExpressionParserTest.java
b/infra/expr/type/literal/src/test/java/org/apache/shardingsphere/infra/expr/literal/LiteralInlineExpressionParserTest.java
similarity index 88%
rename from
infra/expr/type/purelist/src/test/java/org/apache/shardingsphere/infra/expr/purelist/PureListInlineExpressionParserTest.java
rename to
infra/expr/type/literal/src/test/java/org/apache/shardingsphere/infra/expr/literal/LiteralInlineExpressionParserTest.java
index 2ddeacdd7b4..75538527b1f 100644
---
a/infra/expr/type/purelist/src/test/java/org/apache/shardingsphere/infra/expr/purelist/PureListInlineExpressionParserTest.java
+++
b/infra/expr/type/literal/src/test/java/org/apache/shardingsphere/infra/expr/literal/LiteralInlineExpressionParserTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.infra.expr.purelist;
+package org.apache.shardingsphere.infra.expr.literal;
import org.apache.shardingsphere.infra.expr.spi.InlineExpressionParser;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
@@ -31,18 +31,18 @@ import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;
-class PureListInlineExpressionParserTest {
+class LiteralInlineExpressionParserTest {
@Test
void assertEvaluateForExpressionIsNull() {
- InlineExpressionParser parser =
TypedSPILoader.getService(InlineExpressionParser.class, "PURELIST", new
Properties());
+ InlineExpressionParser parser =
TypedSPILoader.getService(InlineExpressionParser.class, "LITERAL", new
Properties());
List<String> expected = parser.splitAndEvaluate();
assertThat(expected, is(Collections.<String>emptyList()));
}
@Test
void assertEvaluateForSimpleString() {
- List<String> expected =
TypedSPILoader.getService(InlineExpressionParser.class, "PURELIST",
PropertiesBuilder.build(
+ List<String> expected =
TypedSPILoader.getService(InlineExpressionParser.class, "LITERAL",
PropertiesBuilder.build(
new
PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY, "
t_order_0, t_order_1 "))).splitAndEvaluate();
assertThat(expected.size(), is(2));
assertThat(expected, hasItems("t_order_0", "t_order_1"));
@@ -60,7 +60,7 @@ class PureListInlineExpressionParserTest {
expression.append(",");
}
}
- List<String> expected =
TypedSPILoader.getService(InlineExpressionParser.class, "PURELIST",
PropertiesBuilder.build(
+ List<String> expected =
TypedSPILoader.getService(InlineExpressionParser.class, "LITERAL",
PropertiesBuilder.build(
new
PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY,
expression.toString()))).splitAndEvaluate();
assertThat(expected.size(), is(1024));
assertThat(expected, hasItems("ds_0.t_user_0", "ds_15.t_user_1023"));
@@ -68,15 +68,15 @@ class PureListInlineExpressionParserTest {
@Test
void assertHandlePlaceHolder() {
- assertThat(TypedSPILoader.getService(InlineExpressionParser.class,
"PURELIST", PropertiesBuilder.build(
+ assertThat(TypedSPILoader.getService(InlineExpressionParser.class,
"LITERAL", PropertiesBuilder.build(
new
PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY,
"t_$->{[\"new$->{1+2}\"]}"))).handlePlaceHolder(),
is("t_$->{[\"new$->{1+2}\"]}"));
- assertThat(TypedSPILoader.getService(InlineExpressionParser.class,
"PURELIST", PropertiesBuilder.build(
+ assertThat(TypedSPILoader.getService(InlineExpressionParser.class,
"LITERAL", PropertiesBuilder.build(
new
PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY,
"t_${[\"new$->{1+2}\"]}"))).handlePlaceHolder(), is("t_${[\"new$->{1+2}\"]}"));
}
@Test
void assertEvaluateClosure() {
- assertThrows(UnsupportedOperationException.class, () ->
TypedSPILoader.getService(InlineExpressionParser.class, "PURELIST",
PropertiesBuilder.build(
+ assertThrows(UnsupportedOperationException.class, () ->
TypedSPILoader.getService(InlineExpressionParser.class, "LITERAL",
PropertiesBuilder.build(
new
PropertiesBuilder.Property(InlineExpressionParser.INLINE_EXPRESSION_KEY,
"${1+2}"))).evaluateClosure().call().toString());
}
}
diff --git a/infra/expr/type/pom.xml b/infra/expr/type/pom.xml
index 12131f0ae98..8283b9eb8a8 100644
--- a/infra/expr/type/pom.xml
+++ b/infra/expr/type/pom.xml
@@ -29,7 +29,7 @@
<modules>
<module>groovy</module>
- <module>purelist</module>
+ <module>literal</module>
<module>espresso</module>
</modules>
</project>