[ https://issues.apache.org/jira/browse/BEAM-3061?focusedWorklogId=260584&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-260584 ]
ASF GitHub Bot logged work on BEAM-3061: ---------------------------------------- Author: ASF GitHub Bot Created on: 14/Jun/19 17:20 Start Date: 14/Jun/19 17:20 Worklog Time Spent: 10m Work Description: jkff commented on pull request #7805: [BEAM-3061] Done notifications for BigtableIO.Write URL: https://github.com/apache/beam/pull/7805#discussion_r293902038 ########## File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java ########## @@ -684,11 +686,40 @@ public String toString() { return MoreObjects.toStringHelper(Write.class).add("config", getBigtableConfig()).toString(); } + private static class SeenWindow { + private BoundedWindow window; + private Instant timestamp; + + public SeenWindow(BoundedWindow window, Instant timestamp) { + this.window = window; + this.timestamp = timestamp; + } + + @Override + public boolean equals(Object o) { + return (o instanceof SeenWindow) && ((SeenWindow) o).window.equals(window); + } + + @Override + public int hashCode() { + return window.hashCode(); + } + + public BoundedWindow getWindow() { + return window; + } + + public Instant getTimestamp() { + return timestamp; + } + } + private class BigtableWriterFn extends DoFn<KV<ByteString, Iterable<Mutation>>, Void> { public BigtableWriterFn(BigtableConfig bigtableConfig) { this.config = bigtableConfig; this.failures = new ConcurrentLinkedQueue<>(); + this.seenWindows = new HashSet<>(); Review comment: Seems like this would be much cleaner in terms of Java readability as a simple `HashMap<BoundedWindow, Instant>`. However, looking at code below, you just need a `HashSet<BoundedWindow>`, and then use window.maxTimestamp() instead of the timestamp of a non-deterministically chosen element within the window. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 260584) Time Spent: 8h 20m (was: 8h 10m) > BigtableIO should support emitting a sentinel "done" value when a bundle > completes > ---------------------------------------------------------------------------------- > > Key: BEAM-3061 > URL: https://issues.apache.org/jira/browse/BEAM-3061 > Project: Beam > Issue Type: Improvement > Components: io-java-gcp > Reporter: Steve Niemitz > Assignee: Steve Niemitz > Priority: Major > Time Spent: 8h 20m > Remaining Estimate: 0h > > There was some discussion of this on the dev@ mailing list [1]. This > approach was taken based on discussion there. > [1] > https://lists.apache.org/thread.html/949b33782f722a9000c9bf9e37042739c6fd0927589b99752b78d7bd@%3Cdev.beam.apache.org%3E -- This message was sent by Atlassian JIRA (v7.6.3#76005)