Skip to content

Commit

Permalink
remove is idempotent
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Shields authored and peihe committed Mar 14, 2016
1 parent 294fa0c commit 5419ac5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.google.cloud.dataflow</groupId>
<artifactId>google-cloud-dataflow-java-sdk-parent</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>1.6.0-SNAPSHOT</version>
</parent>

<groupId>com.google.cloud.dataflow</groupId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<url>http://cloud.google.com/dataflow</url>
<inceptionYear>2013</inceptionYear>

<version>1.5.0-SNAPSHOT</version>
<version>1.6.0-SNAPSHOT</version>

<licenses>
<license>
Expand Down
2 changes: 1 addition & 1 deletion sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.google.cloud.dataflow</groupId>
<artifactId>google-cloud-dataflow-java-sdk-parent</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>1.6.0-SNAPSHOT</version>
</parent>

<groupId>com.google.cloud.dataflow</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,12 @@ public void addActive(W window) {

@Override
public void remove(W window) {
Preconditions.checkState(isActive(window), "Window %s is not active", window);
for (W stateAddressWindow : activeWindowToStateAddressWindows.get(window)) {
Set<W> stateAddressWindows = activeWindowToStateAddressWindows.get(window);
if (stateAddressWindows == null) {
// Window is no longer active.
return;
}
for (W stateAddressWindow : stateAddressWindows) {
windowToActiveWindow.remove(stateAddressWindow);
}
activeWindowToStateAddressWindows.remove(window);
Expand Down

0 comments on commit 5419ac5

Please sign in to comment.