vinothchandar commented on a change in pull request #2500:
URL: https://github.com/apache/hudi/pull/2500#discussion_r577528143
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieLogFileReader.java
##########
@@ -74,20 +75,28 @@
public HoodieLogFileReader(FileSystem fs, HoodieLogFile logFile, Schema
readerSchema, int bufferSize,
boolean readBlockLazily, boolean reverseReader)
throws IOException {
+ FSDataInputStream inputStreamLocal;
FSDataInputStream fsDataInputStream = fs.open(logFile.getPath(),
bufferSize);
- if (FSUtils.isGCSInputStream(fsDataInputStream)) {
- this.inputStream = new TimedFSDataInputStream(logFile.getPath(), new
FSDataInputStream(
- new BufferedFSInputStream((FSInputStream) ((
- (FSDataInputStream)
fsDataInputStream.getWrappedStream()).getWrappedStream()), bufferSize)));
- } else if (fsDataInputStream.getWrappedStream() instanceof FSInputStream) {
- this.inputStream = new TimedFSDataInputStream(logFile.getPath(), new
FSDataInputStream(
+ if (fsDataInputStream.getWrappedStream() instanceof FSInputStream) {
Review comment:
please avoid flipping the if-elses, unless we need to. makes reading the
changes pretty hard. :)
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieLogBlock.java
##########
@@ -258,14 +257,6 @@ protected void deflate() {
* @throws IOException -
*/
private static void safeSeek(FSDataInputStream inputStream, long pos) throws
IOException {
Review comment:
do we still need this method then? just call `inputStream.seek()`?
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieLogFileReader.java
##########
@@ -75,13 +76,13 @@
public HoodieLogFileReader(FileSystem fs, HoodieLogFile logFile, Schema
readerSchema, int bufferSize,
boolean readBlockLazily, boolean reverseReader)
throws IOException {
FSDataInputStream fsDataInputStream = fs.open(logFile.getPath(),
bufferSize);
- if (FSUtils.isGCSInputStream(fsDataInputStream)) {
- this.inputStream = new TimedFSDataInputStream(logFile.getPath(), new
FSDataInputStream(
- new BufferedFSInputStream((FSInputStream) ((
- (FSDataInputStream)
fsDataInputStream.getWrappedStream()).getWrappedStream()), bufferSize)));
- } else if (fsDataInputStream.getWrappedStream() instanceof FSInputStream) {
+ if (fsDataInputStream.getWrappedStream() instanceof FSInputStream) {
this.inputStream = new TimedFSDataInputStream(logFile.getPath(), new
FSDataInputStream(
new BufferedFSInputStream((FSInputStream)
fsDataInputStream.getWrappedStream(), bufferSize)));
+ } else if (FSUtils.isGCSFileSystem(fs)) {
Review comment:
@nsivabalan @bvaradar could you please clarify why we need this casting
business here in the first place. With @vburenin . If we can simplify all this,
we should
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]