fix HoodieLogFileReader (#787)
This commit is contained in:
@@ -67,9 +67,17 @@ class HoodieLogFileReader implements HoodieLogFormat.Reader {
|
|||||||
|
|
||||||
HoodieLogFileReader(FileSystem fs, HoodieLogFile logFile, Schema readerSchema, int bufferSize,
|
HoodieLogFileReader(FileSystem fs, HoodieLogFile logFile, Schema readerSchema, int bufferSize,
|
||||||
boolean readBlockLazily, boolean reverseReader) throws IOException {
|
boolean readBlockLazily, boolean reverseReader) throws IOException {
|
||||||
this.inputStream = new FSDataInputStream(
|
FSDataInputStream fsDataInputStream = fs.open(logFile.getPath(), bufferSize);
|
||||||
new BufferedFSInputStream((FSInputStream) fs.open(logFile.getPath(), bufferSize).getWrappedStream(),
|
if (fsDataInputStream.getWrappedStream() instanceof FSInputStream) {
|
||||||
bufferSize));
|
this.inputStream = new FSDataInputStream(
|
||||||
|
new BufferedFSInputStream((FSInputStream) fsDataInputStream.getWrappedStream(),
|
||||||
|
bufferSize));
|
||||||
|
} else {
|
||||||
|
// fsDataInputStream.getWrappedStream() maybe a BufferedFSInputStream
|
||||||
|
// need to wrap in another BufferedFSInputStream the make bufferSize work?
|
||||||
|
this.inputStream = fsDataInputStream;
|
||||||
|
}
|
||||||
|
|
||||||
this.logFile = logFile;
|
this.logFile = logFile;
|
||||||
this.readerSchema = readerSchema;
|
this.readerSchema = readerSchema;
|
||||||
this.readBlockLazily = readBlockLazily;
|
this.readBlockLazily = readBlockLazily;
|
||||||
|
|||||||
Reference in New Issue
Block a user