Skip to content

Commit

Permalink
tolerate
Browse files Browse the repository at this point in the history
  • Loading branch information
turboFei committed Sep 13, 2024
1 parent 5f02f3e commit 50475ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -80,9 +81,10 @@ public synchronized void refreshCache() throws IOException {
}

private Map<String, String> getConfigs(Map<String, Object> configMap) {
return ((Map<String, Object>) configMap.get(CONF_CONFIG))
.entrySet().stream()
.collect(Collectors.toMap(Map.Entry::getKey, config -> config.getValue().toString()));
Map<String, Object> configs = (Map<String, Object>) configMap.get(CONF_CONFIG);
if (configs == null) return Collections.emptyMap();
return configs.entrySet().stream()
.collect(Collectors.toMap(Map.Entry::getKey, config -> config.getValue().toString()));
}

private File getConfigFile(Map<String, String> env) throws IOException {
Expand Down
6 changes: 6 additions & 0 deletions service/src/test/resources/dynamicConfig_2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@
config:
celeborn.test.int.only: 100

- tenantId: tenant_id
level: TENANT
config:
users:
- name: Jerry
config:

0 comments on commit 50475ca

Please sign in to comment.