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

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

                Author: ASF GitHub Bot
            Created on: 23/Oct/18 18:43
            Start Date: 23/Oct/18 18:43
    Worklog Time Spent: 10m 
      Work Description: jklukas commented on a change in pull request #6586: 
[BEAM-5638] Exception handling for Java single message transforms
URL: https://github.com/apache/beam/pull/6586#discussion_r227517803
 
 

 ##########
 File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/MapElements.java
 ##########
 @@ -162,4 +171,89 @@ public void populateDisplayData(DisplayData.Builder 
builder) {
       builder.include("fn", (HasDisplayData) originalFnForDisplayData);
     }
   }
+
+  /**
+   * Sets a {@link TupleTag} to associate with successes, converting this 
{@link PTransform} into
+   * one that returns a {@link PCollectionTuple}. This allows you to make 
subsequent {@link
+   * WithFailures#withFailureTag(TupleTag, Class, Class[])} calls to capture 
thrown exceptions to
+   * failure collections.
+   */
+  public WithFailures withSuccessTag(TupleTag<OutputT> successTag) {
+    return new WithFailures(successTag, TaggedExceptionsList.empty());
+  }
 
 Review comment:
   Fair point. I can add `withFailureTag` to the main class. There's getting to 
be quite a lot of duplicate code between MapElements, FlatMapElements, and 
Filter. I'm wondering whether we've reached the point of refactoring to have 
all three depend on a common abstract `SingleMessageTransform` base class that 
could include all the machinery for generating `WithFailures` instances.
   
   I'm going to post to the mailing list about that.

----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

            Worklog Id:     (was: 157757)
            Time Spent: 4h 10m  (was: 4h)
    Remaining Estimate: 163h 50m  (was: 164h)

> Add exception handling to single message transforms in Java SDK
> ---------------------------------------------------------------
>
>                 Key: BEAM-5638
>                 URL: https://issues.apache.org/jira/browse/BEAM-5638
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-java-core
>            Reporter: Jeff Klukas
>            Assignee: Jeff Klukas
>            Priority: Minor
>   Original Estimate: 168h
>          Time Spent: 4h 10m
>  Remaining Estimate: 163h 50m
>
> Add methods to MapElements, FlatMapElements, and Filter that allow users to 
> specify expected exceptions and tuple tags to associate with the with 
> collections of the successfully and unsuccessfully processed elements.
> See discussion on dev list:
> https://lists.apache.org/thread.html/936ed2a5f2c01be066fd903abf70130625e0b8cf4028c11b89b8b23f@%3Cdev.beam.apache.org%3E



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

Reply via email to