You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by allanqinjy <al...@163.com> on 2022/11/30 03:45:33 UTC

ElasticsearchSink 设置es 主分片数


hi,
    flink streaming(版本1.12.5) 写es的时候ElasticsearchSink.Builder发现没有设置配置的地方,比如要想设置 number_of_shards。哪位大佬知道,请教一下!


ElasticsearchSink.Builder<String>esSinkBuilder=newElasticsearchSink.Builder<>(httpHosts,newElasticsearchSinkFunction<String>(){publicIndexRequestcreateIndexRequest(Stringelement){Map<String,String>json=newHashMap<>();json.put("data",element);returnRequests.indexRequest().index("my-index").type("my-type").source(json);}@Overridepublicvoidprocess(Stringelement,RuntimeContextctx,RequestIndexerindexer){indexer.add(createIndexRequest(element));}})
| |
allanqinjy
|
|
allanqinjy@163.com
|
签名由网易邮箱大师定制