Lemarais commented on a change in pull request #317:
URL: https://github.com/apache/incubator-nemo/pull/317#discussion_r705903886
##########
File path:
runtime/executor/src/main/java/org/apache/nemo/runtime/executor/task/TaskExecutor.java
##########
@@ -123,9 +140,63 @@ public TaskExecutor(final Task task,
this.dataFetchers = pair.left();
this.sortedHarnesses = pair.right();
+ // initialize metrics
+ this.numOfReadTupleMap = new HashMap<>();
+ this.lastSerializedReadByteMap = new HashMap<>();
+ for (DataFetcher dataFetcher : dataFetchers) {
+ this.numOfReadTupleMap.put(dataFetcher.getDataSource().getId(), new
AtomicLong());
+ this.lastSerializedReadByteMap.put(dataFetcher.getDataSource().getId(),
0L);
+ }
+
+ // set the interval for recording stream metric
+ if (streamMetricRecordPeriod > 0) {
+ this.timeSinceLastRecordStreamMetric = System.currentTimeMillis();
+ this.periodicMetricService = Executors.newScheduledThreadPool(1);
+ this.periodicMetricService.scheduleAtFixedRate(
+ this::saveStreamMetric, 0, streamMetricRecordPeriod,
TimeUnit.MILLISECONDS);
+ }
this.timeSinceLastExecution = System.currentTimeMillis();
}
+ // Send stream metric to the runtime master
+ private void saveStreamMetric() {
Review comment:
method is called only
[here](https://github.com/apache/incubator-nemo/pull/314/files) and It is
called at separated thread. I'll add a comment about this context.
But anyway It is too inefficient that creating an additional thread for
every task. However If I want to separate this, I have to store the created
taskExecutors in Executor, And It is implemented [not merged
PR](https://github.com/apache/incubator-nemo/pull/314/files). Is It okay to
implement same Map in this PR?
--
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]