public virtual YarnProtos.ContainerResourceIncreaseRequestProto GetProto()
 {
     MergeLocalToProto();
     proto = viaProto ? proto : ((YarnProtos.ContainerResourceIncreaseRequestProto)builder
                                 .Build());
     viaProto = true;
     return(proto);
 }
 private void MergeLocalToProto()
 {
     if (viaProto)
     {
         MaybeInitBuilder();
     }
     MergeLocalToBuilder();
     proto    = ((YarnProtos.ContainerResourceIncreaseRequestProto)builder.Build());
     viaProto = true;
 }
 public virtual void TestResourceChangeContextWithNullField()
 {
     Org.Apache.Hadoop.Yarn.Api.Records.ContainerResourceIncreaseRequest context = Org.Apache.Hadoop.Yarn.Api.Records.ContainerResourceIncreaseRequest
                                                                                   .NewInstance(null, null);
     // to proto and get it back
     YarnProtos.ContainerResourceIncreaseRequestProto proto = ((ContainerResourceIncreaseRequestPBImpl
                                                                )context).GetProto();
     Org.Apache.Hadoop.Yarn.Api.Records.ContainerResourceIncreaseRequest contextRecover
         = new ContainerResourceIncreaseRequestPBImpl(proto);
     // check value
     NUnit.Framework.Assert.IsNull(contextRecover.GetContainerId());
     NUnit.Framework.Assert.IsNull(contextRecover.GetCapability());
 }
        public virtual void ContainerResourceIncreaseRequest()
        {
            ContainerId containerId = ContainerId.NewContainerId(ApplicationAttemptId.NewInstance
                                                                     (ApplicationId.NewInstance(1234, 3), 3), 7);
            Resource resource = Resource.NewInstance(1023, 3);

            Org.Apache.Hadoop.Yarn.Api.Records.ContainerResourceIncreaseRequest context = Org.Apache.Hadoop.Yarn.Api.Records.ContainerResourceIncreaseRequest
                                                                                          .NewInstance(containerId, resource);
            // to proto and get it back
            YarnProtos.ContainerResourceIncreaseRequestProto proto = ((ContainerResourceIncreaseRequestPBImpl
                                                                       )context).GetProto();
            Org.Apache.Hadoop.Yarn.Api.Records.ContainerResourceIncreaseRequest contextRecover
                = new ContainerResourceIncreaseRequestPBImpl(proto);
            // check value
            NUnit.Framework.Assert.AreEqual(contextRecover.GetContainerId(), containerId);
            NUnit.Framework.Assert.AreEqual(contextRecover.GetCapability(), resource);
        }
 public ContainerResourceIncreaseRequestPBImpl(YarnProtos.ContainerResourceIncreaseRequestProto
                                               proto)
 {
     this.proto = proto;
     viaProto   = true;
 }
Ejemplo n.º 6
0
 private ContainerResourceIncreaseRequestPBImpl ConvertFromProtoFormat(YarnProtos.ContainerResourceIncreaseRequestProto
                                                                       p)
 {
     return(new ContainerResourceIncreaseRequestPBImpl(p));
 }