m2m模型翻译
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
757 B

6 months ago
  1. from __future__ import absolute_import
  2. class NewPartitions(object):
  3. """A class for new partition creation on existing topics. Note that the length of new_assignments, if specified,
  4. must be the difference between the new total number of partitions and the existing number of partitions.
  5. Arguments:
  6. total_count (int): the total number of partitions that should exist on the topic
  7. new_assignments ([[int]]): an array of arrays of replica assignments for new partitions.
  8. If not set, broker assigns replicas per an internal algorithm.
  9. """
  10. def __init__(
  11. self,
  12. total_count,
  13. new_assignments=None
  14. ):
  15. self.total_count = total_count
  16. self.new_assignments = new_assignments