Skip to content

Commit f999b4d

Browse files
committed
nits/cleanup
1 parent e8701e4 commit f999b4d

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

internal-api/src/main/java/datadog/trace/api/ConfigCollector.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public Map<String, Map<ConfigOrigin, ConfigSetting>> collect() {
4949
}
5050
}
5151

52+
/**
53+
* Returns the {@link ConfigSetting} with the highest precedence for the given key, or {@code
54+
* null} if no setting exists for that key.
55+
*/
5256
public ConfigSetting getAppliedConfigSetting(String key) {
5357
Map<ConfigOrigin, ConfigSetting> originMap = collected.get(key);
5458
if (originMap == null || originMap.isEmpty()) {

telemetry/src/main/java/datadog/telemetry/TelemetryService.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ public static TelemetryService build(
8585
this.debug = debug;
8686
}
8787

88-
// Old method for backward compatibility
8988
public boolean addConfiguration(Map<String, ConfigSetting> configuration) {
9089
for (ConfigSetting cs : configuration.values()) {
9190
extendedHeartbeatData.pushConfigSetting(cs);
@@ -96,7 +95,14 @@ public boolean addConfiguration(Map<String, ConfigSetting> configuration) {
9695
return true;
9796
}
9897

99-
// New method for the new collector structure
98+
/**
99+
* Adds all configuration settings from the provided map, grouped by their origin.
100+
*
101+
* @param configuration a map of configuration keys to a map of origins and their corresponding
102+
* settings
103+
* @return {@code true} if all settings were successfully added, {@code false} if the queue is
104+
* full
105+
*/
100106
public boolean addConfigurationByOrigin(
101107
Map<String, Map<ConfigOrigin, ConfigSetting>> configuration) {
102108
for (Map<ConfigOrigin, ConfigSetting> settings : configuration.values()) {

0 commit comments

Comments
 (0)