RaigorJiang commented on a change in pull request #15339:
URL: https://github.com/apache/shardingsphere/pull/15339#discussion_r804426532



##########
File path: 
shardingsphere-distsql/shardingsphere-distsql-parser/src/main/java/org/apache/shardingsphere/distsql/parser/core/common/CommonDistSQLStatementVisitor.java
##########
@@ -195,6 +197,21 @@ public ASTNode visitLabelInstance(final 
LabelInstanceContext ctx) {
         return new LabelInstanceStatement(ctx.RELABEL() != null, ip, port, 
labels);
     }
     
+    @Override
+    public ASTNode visitUnlabelInstance(final UnlabelInstanceContext ctx) {
+        String ip;
+        String port;
+        if (null != ctx.instanceDefination()) {
+            ip = getIdentifierValue(ctx.instanceDefination().ip());
+            port = getIdentifierValue(ctx.instanceDefination().port());
+        } else {
+            ip = getIdentifierValue(ctx.instanceId().ip());
+            port = getIdentifierValue(ctx.instanceId().port());
+        }
+        LinkedList<String> labels = 
ctx.label().stream().map(this::getIdentifierValue).collect(Collectors.toCollection(LinkedList::new));

Review comment:
       Can `LinkedList<String>` be replaced by `Collection<String>` ?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to