Class Cell

java.lang.Object
org.apache.kafka.common.Cell

public class Cell extends Object
Represents the contents of a cell, a collection of brokers.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Cell(int cellId, Set<Integer> brokers, CellState state, short minSize, short maxSize)
    Represents the contents of a cell.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the set of brokers assigned to this cell
    Return the list of brokers assigned to this cell
    int
    The unique cell Id
    boolean
     
    static int
    getImplicitBrokerCellId(int brokerId, int cellSize, int k2BaseBrokerIndex, int k2CellId, int k2DefaultCellId)
    Computes the implicit cell-id based on the cellSize
    int
     
    short
    Return the max cell size, a cell cannot be over maxSize number of brokers
    short
    Return the min cell size, there must be at least minSize brokers before a cell is considered usable
    Return the cell state (ready, quarantined, excluded)
     

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Cell

      public Cell(int cellId, Set<Integer> brokers, CellState state, short minSize, short maxSize)
      Represents the contents of a cell.
      Parameters:
      cellId - the cell id
      brokers - the brokers assigned to this cell
      state - the cell state (ready, quarantined, excluded)
      minSize - the min cell size, there must be at least minSize brokers before a cell is considered usable
      maxSize - the max cell size, a cell cannot be over maxSize number of brokers
  • Method Details

    • getImplicitBrokerCellId

      public static int getImplicitBrokerCellId(int brokerId, int cellSize, int k2BaseBrokerIndex, int k2CellId, int k2DefaultCellId)
      Computes the implicit cell-id based on the cellSize
      Parameters:
      brokerId -
      cellSize -
      Returns:
      return the implicit cell-id for the given broker
    • cellId

      public int cellId()
      The unique cell Id
      Returns:
      cell ID
    • minSize

      public short minSize()
      Return the min cell size, there must be at least minSize brokers before a cell is considered usable
      Returns:
      min cell size
    • maxSize

      public short maxSize()
      Return the max cell size, a cell cannot be over maxSize number of brokers
      Returns:
      max cell size
    • state

      public CellState state()
      Return the cell state (ready, quarantined, excluded)
      Returns:
      cell state
    • brokers

      public Set<Integer> brokers()
      Return the set of brokers assigned to this cell
      Returns:
      cell brokers
    • brokersList

      public List<Integer> brokersList()
      Return the list of brokers assigned to this cell
      Returns:
      cell brokers
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object