diff --git a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShadowAlgorithmTypeAndClassMapper.java b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShadowAlgorithmTypeAndClassMapper.java index bfcf22a3164e1..012eeffb0fac4 100644 --- a/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShadowAlgorithmTypeAndClassMapper.java +++ b/features/shadow/distsql/handler/src/main/java/org/apache/shardingsphere/shadow/distsql/handler/query/ShadowAlgorithmTypeAndClassMapper.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.shadow.spi.ShadowAlgorithm; /** - * Show shadow algorithm type and class mapper. + * Shadow algorithm type and class mapper. */ public final class ShadowAlgorithmTypeAndClassMapper implements PluginTypeAndClassMapper { diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShardingAlgorithmTypeAndClassMapper.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShardingAlgorithmTypeAndClassMapper.java index 1c406943466d2..734b92d0d293c 100644 --- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShardingAlgorithmTypeAndClassMapper.java +++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShardingAlgorithmTypeAndClassMapper.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.sharding.spi.ShardingAlgorithm; /** - * Show sharding algorithm type and class mapper. + * Sharding algorithm type and class mapper. */ public final class ShardingAlgorithmTypeAndClassMapper implements PluginTypeAndClassMapper { diff --git a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationSourceStorageUnitsExecutor.java b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationSourceStorageUnitsExecutor.java index feebc4abc97b4..58f4efc134b4b 100644 --- a/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationSourceStorageUnitsExecutor.java +++ b/kernel/data-pipeline/distsql/handler/src/main/java/org/apache/shardingsphere/data/pipeline/migration/distsql/handler/query/ShowMigrationSourceStorageUnitsExecutor.java @@ -29,16 +29,13 @@ import java.util.Arrays; import java.util.Collection; -import java.util.Iterator; -import java.util.LinkedList; +import java.util.stream.Collectors; /** * Show migration source storage units executor. */ public final class ShowMigrationSourceStorageUnitsExecutor implements DistSQLQueryExecutor { - private final MigrationJobAPI jobAPI = (MigrationJobAPI) TypedSPILoader.getService(TransmissionJobAPI.class, "MIGRATION"); - @Override public Collection getColumnNames(final ShowMigrationSourceStorageUnitsStatement sqlStatement) { return Arrays.asList("name", "type", "host", "port", "db", "connection_timeout_milliseconds", "idle_timeout_milliseconds", @@ -47,12 +44,8 @@ public Collection getColumnNames(final ShowMigrationSourceStorageUnitsSt @Override public Collection getRows(final ShowMigrationSourceStorageUnitsStatement sqlStatement, final ContextManager contextManager) { - Iterator> data = jobAPI.listMigrationSourceResources(new PipelineContextKey(InstanceType.PROXY)).iterator(); - Collection result = new LinkedList<>(); - while (data.hasNext()) { - result.add(new LocalDataQueryResultRow(data.next().toArray())); - } - return result; + MigrationJobAPI jobAPI = (MigrationJobAPI) TypedSPILoader.getService(TransmissionJobAPI.class, "MIGRATION"); + return jobAPI.listMigrationSourceResources(new PipelineContextKey(InstanceType.PROXY)).stream().map(each -> new LocalDataQueryResultRow(each.toArray())).collect(Collectors.toList()); } @Override