/** * Continue iterating the data rows and form new batches. * * @param nodeId Node that is ready for a new batch. */ private void sendNextBatches(@Nullable UUID nodeId) { try { Collection<Batch> next = continueLoop(nodeId); if (next == null) return; boolean first = (nodeId != null); // Need to unlock topology to avoid deadlock with binary descriptors registration. if (!topLocked && cctx.topology().holdsLock()) cctx.topology().readUnlock(); for (Batch batch : next) { ClusterNode node = batch.node(); sendBatch(node, batch, first); if (!node.isLocal()) first = false; } } catch (Throwable e) { onDone(e); if (e instanceof Error) throw (Error)e; } }
/** * Continue iterating the data rows and form new batches. * * @param nodeId Node that is ready for a new batch. */ private void sendNextBatches(@Nullable UUID nodeId) { try { Collection<Batch> next = continueLoop(nodeId); if (next == null) return; boolean first = (nodeId != null); // Need to unlock topology to avoid deadlock with binary descriptors registration. if(!topLocked && cctx.topology().holdsLock()) cctx.topology().readUnlock(); for (Batch batch : next) { ClusterNode node = batch.node(); sendBatch(node, batch, first); if (!node.isLocal()) first = false; } } catch (Throwable e) { onDone(e); if (e instanceof Error) throw (Error)e; } }