YARN-10296. Make ContainerPBImpl#getId/setId synchronized. Contributed by Benjamin Teke
This commit is contained in:
parent
2e4892061a
commit
0c209f3f7d
@ -63,7 +63,7 @@ public ContainerPBImpl(ContainerProto proto) {
|
||||
viaProto = true;
|
||||
}
|
||||
|
||||
public ContainerProto getProto() {
|
||||
synchronized public ContainerProto getProto() {
|
||||
|
||||
mergeLocalToProto();
|
||||
proto = viaProto ? proto : builder.build();
|
||||
@ -132,7 +132,7 @@ private void maybeInitBuilder() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContainerId getId() {
|
||||
synchronized public ContainerId getId() {
|
||||
ContainerProtoOrBuilder p = viaProto ? proto : builder;
|
||||
if (this.containerId != null) {
|
||||
return this.containerId;
|
||||
@ -166,7 +166,7 @@ public NodeId getNodeId() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(ContainerId id) {
|
||||
synchronized public void setId(ContainerId id) {
|
||||
maybeInitBuilder();
|
||||
if (id == null)
|
||||
builder.clearId();
|
||||
|
Loading…
x
Reference in New Issue
Block a user