Skip to content
This repository was archived by the owner on Nov 11, 2022. It is now read-only.

FileBasedSink removes temp files from successful bundles - #484

Merged
lukecwik merged 1 commit into
GoogleCloudPlatform:masterfrom
jkff:file-based-sink
Nov 15, 2016
Merged

FileBasedSink removes temp files from successful bundles#484
lukecwik merged 1 commit into
GoogleCloudPlatform:masterfrom
jkff:file-based-sink

Conversation

@jkff

@jkffjkff commented Nov 14, 2016

Copy link
Copy Markdown
Contributor

This is a weaker but backward-compatible version of #482.

R: @dhalperi@lukecwik

List<File> temporaryFiles = new ArrayList<>();
List<String> temporaryFiles = new ArrayList<>();
List<File> outputFiles = new ArrayList<>();
for (int i = 0; i < numFiles; i++) {

Copy link
Copy Markdown
Contributor

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.

@jkffjkffNov 14, 2016

Copy link
Copy Markdown
ContributorAuthor

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.

LOG.debug("Removing {} files.", matches.size());
Set<String> allMatches = new HashSet<>(matches);
allMatches.addAll(knownFiles);
LOG.debug(

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
ContributorAuthor

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.

Copy link
Copy Markdown
Contributor

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#1050apache/beam#1278
@lukecwik
lukecwik merged commit 9c3af6e into GoogleCloudPlatform:masterNov 15, 2016
@jkff
jkff deleted the file-based-sink branch November 15, 2016 21:35
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jkff@lukecwik@googlebot