/** * * @param node Node. * @param batch Batch. * @param first First mapping flag. */ private void sendBatch(ClusterNode node, Batch batch, boolean first) throws IgniteCheckedException { updateMappings(node); boolean clientFirst = first && cctx.localNode().isClient() && !topLocked && !tx.hasRemoteLocks(); int batchId = batchCntr.incrementAndGet(); if (node.isLocal()) enlistLocal(batchId, node.id(), batch); else sendBatch(batchId, node.id(), batch, clientFirst); }
/** * 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; } }
/** * * @param node Node. * @param batch Batch. * @param first First mapping flag. */ private void sendBatch(ClusterNode node, Batch batch, boolean first) throws IgniteCheckedException { updateMappings(node); boolean clientFirst = first && cctx.localNode().isClient() && !topLocked && !tx.hasRemoteLocks(); int batchId = batchCntr.incrementAndGet(); if (node.isLocal()) enlistLocal(batchId, node.id(), batch); else sendBatch(batchId, node.id(), batch, clientFirst); }
/** * 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; } }