Flink: Maintenance - MonitorSource#10308
Conversation
|
Please link the design doc in the PR description |
rodmeneses
left a comment
There was a problem hiding this comment.
some minor comments, otherwise LGTM
|
|
||
| // Add temporary dir as a warehouse location | ||
| try { | ||
| this.warehouse = Files.createTempDirectory("warehouse"); |
There was a problem hiding this comment.
do we need to pass in a @TempDir that can auto clean up files/dirs?
There was a problem hiding this comment.
In Junit5 mixing extensions with @TempDir is not supported.
See: junit-team/junit-framework#1786
I found the proposed solution much more ugly than creating a temp dir using the java api
There was a problem hiding this comment.
My concern is that the temp dir (and files under it) wasn't cleaned up at the end of the test. at least, we should consider deleteOnExit()
There was a problem hiding this comment.
It is taken care in the afterEach method:
Files.walk(warehouse).sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete);
There was a problem hiding this comment.
ah. I missed the afterEach part. it might still make sense to add deleteOnExit as fallback, in case afterEach method throws an exception before the file cleanup step.
There was a problem hiding this comment.
deleteOnExit will only work if the directory is empty. See: https://docs.oracle.com/javase/7/docs/api/java/io/File.html#delete%28%29
I don't think it would help much adding this to the code.
c1c188d to
41d1b29
Compare
stevenzwu
left a comment
There was a problem hiding this comment.
LGTM. have one minor comment and will leave the decision to you on that one
|
Merged to main. |
Implements a monitor source which emits TableChange events based on the new commits to the Iceberg table.
This will be used for Maintenance Task scheduling as described in the design doc. The Scheduling paragraph describes the require parameters of the TableChange object. Also the Monitor paragraph adds some more details.
Implements #10300