hash = (53 * hash) + getReceivingMajorFragmentId(); if (getReceivingMinorFragmentIdCount() > 0) { hash = (37 * hash) + RECEIVING_MINOR_FRAGMENT_ID_FIELD_NUMBER; hash = (53 * hash) + getReceivingMinorFragmentIdList().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)); } }