Search in sources :

Example 1 with YarnStackV4Parameters

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.stack.YarnStackV4Parameters 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 2 with YarnStackV4Parameters

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.stack.YarnStackV4Parameters in project cloudbreak by hortonworks.

the class YarnCloudProvider method stackParameters.

@Override
public YarnStackV4Parameters stackParameters() {
    YarnStackV4Parameters yarnStackV4Parameters = new YarnStackV4Parameters();
    yarnStackV4Parameters.setYarnQueue(getQueue());
    return yarnStackV4Parameters;
}
Also used : YarnStackV4Parameters(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.stack.YarnStackV4Parameters)

Example 3 with YarnStackV4Parameters

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.stack.YarnStackV4Parameters 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 YarnStackV4Parameters

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.stack.YarnStackV4Parameters in project cloudbreak by hortonworks.

the class DistroXParameterConverterTest method testYarnStackV4ParametersToYarnDistroXV1Parameters.

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

Example 5 with YarnStackV4Parameters

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.stack.YarnStackV4Parameters in project cloudbreak by hortonworks.

the class DistroXParameterConverterTest method testYarnDistroXV1ParametersToYarnStackV4Parameters.

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

Aggregations

YarnStackV4Parameters (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.stack.YarnStackV4Parameters)7 Test (org.junit.jupiter.api.Test)3 YarnDistroXV1Parameters (com.sequenceiq.distrox.api.v1.distrox.model.YarnDistroXV1Parameters)2 EnvironmentNetworkYarnParams (com.sequenceiq.environment.api.v1.environment.model.EnvironmentNetworkYarnParams)2 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)1