Skip to content

Commit 8f15038

Browse files
committed
Applied jack-berg changes
1 parent 745d874 commit 8f15038

6 files changed

Lines changed: 227 additions & 275 deletions

File tree

api/incubator/src/main/java/io/opentelemetry/api/incubator/config/ConfigProvider.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -87,42 +87,6 @@ default ConfigChangeRegistration addConfigChangeListener(
8787
return () -> {};
8888
}
8989

90-
/**
91-
* Updates the declarative configuration subtree at the given path.
92-
*
93-
* <p>The path uses {@code .} as a separator (e.g., {@code
94-
* ".instrumentation/development.java.myLib"}). The subtree at that path is replaced with {@code
95-
* newSubtree}, and any registered {@link ConfigChangeListener}s watching affected paths are
96-
* notified.
97-
*
98-
* <p>The default implementation is a no-op.
99-
*
100-
* @param path the declarative configuration path to update
101-
* @param newSubtree the new configuration subtree to set at the path
102-
* @throws DeclarativeConfigException if an intermediate segment of the path resolves to a
103-
* non-mapping value (e.g., a scalar or list), indicating a schema conflict
104-
*/
105-
default void updateConfig(String path, DeclarativeConfigProperties newSubtree) {}
106-
107-
/**
108-
* Sets a single scalar configuration property at the given path.
109-
*
110-
* <p>The path uses {@code .} as a separator (e.g., {@code
111-
* ".instrumentation/development.java.myLib"}). The property identified by {@code key} within that
112-
* path is set to {@code value}, and any registered {@link ConfigChangeListener}s watching
113-
* affected paths are notified.
114-
*
115-
* <p>The default implementation is a no-op.
116-
*
117-
* @param path the declarative configuration path containing the property
118-
* @param key the property key within the path
119-
* @param value the new value for the property (must be a scalar: String, Boolean, Long, Double,
120-
* Integer, or a List of scalars)
121-
* @throws DeclarativeConfigException if an intermediate segment of the path resolves to a
122-
* non-mapping value (e.g., a scalar or list), indicating a schema conflict
123-
*/
124-
default void setConfigProperty(String path, String key, Object value) {}
125-
12690
/** Returns a no-op {@link ConfigProvider}. */
12791
static ConfigProvider noop() {
12892
return DeclarativeConfigProperties::empty;

api/incubator/src/test/java/io/opentelemetry/api/incubator/ConfigProviderTest.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import io.opentelemetry.api.incubator.config.ConfigChangeRegistration;
1212
import io.opentelemetry.api.incubator.config.ConfigProvider;
13-
import io.opentelemetry.api.incubator.config.DeclarativeConfigProperties;
1413
import org.junit.jupiter.api.Test;
1514

1615
class ConfigProviderTest {
@@ -32,18 +31,4 @@ void instrumentationConfigFallback() {
3231
".instrumentation/development.java.servlet", (path, newConfig) -> {});
3332
assertThatCode(listenerRegistration::close).doesNotThrowAnyException();
3433
}
35-
36-
@Test
37-
void defaultUpdateConfig_isNoop() {
38-
ConfigProvider configProvider = ConfigProvider.noop();
39-
assertThatCode(() -> configProvider.updateConfig(".foo", DeclarativeConfigProperties.empty()))
40-
.doesNotThrowAnyException();
41-
}
42-
43-
@Test
44-
void defaultSetConfigProperty_isNoop() {
45-
ConfigProvider configProvider = ConfigProvider.noop();
46-
assertThatCode(() -> configProvider.setConfigProperty(".foo", "key", "value"))
47-
.doesNotThrowAnyException();
48-
}
4934
}

api/incubator/src/test/java/io/opentelemetry/api/incubator/ExtendedOpenTelemetryTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ void close_shutsDownConfigProvider() {
133133

134134
sdk.close();
135135

136-
configProvider.setConfigProperty(
137-
".instrumentation/development.general.http", "enabled", "true");
136+
configProvider.setConfig(".instrumentation/development.general.http.enabled", "true");
138137
assertThat(callbackCount.get()).isEqualTo(0);
139138
}
140139

0 commit comments

Comments
 (0)