OneSizeFitsQuorum commented on code in PR #9439:
URL: https://github.com/apache/iotdb/pull/9439#discussion_r1149079211
##########
server/src/main/java/org/apache/iotdb/db/service/metrics/IoTDBInternalLocalReporter.java:
##########
@@ -150,39 +150,43 @@ public ReporterType getReporterType() {
@Override
protected void writeMetricToIoTDB(Map<String, Object> valueMap, String
prefix, long time) {
- try {
- TSInsertRecordReq request = new TSInsertRecordReq();
- List<String> measurements = new ArrayList<>();
- List<TSDataType> types = new ArrayList<>();
- List<Object> values = new ArrayList<>();
- for (Map.Entry<String, Object> entry : valueMap.entrySet()) {
- String measurement = entry.getKey();
- Object value = entry.getValue();
- measurements.add(measurement);
- types.add(inferType(value));
- values.add(value);
- }
- ByteBuffer buffer = SessionUtils.getValueBuffer(types, values);
+ service.execute(
Review Comment:
> This is just a talk about whether submit a new task inside a thread pool
to itself is a the best practice or not.
Yeah, I don't want to do that either. But if the cost of best practices is
to introduce an extra thread, I'm inclined to start from a thread count
reduction perspective for now (we want to reduce thread count in IoTDB within
the next year).
> shall we add some limitation to it such as change the method name to
something like xxxxxAsync.
Good advice. It's been changed.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]