Class BuilderUtils
java.lang.Object
org.apache.hadoop.yarn.server.utils.BuilderUtils
Builder utilities to construct various objects.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.hadoop.yarn.api.records.ApplicationIdconvert(long clustertimestamp, CharSequence id) static org.apache.hadoop.yarn.api.protocolrecords.AllocateResponsenewAllocateResponse(int responseId, List<org.apache.hadoop.yarn.api.records.ContainerStatus> completedContainers, List<org.apache.hadoop.yarn.api.records.Container> allocatedContainers, List<org.apache.hadoop.yarn.api.records.NodeReport> updatedNodes, org.apache.hadoop.yarn.api.records.Resource availResources, org.apache.hadoop.yarn.api.records.AMCommand command, int numClusterNodes, org.apache.hadoop.yarn.api.records.PreemptionMessage preempt) static org.apache.hadoop.yarn.api.records.TokennewAMRMToken(byte[] identifier, String kind, byte[] password, String service) static org.apache.hadoop.yarn.api.records.ApplicationAttemptIdnewApplicationAttemptId(org.apache.hadoop.yarn.api.records.ApplicationId appId, int attemptId) static org.apache.hadoop.yarn.api.records.ApplicationIdnewApplicationId(long clusterTimeStamp, int id) static org.apache.hadoop.yarn.api.records.ApplicationIdnewApplicationId(org.apache.hadoop.yarn.factories.RecordFactory recordFactory, long clusterTimeStamp, int id) static org.apache.hadoop.yarn.api.records.ApplicationIdnewApplicationId(org.apache.hadoop.yarn.factories.RecordFactory recordFactory, long clustertimestamp, CharSequence id) static org.apache.hadoop.yarn.api.records.ApplicationReportnewApplicationReport(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, String user, String queue, String name, String host, int rpcPort, org.apache.hadoop.yarn.api.records.Token clientToAMToken, org.apache.hadoop.yarn.api.records.YarnApplicationState state, String diagnostics, String url, long startTime, long launchTime, long finishTime, org.apache.hadoop.yarn.api.records.FinalApplicationStatus finalStatus, org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport appResources, String origTrackingUrl, float progress, String appType, org.apache.hadoop.yarn.api.records.Token amRmToken, Set<String> tags, org.apache.hadoop.yarn.api.records.Priority priority) static org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReportnewApplicationResourceUsageReport(int numUsedContainers, int numReservedContainers, org.apache.hadoop.yarn.api.records.Resource usedResources, org.apache.hadoop.yarn.api.records.Resource reservedResources, org.apache.hadoop.yarn.api.records.Resource neededResources, Map<String, Long> resourceSecondsMap, Map<String, Long> preemptedResourceSecondsMap) static org.apache.hadoop.yarn.api.records.ApplicationSubmissionContextnewApplicationSubmissionContext(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, String applicationName, String queue, org.apache.hadoop.yarn.api.records.Priority priority, org.apache.hadoop.yarn.api.records.ContainerLaunchContext amContainer, boolean isUnmanagedAM, boolean cancelTokensWhenComplete, int maxAppAttempts, org.apache.hadoop.yarn.api.records.Resource resource) static org.apache.hadoop.yarn.api.records.ApplicationSubmissionContextnewApplicationSubmissionContext(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, String applicationName, String queue, org.apache.hadoop.yarn.api.records.Priority priority, org.apache.hadoop.yarn.api.records.ContainerLaunchContext amContainer, boolean isUnmanagedAM, boolean cancelTokensWhenComplete, int maxAppAttempts, org.apache.hadoop.yarn.api.records.Resource resource, String applicationType) static org.apache.hadoop.yarn.api.records.TokennewClientToAMToken(byte[] identifier, String kind, byte[] password, String service) static org.apache.hadoop.yarn.api.records.ContainernewContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String nodeHttpAddress, org.apache.hadoop.yarn.api.records.Resource resource, org.apache.hadoop.yarn.api.records.Priority priority, org.apache.hadoop.yarn.api.records.Token containerToken) static org.apache.hadoop.yarn.api.records.ContainernewContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String nodeHttpAddress, org.apache.hadoop.yarn.api.records.Resource resource, org.apache.hadoop.yarn.api.records.Priority priority, org.apache.hadoop.yarn.api.records.Token containerToken, long allocationRequestId) static org.apache.hadoop.yarn.api.records.ContainernewContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String nodeHttpAddress, org.apache.hadoop.yarn.api.records.Resource resource, org.apache.hadoop.yarn.api.records.Priority priority, org.apache.hadoop.yarn.api.records.Token containerToken, org.apache.hadoop.yarn.api.records.ExecutionType executionType, long allocationRequestId) static org.apache.hadoop.yarn.api.records.ContainerIdnewContainerId(int appId, int appAttemptId, long timestamp, long id) static org.apache.hadoop.yarn.api.records.ContainerIdnewContainerId(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, long containerId) static org.apache.hadoop.yarn.api.records.ContainerIdnewContainerId(org.apache.hadoop.yarn.factories.RecordFactory recordFactory, org.apache.hadoop.yarn.api.records.ApplicationId appId, org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, int containerId) static org.apache.hadoop.yarn.api.records.ContainerLaunchContextnewContainerLaunchContext(Map<String, org.apache.hadoop.yarn.api.records.LocalResource> localResources, Map<String, String> environment, List<String> commands, Map<String, ByteBuffer> serviceData, ByteBuffer tokens, Map<org.apache.hadoop.yarn.api.records.ApplicationAccessType, String> acls) static org.apache.hadoop.yarn.api.records.ContainerStatusnewContainerStatus(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.ContainerState containerState, String diagnostics, int exitStatus, org.apache.hadoop.yarn.api.records.Resource capability) static org.apache.hadoop.yarn.api.records.ContainerStatusnewContainerStatus(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.ContainerState containerState, String diagnostics, int exitStatus, org.apache.hadoop.yarn.api.records.Resource capability, org.apache.hadoop.yarn.api.records.ExecutionType executionType) static org.apache.hadoop.yarn.api.records.TokennewContainerToken(org.apache.hadoop.yarn.api.records.ContainerId cId, int containerVersion, String host, int port, String user, org.apache.hadoop.yarn.api.records.Resource r, long expiryTime, int masterKeyId, byte[] password, long rmIdentifier) static org.apache.hadoop.yarn.api.records.TokennewContainerToken(org.apache.hadoop.yarn.api.records.NodeId nodeId, byte[] password, org.apache.hadoop.yarn.security.ContainerTokenIdentifier tokenIdentifier) static org.apache.hadoop.yarn.security.ContainerTokenIdentifiernewContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.Token containerToken) static org.apache.hadoop.yarn.api.records.TokennewDelegationToken(byte[] identifier, String kind, byte[] password, String service) static org.apache.hadoop.yarn.api.records.Resourcestatic org.apache.hadoop.yarn.api.records.LocalResourcenewLocalResource(URI uri, org.apache.hadoop.yarn.api.records.LocalResourceType type, org.apache.hadoop.yarn.api.records.LocalResourceVisibility visibility, long size, long timestamp, boolean shouldBeUploadedToSharedCache) static org.apache.hadoop.yarn.api.records.LocalResourcenewLocalResource(org.apache.hadoop.yarn.api.records.URL url, org.apache.hadoop.yarn.api.records.LocalResourceType type, org.apache.hadoop.yarn.api.records.LocalResourceVisibility visibility, long size, long timestamp, boolean shouldBeUploadedToSharedCache) static org.apache.hadoop.yarn.api.records.NodeIdstatic org.apache.hadoop.yarn.api.records.NodeReportnewNodeReport(org.apache.hadoop.yarn.api.records.NodeId nodeId, org.apache.hadoop.yarn.api.records.NodeState nodeState, String httpAddress, String rackName, org.apache.hadoop.yarn.api.records.Resource used, org.apache.hadoop.yarn.api.records.Resource capability, int numContainers, String healthReport, long lastHealthReportTime) static org.apache.hadoop.yarn.api.records.NodeReportnewNodeReport(org.apache.hadoop.yarn.api.records.NodeId nodeId, org.apache.hadoop.yarn.api.records.NodeState nodeState, String httpAddress, String rackName, org.apache.hadoop.yarn.api.records.Resource used, org.apache.hadoop.yarn.api.records.Resource capability, int numContainers, String healthReport, long lastHealthReportTime, Set<String> nodeLabels, Integer decommissioningTimeout, org.apache.hadoop.yarn.api.records.NodeUpdateType nodeUpdateType) static org.apache.hadoop.yarn.api.records.NodeReportnewNodeReport(org.apache.hadoop.yarn.api.records.NodeId nodeId, org.apache.hadoop.yarn.api.records.NodeState nodeState, String httpAddress, String rackName, org.apache.hadoop.yarn.api.records.Resource used, org.apache.hadoop.yarn.api.records.Resource capability, int numContainers, String healthReport, long lastHealthReportTime, Set<String> nodeLabels, org.apache.hadoop.yarn.api.records.ResourceUtilization containersUtilization, org.apache.hadoop.yarn.api.records.ResourceUtilization nodeUtilization, Integer decommissioningTimeout, org.apache.hadoop.yarn.api.records.NodeUpdateType nodeUpdateType, Set<org.apache.hadoop.yarn.api.records.NodeAttribute> attrs) static org.apache.hadoop.yarn.api.records.PrioritynewPriority(int p) static org.apache.hadoop.yarn.api.records.ResourcenewResource(long memory, int vCores) static org.apache.hadoop.yarn.api.records.ResourceRequestnewResourceRequest(org.apache.hadoop.yarn.api.records.Priority priority, String hostName, org.apache.hadoop.yarn.api.records.Resource capability, int numContainers) static org.apache.hadoop.yarn.api.records.ResourceRequestnewResourceRequest(org.apache.hadoop.yarn.api.records.Priority priority, String hostName, org.apache.hadoop.yarn.api.records.Resource capability, int numContainers, String label) static <T extends org.apache.hadoop.yarn.api.records.Token>
Tstatic org.apache.hadoop.yarn.api.records.URLstatic org.apache.hadoop.security.CredentialsparseCredentials(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext application) static org.apache.hadoop.conf.ConfigurationparseTokensConf(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext context)
-
Constructor Details
-
BuilderUtils
public BuilderUtils()
-
-
Method Details
-
newLocalResource
public static org.apache.hadoop.yarn.api.records.LocalResource newLocalResource(org.apache.hadoop.yarn.api.records.URL url, org.apache.hadoop.yarn.api.records.LocalResourceType type, org.apache.hadoop.yarn.api.records.LocalResourceVisibility visibility, long size, long timestamp, boolean shouldBeUploadedToSharedCache) -
newLocalResource
public static org.apache.hadoop.yarn.api.records.LocalResource newLocalResource(URI uri, org.apache.hadoop.yarn.api.records.LocalResourceType type, org.apache.hadoop.yarn.api.records.LocalResourceVisibility visibility, long size, long timestamp, boolean shouldBeUploadedToSharedCache) -
newApplicationId
public static org.apache.hadoop.yarn.api.records.ApplicationId newApplicationId(org.apache.hadoop.yarn.factories.RecordFactory recordFactory, long clustertimestamp, CharSequence id) -
newApplicationId
public static org.apache.hadoop.yarn.api.records.ApplicationId newApplicationId(org.apache.hadoop.yarn.factories.RecordFactory recordFactory, long clusterTimeStamp, int id) -
newApplicationId
public static org.apache.hadoop.yarn.api.records.ApplicationId newApplicationId(long clusterTimeStamp, int id) -
newApplicationAttemptId
public static org.apache.hadoop.yarn.api.records.ApplicationAttemptId newApplicationAttemptId(org.apache.hadoop.yarn.api.records.ApplicationId appId, int attemptId) -
convert
public static org.apache.hadoop.yarn.api.records.ApplicationId convert(long clustertimestamp, CharSequence id) -
newContainerId
public static org.apache.hadoop.yarn.api.records.ContainerId newContainerId(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, long containerId) -
newContainerId
public static org.apache.hadoop.yarn.api.records.ContainerId newContainerId(int appId, int appAttemptId, long timestamp, long id) -
newContainerToken
public static org.apache.hadoop.yarn.api.records.Token newContainerToken(org.apache.hadoop.yarn.api.records.ContainerId cId, int containerVersion, String host, int port, String user, org.apache.hadoop.yarn.api.records.Resource r, long expiryTime, int masterKeyId, byte[] password, long rmIdentifier) throws IOException - Throws:
IOException
-
newContainerId
public static org.apache.hadoop.yarn.api.records.ContainerId newContainerId(org.apache.hadoop.yarn.factories.RecordFactory recordFactory, org.apache.hadoop.yarn.api.records.ApplicationId appId, org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, int containerId) -
newNodeId
-
newNodeReport
public static org.apache.hadoop.yarn.api.records.NodeReport newNodeReport(org.apache.hadoop.yarn.api.records.NodeId nodeId, org.apache.hadoop.yarn.api.records.NodeState nodeState, String httpAddress, String rackName, org.apache.hadoop.yarn.api.records.Resource used, org.apache.hadoop.yarn.api.records.Resource capability, int numContainers, String healthReport, long lastHealthReportTime) -
newNodeReport
public static org.apache.hadoop.yarn.api.records.NodeReport newNodeReport(org.apache.hadoop.yarn.api.records.NodeId nodeId, org.apache.hadoop.yarn.api.records.NodeState nodeState, String httpAddress, String rackName, org.apache.hadoop.yarn.api.records.Resource used, org.apache.hadoop.yarn.api.records.Resource capability, int numContainers, String healthReport, long lastHealthReportTime, Set<String> nodeLabels, Integer decommissioningTimeout, org.apache.hadoop.yarn.api.records.NodeUpdateType nodeUpdateType) -
newNodeReport
public static org.apache.hadoop.yarn.api.records.NodeReport newNodeReport(org.apache.hadoop.yarn.api.records.NodeId nodeId, org.apache.hadoop.yarn.api.records.NodeState nodeState, String httpAddress, String rackName, org.apache.hadoop.yarn.api.records.Resource used, org.apache.hadoop.yarn.api.records.Resource capability, int numContainers, String healthReport, long lastHealthReportTime, Set<String> nodeLabels, org.apache.hadoop.yarn.api.records.ResourceUtilization containersUtilization, org.apache.hadoop.yarn.api.records.ResourceUtilization nodeUtilization, Integer decommissioningTimeout, org.apache.hadoop.yarn.api.records.NodeUpdateType nodeUpdateType, Set<org.apache.hadoop.yarn.api.records.NodeAttribute> attrs) -
newContainerStatus
public static org.apache.hadoop.yarn.api.records.ContainerStatus newContainerStatus(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.ContainerState containerState, String diagnostics, int exitStatus, org.apache.hadoop.yarn.api.records.Resource capability) -
newContainerStatus
public static org.apache.hadoop.yarn.api.records.ContainerStatus newContainerStatus(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.ContainerState containerState, String diagnostics, int exitStatus, org.apache.hadoop.yarn.api.records.Resource capability, org.apache.hadoop.yarn.api.records.ExecutionType executionType) -
newContainer
public static org.apache.hadoop.yarn.api.records.Container newContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String nodeHttpAddress, org.apache.hadoop.yarn.api.records.Resource resource, org.apache.hadoop.yarn.api.records.Priority priority, org.apache.hadoop.yarn.api.records.Token containerToken, org.apache.hadoop.yarn.api.records.ExecutionType executionType, long allocationRequestId) -
newContainer
public static org.apache.hadoop.yarn.api.records.Container newContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String nodeHttpAddress, org.apache.hadoop.yarn.api.records.Resource resource, org.apache.hadoop.yarn.api.records.Priority priority, org.apache.hadoop.yarn.api.records.Token containerToken) -
newContainer
public static org.apache.hadoop.yarn.api.records.Container newContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String nodeHttpAddress, org.apache.hadoop.yarn.api.records.Resource resource, org.apache.hadoop.yarn.api.records.Priority priority, org.apache.hadoop.yarn.api.records.Token containerToken, long allocationRequestId) -
newToken
-
newDelegationToken
-
newClientToAMToken
-
newAMRMToken
-
newContainerToken
@VisibleForTesting public static org.apache.hadoop.yarn.api.records.Token newContainerToken(org.apache.hadoop.yarn.api.records.NodeId nodeId, byte[] password, org.apache.hadoop.yarn.security.ContainerTokenIdentifier tokenIdentifier) -
newContainerTokenIdentifier
public static org.apache.hadoop.yarn.security.ContainerTokenIdentifier newContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.Token containerToken) throws IOException - Throws:
IOException
-
newContainerLaunchContext
public static org.apache.hadoop.yarn.api.records.ContainerLaunchContext newContainerLaunchContext(Map<String, org.apache.hadoop.yarn.api.records.LocalResource> localResources, Map<String, String> environment, List<String> commands, Map<String, ByteBuffer> serviceData, ByteBuffer tokens, Map<org.apache.hadoop.yarn.api.records.ApplicationAccessType, String> acls) -
newPriority
public static org.apache.hadoop.yarn.api.records.Priority newPriority(int p) -
newResourceRequest
public static org.apache.hadoop.yarn.api.records.ResourceRequest newResourceRequest(org.apache.hadoop.yarn.api.records.Priority priority, String hostName, org.apache.hadoop.yarn.api.records.Resource capability, int numContainers) -
newResourceRequest
-
newApplicationReport
public static org.apache.hadoop.yarn.api.records.ApplicationReport newApplicationReport(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, String user, String queue, String name, String host, int rpcPort, org.apache.hadoop.yarn.api.records.Token clientToAMToken, org.apache.hadoop.yarn.api.records.YarnApplicationState state, String diagnostics, String url, long startTime, long launchTime, long finishTime, org.apache.hadoop.yarn.api.records.FinalApplicationStatus finalStatus, org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport appResources, String origTrackingUrl, float progress, String appType, org.apache.hadoop.yarn.api.records.Token amRmToken, Set<String> tags, org.apache.hadoop.yarn.api.records.Priority priority) -
newApplicationSubmissionContext
public static org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext newApplicationSubmissionContext(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, String applicationName, String queue, org.apache.hadoop.yarn.api.records.Priority priority, org.apache.hadoop.yarn.api.records.ContainerLaunchContext amContainer, boolean isUnmanagedAM, boolean cancelTokensWhenComplete, int maxAppAttempts, org.apache.hadoop.yarn.api.records.Resource resource, String applicationType) -
newApplicationSubmissionContext
public static org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext newApplicationSubmissionContext(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, String applicationName, String queue, org.apache.hadoop.yarn.api.records.Priority priority, org.apache.hadoop.yarn.api.records.ContainerLaunchContext amContainer, boolean isUnmanagedAM, boolean cancelTokensWhenComplete, int maxAppAttempts, org.apache.hadoop.yarn.api.records.Resource resource) -
newApplicationResourceUsageReport
public static org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport newApplicationResourceUsageReport(int numUsedContainers, int numReservedContainers, org.apache.hadoop.yarn.api.records.Resource usedResources, org.apache.hadoop.yarn.api.records.Resource reservedResources, org.apache.hadoop.yarn.api.records.Resource neededResources, Map<String, Long> resourceSecondsMap, Map<String, Long> preemptedResourceSecondsMap) -
newResource
public static org.apache.hadoop.yarn.api.records.Resource newResource(long memory, int vCores) -
newEmptyResource
public static org.apache.hadoop.yarn.api.records.Resource newEmptyResource() -
newURL
-
newAllocateResponse
public static org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse newAllocateResponse(int responseId, List<org.apache.hadoop.yarn.api.records.ContainerStatus> completedContainers, List<org.apache.hadoop.yarn.api.records.Container> allocatedContainers, List<org.apache.hadoop.yarn.api.records.NodeReport> updatedNodes, org.apache.hadoop.yarn.api.records.Resource availResources, org.apache.hadoop.yarn.api.records.AMCommand command, int numClusterNodes, org.apache.hadoop.yarn.api.records.PreemptionMessage preempt) -
parseCredentials
public static org.apache.hadoop.security.Credentials parseCredentials(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext application) throws IOException - Throws:
IOException
-
parseTokensConf
public static org.apache.hadoop.conf.Configuration parseTokensConf(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext context) throws IOException - Throws:
IOException
-