Github user HeartSaVioR commented on a diff in the pull request: https://github.com/apache/storm/pull/679#discussion_r37156295 --- 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 -- @sweetest SampleEsTupleMapper is just a class I defined from README. But I also think it would be better to have default mapper, and its name would be DefaultEsTupleMapper. I'll reflect it. Thanks!
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---