From 9c66e4c645251b048e269cd0a440e859923dd649 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 24 Sep 2023 00:10:15 +0800 Subject: [PATCH] Refactor ShardingRule --- .../sharding/rule/ShardingRule.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rule/ShardingRule.java b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rule/ShardingRule.java index cd35c79d0824a..2b38f3e591ef8 100644 --- a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rule/ShardingRule.java +++ b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/rule/ShardingRule.java @@ -692,6 +692,15 @@ public Map getLogicAndActualTablesFromBindingTable(final String .orElseGet(Collections::emptyMap); } + /** + * Is sharding cache enabled. + * + * @return is sharding cache enabled + */ + public boolean isShardingCacheEnabled() { + return null != shardingCache; + } + @Override public Map> getAllDataNodes() { return shardingTableDataNodes; @@ -784,13 +793,4 @@ private boolean isJoinConditionExpression(final ExpressionSegment expression) { BinaryOperationExpression binaryExpression = (BinaryOperationExpression) expression; return binaryExpression.getLeft() instanceof ColumnSegment && binaryExpression.getRight() instanceof ColumnSegment && "=".equals(binaryExpression.getOperator()); } - - /** - * Is sharding cache enabled. - * - * @return is sharding cache enabled - */ - public boolean isShardingCacheEnabled() { - return null != shardingCache; - } }