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

ASF GitHub Bot commented on STORM-974:
--------------------------------------

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

    https://github.com/apache/storm/pull/679#discussion_r37155617
  
    --- Diff: 
external/storm-elasticsearch/src/test/java/org/apache/storm/elasticsearch/common/EsTestUtil.java
 ---
    @@ -46,6 +47,30 @@ public Fields getComponentOutputFields(String 
componentId, String streamId) {
             return new TupleImpl(topologyContext, new Values(source, index, 
type, id), 1, "");
         }
     
    +    public static EsTupleMapper generateDefaultTupleMapper() {
    +        return new EsTupleMapper() {
    +            @Override
    +            public String getSource(ITuple tuple) {
    +                return tuple.getStringByField("source");
    +            }
    +
    +            @Override
    +            public String getIndex(ITuple tuple) {
    +                return tuple.getStringByField("index");
    +            }
    +
    +            @Override
    +            public String getType(ITuple tuple) {
    +                return tuple.getStringByField("type");
    +            }
    +
    +            @Override
    +            public String getId(ITuple tuple) {
    +                return tuple.getStringByField("id");
    +            }
    +        };
    +    }
    +
    --- End diff --
    
    can't we just use SampleEsTupleMapper instance instead?


> [storm-elasticsearch] Introduces Tuple -> ES document mapper to get rid of 
> constant field mapping (source, index, type)
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: STORM-974
>                 URL: https://issues.apache.org/jira/browse/STORM-974
>             Project: Apache Storm
>          Issue Type: Improvement
>            Reporter: Jungtaek Lim
>            Assignee: Jungtaek Lim
>
> For now EsIndexBolt uses constant field mapping (source, index, type) which 
> is not flexible.
> We can introduce tuple -> ES document mapper interface to let users define 
> their relationship, as other external modules did.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to