2
我想使用async java客戶端進行異步讀取。我指的是在 http://www.aerospike.com/docs/client/java/usage/asyncAerospike Java異步客戶端阻止
我使用下面獲取閱讀 GET(BatchPolicy政策,RecordArrayListener監聽器,按鍵[]鍵)
這正常工作與幾個請求,但是製作後幾乎提到的例子〜50000個請求,線程進入無限期等待狀態。以下是其中一個線程的堆棧跟蹤。
"pool-11-thread-1" - Thread [email protected]
java.lang.Thread.State: WAITING
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <737890e3> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
at com.aerospike.client.async.AsyncCluster$BlockBufferQueue.getByteBuffer(AsyncCluster.java:114)
at com.aerospike.client.async.AsyncCluster.getByteBuffer(AsyncCluster.java:68)
at com.aerospike.client.async.AsyncCommand.execute(AsyncCommand.java:59)
at com.aerospike.client.async.AsyncMul tiExecutor.execute(AsyncMultiExecutor.java:36)
at com.aerospike.client.async.AsyncBatch$GetArrayExecutor.<init>(AsyncBatch.java:249)
at com.aerospike.client.async.AsyncClient.get(AsyncClient.java:568)
任何人都可以提出爲什麼這可能會發生或如何防止這種情況。
嘿,這工作。我使用固定大小的線程池Executors.newFixedThreadPool(asyncClientPolicy.asyncMaxCommands) 在AsyncClientPolicy中,我們有一個配置asyncSelectorThreads。它沒有在文檔中給出關於它的更多細節。你能否建議應該設置什麼樣的最佳值? –