java.lang.Object
io.kroxylicious.testing.kafka.common.Utils

public class Utils extends Object
The type Utils.
  • Method Details

    • awaitReassignmentOfKafkaInternalTopicsIfNecessary

      public static void awaitReassignmentOfKafkaInternalTopicsIfNecessary(Map<String,Object> connectionConfig, int fromNodeId, int toNodeId, int timeout, TimeUnit timeUnit)
      Reassign all kafka internal topic partitions that exist have a replica on fromNodeId and don't have at least one replica elsewhere in the cluster.
      Parameters:
      connectionConfig - the connection config
      fromNodeId - nodeId being evacuated
      toNodeId - replacement nodeId
      timeout - the timeout
      timeUnit - the time unit
    • awaitExpectedBrokerCountInClusterViaTopic

      public static void awaitExpectedBrokerCountInClusterViaTopic(Map<String,Object> connectionConfig, int timeout, TimeUnit timeUnit, Integer expectedBrokerCount)
      Await expected broker count in cluster. Verifies that all expected brokers are present in the cluster.

      To Verify that all the expected brokers are in the cluster we create a topic with a replication factor = to the expected number of brokers. We then poll describeTopics until

      Parameters:
      connectionConfig - the connection config
      timeout - the timeout
      timeUnit - the time unit
      expectedBrokerCount - the expected broker count
    • awaitCondition

      public static org.awaitility.core.ConditionFactory awaitCondition(int timeout, TimeUnit timeUnit)
      Factory for Awaitility.await() preconfigured with defaults.
      Parameters:
      timeout - at most timeout
      timeUnit - at most TimeUnit
      Returns:
      preconfigured factory