|
@@ -45,29 +45,28 @@ import org.apache.hadoop.security.UserGroupInformation;
|
|
import org.apache.hadoop.security.authorize.AccessControlList;
|
|
import org.apache.hadoop.security.authorize.AccessControlList;
|
|
import org.apache.hadoop.security.authorize.ProxyUsers;
|
|
import org.apache.hadoop.security.authorize.ProxyUsers;
|
|
import org.apache.hadoop.security.authorize.ServiceAuthorizationManager;
|
|
import org.apache.hadoop.security.authorize.ServiceAuthorizationManager;
|
|
-import org.apache.hadoop.yarn.LocalConfigurationProvider;
|
|
|
|
import org.apache.hadoop.yarn.api.records.DecommissionType;
|
|
import org.apache.hadoop.yarn.api.records.DecommissionType;
|
|
import org.apache.hadoop.yarn.api.records.NodeId;
|
|
import org.apache.hadoop.yarn.api.records.NodeId;
|
|
|
|
+import org.apache.hadoop.yarn.api.records.NodeId;
|
|
|
|
+import org.apache.hadoop.yarn.api.records.Resource;
|
|
import org.apache.hadoop.yarn.conf.HAUtil;
|
|
import org.apache.hadoop.yarn.conf.HAUtil;
|
|
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
|
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
|
import org.apache.hadoop.yarn.exceptions.YarnException;
|
|
import org.apache.hadoop.yarn.exceptions.YarnException;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshAdminAclsRequest;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshAdminAclsRequest;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshClusterMaxPriorityRequest;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshClusterMaxPriorityRequest;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshNodesRequest;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshNodesRequest;
|
|
|
|
+import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshNodesResourcesRequest;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshQueuesRequest;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshServiceAclsRequest;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshServiceAclsRequest;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshSuperUserGroupsConfigurationRequest;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshSuperUserGroupsConfigurationRequest;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshUserToGroupsMappingsRequest;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshUserToGroupsMappingsRequest;
|
|
-import org.apache.hadoop.yarn.server.api.protocolrecords.RefreshNodesResourcesRequest;
|
|
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.RemoveFromClusterNodeLabelsRequest;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.RemoveFromClusterNodeLabelsRequest;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.ReplaceLabelsOnNodeRequest;
|
|
import org.apache.hadoop.yarn.server.api.protocolrecords.ReplaceLabelsOnNodeRequest;
|
|
import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager;
|
|
import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager;
|
|
|
|
+import org.apache.hadoop.yarn.server.resourcemanager.resource.DynamicResourceConfiguration;
|
|
import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNode;
|
|
import org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNode;
|
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
|
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler;
|
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
|
|
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacitySchedulerConfiguration;
|
|
-import org.apache.hadoop.yarn.server.resourcemanager.resource.DynamicResourceConfiguration;
|
|
|
|
-import org.apache.hadoop.yarn.api.records.NodeId;
|
|
|
|
-import org.apache.hadoop.yarn.api.records.Resource;
|
|
|
|
import org.apache.hadoop.yarn.util.ConverterUtils;
|
|
import org.apache.hadoop.yarn.util.ConverterUtils;
|
|
import org.junit.After;
|
|
import org.junit.After;
|
|
import org.junit.Assert;
|
|
import org.junit.Assert;
|
|
@@ -176,6 +175,32 @@ public class TestRMAdminService {
|
|
Assert.assertTrue(maxAppsAfter != maxAppsBefore);
|
|
Assert.assertTrue(maxAppsAfter != maxAppsBefore);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
+ public void testAdminRefreshNodesWithoutConfiguration()
|
|
|
|
+ throws IOException, YarnException {
|
|
|
|
+ configuration.set(YarnConfiguration.RM_CONFIGURATION_PROVIDER_CLASS,
|
|
|
|
+ "org.apache.hadoop.yarn.FileSystemBasedConfigurationProvider");
|
|
|
|
+
|
|
|
|
+ // upload default configurations
|
|
|
|
+ uploadDefaultConfiguration();
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ rm = new MockRM(configuration);
|
|
|
|
+ rm.init(configuration);
|
|
|
|
+ rm.start();
|
|
|
|
+ } catch (Exception ex) {
|
|
|
|
+ fail("Should not get any exceptions");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ rm.adminService
|
|
|
|
+ .refreshNodesResources(RefreshNodesResourcesRequest.newInstance());
|
|
|
|
+ } catch (Exception ex) {
|
|
|
|
+ fail("Should not get any exceptions even when no configurations "
|
|
|
|
+ + "are done for node resources refresh");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
@Test
|
|
@Test
|
|
public void testAdminRefreshNodesResourcesWithFileSystemBasedConfigurationProvider()
|
|
public void testAdminRefreshNodesResourcesWithFileSystemBasedConfigurationProvider()
|
|
throws IOException, YarnException {
|
|
throws IOException, YarnException {
|