Skip to content

Commit

Permalink
Simplify metadatas
Browse files Browse the repository at this point in the history
  • Loading branch information
HaojunRen committed Sep 30, 2022
1 parent 848677c commit d20dfdb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected Object afterInitialization(ConfigurableApplicationContext applicationC
List<String> metadata = consulDiscoveryProperties.getTags();

String groupKey = PluginContextAware.getGroupKey(environment);
if (!MetadataUtil.containsKey(metadata, groupKey)) {
/*if (!MetadataUtil.containsKey(metadata, groupKey)) {
metadata.add(groupKey + "=" + DiscoveryConstant.DEFAULT);
}
if (!MetadataUtil.containsKey(metadata, DiscoveryConstant.VERSION)) {
Expand All @@ -61,7 +61,7 @@ protected Object afterInitialization(ConfigurableApplicationContext applicationC
}
if (!MetadataUtil.containsKey(metadata, DiscoveryConstant.ACTIVE)) {
metadata.add(DiscoveryConstant.ACTIVE + "=" + "false");
}
}*/
String prefixGroup = getPrefixGroup(applicationContext);
if (StringUtils.isNotEmpty(prefixGroup)) {
metadata.set(MetadataUtil.getIndex(metadata, groupKey), groupKey + "=" + prefixGroup);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected Object afterInitialization(ConfigurableApplicationContext applicationC
Map<String, String> metadata = eurekaInstanceConfig.getMetadataMap();

String groupKey = PluginContextAware.getGroupKey(environment);
if (!metadata.containsKey(groupKey)) {
/*if (!metadata.containsKey(groupKey)) {
metadata.put(groupKey, DiscoveryConstant.DEFAULT);
}
if (!metadata.containsKey(DiscoveryConstant.VERSION)) {
Expand All @@ -61,7 +61,7 @@ protected Object afterInitialization(ConfigurableApplicationContext applicationC
}
if (!metadata.containsKey(DiscoveryConstant.ACTIVE)) {
metadata.put(DiscoveryConstant.ACTIVE, "false");
}
}*/
String prefixGroup = getPrefixGroup(applicationContext);
if (StringUtils.isNotEmpty(prefixGroup)) {
metadata.put(groupKey, prefixGroup);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected Object afterInitialization(ConfigurableApplicationContext applicationC
Map<String, String> metadata = nacosDiscoveryProperties.getMetadata();

String groupKey = PluginContextAware.getGroupKey(environment);
if (!metadata.containsKey(groupKey)) {
/*if (!metadata.containsKey(groupKey)) {
metadata.put(groupKey, DiscoveryConstant.DEFAULT);
}
if (!metadata.containsKey(DiscoveryConstant.VERSION)) {
Expand All @@ -62,7 +62,7 @@ protected Object afterInitialization(ConfigurableApplicationContext applicationC
}
if (!metadata.containsKey(DiscoveryConstant.ACTIVE)) {
metadata.put(DiscoveryConstant.ACTIVE, "false");
}
}*/
String prefixGroup = getPrefixGroup(applicationContext);
if (StringUtils.isNotEmpty(prefixGroup)) {
metadata.put(groupKey, prefixGroup);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected Object afterInitialization(ConfigurableApplicationContext applicationC
Map<String, String> metadata = zookeeperDiscoveryProperties.getMetadata();

String groupKey = PluginContextAware.getGroupKey(environment);
if (!metadata.containsKey(groupKey)) {
/*if (!metadata.containsKey(groupKey)) {
metadata.put(groupKey, DiscoveryConstant.DEFAULT);
}
if (!metadata.containsKey(DiscoveryConstant.VERSION)) {
Expand All @@ -61,7 +61,7 @@ protected Object afterInitialization(ConfigurableApplicationContext applicationC
}
if (!metadata.containsKey(DiscoveryConstant.ACTIVE)) {
metadata.put(DiscoveryConstant.ACTIVE, "false");
}
}*/
String prefixGroup = getPrefixGroup(applicationContext);
if (StringUtils.isNotEmpty(prefixGroup)) {
metadata.put(groupKey, prefixGroup);
Expand Down

0 comments on commit d20dfdb

Please sign in to comment.