streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (STREAMS-60) WebHdfsReader should set timestamp when reading documents
Date Mon, 19 May 2014 19:43:39 GMT

    [ https://issues.apache.org/jira/browse/STREAMS-60?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14002224#comment-14002224
] 

ASF GitHub Bot commented on STREAMS-60:
---------------------------------------

Github user steveblackmon commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/12#discussion_r12812340
  
    --- Diff: streams-contrib/streams-processor-json/src/main/java/org/apache/streams/json/JsonPathExtractor.java
---
    @@ -0,0 +1,119 @@
    +package org.apache.streams.json;
    +
    +import com.fasterxml.jackson.core.JsonProcessingException;
    +import com.fasterxml.jackson.databind.ObjectMapper;
    +import com.fasterxml.jackson.databind.node.ObjectNode;
    +import com.fasterxml.jackson.datatype.jsonorg.JsonOrgModule;
    +import com.google.common.collect.Lists;
    +import com.jayway.jsonpath.JsonPath;
    +import net.minidev.json.JSONArray;
    +import net.minidev.json.JSONObject;
    +import org.apache.commons.lang3.StringUtils;
    +import org.apache.streams.core.StreamsDatum;
    +import org.apache.streams.core.StreamsProcessor;
    +import org.apache.streams.jackson.StreamsJacksonMapper;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.util.Iterator;
    +import java.util.List;
    +
    +/**
    + * Created by sblackmon on 12/10/13.
    + */
    +public class JsonPathExtractor implements StreamsProcessor {
    +
    +    public JsonPathExtractor() {
    +        System.out.println("creating JsonPathExtractor");
    +    }
    +
    +    public JsonPathExtractor(String pathExpression) {
    +        this.pathExpression = pathExpression;
    +        System.out.println("creating JsonPathExtractor for " + this.pathExpression);
    +    }
    +
    +    private final static String STREAMS_ID = "JsonPathExtractor";
    +
    +    private final static Logger LOGGER = LoggerFactory.getLogger(JsonPathExtractor.class);
    +
    +    private ObjectMapper mapper = new StreamsJacksonMapper();
    +
    +    private String pathExpression;
    +    private JsonPath jsonPath;
    +
    +    @Override
    +    public List<StreamsDatum> process(StreamsDatum entry) {
    +
    +        List<StreamsDatum> result = Lists.newArrayList();
    +
    +        String json = null;
    +
    +        LOGGER.debug("{} processing {}", STREAMS_ID);
    --- End diff --
    
    Only the string is an argument - the other object gets instantiated with the argument
for internal use


> WebHdfsReader should set timestamp when reading documents
> ---------------------------------------------------------
>
>                 Key: STREAMS-60
>                 URL: https://issues.apache.org/jira/browse/STREAMS-60
>             Project: Streams
>          Issue Type: Improvement
>            Reporter: Steve Blackmon
>
> WebHdfsReader should set timestamp when reading documents



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message