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

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

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

    https://github.com/apache/storm/pull/693#discussion_r38152200
  
    --- Diff: 
external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/ElasticSearchClient.java
 ---
    @@ -0,0 +1,57 @@
    +/**
    + * 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
    + * with the License.  You may obtain a copy of the License at
    + *
    + * 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.storm.elasticsearch.bolt;
    +
    +import java.io.Serializable;
    +
    +import org.apache.storm.elasticsearch.common.EsConfig;
    +import org.elasticsearch.client.Client;
    +import org.elasticsearch.client.transport.TransportClient;
    +import org.elasticsearch.common.settings.ImmutableSettings;
    +import org.elasticsearch.common.settings.Settings;
    +import org.elasticsearch.common.transport.InetSocketTransportAddress;
    +
    +final class ElasticSearchClient implements Serializable {
    +
    +    private final EsConfig esConfig;
    +
    +    ElasticSearchClient(EsConfig esConfig) {
    +        this.esConfig = esConfig;
    +    }
    +
    +    Client construct() {
    +        Settings settings = createBasicSettings();
    +        TransportClient transportClient = new TransportClient(settings);
    +        addTransportAddresses(transportClient);
    +        return transportClient;
    +    }
    +
    +    private Settings createBasicSettings() {
    +        return ImmutableSettings.settingsBuilder()
    +                                .put("cluster.name", 
esConfig.getClusterName())
    +                                .put("client.transport.sniff", "true")
    --- End diff --
    
    If we want to pass configurations to TransportClient, I think it would be 
better to expose Map from EsConfig, and put all things inside Map to 
ImmutableSettings.settingsBuilder().
    I'll make an issue to addressing this.
    
    Before then, I'm fine to leave client.transport.sniff as it is.


> [storm-elasticsearch] Introduces Lookup(or Query)Bolt which emits matched 
> documents from ES
> -------------------------------------------------------------------------------------------
>
>                 Key: STORM-978
>                 URL: https://issues.apache.org/jira/browse/STORM-978
>             Project: Apache Storm
>          Issue Type: Improvement
>            Reporter: Jungtaek Lim
>            Assignee: Alex Panov
>
> storm-elasticsearch has features on storing document, not querying something.
> It would be better to have Lookup (or Query) Bolt for querying to ES and emit 
> matched documents, as other external modules did.



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

Reply via email to