code: public static long getPartitionAvgRecordSize(State state, KafkaPartition partition) {
      return state.getPropAsLong(
          getPartitionPropName(partition.getTopicName(), partition.getId()) + "." + KafkaSource.AVG_RECORD_SIZE);
    }
docs: Get the average record size of a partition, which is stored in property "[topicname].[partitionid].avg.record.size".
  If state doesn't contain this property, it returns defaultSize.