Exception in thread "pool-2-thread-3" java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]

I start 5 threads in my Java process, in order to improve the transport performance I build TransportClient instance in each of these thread by coding <<TransportClient client = new PreBuiltTransportClient(Settings.EMPTY);>> to make each of thread uses its own TransportClient instance to transport data currently(It is very possible these TransportClient instances initial at the same time ), however I always got the exception below.

So it means in the same process, we can only build one TransportClient instance ? And each of these thread share the same TransportClient instance when they try to Bulk data to ES 5.5 currently? If that case it wouldn't have performance issue? As there is just one transport channel to transport the data.

Exception in thread "pool-2-thread-3" java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]
at io.netty.util.NettyRuntime$AvailableProcessorsHolder.setAvailableProcessors(NettyRuntime.java:51)
at io.netty.util.NettyRuntime.setAvailableProcessors(NettyRuntime.java:87)
at org.elasticsearch.transport.netty4.Netty4Utils.setAvailableProcessors(Netty4Utils.java:82)
at org.elasticsearch.transport.netty4.Netty4Transport.(Netty4Transport.java:138)
at org.elasticsearch.transport.Netty4Plugin.lambda$getTransports$0(Netty4Plugin.java:93)
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:174)
at org.elasticsearch.client.transport.TransportClient.(TransportClient.java:265)
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:130)
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:116)
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:106)
at com.pingan.bank.logplatform.processor.elasticsearch.ElasticSearchClient.(ElasticSearchClient.java:19)
at com.pingan.bank.logplatform.processor.elasticsearch.ElasticSearchBulkProcessor.(ElasticSearchBulkProcessor.java:29)
at com.pingan.bank.logplatform.processor.fileEventEntityPoller.fetchFromQueue(fileEventEntityPoller.java:30)
at com.pingan.bank.logplatform.processor.fileEventEntityPoller.run(fileEventEntityPoller.java:25)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.