public class RecoveryUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
COMPARISON_TOOL_INPUT |
static String |
COMPARISON_TOOL_INPUT_DOC |
static String |
COMPARISON_TOOL_OUTPUT |
static String |
COMPARISON_TOOL_OUTPUT_DOC |
static String |
TIER_PROPERTIES_CONF_FILE_CONFIG |
static String |
TIER_PROPERTIES_CONF_FILE_DOC |
Constructor and Description |
---|
RecoveryUtils() |
Modifier and Type | Method and Description |
---|---|
static org.apache.kafka.clients.producer.Producer<byte[],byte[]> |
createTierTopicProducer(Properties properties,
String clientId)
Create and return a new TierTopic Producer object.
|
static int |
getNumPartitions(org.apache.kafka.clients.producer.Producer<byte[],byte[]> producer,
String topicName)
Discovers and returns the number of partitions in the provided topicName.
|
static org.apache.kafka.clients.producer.RecordMetadata |
injectTierTopicEvent(org.apache.kafka.clients.producer.Producer<byte[],byte[]> producer,
AbstractTierMetadata event,
String tierTopicName,
int numTierTopicPartitions)
Injects an event into the TierTopic, using the provided TierTopic producer object.
|
static String |
makeArgument(String arg) |
static List<TopicIdPartition> |
toTopicIdPartitions(List<String> topicIdPartitionsStr)
Converts a list of formatted TopicIdPartition strings to a list of TopicIdPartition.
|
static void |
validatePartitions(Properties properties,
Set<org.apache.kafka.common.TopicPartition> inputPartitions) |
public static final String TIER_PROPERTIES_CONF_FILE_CONFIG
public static final String TIER_PROPERTIES_CONF_FILE_DOC
public static final String COMPARISON_TOOL_INPUT
public static final String COMPARISON_TOOL_INPUT_DOC
public static final String COMPARISON_TOOL_OUTPUT
public static final String COMPARISON_TOOL_OUTPUT_DOC
public static int getNumPartitions(org.apache.kafka.clients.producer.Producer<byte[],byte[]> producer, String topicName)
topicName
- the name of the topic (should be non-empty and valid)public static org.apache.kafka.clients.producer.Producer<byte[],byte[]> createTierTopicProducer(Properties properties, String clientId)
properties
- properties object to pass to the producerclientId
- the client ID to be used to construct the producerpublic static org.apache.kafka.clients.producer.RecordMetadata injectTierTopicEvent(org.apache.kafka.clients.producer.Producer<byte[],byte[]> producer, AbstractTierMetadata event, String tierTopicName, int numTierTopicPartitions) throws InterruptedException, ExecutionException
producer
- the TierTopic producer objectevent
- the event to be injected into the TierTopictierTopicName
- the name of the TierTopicnumTierTopicPartitions
- the number of TierTopic partitionsInterruptedException
- if there was an error in producing the eventExecutionException
- if there was an error in producing the eventpublic static List<TopicIdPartition> toTopicIdPartitions(List<String> topicIdPartitionsStr)
topicIdPartitionsStr
- the list of formatted TopicIdPartition stringspublic static void validatePartitions(Properties properties, Set<org.apache.kafka.common.TopicPartition> inputPartitions) throws CancellationException, IllegalArgumentException