Search in sources :

Example 16 with SinkConfiguration

use of org.apache.flink.connector.pulsar.sink.config.SinkConfiguration in project flink by apache.

the class TopicMetadataListenerTest method sinkConfiguration.

private SinkConfiguration sinkConfiguration(long interval) {
    Configuration configuration = operator().config();
    configuration.set(PULSAR_TOPIC_METADATA_REFRESH_INTERVAL, interval);
    return new SinkConfiguration(configuration);
}
Also used : SinkConfiguration(org.apache.flink.connector.pulsar.sink.config.SinkConfiguration) Configuration(org.apache.flink.configuration.Configuration) SinkConfiguration(org.apache.flink.connector.pulsar.sink.config.SinkConfiguration)

Example 17 with SinkConfiguration

use of org.apache.flink.connector.pulsar.sink.config.SinkConfiguration in project flink by apache.

the class TopicMetadataListenerTest method listenEmptyTopics.

@Test
void listenEmptyTopics() {
    TopicMetadataListener listener = new TopicMetadataListener();
    SinkConfiguration configuration = sinkConfiguration(Duration.ofMinutes(5).toMillis());
    TestProcessingTimeService timeService = new TestProcessingTimeService();
    List<String> topics = listener.availableTopics();
    assertThat(topics).isEmpty();
    listener.open(configuration, timeService);
    topics = listener.availableTopics();
    assertThat(topics).isEmpty();
}
Also used : SinkConfiguration(org.apache.flink.connector.pulsar.sink.config.SinkConfiguration) TestProcessingTimeService(org.apache.flink.streaming.runtime.tasks.TestProcessingTimeService) Test(org.junit.jupiter.api.Test)

Aggregations

SinkConfiguration (org.apache.flink.connector.pulsar.sink.config.SinkConfiguration)17 Test (org.junit.jupiter.api.Test)6 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)6 EnumSource (org.junit.jupiter.params.provider.EnumSource)6 PulsarSinkContext (org.apache.flink.connector.pulsar.sink.writer.context.PulsarSinkContext)5 Configuration (org.apache.flink.configuration.Configuration)4 TestProcessingTimeService (org.apache.flink.streaming.runtime.tasks.TestProcessingTimeService)4 PulsarCommittable (org.apache.flink.connector.pulsar.sink.committer.PulsarCommittable)3 TopicMetadataListener (org.apache.flink.connector.pulsar.sink.writer.topic.TopicMetadataListener)2 TransactionCoordinatorClient (org.apache.pulsar.client.api.transaction.TransactionCoordinatorClient)2 DeliveryGuarantee (org.apache.flink.connector.base.DeliveryGuarantee)1 RoundRobinTopicRouter (org.apache.flink.connector.pulsar.sink.writer.router.RoundRobinTopicRouter)1 PulsarSchemaWrapper (org.apache.flink.connector.pulsar.sink.writer.serializer.PulsarSchemaWrapper)1 TxnID (org.apache.pulsar.client.api.transaction.TxnID)1 Hash (org.apache.pulsar.client.impl.Hash)1