if (hasQueryId()) { hash = (37 * hash) + QUERY_ID_FIELD_NUMBER; hash = (53 * hash) + getQueryId().hashCode();
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 Builder mergeFrom(com.dremio.exec.proto.ExecRPC.FragmentRecordBatch other) { if (other == com.dremio.exec.proto.ExecRPC.FragmentRecordBatch.getDefaultInstance()) return this; if (other.hasQueryId()) { mergeQueryId(other.getQueryId()); } if (other.hasReceivingMajorFragmentId()) { setReceivingMajorFragmentId(other.getReceivingMajorFragmentId()); } if (!other.receivingMinorFragmentId_.isEmpty()) { if (receivingMinorFragmentId_.isEmpty()) { receivingMinorFragmentId_ = other.receivingMinorFragmentId_; bitField0_ = (bitField0_ & ~0x00000004); } else { ensureReceivingMinorFragmentIdIsMutable(); receivingMinorFragmentId_.addAll(other.receivingMinorFragmentId_); } onChanged(); } if (other.hasSendingMajorFragmentId()) { setSendingMajorFragmentId(other.getSendingMajorFragmentId()); } if (other.hasSendingMinorFragmentId()) { setSendingMinorFragmentId(other.getSendingMinorFragmentId()); } if (other.hasArrowRecordBatch()) { setArrowRecordBatch(other.getArrowRecordBatch()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
result = result && (hasQueryId() == other.hasQueryId()); if (hasQueryId()) { result = result && getQueryId() .equals(other.getQueryId());
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)
private static FragmentHandle getHandle(FragmentRecordBatch batch, int index) { return FragmentHandle.newBuilder() .setQueryId(batch.getQueryId()) .setMajorFragmentId(batch.getReceivingMajorFragmentId()) .setMinorFragmentId(batch.getReceivingMinorFragmentId(index)) .build(); }