public void mergeFrom(Input input, FragmentRecordBatch message) throws IOException {
    for (int number = input.readFieldNumber(this); ; number = input.readFieldNumber(this)) {
      switch (number) {
        case 0:
          return;
        case 1:
          message.handle = input.mergeObject(message.handle, FragmentHandle.getSchema());
          break;

        case 2:
          message.sendingMajorFragmentId = input.readInt32();
          break;
        case 3:
          message.sendingMinorFragmentId = input.readInt32();
          break;
        case 4:
          message.def = input.mergeObject(message.def, RecordBatchDef.getSchema());
          break;

        case 5:
          message.isLastBatch = input.readBool();
          break;
        case 6:
          message.isOutOfMemory = input.readBool();
          break;
        default:
          input.handleUnknownField(number, this);
      }
    }
  }
  public void writeTo(Output output, FragmentRecordBatch message) throws IOException {
    if (message.handle != null)
      output.writeObject(1, message.handle, FragmentHandle.getSchema(), false);

    if (message.sendingMajorFragmentId != 0)
      output.writeInt32(2, message.sendingMajorFragmentId, false);

    if (message.sendingMinorFragmentId != 0)
      output.writeInt32(3, message.sendingMinorFragmentId, false);

    if (message.def != null) output.writeObject(4, message.def, RecordBatchDef.getSchema(), false);

    if (message.isLastBatch != null) output.writeBool(5, message.isLastBatch, false);

    if (message.isOutOfMemory != null && message.isOutOfMemory != DEFAULT_IS_OUT_OF_MEMORY)
      output.writeBool(6, message.isOutOfMemory, false);
  }