apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From devtagare <...@git.apache.org>
Subject [GitHub] apex-malhar pull request #348: APEXMALHAR-2157 Json formatter improvements
Date Wed, 20 Jul 2016 16:02:14 GMT
Github user devtagare commented on a diff in the pull request:

    https://github.com/apache/apex-malhar/pull/348#discussion_r71554367
  
    --- Diff: library/src/main/java/com/datatorrent/lib/formatter/JsonFormatter.java ---
    @@ -45,58 +38,30 @@
     @org.apache.hadoop.classification.InterfaceStability.Evolving
     public class JsonFormatter extends Formatter<String>
     {
    +  private transient ObjectMapper objMapper;
       private transient ObjectWriter writer;
    -  protected String dateFormat;
     
    +  @SuppressWarnings("deprecation")
       @Override
       public void setup(OperatorContext context)
       {
    -    try {
    -      ObjectMapper mapper = new ObjectMapper();
    -      if (dateFormat != null) {
    -        mapper.setDateFormat(new SimpleDateFormat(dateFormat));
    -      }
    -      writer = mapper.writerWithType(clazz);
    -      mapper.configure(SerializationConfig.Feature.AUTO_DETECT_FIELDS, true);
    -      mapper.configure(SerializationConfig.Feature.AUTO_DETECT_GETTERS, true);
    -      mapper.configure(SerializationConfig.Feature.AUTO_DETECT_IS_GETTERS, true);
    -    } catch (Throwable e) {
    -      throw new RuntimeException("Unable find provided class");
    --- End diff --
    
    LOG.error("Unable find provided class");
    throw new RuntimeException(e);


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message