RexXiong commented on code in PR #3066:
URL: https://github.com/apache/celeborn/pull/3066#discussion_r1919473071


##########
cpp/celeborn/network/Message.cpp:
##########
@@ -0,0 +1,153 @@
+/*
+ * 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.
+ */
+
+#include "celeborn/network/Message.h"
+
+namespace celeborn {
+namespace network {
+Message::Type Message::decodeType(uint8_t typeId) {
+  switch (typeId) {
+    case 0:
+      return CHUNK_FETCH_REQUEST;
+    case 1:
+      return CHUNK_FETCH_SUCCESS;
+    case 2:
+      return CHUNK_FETCH_FAILURE;
+    case 3:
+      return RPC_REQUEST;
+    case 4:
+      return RPC_RESPONSE;
+    case 5:
+      return RPC_FAILURE;
+    case 6:
+      return OPEN_STREAM;
+    case 7:
+      return STREAM_HANDLE;
+    case 9:
+      return ONE_WAY_MESSAGE;
+    case 11:
+      return PUSH_DATA;
+    case 12:
+      return PUSH_MERGED_DATA;
+    case 13:
+      return REGION_START;
+    case 14:
+      return REGION_FINISH;
+    case 15:
+      return PUSH_DATA_HAND_SHAKE;
+    case 16:
+      return READ_ADD_CREDIT;
+    case 17:
+      return READ_DATA;
+    case 18:
+      return OPEN_STREAM_WITH_CREDIT;
+    case 19:
+      return BACKLOG_ANNOUNCEMENT;
+    case 20:
+      return TRANSPORTABLE_ERROR;
+    case 21:
+      return BUFFER_STREAM_END;
+    case 22:
+      return HEARTBEAT;
+    default:
+      CELEBORN_FAIL("Unknown message type " + std::to_string(typeId));
+  }
+}
+
+std::atomic<long> Message::currRequestId_ = 1000;

Review Comment:
   why start from 1000?



-- 
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: issues-unsubscr...@celeborn.apache.org

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

Reply via email to