luchunliang commented on code in PR #6739:
URL: https://github.com/apache/inlong/pull/6739#discussion_r1041674690
##########
inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/sink/mq/pulsar/PulsarHandler.java:
##########
@@ -243,11 +248,15 @@ public boolean send(BatchPackProfile event) {
/**
* getProducerTopic
*/
- private String getProducerTopic(String baseTopic) {
+ private String getProducerTopic(String baseTopic, IdTopicConfig config) {
StringBuilder builder = new StringBuilder();
if (tenant != null) {
builder.append(tenant).append("/");
}
+ String namespace = this.namespace;
+ if (namespace == null) {
+ namespace = config.getParams().get(PulsarHandler.KEY_NAMESPACE);
+ }
Review Comment:
It is same with line 104, redundant code.
this.namespace = config.getParams().get(KEY_NAMESPACE);
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/repository/DataProxyConfigRepository.java:
##########
@@ -245,7 +246,7 @@ private void reloadCacheCluster(Map<String,
DataProxyCluster> proxyClusterMap) {
Map<String, Map<String, List<CacheCluster>>> cacheClusterMap = new
HashMap<>();
for (CacheCluster cacheCluster :
clusterSetMapper.selectCacheCluster()) {
if (StringUtils.isEmpty(cacheCluster.getExtTag())) {
- continue;
+ cacheCluster.setExtTag(DEFAULT_EXT_TAG);
Review Comment:
Which DataProxy do the cache cluster of default tag prepare for?
A new cache cluster add to InLong, it need to synchronize Topic at first
before it service for DataProxy, otherwise DataProxy will be fail to send data
for missing topic.
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/repository/DataProxyConfigRepository.java:
##########
@@ -262,9 +263,13 @@ private void reloadCacheCluster(Map<String,
DataProxyCluster> proxyClusterMap) {
// cache
String clusterTag = proxyObj.getSetName();
String extTag = proxyObj.getZone();
+ if (StringUtils.isEmpty(extTag)) {
+ extTag = DEFAULT_EXT_TAG;
+ }
Map<String, List<CacheCluster>> cacheClusterZoneMap =
cacheClusterMap.get(clusterTag);
if (cacheClusterZoneMap != null) {
- Map<String, String> subTagMap =
tagCache.computeIfAbsent(extTag, k -> MAP_SPLITTER.split(extTag));
+ String finalExtTag = extTag;
Review Comment:
Redundant code
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]