You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lc...@apache.org on 2016/07/06 12:18:14 UTC
[1/2] incubator-beam git commit: [BEAM-405] Fixes inefficient use of
keySet iterator instead of entrySet iterator.
Repository: incubator-beam
Updated Branches:
refs/heads/master 9adbecb6a -> 8147037d6
[BEAM-405] Fixes inefficient use of keySet iterator instead of entrySet iterator.
BiggQueryIO$StreamingWriteFn.finishBundle: Fixes inefficient use of keySet iterator instead of entrySet iterator.
Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/88cc25d7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/88cc25d7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/88cc25d7
Branch: refs/heads/master
Commit: 88cc25d76dd769ff0f309010348b94b22f2ff16f
Parents: 9adbecb
Author: Lucas Amorim <lu...@Lucass-MacBook-Pro.local>
Authored: Sun Jul 3 15:47:15 2016 -0700
Committer: Luke Cwik <lc...@google.com>
Committed: Wed Jul 6 04:56:46 2016 -0700
----------------------------------------------------------------------
.../build-tools/src/main/resources/beam/findbugs-filter.xml | 6 ------
.../src/main/java/org/apache/beam/sdk/io/BigQueryIO.java | 8 ++++----
2 files changed, 4 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/88cc25d7/sdks/java/build-tools/src/main/resources/beam/findbugs-filter.xml
----------------------------------------------------------------------
diff --git a/sdks/java/build-tools/src/main/resources/beam/findbugs-filter.xml b/sdks/java/build-tools/src/main/resources/beam/findbugs-filter.xml
index 3f15835..a871eb7 100644
--- a/sdks/java/build-tools/src/main/resources/beam/findbugs-filter.xml
+++ b/sdks/java/build-tools/src/main/resources/beam/findbugs-filter.xml
@@ -122,12 +122,6 @@
<!--May expose internal representation by incorporating reference to mutable object-->
</Match>
<Match>
- <Class name="org.apache.beam.sdk.io.BigQueryIO$StreamingWriteFn"/>
- <Method name="finishBundle"/>
- <Bug pattern="WMI_WRONG_MAP_ITERATOR"/>
- <!--Inefficient use of keySet iterator instead of entrySet iterator-->
- </Match>
- <Match>
<Class name="org.apache.beam.sdk.io.PubsubIO$Read$Bound$PubsubBoundedReader"/>
<Method name="processElement"/>
<Bug pattern="DMI_RANDOM_USED_ONLY_ONCE"/>
http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/88cc25d7/sdks/java/core/src/main/java/org/apache/beam/sdk/io/BigQueryIO.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/BigQueryIO.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/BigQueryIO.java
index 7955022..9141f39 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/BigQueryIO.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/BigQueryIO.java
@@ -2063,10 +2063,10 @@ public class BigQueryIO {
BigQueryOptions options = context.getPipelineOptions().as(BigQueryOptions.class);
Bigquery client = Transport.newBigQueryClient(options).build();
- for (String tableSpec : tableRows.keySet()) {
- TableReference tableReference = getOrCreateTable(options, tableSpec);
- flushRows(client, tableReference, tableRows.get(tableSpec),
- uniqueIdsForTableRows.get(tableSpec), options);
+ for (Map.Entry<String, List<TableRow>> entry : tableRows.entrySet()) {
+ TableReference tableReference = getOrCreateTable(options, entry.getKey());
+ flushRows(client, tableReference, entry.getValue(),
+ uniqueIdsForTableRows.get(entry.getKey()), options);
}
tableRows.clear();
uniqueIdsForTableRows.clear();
[2/2] incubator-beam git commit: [BEAM-405] Fixes inefficient use of
keySet iterator instead of entrySet iterator
Posted by lc...@apache.org.
[BEAM-405] Fixes inefficient use of keySet iterator instead of entrySet iterator
This closes #587
Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/8147037d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/8147037d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/8147037d
Branch: refs/heads/master
Commit: 8147037d61179daf96b17f901b4625210f340466
Parents: 9adbecb 88cc25d
Author: Luke Cwik <lc...@google.com>
Authored: Wed Jul 6 05:17:55 2016 -0700
Committer: Luke Cwik <lc...@google.com>
Committed: Wed Jul 6 05:17:55 2016 -0700
----------------------------------------------------------------------
.../build-tools/src/main/resources/beam/findbugs-filter.xml | 6 ------
.../src/main/java/org/apache/beam/sdk/io/BigQueryIO.java | 8 ++++----
2 files changed, 4 insertions(+), 10 deletions(-)
----------------------------------------------------------------------