-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transfer output file compression option into ResultEventListener #966
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait a minute... Didn't we already have this feature already?
simona/src/main/scala/edu/ie3/simona/event/listener/ResultEventListener.scala
Lines 90 to 94 in ab53b8c
ResultEntityCsvSink( | |
fileName.replace(".gz", ""), | |
new ResultEntityProcessor(resultClass), | |
fileName.endsWith(".gz"), | |
), |
simona/src/main/scala/edu/ie3/simona/io/result/ResultEntityCsvSink.scala
Lines 133 to 135 in ab53b8c
// compress files if necessary | |
if (compressOutputFiles) | |
Await.ready(zipAndDel(outfileName), 100.minutes) |
Maybe we should also add this to documentation so it's not easily missed!
…g Option from config
…ntListener' into df/#965-compression-at-resultEventListener
…ntListener' into df/#965-compression-at-resultEventListener
…Listener # Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking care of this! Just two comments from my side
case _ => | ||
throw new ProcessResultEventException( | ||
s"Invalid output file format for file $fileName provided. Currently only '.csv' or '.csv.gz' is supported!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case is never reached. My suggestion for the whole thing would be:
fileName.endsWith(".csv.gz")
andcompression = true
=> remove.gz
fileName.endsWith(".csv")
=> filename as-is- else => throw exception (with adapted message)
) | ||
} | ||
|
||
filePathFuture.flatMap { fileName => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use map
here, you don't need the Future { ... }
below!
Resolves #965