Skip to content

[BEAM-2276] Cleanups to windowed DefaultFilenamePolicy#3232

Closed
reuvenlax wants to merge 4 commits intoapache:masterfrom
reuvenlax:cleanup_filename_policy
Closed

[BEAM-2276] Cleanups to windowed DefaultFilenamePolicy#3232
reuvenlax wants to merge 4 commits intoapache:masterfrom
reuvenlax:cleanup_filename_policy

Conversation

@reuvenlax
Copy link
Contributor

Make window strings more concise, and provide more information about the pane more concisely (most users care about whether a pane is the last one, and whether it is late).

Cleanup complicated code around filename templates - simply store two default templates, and pick the correct one based on whether windowed writes are enabled.

Remove log statements that would be extremely noisy in practice. Users may have valid reasons for not including W and P template variables - e.g. they may know they are in the global window and not want every file to contain GlobalWindow. This is the same reason we don't warn if S and N are missing from their template (they may be writing to a single shard).

R: @jbonofre

@reuvenlax
Copy link
Contributor Author

retest this please.

1 similar comment
@reuvenlax
Copy link
Contributor Author

retest this please.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 6c69666 on reuvenlax:cleanup_filename_policy into ** on apache:master**.

@jbonofre
Copy link
Member

Thanks ! I'm taking a look.

@jbonofre
Copy link
Member

retest this please

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 6c69666 on reuvenlax:cleanup_filename_policy into ** on apache:master**.

@asfbot
Copy link

asfbot commented May 29, 2017

Build finished.
--none--

@reuvenlax
Copy link
Contributor Author

retest this please.

@reuvenlax
Copy link
Contributor Author

retest this please

@asfbot
Copy link

asfbot commented May 31, 2017

--none--

1 similar comment
@asfbot
Copy link

asfbot commented May 31, 2017

--none--

@reuvenlax
Copy link
Contributor Author

I don't see how the failure in org.apache.beam.sdk.io.jms.JmsIOTest.testAuthenticationWithBadPassword could be related to this PR.

@jbonofre
Copy link
Member

@reuvenlax if you take a look on the result in this PR, I don't think it's the latest build due to the issue we have currently between Jenkins and GitHub. Let me try and trigger a build by hand.

@reuvenlax
Copy link
Contributor Author

retest this please

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 6c69666 on reuvenlax:cleanup_filename_policy into ** on apache:master**.

Copy link
Member

@jbonofre jbonofre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@reuvenlax
Copy link
Contributor Author

@jbonofre tests are now succeeding

ResourceId outputDirectory = LocalResources.fromString("/foo/bar", true /* isDirectory */);
FilenamePolicy policy = DefaultFilenamePolicy.constructUsingStandardParameters(
StaticValueProvider.of(outputDirectory), DefaultFilenamePolicy.DEFAULT_SHARD_TEMPLATE, "");
StaticValueProvider.of(outputDirectory), DefaultFilenamePolicy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting is crazy here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto formatted

ResourceId outputDirectory = LocalResources.fromString("/foo", true /* isDirectory */);
FilenamePolicy policy = DefaultFilenamePolicy.constructUsingStandardParameters(
StaticValueProvider.of(outputDirectory), DefaultFilenamePolicy.DEFAULT_SHARD_TEMPLATE, "");
StaticValueProvider.of(outputDirectory), DefaultFilenamePolicy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here also.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto formatted

*
* <p>If provided, the suffix will be used; otherwise the files will have an empty suffix.
*/
public static DefaultFilenamePolicy constructUsingStandardParameters(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these changes are backwards incompatible, and this class appears to be on the public API and not marked with @Experimental or @Internal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have marked all of FileBasedSink experimental, and this is used by that. That should cover use of FilenamePolicy as well

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 79f95e9 on reuvenlax:cleanup_filename_policy into ** on apache:master**.

@asfgit asfgit closed this in 88f78fa Jun 6, 2017
@reuvenlax reuvenlax deleted the cleanup_filename_policy branch December 9, 2018 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants