use of org.apache.hudi.connect.transaction.ConnectTransactionParticipant in project hudi by apache.
the class HoodieSinkTask method bootstrap.
private void bootstrap(Collection<TopicPartition> partitions) {
LOG.info(String.format("Bootstrap task for connector %s with id %s with assignments %s part %s", connectorName, taskId, context.assignment(), partitions));
for (TopicPartition partition : partitions) {
try {
// If the partition is 0, instantiate the Leader
if (partition.partition() == ConnectTransactionCoordinator.COORDINATOR_KAFKA_PARTITION) {
ConnectTransactionCoordinator coordinator = new ConnectTransactionCoordinator(connectConfigs, partition, controlKafkaClient);
coordinator.start();
transactionCoordinators.put(partition, coordinator);
}
ConnectTransactionParticipant worker = new ConnectTransactionParticipant(connectConfigs, partition, controlKafkaClient, context);
transactionParticipants.put(partition, worker);
worker.start();
} catch (HoodieException exception) {
LOG.error(String.format("Fatal error initializing task %s for partition %s", taskId, partition.partition()), exception);
}
}
}
use of org.apache.hudi.connect.transaction.ConnectTransactionParticipant in project hudi by apache.
the class TestConnectTransactionParticipant method initializeParticipant.
private void initializeParticipant() {
testHudiWriterProvider = new TestHudiWriterProvider();
participant = new ConnectTransactionParticipant(partition, kafkaControlAgent, mockKafkaConnect, testHudiWriterProvider);
mockKafkaConnect.setParticipant(participant);
participant.start();
}
Aggregations