size += 1 * getReceivingMinorFragmentIdList().size();
@Override public Void answer(InvocationOnMock invocation) throws Throwable { final FragmentWritableBatch batch = (FragmentWritableBatch) invocation.getArguments()[0]; for (int fragId : batch.getHeader().getReceivingMinorFragmentIdList()) { rowCountPerFragment[fragId] += batch.getRecordCount(); } for(ByteBuf b : batch.getBuffers()){ b.release(); } return null; }}).when(tunnel).sendRecordBatch(any(FragmentWritableBatch.class));
hash = (53 * hash) + getReceivingMinorFragmentIdList().hashCode();
== other.getReceivingMajorFragmentId()); result = result && getReceivingMinorFragmentIdList() .equals(other.getReceivingMinorFragmentIdList()); result = result && (hasSendingMajorFragmentId() == other.hasSendingMajorFragmentId()); if (hasSendingMajorFragmentId()) {
private void handleFragmentRecordBatch(FragmentRecordBatch fragmentBatch, ByteBuf body, ResponseSender sender) throws RpcException { final AckSender ack = new AckSender(sender); // increment so we don't get false returns. ack.increment(); try { final IncomingDataBatch batch = new IncomingDataBatch(fragmentBatch, (ArrowBuf) body, ack); final int targetCount = fragmentBatch.getReceivingMinorFragmentIdCount(); // randomize who gets first transfer (and thus ownership) so memory usage // is balanced when we're sharing amongst // multiple fragments. final int firstOwner = ThreadLocalRandom.current().nextInt(targetCount); submit(batch, firstOwner, targetCount); submit(batch, 0, firstOwner); // decrement the extra reference we grabbed at the top. ack.sendOk(); } catch (IOException | FragmentSetupException e) { logger.error("Failure while getting fragment manager. {}", QueryIdHelper.getQueryIdentifiers(fragmentBatch.getQueryId(), fragmentBatch.getReceivingMajorFragmentId(), fragmentBatch.getReceivingMinorFragmentIdList()), e); ack.clear(); sender.send(new Response(RpcType.ACK, Acks.FAIL)); } }
public void writeTo(io.protostuff.Output output, com.dremio.exec.proto.ExecRPC.FragmentRecordBatch message) throws java.io.IOException { if(message.hasQueryId()) output.writeObject(1, message.getQueryId(), com.dremio.exec.proto.SchemaUserBitShared.QueryId.WRITE, false); if(message.hasReceivingMajorFragmentId()) output.writeInt32(2, message.getReceivingMajorFragmentId(), false); for(int receivingMinorFragmentId : message.getReceivingMinorFragmentIdList()) output.writeInt32(3, receivingMinorFragmentId, true); if(message.hasSendingMajorFragmentId()) output.writeInt32(4, message.getSendingMajorFragmentId(), false); if(message.hasSendingMinorFragmentId()) output.writeInt32(5, message.getSendingMinorFragmentId(), false); if(message.hasArrowRecordBatch()) output.writeByteArray(6, message.getArrowRecordBatch().toByteArray(), false); } public boolean isInitialized(com.dremio.exec.proto.ExecRPC.FragmentRecordBatch message)