You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2021/09/11 06:49:55 UTC

[shardingsphere] branch master updated: Minor changes for ShadowAlgorithm (#12365)

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 429d6c0  Minor changes for ShadowAlgorithm (#12365)
429d6c0 is described below

commit 429d6c03ff7414100063506d43b179edbc13a7ca
Author: Liang Zhang <te...@163.com>
AuthorDate: Sat Sep 11 14:49:25 2021 +0800

    Minor changes for ShadowAlgorithm (#12365)
---
 .../shadow/column/ColumnRegexMatchShadowAlgorithm.java         | 10 +++++-----
 .../algorithm/shadow/note/SimpleSQLNoteShadowAlgorithm.java    | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/algorithm/shadow/column/ColumnRegexMatchShadowAlgorithm.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/algorithm/shadow/column/ColumnRegexMatchShadowAlgorithm.java
index 271e59b..a37a324 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/algorithm/shadow/column/ColumnRegexMatchShadowAlgorithm.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/algorithm/shadow/column/ColumnRegexMatchShadowAlgorithm.java
@@ -47,11 +47,6 @@ public final class ColumnRegexMatchShadowAlgorithm implements ColumnShadowAlgori
     private ShadowOperationType shadowOperationType;
     
     @Override
-    public String getType() {
-        return "COLUMN_REGEX_MATCH";
-    }
-    
-    @Override
     public void init() {
         checkProps();
     }
@@ -88,4 +83,9 @@ public final class ColumnRegexMatchShadowAlgorithm implements ColumnShadowAlgori
         boolean isRegexMatch = String.valueOf(shadowValue.getValue()).matches(props.get(REGEX).toString());
         return containTable && isSameOperation && isSameColumnName && isRegexMatch;
     }
+    
+    @Override
+    public String getType() {
+        return "COLUMN_REGEX_MATCH";
+    }
 }
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/algorithm/shadow/note/SimpleSQLNoteShadowAlgorithm.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/algorithm/shadow/note/SimpleSQLNoteShadowAlgorithm.java
index 8429929..b04d895 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/algorithm/shadow/note/SimpleSQLNoteShadowAlgorithm.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/algorithm/shadow/note/SimpleSQLNoteShadowAlgorithm.java
@@ -39,11 +39,6 @@ public final class SimpleSQLNoteShadowAlgorithm implements NoteShadowAlgorithm<S
     private Properties props = new Properties();
     
     @Override
-    public String getType() {
-        return "SIMPLE_NOTE";
-    }
-    
-    @Override
     public void init() {
         checkPropsSize();
     }
@@ -60,4 +55,9 @@ public final class SimpleSQLNoteShadowAlgorithm implements NoteShadowAlgorithm<S
         Optional<Map<String, String>> noteOptional = NoteShadowAlgorithmUtil.parseSimpleSQLNote(noteShadowValue.getSqlNoteValue());
         return noteOptional.filter(stringStringMap -> props.entrySet().stream().allMatch(entry -> Objects.equals(entry.getValue(), stringStringMap.get(String.valueOf(entry.getKey()))))).isPresent();
     }
+    
+    @Override
+    public String getType() {
+        return "SIMPLE_NOTE";
+    }
 }