code: private void serializePartitionInfoToState() {
      List<PartitionDescriptor> descriptors = new ArrayList<>();
  
      for (DataWriter writer : partitionWriters.asMap().values()) {
        Descriptor descriptor = writer.getDataDescriptor();
        if (null == descriptor) {
          log.warn("Drop partition info as writer {} returns a null PartitionDescriptor", writer.toString());
          continue;
        }
  
        if (!(descriptor instanceof PartitionDescriptor)) {
          log.warn("Drop partition info as writer {} does not return a PartitionDescriptor", writer.toString());
          continue;
        }
  
        descriptors.add((PartitionDescriptor)descriptor);
      }
  
      if (descriptors.size() > 0) {
        state.setProp(getPartitionsKey(branchId), PartitionDescriptor.toPartitionJsonList(descriptors));
      } else {
        log.info("Partitions info not available. Will not serialize partitions");
      }
    }
docs: Serialize partitions info to {@link #state} if they are any