YARN-11133. YarnClient gets the wrong EffectiveMinCapacity value (#4280)

* Update QueueConfigurationsPBImpl.java

* Update TestPBImplRecords.java

* Update TestPBImplRecords.java

* Update TestPBImplRecords.java

* Update TestPBImplRecords.java
This commit is contained in:
Zilong Zhu 2022-05-17 00:40:09 +08:00 committed by GitHub
parent c85b80018b
commit 79cc0caf9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -72,11 +72,11 @@ public class QueueConfigurationsPBImpl extends QueueConfigurations {
.setEffectiveMaxCapacity(convertToProtoFormat(this.effMaxResource)); .setEffectiveMaxCapacity(convertToProtoFormat(this.effMaxResource));
} }
if (this.configuredMinResource != null) { if (this.configuredMinResource != null) {
builder.setEffectiveMinCapacity( builder.setConfiguredMinCapacity(
convertToProtoFormat(this.configuredMinResource)); convertToProtoFormat(this.configuredMinResource));
} }
if (this.configuredMaxResource != null) { if (this.configuredMaxResource != null) {
builder.setEffectiveMaxCapacity( builder.setConfiguredMaxCapacity(
convertToProtoFormat(this.configuredMaxResource)); convertToProtoFormat(this.configuredMaxResource));
} }
} }

View File

@ -202,6 +202,7 @@ import org.apache.hadoop.yarn.api.records.impl.pb.PreemptionMessagePBImpl;
import org.apache.hadoop.yarn.api.records.impl.pb.PreemptionResourceRequestPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.PreemptionResourceRequestPBImpl;
import org.apache.hadoop.yarn.api.records.impl.pb.PriorityPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.PriorityPBImpl;
import org.apache.hadoop.yarn.api.records.impl.pb.QueueInfoPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.QueueInfoPBImpl;
import org.apache.hadoop.yarn.api.records.impl.pb.QueueConfigurationsPBImpl;
import org.apache.hadoop.yarn.api.records.impl.pb.QueueUserACLInfoPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.QueueUserACLInfoPBImpl;
import org.apache.hadoop.yarn.api.records.impl.pb.ResourceBlacklistRequestPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ResourceBlacklistRequestPBImpl;
import org.apache.hadoop.yarn.api.records.impl.pb.ResourceOptionPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ResourceOptionPBImpl;
@ -245,6 +246,7 @@ import org.apache.hadoop.yarn.proto.YarnProtos.PreemptionMessageProto;
import org.apache.hadoop.yarn.proto.YarnProtos.PreemptionResourceRequestProto; import org.apache.hadoop.yarn.proto.YarnProtos.PreemptionResourceRequestProto;
import org.apache.hadoop.yarn.proto.YarnProtos.PriorityProto; import org.apache.hadoop.yarn.proto.YarnProtos.PriorityProto;
import org.apache.hadoop.yarn.proto.YarnProtos.QueueInfoProto; import org.apache.hadoop.yarn.proto.YarnProtos.QueueInfoProto;
import org.apache.hadoop.yarn.proto.YarnProtos.QueueConfigurationsProto;
import org.apache.hadoop.yarn.proto.YarnProtos.QueueUserACLInfoProto; import org.apache.hadoop.yarn.proto.YarnProtos.QueueUserACLInfoProto;
import org.apache.hadoop.yarn.proto.YarnProtos.ResourceBlacklistRequestProto; import org.apache.hadoop.yarn.proto.YarnProtos.ResourceBlacklistRequestProto;
import org.apache.hadoop.yarn.proto.YarnProtos.ResourceOptionProto; import org.apache.hadoop.yarn.proto.YarnProtos.ResourceOptionProto;
@ -918,6 +920,12 @@ public class TestPBImplRecords extends BasePBImplRecordsTest {
validatePBImplRecord(QueueInfoPBImpl.class, QueueInfoProto.class); validatePBImplRecord(QueueInfoPBImpl.class, QueueInfoProto.class);
} }
@Test
public void testQueueConfigurationsPBImpl() throws Exception{
validatePBImplRecord(QueueConfigurationsPBImpl.class,
QueueConfigurationsProto.class);
}
@Test @Test
public void testQueueUserACLInfoPBImpl() throws Exception { public void testQueueUserACLInfoPBImpl() throws Exception {
validatePBImplRecord(QueueUserACLInfoPBImpl.class, validatePBImplRecord(QueueUserACLInfoPBImpl.class,