public AMRMClient.ContainerRequest getContainerRequest(
            Resource containerResource, Priority priority, String nodeLabel) {
        if (StringUtils.isNullOrWhitespaceOnly(nodeLabel) || defaultConstructor == null) {
            return new AMRMClient.ContainerRequest(containerResource, null, null, priority);
        }

        try {
            /**
             * Set the param of relaxLocality to true, which tells the Yarn ResourceManager if the
             * application wants locality to be loose (i.e. allows fall-through to rack or any)
             */
            return defaultConstructor.newInstance(
                    containerResource, null, null, priority, true, nodeLabel);
        } catch (InvocationTargetException | InstantiationException | IllegalAccessException e) {
            LOG.warn("Errors on creating Container Request.", e);
        }

        return new AMRMClient.ContainerRequest(containerResource, null, null, priority);
    }
@Test
    void testGetContainerRequestIfConstructorAbsent() {
        final ContainerRequestReflector containerRequestReflector =
                new ContainerRequestReflector(ContainerRequestWithoutConstructor.class);
        Resource resource = Resource.newInstance(100, 1);
        Priority priority = Priority.newInstance(1);

        AMRMClient.ContainerRequest containerRequest =
                containerRequestReflector.getContainerRequest(resource, priority, "GPU");
        assertThat(containerRequest).isNotInstanceOf(ContainerRequestWithoutConstructor.class);

        containerRequest = containerRequestReflector.getContainerRequest(resource, priority, null);
        assertThat(containerRequest).isNotInstanceOf(ContainerRequestWithoutConstructor.class);

        containerRequest = containerRequestReflector.getContainerRequest(resource, priority, "");
        assertThat(containerRequest).isNotInstanceOf(ContainerRequestWithoutConstructor.class);
    }