-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YARN-5025. Added and updated container management protocols for conta…
…iner relocation
- Loading branch information
Showing
24 changed files
with
1,280 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...ain/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerLaunchContextRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.hadoop.yarn.api.protocolrecords; | ||
|
||
import org.apache.hadoop.classification.InterfaceAudience.Public; | ||
import org.apache.hadoop.classification.InterfaceStability.Stable; | ||
import org.apache.hadoop.yarn.api.records.ContainerId; | ||
import org.apache.hadoop.yarn.api.ContainerManagementProtocol; | ||
import org.apache.hadoop.yarn.util.Records; | ||
|
||
/** | ||
* <p>The request sent by one <code>NodeManager</code> to another | ||
* <code>NodeManager</code> in order to get the launch context of the container with id | ||
* <em>containerId</em>.</p> | ||
* | ||
* <p>This request is used only for container relocation, where the launch context of | ||
* the origin container is necessary for launching the relocated container on the target node.</p> | ||
* | ||
* @see ContainerManagementProtocol#getContainerLaunchContext(GetContainerLaunchContextRequest) | ||
*/ | ||
public abstract class GetContainerLaunchContextRequest { | ||
|
||
@Public | ||
@Stable | ||
public static GetContainerLaunchContextRequest newInstance(ContainerId containerId) { | ||
GetContainerLaunchContextRequest request = | ||
Records.newRecord(GetContainerLaunchContextRequest.class); | ||
request.setContainerId(containerId); | ||
return request; | ||
} | ||
|
||
/** | ||
* Gets the container id for which the launch context is requested. | ||
* @return the container id for which the launch context is requested | ||
*/ | ||
@Public | ||
@Stable | ||
public abstract ContainerId getContainerId(); | ||
|
||
/** | ||
* Sets the container id for which the launch context is requested. | ||
* @param containerId the container id for which the launch context is requested | ||
*/ | ||
@Public | ||
@Stable | ||
public abstract void setContainerId(ContainerId containerId); | ||
} |
61 changes: 61 additions & 0 deletions
61
...in/java/org/apache/hadoop/yarn/api/protocolrecords/GetContainerLaunchContextResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.hadoop.yarn.api.protocolrecords; | ||
|
||
import org.apache.hadoop.classification.InterfaceAudience.Public; | ||
import org.apache.hadoop.classification.InterfaceStability.Stable; | ||
import org.apache.hadoop.yarn.api.records.ContainerLaunchContext; | ||
import org.apache.hadoop.yarn.util.Records; | ||
|
||
/** | ||
* <p>The response for a container launch context request sent between | ||
* <code>NodeManager</code>s. It contains the requested container launch context.</p> | ||
* | ||
* <p>This request is used only for container relocation, where a launch context | ||
* of the origin container is necessary for launching the relocated container on | ||
* the target node.</p> | ||
*/ | ||
public abstract class GetContainerLaunchContextResponse { | ||
|
||
@Public | ||
@Stable | ||
public static GetContainerLaunchContextResponse newInstance(ContainerLaunchContext | ||
containerLaunchContext) { | ||
GetContainerLaunchContextResponse request = | ||
Records.newRecord(GetContainerLaunchContextResponse.class); | ||
request.setContainerLaunchContext(containerLaunchContext); | ||
return request; | ||
} | ||
|
||
/** | ||
* Gets the launch context of the requested container. | ||
* @return the launch context of the requested container | ||
*/ | ||
@Public | ||
@Stable | ||
public abstract ContainerLaunchContext getContainerLaunchContext(); | ||
|
||
/** | ||
* Sets the launch context of the requested container. | ||
* @param containerLaunchContext the launch context of the requested container | ||
*/ | ||
@Public | ||
@Stable | ||
public abstract void setContainerLaunchContext(ContainerLaunchContext containerLaunchContext); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.