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

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

                Author: ASF GitHub Bot
            Created on: 05/Oct/18 17:20
            Start Date: 05/Oct/18 17:20
    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_r223081316
 
 

 ##########
 File path: 
sdks/java/extensions/jackson/src/main/java/org/apache/beam/sdk/extensions/jackson/AsJsons.java
 ##########
 @@ -64,13 +77,75 @@ private AsJsons(Class<? extends InputT> outputClass) {
               @Override
               public String apply(InputT input) {
                 try {
-                  ObjectMapper mapper = 
Optional.fromNullable(customMapper).or(DEFAULT_MAPPER);
-                  return mapper.writeValueAsString(input);
+                  return writeValue(input);
                 } catch (IOException e) {
-                  throw new RuntimeException(
+                  throw new UncheckedIOException(
                       "Failed to serialize " + inputClass.getName() + " value: 
" + input, e);
                 }
               }
             }));
   }
+
+  /** Return the {@link TupleTag} associated with successfully written JSON 
strings. */
+  public static TupleTag<String> successTag() {
+    return SUCCESS_TAG;
+  }
 
 Review comment:
   We could make the constant itself public, but this accessor makes for more 
pleasant usage in my opinion.

----------------------------------------------------------------
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: 151737)
            Time Spent: 50m  (was: 40m)
    Remaining Estimate: 167h 10m  (was: 167h 20m)

> 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: 50m
>  Remaining Estimate: 167h 10m
>
> 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