Пример #1
0
 public override bool Equals(object other)
 {
     if (other is ContainerResourceDecrease)
     {
         ContainerResourceDecrease ctx = (ContainerResourceDecrease)other;
         if (GetContainerId() == null && ctx.GetContainerId() != null)
         {
             return(false);
         }
         else
         {
             if (!GetContainerId().Equals(ctx.GetContainerId()))
             {
                 return(false);
             }
         }
         if (GetCapability() == null && ctx.GetCapability() != null)
         {
             return(false);
         }
         else
         {
             if (!GetCapability().Equals(ctx.GetCapability()))
             {
                 return(false);
             }
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
Пример #2
0
        public static ContainerResourceDecrease NewInstance(ContainerId existingContainerId
                                                            , Resource targetCapability)
        {
            ContainerResourceDecrease context = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord
                                                <ContainerResourceDecrease>();

            context.SetContainerId(existingContainerId);
            context.SetCapability(targetCapability);
            return(context);
        }