Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

emit Pulsar source and sink configuration property values to logs #335 #351

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

import org.apache.flink.shaded.guava18.com.google.common.collect.Maps;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
gaozhangmin marked this conversation as resolved.
Show resolved Hide resolved
import lombok.extern.slf4j.Slf4j;
import org.apache.pulsar.client.admin.PulsarAdmin;
import org.apache.pulsar.client.api.MessageId;
Expand Down Expand Up @@ -271,6 +273,15 @@ public void open(Configuration parameters) throws Exception {
topic2Producer = new HashMap<>();
}
//super.open(parameters);
if (log.isDebugEnabled()) {
try {
ObjectMapper m = new ObjectMapper();
ObjectWriter w = m.writerWithDefaultPrettyPrinter();
log.debug("Pulsar sink config: {}", w.writeValueAsString(properties));
} catch (IOException e) {
log.error("Failed to dump sink config info", e);
}
}
}

protected void initializeSendCallback() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,16 @@

import org.apache.flink.shaded.guava18.com.google.common.collect.Sets;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
gaozhangmin marked this conversation as resolved.
Show resolved Hide resolved
import lombok.extern.slf4j.Slf4j;
import org.apache.pulsar.client.api.MessageId;
import org.apache.pulsar.client.api.PulsarClientException;
import org.apache.pulsar.client.impl.conf.ClientConfigurationData;
import org.apache.pulsar.shade.com.google.common.collect.Maps;
import org.apache.pulsar.shade.org.apache.commons.lang3.StringUtils;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
Expand Down Expand Up @@ -501,6 +504,16 @@ public void open(Configuration parameters) throws Exception {
taskIndex, ownedTopicStarts.size(), ownedTopicStarts);
}
}

if (log.isDebugEnabled()) {
try {
ObjectMapper m = new ObjectMapper();
ObjectWriter w = m.writerWithDefaultPrettyPrinter();
log.debug("Pulsar source config: {}", w.writeValueAsString(properties));
} catch (IOException e) {
log.error("Failed to dump source config info", e);
}
}
}

protected String getSubscriptionName() {
Expand Down