Search in sources :

Example 1 with EnvironmentNetworkYarnParams

use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkYarnParams in project cloudbreak by hortonworks.

the class NetworkRequestToDtoConverterTest method createYarnParams.

private EnvironmentNetworkYarnParams createYarnParams() {
    EnvironmentNetworkYarnParams yarnParams = new EnvironmentNetworkYarnParams();
    yarnParams.setQueue("yarn-queue");
    yarnParams.setLifetime(1000);
    return yarnParams;
}
Also used : EnvironmentNetworkYarnParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkYarnParams)

Example 2 with EnvironmentNetworkYarnParams

use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkYarnParams in project cloudbreak by hortonworks.

the class DistroXParameterConverterTest method testEnvironmentNetworkYarnParamsToYarnStackV4Parameters.

@Test
void testEnvironmentNetworkYarnParamsToYarnStackV4Parameters() {
    EnvironmentNetworkYarnParams input = new EnvironmentNetworkYarnParams();
    input.setLifetime(10);
    input.setQueue("queue");
    YarnStackV4Parameters result = underTest.convert(input);
    assertNotNull(result);
    assertEquals(input.getLifetime(), result.getLifetime());
    assertEquals(input.getQueue(), result.getYarnQueue());
}
Also used : YarnStackV4Parameters(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.stack.YarnStackV4Parameters) EnvironmentNetworkYarnParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkYarnParams) Test(org.junit.jupiter.api.Test)

Example 3 with EnvironmentNetworkYarnParams

use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkYarnParams in project cloudbreak by hortonworks.

the class StackRequestManifester method setupYarnDetails.

private void setupYarnDetails(DetailedEnvironmentResponse environment, StackV4Request stackRequest) {
    if (stackRequest.getYarn() == null || stackRequest.getYarn().getYarnQueue() == null) {
        if (environment.getNetwork() == null || environment.getNetwork().getYarn() == null || environment.getNetwork().getYarn().getQueue() == null) {
            throw new BadRequestException("There is no queue defined in your environment, please create a new yarn environment with queue");
        } else {
            EnvironmentNetworkYarnParams yarnParams = environment.getNetwork().getYarn();
            YarnStackV4Parameters yarnStackV4Parameters = new YarnStackV4Parameters();
            yarnStackV4Parameters.setYarnQueue(yarnParams.getQueue());
            yarnStackV4Parameters.setLifetime(yarnParams.getLifetime());
            stackRequest.setYarn(yarnStackV4Parameters);
        }
    }
}
Also used : BadRequestException(com.sequenceiq.cloudbreak.common.exception.BadRequestException) YarnStackV4Parameters(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.stack.YarnStackV4Parameters) EnvironmentNetworkYarnParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkYarnParams)

Example 4 with EnvironmentNetworkYarnParams

use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkYarnParams in project cloudbreak by hortonworks.

the class NetworkV1ToNetworkV4ConverterTest method yarnEnvironmentNetwork.

private DetailedEnvironmentResponse yarnEnvironmentNetwork() {
    DetailedEnvironmentResponse der = new DetailedEnvironmentResponse();
    der.setCloudPlatform("YARN");
    EnvironmentNetworkResponse environmentNetworkResponse = new EnvironmentNetworkResponse();
    EnvironmentNetworkYarnParams environmentNetwork = new EnvironmentNetworkYarnParams();
    environmentNetwork.setQueue("default");
    environmentNetworkResponse.setYarn(environmentNetwork);
    der.setNetwork(environmentNetworkResponse);
    return der;
}
Also used : DetailedEnvironmentResponse(com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse) EnvironmentNetworkResponse(com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse) EnvironmentNetworkYarnParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkYarnParams)

Example 5 with EnvironmentNetworkYarnParams

use of com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkYarnParams in project cloudbreak by hortonworks.

the class YarnCloudProvider method environmentNetworkParameters.

private EnvironmentNetworkYarnParams environmentNetworkParameters() {
    EnvironmentNetworkYarnParams environmentNetworkYarnParams = new EnvironmentNetworkYarnParams();
    environmentNetworkYarnParams.setQueue(getQueue());
    return environmentNetworkYarnParams;
}
Also used : EnvironmentNetworkYarnParams(com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkYarnParams)

Aggregations

EnvironmentNetworkYarnParams (com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkYarnParams)5 YarnStackV4Parameters (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.stack.YarnStackV4Parameters)2 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)1 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)1 EnvironmentNetworkResponse (com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse)1 Test (org.junit.jupiter.api.Test)1