0
我一直在嘗試使用elastic4s在我的火花的應用,但每次嘗試的時間將數據發送到我的elasticsearch節點我不斷收到:elastic4s在星火應用程序了
java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;
at org.elasticsearch.threadpool.ThreadPool.<clinit>(ThreadPool.java:190)
at org.elasticsearch.client.transport.TransportClient$Builder.build(TransportClient.java:131)
at com.sksamuel.elastic4s.ElasticClient$.transport(ElasticClient.scala:111)
at com.sksamuel.elastic4s.ElasticClient$.remote(ElasticClient.scala:92)
不知道,我甚至可以開始調試這個錯誤。代碼相當簡單:
val elasticAddress = getEnvirometalParameter("streaming_pipeline", "elastic_address")(0)._1
val uri = ElasticsearchClientUri("elasticsearch://" + elasticAddress)
val client = ElasticClient.remote(uri)
def elasticInsert(subject:String, predicate:String, obj:String, label:String) = {
client.execute {
update id (label + subject + predicate + obj) in "test"/"quad" docAsUpsert (
"subject" -> subject,
"predicate" -> predicate,
"object" -> obj,
"label" -> label
)
}
}
看起來像是:「番石榴的問題。其他的東西有更新版本的番石榴,但是ES想要18.」 – theMadKing
由於番石榴,Elasticsearch和Spark似乎不太好。在Elasticsearch 5.0中,他們刪除了對Guava的依賴,這非常好。 – monkjack