Jackie-Jiang commented on code in PR #12955:
URL: https://github.com/apache/pinot/pull/12955#discussion_r1569665249


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/physical/MailboxId.java:
##########
@@ -0,0 +1,104 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.query.planner.physical;
+
+import java.util.Objects;
+
+
+public class MailboxId {
+  public static final char SEPARATOR = '|';
+
+  private final long _requestId;
+  private final int _senderStageId;
+  private final int _senderWorkerId;
+  private final int _receiverStageId;
+  private final int _receiverWorkerId;
+
+  public MailboxId(long requestId, int senderStageId, int senderWorkerId, int 
receiverStageId, int receiverWorkerId) {
+    _requestId = requestId;
+    _senderStageId = senderStageId;
+    _senderWorkerId = senderWorkerId;
+    _receiverStageId = receiverStageId;
+    _receiverWorkerId = receiverWorkerId;
+  }
+
+  public long getRequestId() {
+    return _requestId;
+  }
+
+  public int getSenderStageId() {
+    return _senderStageId;
+  }
+
+  public int getSenderWorkerId() {
+    return _senderWorkerId;
+  }
+
+  public int getReceiverStageId() {
+    return _receiverStageId;
+  }
+
+  public int getReceiverWorkerId() {
+    return _receiverWorkerId;
+  }
+
+  public static MailboxId fromPipeString(String mailboxIdStr) {
+    String[] parts = mailboxIdStr.split("\\" + SEPARATOR);
+    return new MailboxId(Long.parseLong(parts[0]), Integer.parseInt(parts[1]), 
Integer.parseInt(parts[2]),
+        Integer.parseInt(parts[3]), Integer.parseInt(parts[4]));
+  }
+
+  public String toPipeString() {
+    return Long.toString(_requestId) + SEPARATOR + _senderStageId + SEPARATOR 
+ _senderWorkerId + SEPARATOR
+        + _receiverStageId + SEPARATOR + _receiverWorkerId;
+  }
+
+  @Override
+  public String toString() {
+    // CHECKSTYLE:OFF

Review Comment:
   Checkstyle also doesn't like this?



##########
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/physical/MailboxId.java:
##########
@@ -0,0 +1,104 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.query.planner.physical;
+
+import java.util.Objects;
+
+
+public class MailboxId {
+  public static final char SEPARATOR = '|';
+
+  private final long _requestId;
+  private final int _senderStageId;
+  private final int _senderWorkerId;
+  private final int _receiverStageId;
+  private final int _receiverWorkerId;
+
+  public MailboxId(long requestId, int senderStageId, int senderWorkerId, int 
receiverStageId, int receiverWorkerId) {
+    _requestId = requestId;
+    _senderStageId = senderStageId;
+    _senderWorkerId = senderWorkerId;
+    _receiverStageId = receiverStageId;
+    _receiverWorkerId = receiverWorkerId;
+  }
+
+  public long getRequestId() {
+    return _requestId;
+  }
+
+  public int getSenderStageId() {
+    return _senderStageId;
+  }
+
+  public int getSenderWorkerId() {
+    return _senderWorkerId;
+  }
+
+  public int getReceiverStageId() {
+    return _receiverStageId;
+  }
+
+  public int getReceiverWorkerId() {
+    return _receiverWorkerId;
+  }
+
+  public static MailboxId fromPipeString(String mailboxIdStr) {
+    String[] parts = mailboxIdStr.split("\\" + SEPARATOR);

Review Comment:
   Suggest using `StringUtils.split(mailboxIdStr, '|')` for efficiency



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to