Example #1
0
            /// <summary>Parse xml and instantiate the nested rule</summary>
            /// <exception cref="Org.Apache.Hadoop.Yarn.Server.Resourcemanager.Scheduler.Fair.AllocationConfigurationException
            ///     "/>
            public override void InitializeFromXml(Element el)
            {
                NodeList elements = el.GetChildNodes();

                for (int i = 0; i < elements.GetLength(); i++)
                {
                    Node node = elements.Item(i);
                    if (node is Element)
                    {
                        Element element = (Element)node;
                        if ("rule".Equals(element.GetTagName()))
                        {
                            QueuePlacementRule rule = QueuePlacementPolicy.CreateAndInitializeRule(node);
                            if (rule == null)
                            {
                                throw new AllocationConfigurationException("Unable to create nested rule in nestedUserQueue rule"
                                                                           );
                            }
                            this.nestedRule = rule;
                            break;
                        }
                        else
                        {
                            continue;
                        }
                    }
                }
                if (this.nestedRule == null)
                {
                    throw new AllocationConfigurationException("No nested rule specified in <nestedUserQueue> rule"
                                                               );
                }
                base.InitializeFromXml(el);
            }