partitioner.getOutgoingBatches(terminations.buffer[index]).terminate(); terminations.clear();
final BitSet visited = new BitSet(); final IntStack nodes = new IntStack(); linearized.clear();
final BitSet visited = new BitSet(); final IntStack nodes = new IntStack(); linearized.clear();
@Override public void setup(VectorAccessible incoming) throws Exception { state.is(State.NEEDS_SETUP); Preconditions.checkState(incoming.getSchema().getSelectionVectorMode() == BatchSchema.SelectionVectorMode.NONE, "Vectorized Partition Sender doesn't support SV " + incoming.getSchema().getSelectionVectorMode()); checkSchema(incoming.getSchema()); // how many records we can keep in memory before we are forced to flush the outgoing batch numRecordsBeforeFlush = calculateBucketSize(incoming); stats.setLongStat(Metric.BUCKET_SIZE, numRecordsBeforeFlush); // final BufferAllocator allocator = context.getAllocator(); // we need to synchronize this to ensure no receiver termination message is lost synchronized (batchCreationLock) { initBatchesAndLookup(incoming); // some receivers may have finished already, make sure to terminate corresponding outgoing batches for (int index = 0; index < terminations.size(); index++) { final int p = terminations.buffer[index]; batches[p].terminate(); batches[p + numReceivers].terminate(); } terminations.clear(); } copiers = MultiDestCopier.getCopiers(VectorContainer.getFieldVectors(incoming), batches, copyWatches); copyIndices = new IntVector("copy-compound-indices", allocator); copyIndices.allocateNew(numRecordsBeforeFlush); initHashVector(incoming); state = State.CAN_CONSUME; }
partitioner.getOutgoingBatches(terminations.buffer[index]).terminate(); terminations.clear();