Class RuntimeMaster

  • public final class RuntimeMaster
    extends Object
    (WARNING) Use runtimeMasterThread for all public methods to avoid race conditions. See comments in the Scheduler for avoiding race conditions.

    Runtime Master is the central controller of Runtime. Compiler submits an PhysicalPlan to Runtime Master to execute a job. Runtime Master handles: a) Scheduling the plan with Scheduler. b) Managing resources with ContainerManager. c) Managing blocks with BlockManagerMaster. d) Receiving and sending control messages with MessageEnvironment. e) Metric using MetricMessageHandler.

    • Method Detail

      • recordIRDAGMetrics

        public void recordIRDAGMetrics​(IRDAG irdag,
                                       String planId)
        Record IR DAG related metrics.
        irdag - the IR DAG to record.
        planId - the ID of the IR DAG Physical Plan.
      • flushMetrics

        public void flushMetrics()
        Flush metrics.
      • terminate

        public void terminate()
        Terminates the RuntimeMaster.
      • requestContainer

        public void requestContainer​(String resourceSpecificationString)
        Requests a container with resource specification.
        resourceSpecificationString - the resource specification.
      • onContainerAllocated

        public void onContainerAllocated​(String executorId,
                                         org.apache.reef.driver.evaluator.AllocatedEvaluator allocatedEvaluator,
                                         org.apache.reef.tang.Configuration executorConfiguration)
        Called when a container is allocated for this runtime. A wrapper function for ContainerManager.
        executorId - to use for the executor to be launched on this container.
        allocatedEvaluator - to be used as the container.
        executorConfiguration - to use for the executor to be launched on this container.
      • onExecutorLaunched

        public boolean onExecutorLaunched​(org.apache.reef.driver.context.ActiveContext activeContext)
        Called when an executor is launched on a container for this runtime.
        activeContext - of the launched executor.
        true if all requested executors have been launched, false otherwise.
      • onExecutorFailed

        public void onExecutorFailed​(org.apache.reef.driver.evaluator.FailedEvaluator failedEvaluator)
        Called when an executor fails due to container failure on this runtime.
        failedEvaluator - that failed.