/// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/> /// <exception cref="System.IO.IOException"/> public override YarnClusterMetrics GetYarnClusterMetrics() { GetClusterMetricsRequest request = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord < GetClusterMetricsRequest>(); GetClusterMetricsResponse response = rmClient.GetClusterMetrics(request); return(response.GetClusterMetrics()); }
/// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/> public override GetClusterMetricsResponse GetClusterMetrics(GetClusterMetricsRequest request) { this._enclosing.ResetStartFailoverFlag(true); // make sure failover has been triggered NUnit.Framework.Assert.IsTrue(this._enclosing.WaittingForFailOver()); // create GetClusterMetricsResponse with fake YarnClusterMetrics GetClusterMetricsResponse response = GetClusterMetricsResponse.NewInstance(this._enclosing .CreateFakeYarnClusterMetrics()); return(response); }
/// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/> /// <exception cref="System.IO.IOException"/> public virtual GetClusterMetricsResponse GetClusterMetrics(GetClusterMetricsRequest request) { YarnServiceProtos.GetClusterMetricsRequestProto requestProto = ((GetClusterMetricsRequestPBImpl )request).GetProto(); try { return(new GetClusterMetricsResponsePBImpl(proxy.GetClusterMetrics(null, requestProto ))); } catch (ServiceException e) { RPCUtil.UnwrapAndThrowException(e); return(null); } }
/// <summary>Wait for all the NodeManagers to connect to the ResourceManager.</summary> /// <param name="timeout">Time to wait (sleeps in 100 ms intervals) in milliseconds.</param> /// <returns> /// true if all NodeManagers connect to the (Active) /// ResourceManager, false otherwise. /// </returns> /// <exception cref="Org.Apache.Hadoop.Yarn.Exceptions.YarnException"/> /// <exception cref="System.Exception"/> public virtual bool WaitForNodeManagersToConnect(long timeout) { GetClusterMetricsRequest req = GetClusterMetricsRequest.NewInstance(); for (int i = 0; i < timeout / 100; i++) { ResourceManager rm = GetResourceManager(); if (rm == null) { throw new YarnException("Can not find the active RM."); } else { if (nodeManagers.Length == rm.GetClientRMService().GetClusterMetrics(req).GetClusterMetrics ().GetNumNodeManagers()) { return(true); } } Sharpen.Thread.Sleep(100); } return(false); }
/// <exception cref="System.IO.IOException"/> public virtual GetClusterMetricsResponse GetClusterMetrics(GetClusterMetricsRequest request) { return(null); }