Ejemplo n.º 1
0
        public DriverInformation GetDriverInformation()
        {
            if (string.IsNullOrWhiteSpace(_applicationId))
            {
                throw new ApplicationException("Could not fetch the application ID from YARN's container environment variables.");
            }

            var yarnRMWebAppEndpoints = _yarnConfiguration.GetYarnRMWebappEndpoints();

            foreach (var yarnRMWebAppEndpoint in yarnRMWebAppEndpoints)
            {
                try
                {
                    var queryUri = new Uri(
                        yarnRMWebAppEndpoint,
                        "proxy/" + _applicationId + "/" + Constants.HttpReefUriSpecification + Constants.HttpDriverUriTarget);
                    return(DriverInformation.GetDriverInformationFromHttp(queryUri));
                }
                catch (Exception ex)
                {
                    Utilities.Diagnostics.Exceptions.Caught(
                        ex,
                        Level.Info,
                        "Unable to reach RM at " + yarnRMWebAppEndpoint,
                        Logger);
                }
            }

            throw new ApplicationException("Unable to get Driver Information.");
        }
Ejemplo n.º 2
0
        public DriverInformation GetDriverInformation()
        {
            // e.g., http://headnodehost:9014/proxy/application_1407519727821_0012/reef/v1/driver
            Uri queryUri = new Uri(
                string.Concat(
                    Constants.HDInsightClusterHttpEndpointBaseUri,
                    _applicationId + "/",
                    Constants.HttpReefUriSpecification,
                    Constants.HttpDriverUriTarget));

            return(DriverInformation.GetDriverInformationFromHttp(queryUri));
        }
        public DriverInformation GetDriverInformation()
        {
            // e.g., http://yingdac1:8088/proxy/application_1407519727821_0012/reef/v1/driver
            string oneBoxHost = string.Format(CultureInfo.InvariantCulture, "http://{0}:8088/proxy/", Environment.MachineName);
            Uri    queryUri   = new Uri(
                string.Concat(
                    oneBoxHost,
                    _applicationId + '/',
                    Constants.HttpReefUriSpecification,
                    Constants.HttpDriverUriTarget));

            return(DriverInformation.GetDriverInformationFromHttp(queryUri));
        }
Ejemplo n.º 4
0
        public DriverInformation GetDriverInformation()
        {
            if (string.IsNullOrWhiteSpace(_applicationId))
            {
                throw new ApplicationException("Could not fetch the application ID from YARN's container environment variables.");
            }

            // e.g., http://headnodehost:9014/proxy/application_1407519727821_0012/reef/v1/driver
            Uri queryUri = new Uri(
                string.Concat(
                    Constants.HDInsightClusterHttpEndpointBaseUri,
                    _applicationId + "/",
                    Constants.HttpReefUriSpecification,
                    Constants.HttpDriverUriTarget));

            return(DriverInformation.GetDriverInformationFromHttp(queryUri));
        }
        public DriverInformation GetDriverInformation()
        {
            if (string.IsNullOrWhiteSpace(_applicationId))
            {
                throw new ApplicationException("Could not fetch the application ID from YARN's container environment variables.");
            }

            // e.g., http://yingdac1:8088/proxy/application_1407519727821_0012/reef/v1/driver
            string oneBoxHost = string.Format(CultureInfo.InvariantCulture, "http://{0}:8088/proxy/", Environment.MachineName);
            Uri    queryUri   = new Uri(
                string.Concat(
                    oneBoxHost,
                    _applicationId + '/',
                    Constants.HttpReefUriSpecification,
                    Constants.HttpDriverUriTarget));

            return(DriverInformation.GetDriverInformationFromHttp(queryUri));
        }
Ejemplo n.º 6
0
        private void Recover(DriverInformation driverInformation)
        {
            IPEndPoint driverEndpoint = NetUtilities.ParseIpEndpoint(driverInformation.DriverRemoteIdentifier);
            _remoteId = new SocketRemoteIdentifier(driverEndpoint);
            _observer = _remoteManager.GetRemoteObserver(new RemoteEventEndPoint<REEFMessage>(_remoteId));
            lock (_evaluatorSettings)
            {
                if (_evaluatorSettings.NameClient != null)
                {
                    try
                    {
                        LOGGER.Log(Level.Verbose, "Trying to reset and reconnect to name server" + driverInformation.NameServerId);
                        _evaluatorSettings.NameClient.Restart(NetUtilities.ParseIpEndpoint(driverInformation.NameServerId));
                        LOGGER.Log(Level.Info, "Reconnected to name server: " + driverInformation.NameServerId);
                    }
                    catch (Exception e)
                    {
                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.Caught(e, Level.Error, LOGGER);
                    }
                }
            }

            lock (_queuedHeartbeats)
            {
                bool firstHeartbeatInQueue = true;
                while (_queuedHeartbeats.Any())
                {
                    LOGGER.Log(Level.Info, "Sending cached recovery heartbeats to " + _remoteId);
                    try
                    {
                        if (firstHeartbeatInQueue)
                        {
                            // first heartbeat is specially construted to include the recovery flag
                            EvaluatorHeartbeatProto recoveryHeartbeat = ConstructRecoveryHeartBeat(_queuedHeartbeats.Dequeue());
                            LOGGER.Log(Level.Info, "Recovery heartbeat to be sent:" + recoveryHeartbeat);
                            _observer.OnNext(new REEFMessage(recoveryHeartbeat));
                            firstHeartbeatInQueue = false;
                        }
                        else
                        {
                            _observer.OnNext(new REEFMessage(_queuedHeartbeats.Dequeue()));
                        }
                    }
                    catch (Exception e)
                    {
                        // we do not handle failures during RECOVERY 
                        Org.Apache.REEF.Utilities.Diagnostics.Exceptions.CaughtAndThrow(
                            e,
                            Level.Error,
                            string.Format(CultureInfo.InvariantCulture, "Hearbeat attempt failed in RECOVERY mode to Driver {0} , giving up...", _remoteId),
                            LOGGER);
                    }
                    Thread.Sleep(500);
                }
            }

            _evaluatorSettings.OperationState = EvaluatorOperationState.OPERATIONAL;
            ContextManager.HandleDriverConnectionMessage(new DriverConnectionMessageImpl(DriverConnectionState.Reconnected));

            LOGGER.Log(Level.Info, "=========== Exiting RECOVERY mode. ===========");
        }
Ejemplo n.º 7
0
 public DriverInformation GetDriverInformation()
 {
     // application id not needed for local runtime
     return(DriverInformation.GetDriverInformationFromHttp(_queryUri));
 }