File: new_partitions.py

package info (click to toggle)
python-kafka 2.0.2-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,740 kB
  • sloc: python: 20,457; makefile: 210; sh: 76
file content (19 lines) | stat: -rw-r--r-- 757 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from __future__ import absolute_import


class NewPartitions(object):
    """A class for new partition creation on existing topics.  Note that the length of new_assignments, if specified,
    must be the difference between the new total number of partitions and the existing number of partitions.
    Arguments:
        total_count (int): the total number of partitions that should exist on the topic
        new_assignments ([[int]]): an array of arrays of replica assignments for new partitions.
            If not set, broker assigns replicas per an internal algorithm.
    """

    def __init__(
        self,
        total_count,
        new_assignments=None
    ):
        self.total_count = total_count
        self.new_assignments = new_assignments