public class RecoveryUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMPARISON_TOOL_INPUT |
static java.lang.String |
COMPARISON_TOOL_INPUT_DOC |
static java.lang.String |
COMPARISON_TOOL_OUTPUT |
static java.lang.String |
COMPARISON_TOOL_OUTPUT_DOC |
static java.lang.String |
TIER_PROPERTIES_CONF_FILE_CONFIG |
static java.lang.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(java.util.Properties properties,
java.lang.String clientId)
Create and return a new TierTopic Producer object.
|
static int |
getNumPartitions(org.apache.kafka.clients.producer.Producer<byte[],byte[]> producer,
java.lang.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,
java.lang.String tierTopicName,
int numTierTopicPartitions)
Injects an event into the TierTopic, using the provided TierTopic producer object.
|
static java.lang.String |
makeArgument(java.lang.String arg) |
static java.util.List<TopicIdPartition> |
toTopicIdPartitions(java.util.List<java.lang.String> topicIdPartitionsStr)
Converts a list of formatted TopicIdPartition strings to a list of TopicIdPartition.
|
static void |
validatePartitions(java.util.Properties properties,
java.util.Set<org.apache.kafka.common.TopicPartition> inputPartitions) |
public static final java.lang.String TIER_PROPERTIES_CONF_FILE_CONFIG
public static final java.lang.String TIER_PROPERTIES_CONF_FILE_DOC
public static final java.lang.String COMPARISON_TOOL_INPUT
public static final java.lang.String COMPARISON_TOOL_INPUT_DOC
public static final java.lang.String COMPARISON_TOOL_OUTPUT
public static final java.lang.String COMPARISON_TOOL_OUTPUT_DOC
public static int getNumPartitions(org.apache.kafka.clients.producer.Producer<byte[],byte[]> producer, java.lang.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(java.util.Properties properties, java.lang.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, java.lang.String tierTopicName, int numTierTopicPartitions) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
producer
- the TierTopic producer objectevent
- the event to be injected into the TierTopictierTopicName
- the name of the TierTopicnumTierTopicPartitions
- the number of TierTopic partitionsjava.lang.InterruptedException
- if there was an error in producing the eventjava.util.concurrent.ExecutionException
- if there was an error in producing the eventpublic static java.util.List<TopicIdPartition> toTopicIdPartitions(java.util.List<java.lang.String> topicIdPartitionsStr)
topicIdPartitionsStr
- the list of formatted TopicIdPartition stringspublic static java.lang.String makeArgument(java.lang.String arg)
public static void validatePartitions(java.util.Properties properties, java.util.Set<org.apache.kafka.common.TopicPartition> inputPartitions) throws java.util.concurrent.CancellationException, java.lang.IllegalArgumentException
java.util.concurrent.CancellationException
java.lang.IllegalArgumentException