FMX commented on code in PR #3261:
URL: https://github.com/apache/celeborn/pull/3261#discussion_r2141606834


##########
common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala:
##########
@@ -5356,6 +5358,14 @@ object CelebornConf extends Logging {
       .bytesConf(ByteUnit.BYTE)
       .createWithDefaultString("512k")
 
+  val CLIENT_SPARK_SHUFFLE_INTEGRITY_CHECK_ENABLED: ConfigEntry[Boolean] =
+    buildConf("celeborn.client.spark.shuffle.integrityCheck.enabled")
+      .categories("client", "shuffle")

Review Comment:
   Category refers to an isolated configuration file. The 'shuffle' doesn't 
refer to a file now.



##########
common/src/main/scala/org/apache/celeborn/common/CelebornConf.scala:
##########
@@ -5356,6 +5358,14 @@ object CelebornConf extends Logging {
       .bytesConf(ByteUnit.BYTE)
       .createWithDefaultString("512k")
 
+  val CLIENT_SPARK_SHUFFLE_INTEGRITY_CHECK_ENABLED: ConfigEntry[Boolean] =
+    buildConf("celeborn.client.spark.shuffle.integrityCheck.enabled")
+      .categories("client", "shuffle")
+      .version("0.6.0")

Review Comment:
   The version can be 0.6.1.



##########
common/src/main/java/org/apache/celeborn/common/CommitMetadata.java:
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.celeborn.common;
+
+import java.util.Objects;
+import java.util.concurrent.atomic.AtomicLong;
+
+import io.netty.buffer.ByteBuf;
+
+public class CommitMetadata {
+
+  private AtomicLong bytes = new AtomicLong();
+  private CelebornCRC32 crc = new CelebornCRC32();
+
+  public CommitMetadata() {}
+
+  public CommitMetadata(long checksum, long numBytes) {
+    this.bytes = new AtomicLong(numBytes);
+    this.crc = new CelebornCRC32((int) checksum);
+  }
+
+  public void addDataWithOffsetAndLength(byte[] rawDataBuf, int offset, int 
length) {
+    this.bytes.addAndGet(length);
+    this.crc.addData(rawDataBuf, offset, length);
+  }
+
+  public void addCommitData(CommitMetadata commitMetadata) {
+    this.bytes.addAndGet(commitMetadata.bytes.longValue());
+    this.crc.addChecksum(commitMetadata.getChecksum());
+  }
+
+  public int getChecksum() {
+    return crc.get();
+  }
+
+  public long getBytes() {
+    return bytes.get();
+  }
+
+  public void encode(ByteBuf buf) {
+    buf.writeLong(this.getChecksum());
+    buf.writeLong(this.bytes.get());
+  }
+
+  public static CommitMetadata decode(ByteBuf buf) {
+    long checksum = buf.readLong();
+    long numBytes = buf.readLong();
+    return new CommitMetadata(checksum, numBytes);
+  }
+
+  public static boolean checkCommitMetadata(CommitMetadata expected, 
CommitMetadata actual) {

Review Comment:
   This method is not used, and can be removed.



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