vburenin edited a comment on pull request #2500:
URL: https://github.com/apache/hudi/pull/2500#issuecomment-792965380
Here is working option:
```java
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);
LOG.info("fsDataInputStream.getWrappedStream: " +
fsDataInputStream.getWrappedStream().getClass().getCanonicalName());
LOG.info("fsDataInputStream.getWrappedStream: instanceof FSInputStream"
+ (fsDataInputStream.getWrappedStream() instanceof FSInputStream));
if (fsDataInputStream.getWrappedStream() instanceof FSInputStream) {
LOG.info("fsDataInputStream.getWrappedStream: instanceof
FSInputStream" + (fsDataInputStream.getWrappedStream() instanceof
FSInputStream));
inputStreamLocal = new TimedFSDataInputStream(logFile.getPath(), new
FSDataInputStream(
new BufferedFSInputStream((FSInputStream)
fsDataInputStream.getWrappedStream(), bufferSize)));
} else if (fsDataInputStream.getWrappedStream() instanceof
FSDataInputStream
&& ((FSDataInputStream)
fsDataInputStream.getWrappedStream()).getWrappedStream() instanceof
FSInputStream) {
FSInputStream inputStream = (FSInputStream)((FSDataInputStream)
fsDataInputStream.getWrappedStream()).getWrappedStream();
LOG.info("getWrappedStream.getWrappedStream: " +
inputStream.getClass().getCanonicalName());
inputStreamLocal = new TimedFSDataInputStream(logFile.getPath(), new
FSDataInputStream(
new BufferedFSInputStream(inputStream, bufferSize)));
} else {
inputStreamLocal = fsDataInputStream;
}
if (FSUtils.isGCSFileSystem(fs)) {
inputStreamLocal = new SchemeAwareFSDataInputStream(inputStreamLocal,
true);
}
LOG.info("inputStreamLocal: " +
inputStreamLocal.getClass().getCanonicalName());
this.inputStream = inputStreamLocal;
this.logFile = logFile;
this.readerSchema = readerSchema;
this.readBlockLazily = readBlockLazily;
this.reverseReader = reverseReader;
if (this.reverseReader) {
this.reverseLogFilePosition = this.lastReverseLogFilePosition =
fs.getFileStatus(logFile.getPath()).getLen();
}
addShutDownHook();
}
```
223711 [Executor task launch worker for task 174] INFO
org.apache.hudi.common.table.log.HoodieLogFileReader -
fsDataInputStream.getWrappedStream: org.apache.hadoop.fs.FSDataInputStream
223711 [Executor task launch worker for task 174] INFO
org.apache.hudi.common.table.log.HoodieLogFileReader -
fsDataInputStream.getWrappedStream: instanceof FSInputStreamfalse
223711 [Executor task launch worker for task 174] INFO
org.apache.hudi.common.table.log.HoodieLogFileReader -
getWrappedStream.getWrappedStream:
com.google.cloud.hadoop.fs.gcs.GoogleHadoopFSInputStream
223713 [Executor task launch worker for task 174] INFO
org.apache.hudi.common.fs.FSUtils - FS Scheme:gs
223713 [Executor task launch worker for task 174] INFO
org.apache.hudi.common.fs.FSUtils - GSC Scheme:gs
223713 [Executor task launch worker for task 174] INFO
org.apache.hudi.common.table.log.HoodieLogFileReader - inputStreamLocal:
org.apache.hudi.common.fs.SchemeAwareFSDataInputStream
----------------------------------------------------------------
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]