You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by dh...@apache.org on 2017/05/01 00:12:21 UTC
[1/2] beam git commit: [BEAM-59] Minor style cleanups to
WriteOneWindowPerFile
Repository: beam
Updated Branches:
refs/heads/master 46ca02aba -> a198f8d23
[BEAM-59] Minor style cleanups to WriteOneWindowPerFile
Makes the changes in #2779 more standalone
Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/1ecc6eba
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/1ecc6eba
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/1ecc6eba
Branch: refs/heads/master
Commit: 1ecc6ebad39f11df8fc3dc7d34cb69599c284230
Parents: 46ca02a
Author: Dan Halperin <dh...@google.com>
Authored: Sun Apr 30 10:57:56 2017 -0700
Committer: Dan Halperin <dh...@google.com>
Committed: Sun Apr 30 17:12:08 2017 -0700
----------------------------------------------------------------------
.../beam/examples/common/WriteOneFilePerWindow.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/beam/blob/1ecc6eba/examples/java/src/main/java/org/apache/beam/examples/common/WriteOneFilePerWindow.java
----------------------------------------------------------------------
diff --git a/examples/java/src/main/java/org/apache/beam/examples/common/WriteOneFilePerWindow.java b/examples/java/src/main/java/org/apache/beam/examples/common/WriteOneFilePerWindow.java
index 2ed8a74..6609828 100644
--- a/examples/java/src/main/java/org/apache/beam/examples/common/WriteOneFilePerWindow.java
+++ b/examples/java/src/main/java/org/apache/beam/examples/common/WriteOneFilePerWindow.java
@@ -38,8 +38,8 @@ import org.joda.time.format.ISODateTimeFormat;
*/
public class WriteOneFilePerWindow extends PTransform<PCollection<String>, PDone> {
- private static DateTimeFormatter formatter = ISODateTimeFormat.hourMinute();
- private String filenamePrefix;
+ private static final DateTimeFormatter FORMATTER = ISODateTimeFormat.hourMinute();
+ private final String filenamePrefix;
public WriteOneFilePerWindow(String filenamePrefix) {
this.filenamePrefix = filenamePrefix;
@@ -48,7 +48,10 @@ public class WriteOneFilePerWindow extends PTransform<PCollection<String>, PDone
@Override
public PDone expand(PCollection<String> input) {
return input.apply(
- TextIO.Write.to(new PerWindowFiles(filenamePrefix)).withWindowedWrites().withNumShards(3));
+ TextIO.Write
+ .to(new PerWindowFiles(filenamePrefix))
+ .withWindowedWrites()
+ .withNumShards(3));
}
/**
@@ -72,7 +75,7 @@ public class WriteOneFilePerWindow extends PTransform<PCollection<String>, PDone
public String filenamePrefixForWindow(IntervalWindow window) {
return String.format(
- "%s-%s-%s", output, formatter.print(window.start()), formatter.print(window.end()));
+ "%s-%s-%s", output, FORMATTER.print(window.start()), FORMATTER.print(window.end()));
}
@Override
[2/2] beam git commit: This closes #2792
Posted by dh...@apache.org.
This closes #2792
Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/a198f8d2
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/a198f8d2
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/a198f8d2
Branch: refs/heads/master
Commit: a198f8d232bda1ae68467b17027565d9fcef63a8
Parents: 46ca02a 1ecc6eb
Author: Dan Halperin <dh...@google.com>
Authored: Sun Apr 30 17:12:13 2017 -0700
Committer: Dan Halperin <dh...@google.com>
Committed: Sun Apr 30 17:12:13 2017 -0700
----------------------------------------------------------------------
.../beam/examples/common/WriteOneFilePerWindow.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------