java.lang.Comparable<ContainerId>@Public @Stable public abstract class ContainerId extends java.lang.Object implements java.lang.Comparable<ContainerId>
ContainerId represents a globally unique identifier
for a Container in the cluster.
| Modifier and Type | Field | Description |
|---|---|---|
static long |
CONTAINER_ID_BITMASK |
| Constructor | Description |
|---|---|
ContainerId() |
| Modifier and Type | Method | Description |
|---|---|---|
protected abstract void |
build() |
|
int |
compareTo(ContainerId other) |
|
boolean |
equals(java.lang.Object obj) |
|
static ContainerId |
fromString(java.lang.String containerIdStr) |
|
abstract ApplicationAttemptId |
getApplicationAttemptId() |
Get the
ApplicationAttemptId of the application to which the
Container was assigned. |
abstract long |
getContainerId() |
Get the identifier of the
ContainerId. |
abstract int |
getId() |
Deprecated.
|
int |
hashCode() |
|
static ContainerId |
newContainerId(ApplicationAttemptId appAttemptId,
long containerId) |
|
static ContainerId |
newInstance(ApplicationAttemptId appAttemptId,
int containerId) |
Deprecated.
|
protected abstract void |
setApplicationAttemptId(ApplicationAttemptId atId) |
|
protected abstract void |
setContainerId(long id) |
|
java.lang.String |
toString() |
public static final long CONTAINER_ID_BITMASK
@Public @Unstable public static ContainerId newContainerId(ApplicationAttemptId appAttemptId, long containerId)
@Private @Deprecated @Unstable public static ContainerId newInstance(ApplicationAttemptId appAttemptId, int containerId)
@Public @Stable public abstract ApplicationAttemptId getApplicationAttemptId()
ApplicationAttemptId of the application to which the
Container was assigned.
Note: If containers are kept alive across application attempts via
ApplicationSubmissionContext.setKeepContainersAcrossApplicationAttempts(boolean)
the ContainerId does not necessarily contain the current
running application attempt's ApplicationAttemptId This
container can be allocated by previously exited application attempt and
managed by the current running attempt thus have the previous application
attempt's ApplicationAttemptId.
ApplicationAttemptId of the application to which the
Container was assigned@Private @Unstable protected abstract void setApplicationAttemptId(ApplicationAttemptId atId)
@Public @Deprecated @Unstable public abstract int getId()
ContainerId,
which doesn't include epoch. Note that this method will be marked as
deprecated, so please use getContainerId instead.ContainerId@Public @Unstable public abstract long getContainerId()
ContainerId. Upper 24 bits are
reserved as epoch of cluster, and lower 40 bits are reserved as
sequential number of containers.ContainerId@Private @Unstable protected abstract void setContainerId(long id)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int compareTo(ContainerId other)
compareTo in interface java.lang.Comparable<ContainerId>public java.lang.String toString()
toString in class java.lang.Object@Public @Stable public static ContainerId fromString(java.lang.String containerIdStr)
protected abstract void build()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.