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 800e95dfee1 Add convert on LocalDataQueryResultRow (#30097)
800e95dfee1 is described below
commit 800e95dfee195f1dbf57536e13a459b16e601184
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Feb 12 19:12:14 2024 +0800
Add convert on LocalDataQueryResultRow (#30097)
---
.../handler/query/ShowEncryptRuleExecutor.java | 7 +++----
.../handler/query/ShowMaskRuleExecutor.java | 3 +--
.../query/ShowReadwriteSplittingRuleExecutor.java | 5 ++---
...wStatusFromReadwriteSplittingRulesExecutor.java | 2 +-
.../query/ShowDefaultShadowAlgorithmExecutor.java | 8 +-------
.../query/ShowShadowAlgorithmsExecutor.java | 9 +--------
.../handler/query/ShowShadowRuleExecutor.java | 5 ++---
.../query/ShowShardingAlgorithmExecutor.java | 8 +-------
.../query/ShowShardingAuditorsExecutor.java | 3 +--
.../query/ShowShardingKeyGeneratorExecutor.java | 3 +--
.../ShowUnusedShardingAlgorithmsExecutor.java | 8 +-------
.../query/ShowUnusedShardingAuditorsExecutor.java | 3 +--
.../ShowUnusedShardingKeyGeneratorExecutor.java | 8 +-------
.../result/impl/local/LocalDataQueryResultRow.java | 23 ++++++++++++++++++++--
.../handler/query/ShowAuthorityRuleExecutor.java | 2 +-
.../query/ShowMigrationCheckStatusExecutor.java | 19 +++++-------------
.../query/ShowMigrationJobStatusExecutor.java | 3 +--
.../handler/query/ShowMigrationListExecutor.java | 6 ++----
.../handler/query/ShowGlobalClockRuleExecutor.java | 4 +---
.../query/ShowSQLFederationRuleExecutor.java | 3 +--
.../query/ShowSQLTranslatorRuleExecutor.java | 4 +---
.../handler/query/ShowTrafficRuleExecutor.java | 4 +---
.../handler/query/ShowTransactionRuleExecutor.java | 4 +---
.../ral/queryable/ShowComputeNodeModeExecutor.java | 4 ++--
24 files changed, 54 insertions(+), 94 deletions(-)
diff --git
a/features/encrypt/distsql/handler/src/main/java/org/apache/shardingsphere/encrypt/distsql/handler/query/ShowEncryptRuleExecutor.java
b/features/encrypt/distsql/handler/src/main/java/org/apache/shardingsphere/encrypt/distsql/handler/query/ShowEncryptRuleExecutor.java
index c30eaa6cc59..6d148026846 100644
---
a/features/encrypt/distsql/handler/src/main/java/org/apache/shardingsphere/encrypt/distsql/handler/query/ShowEncryptRuleExecutor.java
+++
b/features/encrypt/distsql/handler/src/main/java/org/apache/shardingsphere/encrypt/distsql/handler/query/ShowEncryptRuleExecutor.java
@@ -28,7 +28,6 @@ import
org.apache.shardingsphere.encrypt.distsql.statement.ShowEncryptRulesState
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.mode.manager.ContextManager;
import java.util.Arrays;
@@ -75,11 +74,11 @@ public final class ShowEncryptRuleExecutor implements
DistSQLQueryExecutor<ShowE
each.getAssistedQuery().map(EncryptColumnItemRuleConfiguration::getName).orElse(""),
each.getLikeQuery().map(EncryptColumnItemRuleConfiguration::getName).orElse(""),
encryptorAlgorithmConfig.getType(),
-
PropertiesConverter.convert(encryptorAlgorithmConfig.getProps()),
+ encryptorAlgorithmConfig.getProps(),
null == assistedQueryEncryptorAlgorithmConfig ? "" :
assistedQueryEncryptorAlgorithmConfig.getType(),
- null == assistedQueryEncryptorAlgorithmConfig ? "" :
PropertiesConverter.convert(assistedQueryEncryptorAlgorithmConfig.getProps()),
+ null == assistedQueryEncryptorAlgorithmConfig ? "" :
assistedQueryEncryptorAlgorithmConfig.getProps(),
null == likeQueryEncryptorAlgorithmConfig ? "" :
likeQueryEncryptorAlgorithmConfig.getType(),
- null == likeQueryEncryptorAlgorithmConfig ? "" :
PropertiesConverter.convert(likeQueryEncryptorAlgorithmConfig.getProps())));
+ null == likeQueryEncryptorAlgorithmConfig ? "" :
likeQueryEncryptorAlgorithmConfig.getProps()));
}
return result;
}
diff --git
a/features/mask/distsql/handler/src/main/java/org/apache/shardingsphere/mask/distsql/handler/query/ShowMaskRuleExecutor.java
b/features/mask/distsql/handler/src/main/java/org/apache/shardingsphere/mask/distsql/handler/query/ShowMaskRuleExecutor.java
index 1ffa348e450..bf216535edc 100644
---
a/features/mask/distsql/handler/src/main/java/org/apache/shardingsphere/mask/distsql/handler/query/ShowMaskRuleExecutor.java
+++
b/features/mask/distsql/handler/src/main/java/org/apache/shardingsphere/mask/distsql/handler/query/ShowMaskRuleExecutor.java
@@ -22,7 +22,6 @@ import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorRuleAware;
import
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecutor;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.props.PropertiesConverter;
import
org.apache.shardingsphere.mask.api.config.rule.MaskTableRuleConfiguration;
import org.apache.shardingsphere.mask.distsql.statement.ShowMaskRulesStatement;
import org.apache.shardingsphere.mask.rule.MaskRule;
@@ -57,7 +56,7 @@ public final class ShowMaskRuleExecutor implements
DistSQLQueryExecutor<ShowMask
Collection<LocalDataQueryResultRow> result = new LinkedList<>();
tableRuleConfig.getColumns().forEach(each -> {
AlgorithmConfiguration maskAlgorithmConfig =
algorithmMap.get(each.getMaskAlgorithm());
- result.add(new LocalDataQueryResultRow(tableRuleConfig.getName(),
each.getLogicColumn(), maskAlgorithmConfig.getType(),
PropertiesConverter.convert(maskAlgorithmConfig.getProps())));
+ result.add(new LocalDataQueryResultRow(tableRuleConfig.getName(),
each.getLogicColumn(), maskAlgorithmConfig.getType(),
maskAlgorithmConfig.getProps()));
});
return result;
}
diff --git
a/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowReadwriteSplittingRuleExecutor.java
b/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowReadwriteSplittingRuleExecutor.java
index 17936eb1b78..208de14e06c 100644
---
a/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowReadwriteSplittingRuleExecutor.java
+++
b/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowReadwriteSplittingRuleExecutor.java
@@ -23,7 +23,6 @@ import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorRuleAware;
import
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecutor;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.props.PropertiesConverter;
import
org.apache.shardingsphere.infra.rule.identifier.type.exportable.constant.ExportableConstants;
import
org.apache.shardingsphere.infra.rule.identifier.type.exportable.constant.ExportableItemConstants;
import org.apache.shardingsphere.mode.manager.ContextManager;
@@ -80,8 +79,8 @@ public final class ShowReadwriteSplittingRuleExecutor
implements DistSQLQueryExe
getWriteDataSourceName(dataSourceRuleConfig,
exportDataSources),
getReadDataSourceNames(dataSourceRuleConfig,
exportDataSources),
dataSourceRuleConfig.getTransactionalReadQueryStrategy().name(),
- loadBalancer.map(AlgorithmConfiguration::getType).orElse(""),
- loadBalancer.map(each ->
PropertiesConverter.convert(each.getProps())).orElse(""));
+ loadBalancer.map(AlgorithmConfiguration::getType).orElse(null),
+
loadBalancer.map(AlgorithmConfiguration::getProps).orElse(null));
}
private Map<String, AlgorithmConfiguration> getLoadBalancers(final
ReadwriteSplittingRuleConfiguration ruleConfig) {
diff --git
a/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowStatusFromReadwriteSplittingRulesExecutor.java
b/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowStatusFromReadwriteSplittingRulesExecutor.java
index 54f9074410a..1de3dbd8137 100644
---
a/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowStatusFromReadwriteSplittingRulesExecutor.java
+++
b/features/readwrite-splitting/distsql/handler/src/main/java/org/apache/shardingsphere/readwritesplitting/distsql/handler/query/ShowStatusFromReadwriteSplittingRulesExecutor.java
@@ -113,7 +113,7 @@ public final class
ShowStatusFromReadwriteSplittingRulesExecutor implements Dist
}
private LocalDataQueryResultRow buildRow(final String resource, final
StorageNodeDataSource storageNodeDataSource) {
- return null == storageNodeDataSource ? new
LocalDataQueryResultRow(resource, DataSourceState.ENABLED.name()) : new
LocalDataQueryResultRow(resource, storageNodeDataSource.getStatus().name());
+ return null == storageNodeDataSource ? new
LocalDataQueryResultRow(resource, DataSourceState.ENABLED) : new
LocalDataQueryResultRow(resource, storageNodeDataSource.getStatus());
}
@Override
diff --git
a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowDefaultShadowAlgorithmExecutor.java
b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowDefaultShadowAlgorithmExecutor.java
index b9b8b2a698c..9903a7e4d89 100644
---
a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowDefaultShadowAlgorithmExecutor.java
+++
b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowDefaultShadowAlgorithmExecutor.java
@@ -22,7 +22,6 @@ import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorRuleAware;
import
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecutor;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.mode.manager.ContextManager;
import
org.apache.shardingsphere.shadow.distsql.statement.ShowDefaultShadowAlgorithmStatement;
import org.apache.shardingsphere.shadow.rule.ShadowRule;
@@ -31,7 +30,6 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedList;
import java.util.Map.Entry;
-import java.util.Properties;
import java.util.stream.Collectors;
/**
@@ -53,15 +51,11 @@ public final class ShowDefaultShadowAlgorithmExecutor
implements DistSQLQueryExe
Collection<LocalDataQueryResultRow> result = new LinkedList<>();
for (Entry<String, AlgorithmConfiguration> entry :
rule.getConfiguration().getShadowAlgorithms().entrySet().stream()
.filter(each ->
each.getKey().equals(defaultAlgorithm)).collect(Collectors.toMap(Entry::getKey,
Entry::getValue)).entrySet()) {
- result.add(new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getType(), convertToString(entry.getValue().getProps())));
+ result.add(new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getType(), entry.getValue().getProps()));
}
return result;
}
- private String convertToString(final Properties props) {
- return null == props ? "" : PropertiesConverter.convert(props);
- }
-
@Override
public Class<ShadowRule> getRuleClass() {
return ShadowRule.class;
diff --git
a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowAlgorithmsExecutor.java
b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowAlgorithmsExecutor.java
index bcf54dd25dd..d1f071efd40 100644
---
a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowAlgorithmsExecutor.java
+++
b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowAlgorithmsExecutor.java
@@ -21,14 +21,12 @@ import lombok.Setter;
import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorRuleAware;
import
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecutor;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.mode.manager.ContextManager;
import
org.apache.shardingsphere.shadow.distsql.statement.ShowShadowAlgorithmsStatement;
import org.apache.shardingsphere.shadow.rule.ShadowRule;
import java.util.Arrays;
import java.util.Collection;
-import java.util.Properties;
import java.util.stream.Collectors;
/**
@@ -48,15 +46,10 @@ public final class ShowShadowAlgorithmsExecutor implements
DistSQLQueryExecutor<
public Collection<LocalDataQueryResultRow> getRows(final
ShowShadowAlgorithmsStatement sqlStatement, final ContextManager
contextManager) {
String defaultAlgorithm =
rule.getConfiguration().getDefaultShadowAlgorithmName();
return
rule.getConfiguration().getShadowAlgorithms().entrySet().stream()
- .map(entry -> new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getType(),
- convertToString(entry.getValue().getProps()),
Boolean.toString(entry.getKey().equals(defaultAlgorithm))))
+ .map(entry -> new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getType(), entry.getValue().getProps(),
Boolean.toString(entry.getKey().equals(defaultAlgorithm))))
.collect(Collectors.toList());
}
- private String convertToString(final Properties props) {
- return null == props ? "" : PropertiesConverter.convert(props);
- }
-
@Override
public Class<ShadowRule> getRuleClass() {
return ShadowRule.class;
diff --git
a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowRuleExecutor.java
b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowRuleExecutor.java
index 950f4d008e1..f3df445bf41 100644
---
a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowRuleExecutor.java
+++
b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShowShadowRuleExecutor.java
@@ -22,7 +22,6 @@ import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorRuleAware;
import
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecutor;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.mode.manager.ContextManager;
import
org.apache.shardingsphere.shadow.api.config.datasource.ShadowDataSourceConfiguration;
import
org.apache.shardingsphere.shadow.api.config.table.ShadowTableConfiguration;
@@ -77,8 +76,8 @@ public final class ShowShadowRuleExecutor implements
DistSQLQueryExecutor<ShowSh
Collection<LocalDataQueryResultRow> result = new LinkedList<>();
dataSourceTable.forEach((key, value) ->
value.getShadowAlgorithmNames().forEach(each -> {
AlgorithmConfiguration algorithmConfig =
algorithmConfigs.get(each);
- result.add(new LocalDataQueryResultRow(key,
dataSourceConfig.getName(), dataSourceConfig.getProductionDataSourceName(),
dataSourceConfig.getShadowDataSourceName(),
- algorithmConfig.getType(),
PropertiesConverter.convert(algorithmConfig.getProps())));
+ result.add(new LocalDataQueryResultRow(key,
+ dataSourceConfig.getName(),
dataSourceConfig.getProductionDataSourceName(),
dataSourceConfig.getShadowDataSourceName(), algorithmConfig.getType(),
algorithmConfig.getProps()));
}));
return result;
}
diff --git
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAlgorithmExecutor.java
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAlgorithmExecutor.java
index 549d7a8ee02..92f0a39de2f 100644
---
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAlgorithmExecutor.java
+++
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAlgorithmExecutor.java
@@ -21,14 +21,12 @@ import lombok.Setter;
import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorRuleAware;
import
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecutor;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.mode.manager.ContextManager;
import
org.apache.shardingsphere.sharding.distsql.statement.ShowShardingAlgorithmsStatement;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import java.util.Arrays;
import java.util.Collection;
-import java.util.Properties;
import java.util.stream.Collectors;
/**
@@ -47,11 +45,7 @@ public final class ShowShardingAlgorithmExecutor implements
DistSQLQueryExecutor
@Override
public Collection<LocalDataQueryResultRow> getRows(final
ShowShardingAlgorithmsStatement sqlStatement, final ContextManager
contextManager) {
return
rule.getConfiguration().getShardingAlgorithms().entrySet().stream()
- .map(entry -> new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getType(),
buildProps(entry.getValue().getProps()))).collect(Collectors.toList());
- }
-
- private String buildProps(final Properties props) {
- return null == props ? "" : PropertiesConverter.convert(props);
+ .map(entry -> new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getType(),
entry.getValue().getProps())).collect(Collectors.toList());
}
@Override
diff --git
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAuditorsExecutor.java
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAuditorsExecutor.java
index a5b2fcec184..27dde89b4a9 100644
---
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAuditorsExecutor.java
+++
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingAuditorsExecutor.java
@@ -21,7 +21,6 @@ import lombok.Setter;
import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorRuleAware;
import
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecutor;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.mode.manager.ContextManager;
import
org.apache.shardingsphere.sharding.distsql.statement.ShowShardingAuditorsStatement;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
@@ -46,7 +45,7 @@ public final class ShowShardingAuditorsExecutor implements
DistSQLQueryExecutor<
@Override
public Collection<LocalDataQueryResultRow> getRows(final
ShowShardingAuditorsStatement sqlStatement, final ContextManager
contextManager) {
return rule.getConfiguration().getAuditors().entrySet().stream()
- .map(entry -> new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getType(),
PropertiesConverter.convert(entry.getValue().getProps()))).collect(Collectors.toList());
+ .map(entry -> new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getType(),
entry.getValue().getProps())).collect(Collectors.toList());
}
@Override
diff --git
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingKeyGeneratorExecutor.java
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingKeyGeneratorExecutor.java
index daeda4c0f54..73fb9920b15 100644
---
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingKeyGeneratorExecutor.java
+++
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingKeyGeneratorExecutor.java
@@ -21,7 +21,6 @@ import lombok.Setter;
import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorRuleAware;
import
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecutor;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.mode.manager.ContextManager;
import
org.apache.shardingsphere.sharding.distsql.statement.ShowShardingKeyGeneratorsStatement;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
@@ -46,7 +45,7 @@ public final class ShowShardingKeyGeneratorExecutor
implements DistSQLQueryExecu
@Override
public Collection<LocalDataQueryResultRow> getRows(final
ShowShardingKeyGeneratorsStatement sqlStatement, final ContextManager
contextManager) {
return rule.getConfiguration().getKeyGenerators().entrySet().stream()
- .map(entry -> new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getType(),
PropertiesConverter.convert(entry.getValue().getProps()))).collect(Collectors.toList());
+ .map(entry -> new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getType(),
entry.getValue().getProps())).collect(Collectors.toList());
}
@Override
diff --git
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAlgorithmsExecutor.java
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAlgorithmsExecutor.java
index b30f7567a0f..e4dbf67556a 100644
---
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAlgorithmsExecutor.java
+++
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAlgorithmsExecutor.java
@@ -23,7 +23,6 @@ import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorRuleAware;
import
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecutor;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import
org.apache.shardingsphere.sharding.api.config.strategy.sharding.ShardingStrategyConfiguration;
@@ -35,7 +34,6 @@ import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.Map.Entry;
-import java.util.Properties;
/**
* Show unused sharding algorithms executor.
@@ -57,7 +55,7 @@ public final class ShowUnusedShardingAlgorithmsExecutor
implements DistSQLQueryE
Collection<String> inUsedAlgorithms =
getUsedShardingAlgorithms(shardingRuleConfig);
for (Entry<String, AlgorithmConfiguration> entry :
shardingRuleConfig.getShardingAlgorithms().entrySet()) {
if (!inUsedAlgorithms.contains(entry.getKey())) {
- result.add(new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getType(), buildProps(entry.getValue().getProps())));
+ result.add(new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getType(), entry.getValue().getProps()));
}
}
return result;
@@ -85,10 +83,6 @@ public final class ShowUnusedShardingAlgorithmsExecutor
implements DistSQLQueryE
return result;
}
- private String buildProps(final Properties props) {
- return null == props ? "" : PropertiesConverter.convert(props);
- }
-
@Override
public Class<ShardingRule> getRuleClass() {
return ShardingRule.class;
diff --git
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAuditorsExecutor.java
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAuditorsExecutor.java
index 69573a84761..872e96e7ec7 100644
---
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAuditorsExecutor.java
+++
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingAuditorsExecutor.java
@@ -21,7 +21,6 @@ import lombok.Setter;
import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorRuleAware;
import
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecutor;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import
org.apache.shardingsphere.sharding.api.config.strategy.audit.ShardingAuditStrategyConfiguration;
@@ -51,7 +50,7 @@ public final class ShowUnusedShardingAuditorsExecutor
implements DistSQLQueryExe
ShardingRuleConfiguration shardingRuleConfig = rule.getConfiguration();
Collection<String> inUsedAuditors =
getUsedAuditors(shardingRuleConfig);
return
shardingRuleConfig.getAuditors().entrySet().stream().filter(entry ->
!inUsedAuditors.contains(entry.getKey()))
- .map(entry -> new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getType(),
PropertiesConverter.convert(entry.getValue().getProps()))).collect(Collectors.toList());
+ .map(entry -> new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getType(),
entry.getValue().getProps())).collect(Collectors.toList());
}
private Collection<String> getUsedAuditors(final ShardingRuleConfiguration
shardingRuleConfig) {
diff --git
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingKeyGeneratorExecutor.java
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingKeyGeneratorExecutor.java
index 39142de021b..27256d168e4 100644
---
a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingKeyGeneratorExecutor.java
+++
b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowUnusedShardingKeyGeneratorExecutor.java
@@ -22,7 +22,6 @@ import lombok.Setter;
import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorRuleAware;
import
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecutor;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import
org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
@@ -32,7 +31,6 @@ import org.apache.shardingsphere.sharding.rule.ShardingRule;
import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedHashSet;
-import java.util.Properties;
import java.util.stream.Collectors;
/**
@@ -52,7 +50,7 @@ public final class ShowUnusedShardingKeyGeneratorExecutor
implements DistSQLQuer
public Collection<LocalDataQueryResultRow> getRows(final
ShowUnusedShardingKeyGeneratorsStatement sqlStatement, final ContextManager
contextManager) {
Collection<String> inUsedKeyGenerators =
getUsedKeyGenerators(rule.getConfiguration());
return
rule.getConfiguration().getKeyGenerators().entrySet().stream().filter(entry ->
!inUsedKeyGenerators.contains(entry.getKey()))
- .map(entry -> new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getType(),
buildProps(entry.getValue().getProps()))).collect(Collectors.toList());
+ .map(entry -> new LocalDataQueryResultRow(entry.getKey(),
entry.getValue().getType(),
entry.getValue().getProps())).collect(Collectors.toList());
}
private Collection<String> getUsedKeyGenerators(final
ShardingRuleConfiguration ruleConfig) {
@@ -66,10 +64,6 @@ public final class ShowUnusedShardingKeyGeneratorExecutor
implements DistSQLQuer
return result;
}
- private String buildProps(final Properties props) {
- return null == props ? "" : PropertiesConverter.convert(props);
- }
-
@Override
public Class<ShardingRule> getRuleClass() {
return ShardingRule.class;
diff --git
a/infra/merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/local/LocalDataQueryResultRow.java
b/infra/merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/local/LocalDataQueryResultRow.java
index 54ce37db7f0..d814e7a4158 100644
---
a/infra/merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/local/LocalDataQueryResultRow.java
+++
b/infra/merge/src/main/java/org/apache/shardingsphere/infra/merge/result/impl/local/LocalDataQueryResultRow.java
@@ -18,9 +18,12 @@
package org.apache.shardingsphere.infra.merge.result.impl.local;
import com.google.common.base.Preconditions;
+import org.apache.shardingsphere.infra.props.PropertiesConverter;
-import java.util.Arrays;
import java.util.List;
+import java.util.Properties;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
/**
* Local data query result row.
@@ -30,7 +33,23 @@ public final class LocalDataQueryResultRow {
private final List<Object> data;
public LocalDataQueryResultRow(final Object... data) {
- this.data = Arrays.asList(data);
+ this.data =
Stream.of(data).map(this::convert).collect(Collectors.toList());
+ }
+
+ private Object convert(final Object data) {
+ if (null == data) {
+ return "";
+ }
+ if (data instanceof Boolean) {
+ return Boolean.toString((Boolean) data);
+ }
+ if (data instanceof Enum) {
+ return ((Enum<?>) data).name();
+ }
+ if (data instanceof Properties) {
+ return PropertiesConverter.convert((Properties) data);
+ }
+ return data;
}
/**
diff --git
a/kernel/authority/distsql/handler/src/main/java/org/apache/shardingsphere/authority/distsql/handler/query/ShowAuthorityRuleExecutor.java
b/kernel/authority/distsql/handler/src/main/java/org/apache/shardingsphere/authority/distsql/handler/query/ShowAuthorityRuleExecutor.java
index 37b7cc2b579..00b5e8e8456 100644
---
a/kernel/authority/distsql/handler/src/main/java/org/apache/shardingsphere/authority/distsql/handler/query/ShowAuthorityRuleExecutor.java
+++
b/kernel/authority/distsql/handler/src/main/java/org/apache/shardingsphere/authority/distsql/handler/query/ShowAuthorityRuleExecutor.java
@@ -49,7 +49,7 @@ public final class ShowAuthorityRuleExecutor implements
DistSQLQueryExecutor<Sho
String users = rule.getConfiguration().getUsers().stream().map(each ->
each.getGrantee().toString()).collect(Collectors.joining("; "));
String provider =
rule.getConfiguration().getPrivilegeProvider().getType();
Properties props =
rule.getConfiguration().getPrivilegeProvider().getProps().isEmpty() ? new
Properties() : rule.getConfiguration().getPrivilegeProvider().getProps();
- return Collections.singleton(new LocalDataQueryResultRow(users,
provider, props.isEmpty() ? "" : props));
+ return Collections.singleton(new LocalDataQueryResultRow(users,
provider, props));
}
@Override
diff --git
a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationCheckStatusExecutor.java
b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationCheckStatusExecutor.java
index 234d7877220..c3508838d22 100644
---
a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationCheckStatusExecutor.java
+++
b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationCheckStatusExecutor.java
@@ -27,9 +27,7 @@ import org.apache.shardingsphere.mode.manager.ContextManager;
import java.util.Arrays;
import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Optional;
+import java.util.stream.Collectors;
/**
* Show migration check status executor.
@@ -46,21 +44,14 @@ public final class ShowMigrationCheckStatusExecutor
implements DistSQLQueryExecu
@Override
public Collection<LocalDataQueryResultRow> getRows(final
ShowMigrationCheckStatusStatement sqlStatement, final ContextManager
contextManager) {
- List<ConsistencyCheckJobItemInfo> infos =
jobAPI.getJobItemInfos(sqlStatement.getJobId());
- Collection<LocalDataQueryResultRow> result = new LinkedList<>();
- for (ConsistencyCheckJobItemInfo each : infos) {
- result.add(convert(each));
- }
- return result;
+ return
jobAPI.getJobItemInfos(sqlStatement.getJobId()).stream().map(this::convert).collect(Collectors.toList());
}
private LocalDataQueryResultRow convert(final ConsistencyCheckJobItemInfo
info) {
String checkResult = null == info.getCheckSuccess() ? "" :
info.getCheckSuccess().toString();
- return new
LocalDataQueryResultRow(Optional.ofNullable(info.getTableNames()).orElse(""),
checkResult, Optional.ofNullable(info.getCheckFailedTableNames()).orElse(""),
- info.isActive() ? Boolean.TRUE.toString() :
Boolean.FALSE.toString(),
- String.valueOf(info.getInventoryFinishedPercentage()),
info.getInventoryRemainingSeconds(), info.getIncrementalIdleSeconds(),
- Optional.ofNullable(info.getCheckBeginTime()).orElse(""),
Optional.ofNullable(info.getCheckEndTime()).orElse(""),
info.getDurationSeconds(),
- info.getAlgorithmType(),
Optional.ofNullable(info.getAlgorithmProps()).orElse(""),
Optional.ofNullable(info.getErrorMessage()).orElse(""));
+ return new LocalDataQueryResultRow(info.getTableNames(), checkResult,
info.getCheckFailedTableNames(), info.isActive(),
+ info.getInventoryFinishedPercentage(),
info.getInventoryRemainingSeconds(), info.getIncrementalIdleSeconds(),
+ info.getCheckBeginTime(), info.getCheckEndTime(),
info.getDurationSeconds(), info.getAlgorithmType(), info.getAlgorithmProps(),
info.getErrorMessage());
}
@Override
diff --git
a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationJobStatusExecutor.java
b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationJobStatusExecutor.java
index 662faa03444..213da1d1c2c 100644
---
a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationJobStatusExecutor.java
+++
b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationJobStatusExecutor.java
@@ -59,8 +59,7 @@ public final class ShowMigrationJobStatusExecutor implements
DistSQLQueryExecuto
incrementalIdleSeconds =
String.valueOf(TimeUnit.MILLISECONDS.toSeconds(currentTimeMillis -
latestActiveTimeMillis));
}
return new LocalDataQueryResultRow(jobItemInfo.getShardingItem(),
jobItemProgress.getDataSourceName(), jobItemInfo.getTableNames(),
jobItemProgress.getStatus(),
- jobItemProgress.isActive() ? Boolean.TRUE.toString() :
Boolean.FALSE.toString(), jobItemProgress.getProcessedRecordsCount(),
jobItemInfo.getInventoryFinishedPercentage(),
- incrementalIdleSeconds, jobItemInfo.getErrorMessage());
+ jobItemProgress.isActive(),
jobItemProgress.getProcessedRecordsCount(),
jobItemInfo.getInventoryFinishedPercentage(), incrementalIdleSeconds,
jobItemInfo.getErrorMessage());
}
@Override
diff --git
a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationListExecutor.java
b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationListExecutor.java
index 0a9ca3a1711..916f546e31f 100644
---
a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationListExecutor.java
+++
b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationListExecutor.java
@@ -44,10 +44,8 @@ public final class ShowMigrationListExecutor implements
DistSQLQueryExecutor<Sho
@Override
public Collection<LocalDataQueryResultRow> getRows(final
ShowMigrationListStatement sqlStatement, final ContextManager contextManager) {
- return pipelineJobManager.getJobInfos(new
PipelineContextKey(InstanceType.PROXY)).stream().map(each -> new
LocalDataQueryResultRow(each.getJobMetaData().getJobId(),
- each.getTableName(), each.getJobMetaData().getJobItemCount(),
- each.getJobMetaData().isActive() ? Boolean.TRUE.toString() :
Boolean.FALSE.toString(),
- each.getJobMetaData().getCreateTime(),
each.getJobMetaData().getStopTime())).collect(Collectors.toList());
+ return pipelineJobManager.getJobInfos(new
PipelineContextKey(InstanceType.PROXY)).stream().map(each -> new
LocalDataQueryResultRow(each.getJobMetaData().getJobId(), each.getTableName(),
+ each.getJobMetaData().getJobItemCount(),
each.getJobMetaData().isActive(), each.getJobMetaData().getCreateTime(),
each.getJobMetaData().getStopTime())).collect(Collectors.toList());
}
@Override
diff --git
a/kernel/global-clock/distsql/handler/src/main/java/org/apache/shardingsphere/globalclock/distsql/handler/query/ShowGlobalClockRuleExecutor.java
b/kernel/global-clock/distsql/handler/src/main/java/org/apache/shardingsphere/globalclock/distsql/handler/query/ShowGlobalClockRuleExecutor.java
index 6ad3d01ae4a..4a95d9800ea 100644
---
a/kernel/global-clock/distsql/handler/src/main/java/org/apache/shardingsphere/globalclock/distsql/handler/query/ShowGlobalClockRuleExecutor.java
+++
b/kernel/global-clock/distsql/handler/src/main/java/org/apache/shardingsphere/globalclock/distsql/handler/query/ShowGlobalClockRuleExecutor.java
@@ -24,7 +24,6 @@ import
org.apache.shardingsphere.globalclock.api.config.GlobalClockRuleConfigura
import org.apache.shardingsphere.globalclock.core.rule.GlobalClockRule;
import
org.apache.shardingsphere.globalclock.distsql.statement.queryable.ShowGlobalClockRuleStatement;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.mode.manager.ContextManager;
import java.util.Arrays;
@@ -47,8 +46,7 @@ public final class ShowGlobalClockRuleExecutor implements
DistSQLQueryExecutor<S
@Override
public Collection<LocalDataQueryResultRow> getRows(final
ShowGlobalClockRuleStatement sqlStatement, final ContextManager contextManager)
{
GlobalClockRuleConfiguration ruleConfig = rule.getConfiguration();
- return Collections.singleton(new
LocalDataQueryResultRow(ruleConfig.getType(), ruleConfig.getProvider(),
- String.valueOf(ruleConfig.isEnabled()),
PropertiesConverter.convert(ruleConfig.getProps())));
+ return Collections.singleton(new
LocalDataQueryResultRow(ruleConfig.getType(), ruleConfig.getProvider(),
ruleConfig.isEnabled(), ruleConfig.getProps()));
}
@Override
diff --git
a/kernel/sql-federation/distsql/handler/src/main/java/org/apache/shardingsphere/sqlfederation/distsql/handler/query/ShowSQLFederationRuleExecutor.java
b/kernel/sql-federation/distsql/handler/src/main/java/org/apache/shardingsphere/sqlfederation/distsql/handler/query/ShowSQLFederationRuleExecutor.java
index 486e060d66f..e35c6161a91 100644
---
a/kernel/sql-federation/distsql/handler/src/main/java/org/apache/shardingsphere/sqlfederation/distsql/handler/query/ShowSQLFederationRuleExecutor.java
+++
b/kernel/sql-federation/distsql/handler/src/main/java/org/apache/shardingsphere/sqlfederation/distsql/handler/query/ShowSQLFederationRuleExecutor.java
@@ -49,8 +49,7 @@ public final class ShowSQLFederationRuleExecutor implements
DistSQLQueryExecutor
String sqlFederationEnabled =
String.valueOf(ruleConfig.isSqlFederationEnabled());
String allQueryUseSQLFederation =
String.valueOf(ruleConfig.isAllQueryUseSQLFederation());
String executionPlanCache = null != ruleConfig.getExecutionPlanCache()
? ruleConfig.getExecutionPlanCache().toString() : "";
- LocalDataQueryResultRow row = new
LocalDataQueryResultRow(sqlFederationEnabled, allQueryUseSQLFederation,
executionPlanCache);
- return Collections.singleton(row);
+ return Collections.singleton(new
LocalDataQueryResultRow(sqlFederationEnabled, allQueryUseSQLFederation,
executionPlanCache));
}
@Override
diff --git
a/kernel/sql-translator/distsql/handler/src/main/java/org/apache/shardingsphere/sqltranslator/distsql/handler/query/ShowSQLTranslatorRuleExecutor.java
b/kernel/sql-translator/distsql/handler/src/main/java/org/apache/shardingsphere/sqltranslator/distsql/handler/query/ShowSQLTranslatorRuleExecutor.java
index 2ab55e89d28..9e2b949a40e 100644
---
a/kernel/sql-translator/distsql/handler/src/main/java/org/apache/shardingsphere/sqltranslator/distsql/handler/query/ShowSQLTranslatorRuleExecutor.java
+++
b/kernel/sql-translator/distsql/handler/src/main/java/org/apache/shardingsphere/sqltranslator/distsql/handler/query/ShowSQLTranslatorRuleExecutor.java
@@ -21,7 +21,6 @@ import lombok.Setter;
import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorRuleAware;
import
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecutor;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.mode.manager.ContextManager;
import
org.apache.shardingsphere.sqltranslator.api.config.SQLTranslatorRuleConfiguration;
import
org.apache.shardingsphere.sqltranslator.distsql.statement.queryable.ShowSQLTranslatorRuleStatement;
@@ -47,8 +46,7 @@ public final class ShowSQLTranslatorRuleExecutor implements
DistSQLQueryExecutor
@Override
public Collection<LocalDataQueryResultRow> getRows(final
ShowSQLTranslatorRuleStatement sqlStatement, final ContextManager
contextManager) {
SQLTranslatorRuleConfiguration ruleConfig = rule.getConfiguration();
- return Collections.singleton(new LocalDataQueryResultRow(null ==
ruleConfig.getType() ? "" : ruleConfig.getType(),
- PropertiesConverter.convert(ruleConfig.getProps()),
String.valueOf(ruleConfig.isUseOriginalSQLWhenTranslatingFailed())));
+ return Collections.singleton(new
LocalDataQueryResultRow(ruleConfig.getType(), ruleConfig.getProps(),
String.valueOf(ruleConfig.isUseOriginalSQLWhenTranslatingFailed())));
}
@Override
diff --git
a/kernel/traffic/distsql/handler/src/main/java/org/apache/shardingsphere/traffic/distsql/handler/query/ShowTrafficRuleExecutor.java
b/kernel/traffic/distsql/handler/src/main/java/org/apache/shardingsphere/traffic/distsql/handler/query/ShowTrafficRuleExecutor.java
index c0a5f97e25f..b0946299c43 100644
---
a/kernel/traffic/distsql/handler/src/main/java/org/apache/shardingsphere/traffic/distsql/handler/query/ShowTrafficRuleExecutor.java
+++
b/kernel/traffic/distsql/handler/src/main/java/org/apache/shardingsphere/traffic/distsql/handler/query/ShowTrafficRuleExecutor.java
@@ -22,7 +22,6 @@ import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorRuleAware;
import
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecutor;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.traffic.api.config.TrafficRuleConfiguration;
import
org.apache.shardingsphere.traffic.api.config.TrafficStrategyConfiguration;
@@ -57,8 +56,7 @@ public final class ShowTrafficRuleExecutor implements
DistSQLQueryExecutor<ShowT
private LocalDataQueryResultRow buildRow(final
TrafficStrategyConfiguration strategy, final AlgorithmConfiguration
trafficAlgorithm, final AlgorithmConfiguration loadBalancer) {
return new LocalDataQueryResultRow(strategy.getName(),
String.join(",", strategy.getLabels()), null != trafficAlgorithm ?
trafficAlgorithm.getType() : "",
- null != trafficAlgorithm ?
PropertiesConverter.convert(trafficAlgorithm.getProps()) : "", null !=
loadBalancer ? loadBalancer.getType() : "",
- null != loadBalancer ?
PropertiesConverter.convert(loadBalancer.getProps()) : "");
+ null == trafficAlgorithm ? null : trafficAlgorithm.getProps(),
null == loadBalancer ? "" : loadBalancer.getType(), null == loadBalancer ? "" :
loadBalancer.getProps());
}
@Override
diff --git
a/kernel/transaction/distsql/handler/src/main/java/org/apache/shardingsphere/transaction/distsql/handler/query/ShowTransactionRuleExecutor.java
b/kernel/transaction/distsql/handler/src/main/java/org/apache/shardingsphere/transaction/distsql/handler/query/ShowTransactionRuleExecutor.java
index aeca748ca8e..7f3bbfabca1 100644
---
a/kernel/transaction/distsql/handler/src/main/java/org/apache/shardingsphere/transaction/distsql/handler/query/ShowTransactionRuleExecutor.java
+++
b/kernel/transaction/distsql/handler/src/main/java/org/apache/shardingsphere/transaction/distsql/handler/query/ShowTransactionRuleExecutor.java
@@ -21,7 +21,6 @@ import lombok.Setter;
import
org.apache.shardingsphere.distsql.handler.aware.DistSQLExecutorRuleAware;
import
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecutor;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.props.PropertiesConverter;
import org.apache.shardingsphere.mode.manager.ContextManager;
import
org.apache.shardingsphere.transaction.distsql.statement.queryable.ShowTransactionRuleStatement;
import org.apache.shardingsphere.transaction.rule.TransactionRule;
@@ -45,8 +44,7 @@ public final class ShowTransactionRuleExecutor implements
DistSQLQueryExecutor<S
@Override
public Collection<LocalDataQueryResultRow> getRows(final
ShowTransactionRuleStatement sqlStatement, final ContextManager contextManager)
{
- return Collections.singleton(new
LocalDataQueryResultRow(rule.getDefaultType().name(), null !=
rule.getProviderType() ? rule.getProviderType() : "",
- rule.getProps().isEmpty() ? "" :
PropertiesConverter.convert(rule.getProps())));
+ return Collections.singleton(new
LocalDataQueryResultRow(rule.getDefaultType().name(), rule.getProviderType(),
rule.getProps()));
}
@Override
diff --git
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowComputeNodeModeExecutor.java
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowComputeNodeModeExecutor.java
index 9acd043288d..8628d921dc6 100644
---
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowComputeNodeModeExecutor.java
+++
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowComputeNodeModeExecutor.java
@@ -21,12 +21,12 @@ import
org.apache.shardingsphere.distsql.handler.engine.query.DistSQLQueryExecut
import
org.apache.shardingsphere.distsql.statement.ral.queryable.show.ShowComputeNodeModeStatement;
import
org.apache.shardingsphere.infra.config.mode.PersistRepositoryConfiguration;
import
org.apache.shardingsphere.infra.merge.result.impl.local.LocalDataQueryResultRow;
-import org.apache.shardingsphere.infra.util.json.JsonUtils;
import org.apache.shardingsphere.mode.manager.ContextManager;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.Properties;
/**
* Show compute node mode executor.
@@ -43,7 +43,7 @@ public final class ShowComputeNodeModeExecutor implements
DistSQLQueryExecutor<S
PersistRepositoryConfiguration repositoryConfig =
contextManager.getInstanceContext().getModeConfiguration().getRepository();
String modeType =
contextManager.getInstanceContext().getModeConfiguration().getType();
String repositoryType = null == repositoryConfig ? "" :
repositoryConfig.getType();
- String props = null == repositoryConfig || null ==
repositoryConfig.getProps() || repositoryConfig.getProps().isEmpty() ? "" :
JsonUtils.toJsonString(repositoryConfig.getProps());
+ Properties props = null == repositoryConfig ? new Properties() :
repositoryConfig.getProps();
return Collections.singleton(new LocalDataQueryResultRow(modeType,
repositoryType, props));
}