Copilot commented on code in PR #2115:
URL: https://github.com/apache/phoenix/pull/2115#discussion_r2045719746


##########
phoenix-core-server/src/main/java/org/apache/phoenix/replication/log/LogTrailer.java:
##########
@@ -0,0 +1,208 @@
+/*
+ * 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.phoenix.replication.log;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Arrays;
+
+import org.apache.hadoop.fs.FSDataInputStream;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.util.Bytes;
+
+public class LogTrailer implements Log.Trailer {
+    private int majorVersion = Log.VERSION_MAJOR;
+    private int minorVersion = Log.VERSION_MINOR;
+    private long recordCount;
+    private long blockCount;
+    private long blocksStartOffset;
+    private long trailerStartOffset;
+
+    public static final int VERSION_AND_MAGIC_SIZE = Log.MAGIC.length + 2 * 
Bytes.SIZEOF_BYTE;
+    public static final int FIXED_TRAILER_SIZE = Bytes.SIZEOF_LONG * 4 + 
VERSION_AND_MAGIC_SIZE;
+
+    public LogTrailer() {
+
+    }
+
+    // Add methods to set/get Protobuf metadata when needed in the future, 
e.g.:
+    // public void setMetadata(LogTrailerMetadata metadata) { ... }
+    // public LogTrailerMetadata getMetadata() throws 
InvalidProtocolBufferException { ... }
+
+    @Override
+    public int getMajorVersion() {
+        return majorVersion;
+    }
+
+    @Override
+    public int getMinorVersion() {
+        return minorVersion;
+    }
+
+    @Override
+    public Log.Trailer setMajorVersion(int majorVersion) {
+        this.majorVersion = majorVersion;
+        return this;
+    }
+
+    @Override
+    public Log.Trailer setMinorVersion(int minorVersion) {
+      this.minorVersion = minorVersion;

Review Comment:
   The method 'setMinorVersion' does not return 'this' as expected by its 
interface. Please add 'return this;' as the final statement in the method.
   ```suggestion
           this.minorVersion = minorVersion;
           return this;
   ```



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