public static int getRecordSize(SubRecord.Type type) {
      int subRecordSize;
      switch (type) {
        case DELETE:
          subRecordSize = Delete_Sub_Format_V1.getRecordSize();
          break;
        case TTL_UPDATE:
          subRecordSize = Ttl_Update_Sub_Format_V1.getRecordSize();
          break;
        case UNDELETE:
          subRecordSize = Undelete_Sub_Format_V1.getRecordSize();
          break;
        default:
          throw new IllegalArgumentException("Unknown update record type: " + type);
      }
      return Version_Field_Size_In_Bytes + ACCOUNT_ID_FIELD_SIZE_IN_BYTES + CONTAINER_ID_FIELD_SIZE_IN_BYTES
          + UPDATE_TIME_FIELD_SIZE_IN_BYTES + RECORD_TYPE_FIELD_SIZE_IN_BYTES + subRecordSize + Crc_Size;
    }
@param type the type of the sub record in this update record.
@return the size of the record if the record were serialized
ambry-messageformat/src/main/java/com/github/ambry/messageformat/MessageFormatRecord.java