/// <exception cref="System.Exception"/> public virtual void VerifyClusterSchedulerXML(NodeList nodes) { for (int i = 0; i < nodes.GetLength(); i++) { Element element = (Element)nodes.Item(i); VerifyClusterSchedulerGeneric(WebServicesTestUtils.GetXmlAttrString(element, "xsi:type" ), WebServicesTestUtils.GetXmlFloat(element, "usedCapacity"), WebServicesTestUtils .GetXmlFloat(element, "capacity"), WebServicesTestUtils.GetXmlFloat(element, "maxCapacity" ), WebServicesTestUtils.GetXmlString(element, "queueName")); NodeList children = element.GetChildNodes(); for (int j = 0; j < children.GetLength(); j++) { Element qElem = (Element)children.Item(j); if (qElem.GetTagName().Equals("queues")) { NodeList qListInfos = qElem.GetChildNodes(); for (int k = 0; k < qListInfos.GetLength(); k++) { Element qElem2 = (Element)qListInfos.Item(k); string qName2 = WebServicesTestUtils.GetXmlString(qElem2, "queueName"); string q2 = CapacitySchedulerConfiguration.Root + "." + qName2; VerifySubQueueXML(qElem2, q2, 100, 100); } } } } }
/// <exception cref="Org.Codehaus.Jettison.Json.JSONException"/> /// <exception cref="System.Exception"/> public virtual void VerifySchedulerFifoXML(string xml) { DocumentBuilderFactory dbf = DocumentBuilderFactory.NewInstance(); DocumentBuilder db = dbf.NewDocumentBuilder(); InputSource @is = new InputSource(); @is.SetCharacterStream(new StringReader(xml)); Document dom = db.Parse(@is); NodeList nodesSched = dom.GetElementsByTagName("scheduler"); NUnit.Framework.Assert.AreEqual("incorrect number of elements", 1, nodesSched.GetLength ()); NodeList nodes = dom.GetElementsByTagName("schedulerInfo"); NUnit.Framework.Assert.AreEqual("incorrect number of elements", 1, nodes.GetLength ()); for (int i = 0; i < nodes.GetLength(); i++) { Element element = (Element)nodes.Item(i); VerifyClusterSchedulerFifoGeneric(WebServicesTestUtils.GetXmlAttrString(element, "xsi:type"), WebServicesTestUtils.GetXmlString(element, "qstate"), WebServicesTestUtils .GetXmlFloat(element, "capacity"), WebServicesTestUtils.GetXmlFloat(element, "usedCapacity" ), WebServicesTestUtils.GetXmlInt(element, "minQueueMemoryCapacity"), WebServicesTestUtils .GetXmlInt(element, "maxQueueMemoryCapacity"), WebServicesTestUtils.GetXmlInt(element , "numNodes"), WebServicesTestUtils.GetXmlInt(element, "usedNodeCapacity"), WebServicesTestUtils .GetXmlInt(element, "availNodeCapacity"), WebServicesTestUtils.GetXmlInt(element , "totalNodeCapacity"), WebServicesTestUtils.GetXmlInt(element, "numContainers") ); } }
public virtual void VerifyHsTaskAttemptXML(Element element, TaskAttempt att, TaskType ttype) { VerifyTaskAttemptGeneric(att, ttype, WebServicesTestUtils.GetXmlString(element, "id" ), WebServicesTestUtils.GetXmlString(element, "state"), WebServicesTestUtils.GetXmlString (element, "type"), WebServicesTestUtils.GetXmlString(element, "rack"), WebServicesTestUtils .GetXmlString(element, "nodeHttpAddress"), WebServicesTestUtils.GetXmlString(element , "diagnostics"), WebServicesTestUtils.GetXmlString(element, "assignedContainerId" ), WebServicesTestUtils.GetXmlLong(element, "startTime"), WebServicesTestUtils.GetXmlLong (element, "finishTime"), WebServicesTestUtils.GetXmlLong(element, "elapsedTime") , WebServicesTestUtils.GetXmlFloat(element, "progress")); if (ttype == TaskType.Reduce) { VerifyReduceTaskAttemptGeneric(att, WebServicesTestUtils.GetXmlLong(element, "shuffleFinishTime" ), WebServicesTestUtils.GetXmlLong(element, "mergeFinishTime"), WebServicesTestUtils .GetXmlLong(element, "elapsedShuffleTime"), WebServicesTestUtils.GetXmlLong(element , "elapsedMergeTime"), WebServicesTestUtils.GetXmlLong(element, "elapsedReduceTime" )); } }
/// <exception cref="System.Exception"/> public virtual void VerifySubQueueXML(Element qElem, string q, float parentAbsCapacity , float parentAbsMaxCapacity) { NodeList children = qElem.GetChildNodes(); bool hasSubQueues = false; for (int j = 0; j < children.GetLength(); j++) { Element qElem2 = (Element)children.Item(j); if (qElem2.GetTagName().Equals("queues")) { NodeList qListInfos = qElem2.GetChildNodes(); if (qListInfos.GetLength() > 0) { hasSubQueues = true; } } } TestRMWebServicesCapacitySched.QueueInfo qi = (hasSubQueues) ? new TestRMWebServicesCapacitySched.QueueInfo (this) : new TestRMWebServicesCapacitySched.LeafQueueInfo(this); qi.capacity = WebServicesTestUtils.GetXmlFloat(qElem, "capacity"); qi.usedCapacity = WebServicesTestUtils.GetXmlFloat(qElem, "usedCapacity"); qi.maxCapacity = WebServicesTestUtils.GetXmlFloat(qElem, "maxCapacity"); qi.absoluteCapacity = WebServicesTestUtils.GetXmlFloat(qElem, "absoluteCapacity"); qi.absoluteMaxCapacity = WebServicesTestUtils.GetXmlFloat(qElem, "absoluteMaxCapacity" ); qi.absoluteUsedCapacity = WebServicesTestUtils.GetXmlFloat(qElem, "absoluteUsedCapacity" ); qi.numApplications = WebServicesTestUtils.GetXmlInt(qElem, "numApplications"); qi.queueName = WebServicesTestUtils.GetXmlString(qElem, "queueName"); qi.state = WebServicesTestUtils.GetXmlString(qElem, "state"); VerifySubQueueGeneric(q, qi, parentAbsCapacity, parentAbsMaxCapacity); if (hasSubQueues) { for (int j_1 = 0; j_1 < children.GetLength(); j_1++) { Element qElem2 = (Element)children.Item(j_1); if (qElem2.GetTagName().Equals("queues")) { NodeList qListInfos = qElem2.GetChildNodes(); for (int k = 0; k < qListInfos.GetLength(); k++) { Element qElem3 = (Element)qListInfos.Item(k); string qName3 = WebServicesTestUtils.GetXmlString(qElem3, "queueName"); string q3 = q + "." + qName3; VerifySubQueueXML(qElem3, q3, qi.absoluteCapacity, qi.absoluteMaxCapacity); } } } } else { TestRMWebServicesCapacitySched.LeafQueueInfo lqi = (TestRMWebServicesCapacitySched.LeafQueueInfo )qi; lqi.numActiveApplications = WebServicesTestUtils.GetXmlInt(qElem, "numActiveApplications" ); lqi.numPendingApplications = WebServicesTestUtils.GetXmlInt(qElem, "numPendingApplications" ); lqi.numContainers = WebServicesTestUtils.GetXmlInt(qElem, "numContainers"); lqi.maxApplications = WebServicesTestUtils.GetXmlInt(qElem, "maxApplications"); lqi.maxApplicationsPerUser = WebServicesTestUtils.GetXmlInt(qElem, "maxApplicationsPerUser" ); lqi.userLimit = WebServicesTestUtils.GetXmlInt(qElem, "userLimit"); lqi.userLimitFactor = WebServicesTestUtils.GetXmlFloat(qElem, "userLimitFactor"); VerifyLeafQueueGeneric(q, lqi); } }
public virtual void VerifyAMSingleTaskXML(Element element, Task task) { VerifyTaskGeneric(task, WebServicesTestUtils.GetXmlString(element, "id"), WebServicesTestUtils .GetXmlString(element, "state"), WebServicesTestUtils.GetXmlString(element, "type" ), WebServicesTestUtils.GetXmlString(element, "successfulAttempt"), WebServicesTestUtils .GetXmlLong(element, "startTime"), WebServicesTestUtils.GetXmlLong(element, "finishTime" ), WebServicesTestUtils.GetXmlLong(element, "elapsedTime"), WebServicesTestUtils .GetXmlFloat(element, "progress"), WebServicesTestUtils.GetXmlString(element, "status" )); }