Class SimulatedTaskExecutor


  • public final class SimulatedTaskExecutor
    extends java.lang.Object
    Class for simulated task execution.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Long getElapsedTime()  
      void onTaskReceived​(Task task)
      Handle the task and record metrics, as a real Executor#onTaskReceived would.
      void sendMetric​(java.lang.String metricType, java.lang.String metricId, java.lang.String metricField, byte[] metricValue)
      Send the metric to the scheduler, as an executor would.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • onTaskReceived

        public void onTaskReceived​(Task task)
        Handle the task and record metrics, as a real Executor#onTaskReceived would.
        Parameters:
        task - the task to execute.
      • getElapsedTime

        public java.lang.Long getElapsedTime()
        Returns:
        the elapsed time for the executor.
      • sendMetric

        public void sendMetric​(java.lang.String metricType,
                               java.lang.String metricId,
                               java.lang.String metricField,
                               byte[] metricValue)
        Send the metric to the scheduler, as an executor would. See where it is used in MetricMessageSender#send.
        Parameters:
        metricType - type of metric.
        metricId - id of metric.
        metricField - field of metric.
        metricValue - value of metric.