All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.zeebe.gateway.impl.broker.cluster.BrokerClusterState Maven / Gradle / Ivy

There is a newer version: 1.0.0-alpha7
Show newest version
/*
 * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under
 * one or more contributor license agreements. See the NOTICE file distributed
 * with this work for additional information regarding copyright ownership.
 * Licensed under the Zeebe Community License 1.0. You may not use this file
 * except in compliance with the Zeebe Community License 1.0.
 */
package io.zeebe.gateway.impl.broker.cluster;

import java.util.List;

public interface BrokerClusterState {

  int UNKNOWN_NODE_ID = -1;
  int NODE_ID_NULL = UNKNOWN_NODE_ID - 1;
  int PARTITION_ID_NULL = NODE_ID_NULL - 1;

  int getClusterSize();

  int getPartitionsCount();

  int getReplicationFactor();

  int getLeaderForPartition(int partition);

  List getFollowersForPartition(int partition);

  /** @return the node id of a random broker or {@link UNKNOWN_NODE_ID} if no brokers are known */
  int getRandomBroker();

  List getPartitions();

  List getBrokers();

  String getBrokerAddress(int brokerId);

  int getPartition(int index);

  String getBrokerVersion(int brokerId);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy