apurtell commented on code in PR #2133:
URL: https://github.com/apache/phoenix/pull/2133#discussion_r2075819581


##########
phoenix-core-server/src/main/java/org/apache/phoenix/replication/log/LogFileFormatReader.java:
##########
@@ -0,0 +1,355 @@
+/*
+ * 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.Closeable;
+import java.io.EOFException;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+import org.apache.hadoop.hbase.io.compress.Compression;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.io.compress.Decompressor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Handles the low-level reading of headers, blocks, and trailers for Log 
files. Manages reading
+ * from the underlying stream, checksum validation, decompression, and 
providing access to block
+ * data for the Codec.
+ */
+@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = { "EI_EXPOSE_REP", 
"EI_EXPOSE_REP2" },
+    justification = "Intentional")
+public class LogFileFormatReader implements Closeable {
+
+    private static final Logger LOG = 
LoggerFactory.getLogger(LogFileFormatReader.class);
+
+    private LogFileReaderContext context;
+    private LogFile.Codec.Decoder decoder;
+    private SeekableDataInput input;
+    private LogFile.Header header;
+    private LogFile.Trailer trailer = null;
+    private long currentPosition = 0;
+    private ByteBuffer currentBlockBuffer = null;

Review Comment:
   > eliminate an advance call and thus an end of file exception when the 
current block is consumed.
   
   Sure.
   
   The Codec layer doesn't know about Blocks, so the EOFException handling in 
Codec should remain for the code there to be properly defensive. However my 
understanding is that is not the issue, it is the extra advance() call that is 
the issue, as you have indicated. 



-- 
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...@phoenix.apache.org

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

Reply via email to