walterddr commented on code in PR #10574:
URL: https://github.com/apache/pinot/pull/10574#discussion_r1169447369


##########
pinot-common/src/main/java/org/apache/pinot/common/utils/request/OperatorId.java:
##########
@@ -0,0 +1,139 @@
+/**
+ * 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.common.utils.request;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.google.common.base.Joiner;
+import javax.annotation.Nullable;
+
+public class OperatorId implements Comparable<OperatorId> {
+  public static final String SEPERATOR = "__";
+  private final long _requestId;
+  private final int _stageId;
+  private final String _server;
+  private final String _operatorName;
+  private Integer _operatorIndex;
+
+  public OperatorId(long requestId, int stageId, String server, String 
operatorName, @Nullable Integer operatorIndex) {
+    _requestId = requestId;
+    _stageId = stageId;
+    _operatorIndex = operatorIndex;
+    _server = server;
+    _operatorName = operatorName;
+  }
+
+  public long getRequestId() {
+    return _requestId;
+  }
+
+  public int getStageId() {
+    return _stageId;
+  }
+
+  public Integer getOperatorIndex() {
+    return _operatorIndex;
+  }
+
+  public String getServer() {
+    return _server;
+  }
+
+  public String getOperatorName() {
+    return _operatorName;
+  }
+
+  public void setOperatorIndex(Integer operatorIndex) {
+    _operatorIndex = operatorIndex;
+  }
+
+  public static OperatorId fromString(String str) {
+    String[] parts = str.split(SEPERATOR);
+    if (parts.length < 4) {
+      throw new IllegalArgumentException("Invalid string representation of 
OperatorId");
+    }
+
+    String operatorName = parts[0];
+
+    long requestId = Long.parseLong(parts[1]);
+    int stageId = Integer.parseInt(parts[2]);
+    String server = parts[3];
+
+    Integer operatorIndex = null;
+    if (parts.length == 5) {
+      operatorIndex = Integer.parseInt(parts[4]);
+    }
+
+    return new OperatorId(requestId, stageId, server, operatorName, 
operatorIndex);
+  }
+
+  @JsonValue

Review Comment:
   what's reason for using `@JsonValue` annotation here? do we want to 
serialize this as part json



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to