docs: void initFromSubMessageBuffer(ByteBuffer buf) throws IOException
      {
          // See Serialization Format comment above getSerializedSize().
  
          super.initFromBuffer(buf);
  
          // Header block
          short fragCount = buf.getShort();
          assert(fragCount > 0);
          short unplannedCount = buf.getShort();
          assert(unplannedCount >= 0 && unplannedCount <= fragCount);
          m_isFinal = buf.get() != 0;
          m_taskType = buf.get();
          m_emptyForRestart = buf.get() != 0;
          m_executedOnPreviousLeader = buf.get() == 1;
          boolean haveOutputDependencies = buf.get() != 0;
          boolean haveInputDependencies = buf.get() != 0;
          short procNameToLoadBytesLen = buf.getShort();
          if (procNameToLoadBytesLen >= 0) {
              m_procNameToLoad = new byte[procNameToLoadBytesLen];
              buf.get(m_procNameToLoad);
          }
          m_perFragmentStatsRecording = buf.get() != 0;
          m_coordinatorTask = buf.get() != 0;
          // N Partition Transaction PartitionCount
          m_nPartTxn = buf.get() != 0;
          // timestamp for restarted transaction
          m_restartTimestamp = buf.getLong();
          m_lastSpUniqueId = buf.getLong();
  
          m_items = new ArrayList<FragmentData>(fragCount);
  
          // Fragment ID block (creates the FragmentData objects)
          for (int i = 0; i < fragCount; i++) {
              FragmentData item = new FragmentData();
              item.m_planHash = new byte[20]; // sha1 is 20b
              buf.get(item.m_planHash);
              m_items.add(item);
          }
  
          // Statement names block
          for (FragmentData item : m_items) {
              short stmtNameLen = buf.getShort();
              if (stmtNameLen >= 0) {
                  item.m_stmtName = new byte[stmtNameLen];
                  buf.get(item.m_stmtName);
              }
              else {
                  item.m_stmtName = null;
              }
          }
  
          // Parameter set block
          for (FragmentData item : m_items) {
              int paramsbytecount = buf.getInt();
              item.m_parameterSet = ByteBuffer.allocate(paramsbytecount);
              int cachedLimit = buf.limit();
              buf.limit(buf.position() + item.m_parameterSet.remaining());
              item.m_parameterSet.put(buf);
              item.m_parameterSet.flip();
              buf.limit(cachedLimit);
          }
  
          // Optional output dependency block
          if (haveOutputDependencies) {
              for (FragmentData item : m_items) {
                  item.m_outputDepId = buf.getInt();
              }
          }
  
          // Optional input dependency block
          if (haveInputDependencies) {
              for (FragmentData item : m_items) {
                  short count = buf.getShort();
                  if (count > 0) {
                      assert count == 1;
                      item.m_inputDepId = buf.getInt();
                  }
              }
          }
  
          // read procedure name if there
          short procNameLen = buf.getShort();
          if (procNameLen >= 0) {
              m_procedureName = new byte[procNameLen];
              buf.get(m_procedureName);
          }
          else {
              m_procedureName = null;
          }
  
          // ints for batch context
          m_currentBatchIndex = buf.getInt();
  
          BatchTimeoutOverrideType batchTimeoutType = BatchTimeoutOverrideType.typeFromByte(buf.get());
          if (batchTimeoutType == BatchTimeoutOverrideType.NO_OVERRIDE_FOR_BATCH_TIMEOUT) {
              m_batchTimeout = BatchTimeoutOverrideType.NO_TIMEOUT;
          } else {
              m_batchTimeout = buf.getInt();
          }
  
          // Involved partition
          short involvedPartitionCount = buf.getShort();
          ImmutableSet.Builder<Integer> involvedPartitionsBuilder = ImmutableSet.builder();
          for (int i = 0; i < involvedPartitionCount; i++) {
              involvedPartitionsBuilder.add(buf.getInt());
          }
          m_involvedPartitions = involvedPartitionsBuilder.build();
  
          int initiateTaskMessageLength = buf.getInt();
          if (initiateTaskMessageLength > 0) {
              int startPosition = buf.position();
              Iv2InitiateTaskMessage message = new Iv2InitiateTaskMessage();
              // EHGAWD: init task was serialized with flatten which added
              // the message type byte. deserialization expects the message
              // factory to have stripped that byte. but ... that's not the
              // way we do it here. So read the message type byte...
              byte messageType = buf.get();
              assert(messageType == VoltDbMessageFactory.IV2_INITIATE_TASK_ID);
              message.initFromBuffer(buf);
              m_initiateTask = message;
              if (m_initiateTask != null && m_initiateTaskBuffer == null) {
                  m_initiateTaskBuffer = ByteBuffer.allocate(m_initiateTask.getSerializedSize());
                  try {
                      m_initiateTask.flattenToBuffer(m_initiateTaskBuffer);
                      m_initiateTaskBuffer.flip();
                  } catch (IOException e) {
                      //Executive decision, don't throw a checked exception. Let it burn.
                      throw new RuntimeException(e);
                  }
              }
  
              /*
               * There is an assertion that all bytes of the message are consumed.
               * Initiate task lazily deserializes the parameter buffer and doesn't consume
               * all the bytes so do it here so the assertion doesn't trip
               */
              buf.position(startPosition + initiateTaskMessageLength);
          }
  
          // Unplanned block
          for (int iUnplanned = 0; iUnplanned < unplannedCount; iUnplanned++) {
              short index = buf.getShort();
              assert(index >= 0 && index < m_items.size());
              FragmentData item = m_items.get(index);
              int fragmentPlanLength = buf.getInt();
              if (fragmentPlanLength > 0) {
                  item.m_fragmentPlan = new byte[fragmentPlanLength];
                  buf.get(item.m_fragmentPlan);
  
                  int stmtTextLength = buf.getInt();
                  item.m_stmtText = new byte[stmtTextLength];
                  buf.get(item.m_stmtText);
              }
          }
      }