Update MeterSystem.java (#7019)

This commit is contained in:
Daming 2021-05-26 21:39:58 +08:00 committed by GitHub
parent 7ae2b74a64
commit 03294b81ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -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;
@ -87,7 +87,7 @@ public class MeterSystem implements Service {
}
functionRegister.put(
metricsFunction.functionName(),
(Class<? extends MeterFunction>) functionClass
(Class<? extends AcceptableValue>) functionClass
);
}
}
@ -105,7 +105,7 @@ public class MeterSystem implements Service {
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.");
@ -144,7 +144,7 @@ public class MeterSystem implements Service {
/**
* 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.");