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

    
https://github.com/apache/incubator-predictionio/pull/421#discussion_r134630517
  
    --- Diff: 
storage/elasticsearch/src/main/scala/org/apache/predictionio/data/storage/elasticsearch/StorageClient.scala
 ---
    @@ -18,27 +18,84 @@
     package org.apache.predictionio.data.storage.elasticsearch
     
     import org.apache.http.HttpHost
    +import org.apache.http.auth.{AuthScope, UsernamePasswordCredentials}
    +import org.apache.http.impl.client.BasicCredentialsProvider
    +import org.apache.http.impl.nio.client.HttpAsyncClientBuilder
     import org.apache.predictionio.data.storage.BaseStorageClient
     import org.apache.predictionio.data.storage.StorageClientConfig
     import org.apache.predictionio.data.storage.StorageClientException
    +import org.apache.predictionio.workflow.CleanupFunctions
     import org.elasticsearch.client.RestClient
    +import org.elasticsearch.client.RestClientBuilder.HttpClientConfigCallback
     
     import grizzled.slf4j.Logging
     
    -case class ESClient(hosts: Seq[HttpHost]) {
    -  def open(): RestClient = {
    +object ESClient extends Logging {
    +  var _sharedRestClient: Option[RestClient] = None
    --- End diff --
    
    Thanks for the hints here. I suspected this would be an issue. I'm 
investigating how to make this threadsafe.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to