[ 
https://issues.apache.org/jira/browse/BEAM-5149?focusedWorklogId=141500&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-141500
 ]

ASF GitHub Bot logged work on BEAM-5149:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 05/Sep/18 19:05
            Start Date: 05/Sep/18 19:05
    Worklog Time Spent: 10m 
      Work Description: youngoli commented on a change in pull request #6222: 
[BEAM-5149] Add support for the Java SDK harness to merge windows.
URL: https://github.com/apache/beam/pull/6222#discussion_r215102198
 
 

 ##########
 File path: 
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/WindowMergingFnRunner.java
 ##########
 @@ -0,0 +1,158 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.fn.harness;
+
+import com.google.auto.service.AutoService;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import org.apache.beam.model.pipeline.v1.RunnerApi;
+import org.apache.beam.model.pipeline.v1.RunnerApi.PTransform;
+import org.apache.beam.model.pipeline.v1.RunnerApi.StandardPTransforms;
+import org.apache.beam.runners.core.construction.BeamUrns;
+import org.apache.beam.runners.core.construction.WindowingStrategyTranslation;
+import org.apache.beam.sdk.fn.function.ThrowingFunction;
+import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
+import org.apache.beam.sdk.transforms.windowing.WindowFn;
+import org.apache.beam.sdk.transforms.windowing.WindowFn.MergeContext;
+import org.apache.beam.sdk.values.KV;
+
+/**
+ * Merges windows using a {@link 
org.apache.beam.sdk.transforms.windowing.WindowFn}.
+ *
+ * <p>Window merging function:
+ *
+ * <ul>
+ *   <li>Input: {@code KV<nonce, iterable<OriginalWindow>>}
+ *   <li>Output: {@code KV<nonce, KV<iterable<UnmergedOriginalWindow>, 
iterable<KV<MergedWindow,
 
 Review comment:
   Is `KV<iterable<UnmergedOriginalWindow>, ...>` here being used simply 
because there's no coder that handles non-keyed pairs? Because it doesn't seem 
that the set of unmerged windows is actually used as a key associated with the 
map of `MergedWindow` to `ConsumedOriginalWindow`, but instead as just data 
paired with the map.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 141500)

> Add support to the Java SDK harness to merge windows
> ----------------------------------------------------
>
>                 Key: BEAM-5149
>                 URL: https://issues.apache.org/jira/browse/BEAM-5149
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-java-harness
>            Reporter: Luke Cwik
>            Assignee: Luke Cwik
>            Priority: Major
>              Labels: portability
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Window merging function:
>  
> {code:java}
> Input: KV<nonce, iterable<OriginalWindow>>
> Output: KV<nonce, KV<iterable<UnmergedOriginalWindow>, 
> iterable<KV<MergedWindow, iterable<ConsumedOriginalWindow>>>> 
> {code}
> For each set of original windows, a list of all unmerged windows is output 
> alongside a map of merged window to set of consumed windows. All original 
> windows must be contained in either the unmerged original window set or one 
> of the consumed original window sets. Each original window can only be part 
> of one output set. The nonce is used by a runner to associate each input with 
> its output. The nonce is represented as an opaque set of bytes.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to