-
Notifications
You must be signed in to change notification settings - Fork 323
FileBasedSink removes temp files from successful bundles #484
Conversation
@@ -248,20 +248,20 @@ private void testRemoveTemporaryFiles(int numFiles, String baseTemporaryFilename | |||
PipelineOptions options = PipelineOptionsFactory.create(); | |||
SimpleSink.SimpleWriteOperation writeOp = buildWriteOperation(baseTemporaryFilename); | |||
|
|||
List<File> temporaryFiles = new ArrayList<>(); | |||
List<String> temporaryFiles = new ArrayList<>(); | |||
List<File> outputFiles = new ArrayList<>(); | |||
for (int i = 0; i < numFiles; i++) { |
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.
Please add a unit test that specifically passes in temporary files that would have never been matched.
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.
Woops. There was a bug (FWIW the bug is not present in beam). Thanks for pushing for the test.
Set<String> allMatches = new HashSet<>(matches); | ||
allMatches.addAll(knownFiles); | ||
LOG.debug( | ||
"Removing {} temporary files matching {} ({} matched glob, {} additional known files)", |
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 log statement might be confusing since X != Y + Z because of the set union. Is there a better way to explain this?
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.
Not sure what you mean: the last parameter of the log message, Z, is defined as X - Y.
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.
Nvm
This is a weaker but backward-compatible version of respective Beam changes: apache/beam#1050 apache/beam#1278
fb4f8e3
to
fdbb51f
Compare
This is a weaker but backward-compatible version of #482.
R: @dhalperi @lukecwik