Beispiel #1
0
        public virtual void Setup()
        {
            // setup a context / conf
            csConf = new CapacitySchedulerConfiguration();
            YarnConfiguration conf = new YarnConfiguration();

            csContext = Org.Mockito.Mockito.Mock <CapacitySchedulerContext>();
            Org.Mockito.Mockito.When(csContext.GetConfiguration()).ThenReturn(csConf);
            Org.Mockito.Mockito.When(csContext.GetConf()).ThenReturn(conf);
            Org.Mockito.Mockito.When(csContext.GetMinimumResourceCapability()).ThenReturn(Resources
                                                                                          .CreateResource(Gb, 1));
            Org.Mockito.Mockito.When(csContext.GetMaximumResourceCapability()).ThenReturn(Resources
                                                                                          .CreateResource(16 * Gb, 32));
            Org.Mockito.Mockito.When(csContext.GetClusterResource()).ThenReturn(Resources.CreateResource
                                                                                    (100 * 16 * Gb, 100 * 32));
            Org.Mockito.Mockito.When(csContext.GetResourceCalculator()).ThenReturn(resourceCalculator
                                                                                   );
            RMContext mockRMContext = TestUtils.GetMockRMContext();

            Org.Mockito.Mockito.When(csContext.GetRMContext()).ThenReturn(mockRMContext);
            // create a queue
            PlanQueue pq = new PlanQueue(csContext, "root", null, null);

            reservationQueue = new ReservationQueue(csContext, "a", pq);
        }
 /// <exception cref="System.IO.IOException"/>
 public ReservationQueue(CapacitySchedulerContext cs, string queueName, PlanQueue
                         parent)
     : base(cs, queueName, parent, null)
 {
     // the following parameters are common to all reservation in the plan
     UpdateQuotas(parent.GetUserLimitForReservation(), parent.GetUserLimitFactor(), parent
                  .GetMaxApplicationsForReservations(), parent.GetMaxApplicationsPerUserForReservation
                      ());
     this.parent = parent;
 }