streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From steveblackmon <...@git.apache.org>
Subject [GitHub] incubator-streams pull request: Streams 138
Date Tue, 05 Aug 2014 14:52:01 GMT
Github user steveblackmon commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/59#discussion_r15817312
  
    --- Diff: streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/util/StreamsDatasiftMapper.java
---
    @@ -0,0 +1,84 @@
    +/*
    + * 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
    + *
    + *   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.streams.datasift.util;
    +
    +import com.fasterxml.jackson.core.JsonParser;
    +import com.fasterxml.jackson.core.JsonProcessingException;
    +import com.fasterxml.jackson.databind.DeserializationContext;
    +import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
    +import com.fasterxml.jackson.databind.module.SimpleModule;
    +import org.apache.streams.data.util.RFC3339Utils;
    +import org.apache.streams.jackson.StreamsJacksonMapper;
    +import org.joda.time.DateTime;
    +import org.joda.time.format.DateTimeFormat;
    +import org.joda.time.format.DateTimeFormatter;
    +
    +import java.io.IOException;
    +
    +/**
    + * Created by sblackmon on 3/27/14.
    + */
    +public class StreamsDatasiftMapper extends StreamsJacksonMapper {
    +
    +    public static final DateTimeFormatter DATASIFT_FORMAT = DateTimeFormat.forPattern("EEE,
dd MMM yyyy HH:mm:ss Z");
    --- End diff --
    
    Perhaps - it would be great if there were one ObjectMapper implementation that would be
compatible with all existing and future modules and any datetime format anywhere on the web.
 I'm all for trying to build one, but that goes beyond the scope of this story.  In any case
I think it's appropriate for modules that require tweaks to StreamsJacksonMapper to extend
it internally, rather than updating streams-pojo.  
    However I'd like to see something in streams-pojo that could determine the appropriate
Mapper for any document, even if the Mapper was in a contrib module, and perhaps run all serialization/deserialization
operations through a utility class.


---
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