Skip to content

Commit

Permalink
improve for MetaSynchronizer
Browse files Browse the repository at this point in the history
  • Loading branch information
qifanwang committed Sep 18, 2024
1 parent 6457438 commit 49d6106
Show file tree
Hide file tree
Showing 20 changed files with 384 additions and 1,019 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.springframework.context.annotation.Configuration;

import java.util.*;
import java.util.stream.Collectors;

@Configuration
public class CommonConfigBean extends AbstractConfigBean {
Expand Down Expand Up @@ -68,7 +69,10 @@ public Set<String> getExtraSyncDC() {
}

public boolean disableDb() {
return getExtraSyncDC().contains(FoundationService.DEFAULT.getDataCenter());
return getExtraSyncDC().stream()
.map(String::toUpperCase)
.collect(Collectors.toSet())
.contains(FoundationService.DEFAULT.getDataCenter());
}

public Set<String> getAlertWhileList() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,19 @@ public class DataCenterConfigBean extends AbstractConfigBean {

public static final String KEY_BEACON_ORG_ROUTE = "beacon.org.routes";

public static final String KEY_CONSOLE_NO_DB_DOMAIN = "console.no.db.domain";

private AtomicReference<String> zkConnection = new AtomicReference<>();
private AtomicReference<String> zkNameSpace = new AtomicReference<>();

public DataCenterConfigBean() {
super(ConfigProvider.DEFAULT.getOrCreateConfig(ConfigProvider.DATA_CENTER_CONFIG_NAME));
}

public String getConsoleNoDbDomain() {
return getProperty(KEY_CONSOLE_NO_DB_DOMAIN, "");
}

public String getZkConnectionString() {
return getProperty(KEY_ZK_ADDRESS, zkConnection.get() == null ? "127.0.0.1:2181" : zkConnection.get());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,6 @@ public interface ConsoleConfig extends CoreConfig, CheckerConfig, AlertConfig {

Set<String> getExtraSyncDC();

String getConsoleNoDbDomain();

}
Loading

0 comments on commit 49d6106

Please sign in to comment.