()
| 158 | } |
| 159 | |
| 160 | private Inserter getInserter() { |
| 161 | Inserter inserter; |
| 162 | if (producerBatchSz > 1) { |
| 163 | inserter = thdLocalBatcher.get(); |
| 164 | if (inserter == null) { |
| 165 | BatchInserter b = new BatchInserter(this, producerBatchSz); |
| 166 | inserter = b; |
| 167 | thdLocalBatcher.set(b); |
| 168 | } |
| 169 | } else { |
| 170 | inserter = directInserter; |
| 171 | } |
| 172 | return inserter; |
| 173 | } |
| 174 | |
| 175 | /** |
| 176 | * Blocking call. Retries till it can successfully publish the obj. Can be interrupted via Thread.interrupt(). |