kezhenxu94 commented on a change in pull request #6066:
URL: https://github.com/apache/skywalking/pull/6066#discussion_r548939299
##########
File path:
oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/TableMetaInfo.java
##########
@@ -54,7 +56,10 @@ public static void addModel(Model model) {
storageAndColumnMap.put(columnName.getStorageName(),
columnName.getName());
});
+ final boolean isTrafficTable;
if (model.getName().endsWith("_traffic")) {
+ isTrafficTable = true;
+
Review comment:
> You added a `Traffic` interface, I thinks this part should be
refactored by leveraging that interface?
>> For now, there is no chance to declare this. Model is not related to
this. From the design perspective, there is no concept called metadata anymore.
Right now, there are several places in influxdb storage option having this
kind of name based mechanism, sadly.
https://github.com/apache/skywalking/blob/2d646ee98142584d6dcc50f8e3bd146b7f4be6ff/oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/base/MetricsDAO.java#L66-L68
If so, this part looks very strange, it casts the `metrics` as `Traffic`
with a condition `isTrafficTable()`, seems to be fragile and error prone
because `isTrafficTable()` has no guarantee that the `metrics` can be casted as
`Traffic`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]