Пример #1
0
        public static AllocateResponse NewInstance(int responseId, IList <ContainerStatus>
                                                   completedContainers, IList <Container> allocatedContainers, IList <NodeReport> updatedNodes
                                                   , Resource availResources, AMCommand command, int numClusterNodes, PreemptionMessage
                                                   preempt, IList <NMToken> nmTokens, Token amRMToken, IList <ContainerResourceIncrease
                                                                                                              > increasedContainers, IList <ContainerResourceDecrease> decreasedContainers)
        {
            AllocateResponse response = NewInstance(responseId, completedContainers, allocatedContainers
                                                    , updatedNodes, availResources, command, numClusterNodes, preempt, nmTokens, increasedContainers
                                                    , decreasedContainers);

            response.SetAMRMToken(amRMToken);
            return(response);
        }
Пример #2
0
 public override void SetAMCommand(AMCommand command)
 {
     lock (this)
     {
         MaybeInitBuilder();
         if (command == null)
         {
             builder.ClearAMCommand();
             return;
         }
         builder.SetAMCommand(ProtoUtils.ConvertToProtoFormat(command));
     }
 }
Пример #3
0
        public static AllocateResponse NewInstance(int responseId, IList <ContainerStatus>
                                                   completedContainers, IList <Container> allocatedContainers, IList <NodeReport> updatedNodes
                                                   , Resource availResources, AMCommand command, int numClusterNodes, PreemptionMessage
                                                   preempt, IList <NMToken> nmTokens)
        {
            AllocateResponse response = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <AllocateResponse
                                                                                       >();

            response.SetNumClusterNodes(numClusterNodes);
            response.SetResponseId(responseId);
            response.SetCompletedContainersStatuses(completedContainers);
            response.SetAllocatedContainers(allocatedContainers);
            response.SetUpdatedNodes(updatedNodes);
            response.SetAvailableResources(availResources);
            response.SetAMCommand(command);
            response.SetPreemptionMessage(preempt);
            response.SetNMTokens(nmTokens);
            return(response);
        }
Пример #4
0
 public static AMCommand ConvertFromProtoFormat(YarnProtos.AMCommandProto e)
 {
     return(AMCommand.ValueOf(e.ToString()));
 }
Пример #5
0
 /*
  * AMCommand
  */
 public static YarnProtos.AMCommandProto ConvertToProtoFormat(AMCommand e)
 {
     return(YarnProtos.AMCommandProto.ValueOf(e.ToString()));
 }
Пример #6
0
        public static AllocateResponse NewAllocateResponse(int responseId, IList <ContainerStatus
                                                                                  > completedContainers, IList <Container> allocatedContainers, IList <NodeReport> updatedNodes
                                                           , Resource availResources, AMCommand command, int numClusterNodes, PreemptionMessage
                                                           preempt)
        {
            AllocateResponse response = recordFactory.NewRecordInstance <AllocateResponse>();

            response.SetNumClusterNodes(numClusterNodes);
            response.SetResponseId(responseId);
            response.SetCompletedContainersStatuses(completedContainers);
            response.SetAllocatedContainers(allocatedContainers);
            response.SetUpdatedNodes(updatedNodes);
            response.SetAvailableResources(availResources);
            response.SetAMCommand(command);
            response.SetPreemptionMessage(preempt);
            return(response);
        }
Пример #7
0
 public abstract void SetAMCommand(AMCommand command);