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

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

                Author: ASF GitHub Bot
            Created on: 23/Oct/18 17:21
            Start Date: 23/Oct/18 17:21
    Worklog Time Spent: 10m 
      Work Description: relud 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_r227487904
 
 

 ##########
 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:
   Calling `withFailureTag` without first setting the success tag doesn't have 
to be an invalid state. Someone might have code that always throws an 
exception, which could return a PCollectionTuple of only `Failure`s.

----------------------------------------------------------------
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: 157712)
            Time Spent: 4h  (was: 3h 50m)
    Remaining Estimate: 164h  (was: 164h 10m)

> 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
>  Remaining Estimate: 164h
>
> 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