Skip to content

Commit

Permalink
Update MeterSystem.java (#7019)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsolr committed May 26, 2021
1 parent 7ae2b74 commit 03294b8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class MeterSystem implements Service {
private static final String METER_CLASS_PACKAGE = "org.apache.skywalking.oap.server.core.analysis.meter.dynamic.";
private ModuleManager manager;
private ClassPool classPool;
private Map<String, Class<? extends MeterFunction>> functionRegister = new HashMap<>();
private Map<String, Class<? extends AcceptableValue>> functionRegister = new HashMap<>();
/**
* Host the dynamic meter prototype classes. These classes could be create dynamically through {@link
* Object#clone()} in the runtime;
Expand Down Expand Up @@ -87,7 +87,7 @@ public MeterSystem(final ModuleManager manager) {
}
functionRegister.put(
metricsFunction.functionName(),
(Class<? extends MeterFunction>) functionClass
(Class<? extends AcceptableValue>) functionClass
);
}
}
Expand All @@ -105,7 +105,7 @@ public MeterSystem(final ModuleManager manager) {
public synchronized <T> void create(String metricsName,
String functionName,
ScopeType type) throws IllegalArgumentException {
final Class<? extends MeterFunction> meterFunction = functionRegister.get(functionName);
final Class<? extends AcceptableValue> meterFunction = functionRegister.get(functionName);

if (meterFunction == null) {
throw new IllegalArgumentException("Function " + functionName + " can't be found.");
Expand Down Expand Up @@ -144,7 +144,7 @@ public synchronized <T> void create(String metricsName,
/**
* Create a new meter class dynamically.
*/
final Class<? extends MeterFunction> meterFunction = functionRegister.get(functionName);
final Class<? extends AcceptableValue> meterFunction = functionRegister.get(functionName);

if (meterFunction == null) {
throw new IllegalArgumentException("Function " + functionName + " can't be found.");
Expand Down

0 comments on commit 03294b8

Please sign in to comment.