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 |
FENCE_RESULT_JSON_FILE |
static String |
FENCE_RESULT_JSON_FILE_DOC |
static String |
FENCE_TARGET_PARTITIONS_CONFIG_FILE_FORMAT |
static String |
RESTORE_TIER_STATE_ROOT_DIR |
static String |
RESTORE_TIER_STATE_ROOT_DIR_DOC |
static String |
TIER_PROPERTIES_CONFIG_FILE |
static String |
TIER_PROPERTIES_CONFIG_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 void |
injectTierTopicEventsUntilOffset(org.apache.kafka.clients.producer.Producer<byte[],byte[]> producer,
TopicIdPartition partition,
String tierTopicName,
int numTierTopicPartitions,
long offsetToStop,
boolean freezeLogStartOffset) |
static String |
makeArgument(String arg) |
static Map<TopicIdPartition,Boolean> |
parseFencingInformation(List<String> allPartitionsFencingInfo)
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_CONFIG_FILE
public static final String TIER_PROPERTIES_CONFIG_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 final String FENCE_TARGET_PARTITIONS_CONFIG_FILE_FORMAT
public static final String FENCE_RESULT_JSON_FILE
public static final String FENCE_RESULT_JSON_FILE_DOC
public static final String RESTORE_TIER_STATE_ROOT_DIR
public static final String RESTORE_TIER_STATE_ROOT_DIR_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 void injectTierTopicEventsUntilOffset(org.apache.kafka.clients.producer.Producer<byte[],byte[]> producer, TopicIdPartition partition, String tierTopicName, int numTierTopicPartitions, long offsetToStop, boolean freezeLogStartOffset) throws InterruptedException, ExecutionException
public static Map<TopicIdPartition,Boolean> parseFencingInformation(List<String> allPartitionsFencingInfo)
allPartitionsFencingInfo
- the list of formatted TopicIdPartition stringspublic static void validatePartitions(Properties properties, Set<org.apache.kafka.common.TopicPartition> inputPartitions) throws CancellationException, IllegalArgumentException