refactor code. (#4120)
This commit is contained in:
parent
25a677b9c7
commit
8476316e96
|
|
@ -20,13 +20,13 @@ package org.apache.skywalking.oap.server.core.query.entity;
|
|||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
*/
|
||||
public class IntValues {
|
||||
@Getter private List<KVInt> values = new LinkedList<>();
|
||||
|
||||
private List<KVInt> values = new LinkedList<>();
|
||||
|
||||
public void addKVInt(KVInt e) {
|
||||
values.add(e);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public class MetricsQueryEsDAO extends EsDAO implements IMetricsQueryDAO {
|
|||
KVInt kvInt = new KVInt();
|
||||
kvInt.setId(idBucket.getKeyAsString());
|
||||
kvInt.setValue(value);
|
||||
intValues.getValues().add(kvInt);
|
||||
intValues.addKVInt(kvInt);
|
||||
}
|
||||
return intValues;
|
||||
}
|
||||
|
|
@ -115,7 +115,7 @@ public class MetricsQueryEsDAO extends EsDAO implements IMetricsQueryDAO {
|
|||
Map<String, Object> source = idMap.get(id);
|
||||
kvInt.setValue(((Number)source.getOrDefault(valueCName, 0)).longValue());
|
||||
}
|
||||
intValues.getValues().add(kvInt);
|
||||
intValues.addKVInt(kvInt);
|
||||
}
|
||||
|
||||
return intValues;
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class MetricsQueryEs7DAO extends MetricsQueryEsDAO {
|
|||
KVInt kvInt = new KVInt();
|
||||
kvInt.setId(idBucket.getKeyAsString());
|
||||
kvInt.setValue(value);
|
||||
intValues.getValues().add(kvInt);
|
||||
intValues.addKVInt(kvInt);
|
||||
}
|
||||
return intValues;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class H2MetricsQueryDAO extends H2SQLExecutor implements IMetricsQueryDAO
|
|||
KVInt kv = new KVInt();
|
||||
kv.setId(resultSet.getString("id"));
|
||||
kv.setValue(resultSet.getLong("value"));
|
||||
intValues.getValues().add(kv);
|
||||
intValues.addKVInt(kv);
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
|
|
@ -119,7 +119,7 @@ public class H2MetricsQueryDAO extends H2SQLExecutor implements IMetricsQueryDAO
|
|||
KVInt kv = new KVInt();
|
||||
kv.setId(resultSet.getString("id"));
|
||||
kv.setValue(resultSet.getLong(valueCName));
|
||||
intValues.getValues().add(kv);
|
||||
intValues.addKVInt(kv);
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue