public class KafkaPartitionTestUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PARTITION_HEADER |
Constructor and Description |
---|
KafkaPartitionTestUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
checkResultsAgainstSkew(PartitionTestScenario scenario,
Map<Integer,List<Event>> partitionMap,
Map<Integer,List<byte[]>> resultsMap,
int staticPtn,
int numMsgs)
This method checks the retrieved messages (passed as resultsMap) against the expected
results (passed as partitionMap).
|
static List<Event> |
generateSkewedMessageList(PartitionTestScenario scenario,
int numMsgs,
Map<Integer,List<Event>> partitionMap,
int numPtns,
int staticPtn)
This method is can be used to create a list of events for use in Kafka partition tests.
|
static Map<Integer,List<byte[]>> |
retrieveRecordsFromPartitions(String topic,
int numPtns,
Properties consumerProperties)
Return a map containing one List of records per partition.
|
public static final String PARTITION_HEADER
public static void checkResultsAgainstSkew(PartitionTestScenario scenario, Map<Integer,List<Event>> partitionMap, Map<Integer,List<byte[]>> resultsMap, int staticPtn, int numMsgs)
scenario
- partitionMap
- resultsMap
- staticPtn
- numMsgs
- public static List<Event> generateSkewedMessageList(PartitionTestScenario scenario, int numMsgs, Map<Integer,List<Event>> partitionMap, int numPtns, int staticPtn)
scenario
- The scenario being catered for.numMsgs
- The number of messages to generatepartitionMap
- A map of Integer (partitionId) and List of Events - to be populatednumPtns
- The number of partitions to be populated.staticPtn
- The static partition to be assigned to.public static Map<Integer,List<byte[]>> retrieveRecordsFromPartitions(String topic, int numPtns, Properties consumerProperties)
numPtns
- consumerProperties
- Copyright © 2009–2019 Apache Software Foundation. All rights reserved.