Skip to content

Commit 948c29a

Browse files
committed
#803 Fix PR suggestions.
1 parent 3738dd2 commit 948c29a

File tree

1 file changed

+2
-1
lines changed
  • spark-cobol/src/main/scala/za/co/absa/cobrix/spark/cobol/source/streaming

1 file changed

+2
-1
lines changed

spark-cobol/src/main/scala/za/co/absa/cobrix/spark/cobol/source/streaming/FileStreamer.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import za.co.absa.cobrix.cobol.reader.common.Constants
3232
*
3333
* @param filePath String containing the fully qualified path to the file.
3434
* @param fileSystem Underlying Hadoop file system.
35+
* @note This class is not thread-safe and should only be accessed from a single thread
3536
* @throws IllegalArgumentException if the file is not found in the underlying file system.
3637
*/
3738
class FileStreamer(filePath: String, fileSystem: FileSystem, startOffset: Long = 0L, maximumBytes: Long = 0L) extends SimpleStream {
@@ -110,8 +111,8 @@ class FileStreamer(filePath: String, fileSystem: FileSystem, startOffset: Long =
110111
}
111112

112113
override def close(): Unit = {
114+
wasOpened = true
113115
if (bufferedStream != null && !bufferedStream.isClosed) {
114-
wasOpened = true
115116
bufferedStream.close()
116117
bufferedStream = null
117118
}

0 commit comments

Comments
 (0)