Example #1
0
        /// <summary>
        /// Start the context manager. This initiates the root context.
        /// </summary>
        public void Start()
        {
            lock (_contextLock)
            {
                _topContext = _rootContextLauncher.GetRootContext();
                LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Instantiating root context with Id {0}", _topContext.Id));

                if (_rootContextLauncher.RootTaskConfig.IsPresent())
                {
                    LOGGER.Log(Level.Info, "Launching the initial Task");
                    try
                    {
                        _topContext.StartTask(_rootContextLauncher.RootTaskConfig.Value);
                    }
                    catch (TaskClientCodeException e)
                    {
                        Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, "Exception when trying to start a task.", LOGGER);
                        HandleTaskException(e);
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        /// Start the context manager. This initiates the root context.
        /// </summary>
        public void Start()
        {
            lock (_contextStack)
            {
                ContextRuntime rootContext = _rootContextLauncher.GetRootContext();
                LOGGER.Log(Level.Info, string.Format(CultureInfo.InvariantCulture, "Instantiating root context with Id {0}", rootContext.Id));
                _contextStack.Push(rootContext);

                if (_rootContextLauncher.RootTaskConfig.IsPresent())
                {
                    LOGGER.Log(Level.Info, "Launching the initial Task");
                    try
                    {
                        _contextStack.Peek().StartTask(_rootContextLauncher.RootTaskConfig.Value, _rootContextLauncher.RootContextConfig.Id, _heartBeatManager);
                    }
                    catch (TaskClientCodeException e)
                    {
                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, "Exception when trying to start a task.", LOGGER);
                        HandleTaskException(e);
                    }
                }
            }
        }