use of com.cloudera.api.swagger.model.ApiParcel in project cloudbreak by hortonworks.
the class ClouderaManagerParcelActivationListenerTask method doStatusCheck.
@Override
protected boolean doStatusCheck(ClouderaManagerCommandPollerObject pollerObject) throws ApiException {
ApiClient apiClient = pollerObject.getApiClient();
Stack stack = pollerObject.getStack();
ApiParcelList parcels = getClouderaManagerParcels(apiClient, stack.getName());
List<ApiParcel> notActivated = getNotActivatedOrMissingParcels(parcels);
if (notActivated.isEmpty()) {
LOGGER.debug("Parcels are activated.");
return true;
} else {
LOGGER.debug("Some parcels are not yet activated: [{}].", getJoinedParcelStages(notActivated));
return false;
}
}
use of com.cloudera.api.swagger.model.ApiParcel in project cloudbreak by hortonworks.
the class ClouderaManagerParcelStatusListenerTask method doStatusCheck.
@Override
protected boolean doStatusCheck(ClouderaManagerCommandPollerObject pollerObject) throws ApiException {
ApiClient apiClient = pollerObject.getApiClient();
Stack stack = pollerObject.getStack();
ApiParcelList parcels = getClouderaManagerParcels(apiClient, stack.getName());
List<ApiParcel> notInProperStateParcels = getNotInProperStateParcels(parcels);
if (notInProperStateParcels.isEmpty()) {
LOGGER.debug("Parcels are in the proper statuses: {}", parcelStatus);
return true;
} else {
LOGGER.debug("Some parcels are not yet in the proper status: [{}].", getJoinedParcelStages(notInProperStateParcels));
return false;
}
}
use of com.cloudera.api.swagger.model.ApiParcel in project cloudbreak by hortonworks.
the class RecipeClusterTest method testWhenClusterGetUpScaledThenPostClusterInstallRecipeShouldBeExecuted.
@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "a created cluster with post ambari install recipe", when = "upscaling cluster", then = "the post recipe should run on the new nodes as well")
public void testWhenClusterGetUpScaledThenPostClusterInstallRecipeShouldBeExecuted(MockedTestContext testContext) {
ApiParcel parcel = parcelGeneratorUtil.getActivatedCDHParcel();
String clusterName = resourcePropertyProvider.getName();
parcelMockActivatorUtil.mockActivateWithDefaultParcels(testContext, clusterName, parcel);
String recipeName = resourcePropertyProvider().getName();
testContext.given(RecipeTestDto.class).withName(recipeName).withContent(RECIPE_CONTENT).withRecipeType(POST_CLUSTER_INSTALL).when(recipeTestClient.createV4()).given(INSTANCE_GROUP_ID, InstanceGroupTestDto.class).withHostGroup(HostGroupType.WORKER).withNodeCount(NODE_COUNT).withRecipes(recipeName).given("computeIg", InstanceGroupTestDto.class).withHostGroup(HostGroupType.COMPUTE).withNodeCount(NODE_COUNT).withRecipes(recipeName).given("cmpkey", ClouderaManagerProductTestDto.class).withParcel("someParcel").withName(parcel.getProduct()).withVersion(parcel.getVersion()).given("cmanager", ClouderaManagerTestDto.class).withClouderaManagerProduct("cmpkey").given("cmpclusterkey", ClusterTestDto.class).withClouderaManager("cmanager").given(StackTestDto.class).withName(clusterName).replaceInstanceGroups(INSTANCE_GROUP_ID).withCluster("cmpclusterkey").when(stackTestClient.createV4()).enableVerification().await(STACK_AVAILABLE).when(StackScalePostAction.valid().withDesiredCount(4)).await(STACK_AVAILABLE, pollingInterval(POLLING_INTERVAL)).mockSalt().run().post().bodyContains(HIGHSTATE, 1).atLeast(1).verify().validate();
}
use of com.cloudera.api.swagger.model.ApiParcel in project cloudbreak by hortonworks.
the class RecipeClusterTest method testWhenRecipeProvidedToHostGroupAndAnotherHostGroupGetUpScaledThenThereIsNoFurtherRecipeExecutionOnTheNewNodeBesideTheDefaultOnes.
@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "a created cluster with post ambari recipe", when = "upscaling cluster on hostgroup which has no post install recipe", then = "the post recipe should not run on the new nodes because those recipe not configured on the upscaled hostgroup")
public void testWhenRecipeProvidedToHostGroupAndAnotherHostGroupGetUpScaledThenThereIsNoFurtherRecipeExecutionOnTheNewNodeBesideTheDefaultOnes(MockedTestContext testContext) {
ApiParcel parcel = parcelGeneratorUtil.getActivatedCDHParcel();
String recipeName = resourcePropertyProvider().getName();
String clusterName = resourcePropertyProvider.getName();
parcelMockActivatorUtil.mockActivateWithDefaultParcels(testContext, clusterName, parcel);
testContext.given(RecipeTestDto.class).withName(recipeName).withContent(RECIPE_CONTENT).withRecipeType(POST_CLOUDERA_MANAGER_START).when(recipeTestClient.createV4()).given(INSTANCE_GROUP_ID, InstanceGroupTestDto.class).withHostGroup(HostGroupType.COMPUTE).withNodeCount(NODE_COUNT).withRecipes(recipeName).given("cmpkey", ClouderaManagerProductTestDto.class).withParcel("someParcel").withName(parcel.getProduct()).withVersion(parcel.getVersion()).given("cmanager", ClouderaManagerTestDto.class).withClouderaManagerProduct("cmpkey").given("cmpclusterkey", ClusterTestDto.class).withClouderaManager("cmanager").given(StackTestDto.class).withName(clusterName).replaceInstanceGroups(INSTANCE_GROUP_ID).withCluster("cmpclusterkey").when(stackTestClient.createV4()).enableVerification().await(STACK_AVAILABLE).when(StackScalePostAction.valid().withDesiredCount(4)).await(STACK_AVAILABLE, pollingInterval(POLLING_INTERVAL)).mockSalt().run().post().bodyContains(HIGHSTATE, 1).atLeast(1).verify().validate();
}
use of com.cloudera.api.swagger.model.ApiParcel in project cloudbreak by hortonworks.
the class CMDownscaleWithHttp500ResponsesTest method testDownscale.
@Test(dataProvider = TEST_CONTEXT_WITH_MOCK)
@Description(given = "a stack with upscale", when = "upscale to 15 it downscale to 6", then = "stack is running")
public void testDownscale(MockedTestContext testContext) {
ApiParcel parcel = parcelGeneratorUtil.getActivatedCDHParcel();
String clusterName = resourcePropertyProvider().getName();
parcelMockActivatorUtil.mockActivateWithDefaultParcels(testContext, clusterName, parcel);
testContext.given("cmpkey", DistroXClouderaManagerProductTestDto.class).withParcel("someParcel").withName(parcel.getProduct()).withVersion(parcel.getVersion()).given("cmanager", DistroXClouderaManagerTestDto.class).withClouderaManagerProduct("cmpkey").given("cmpclusterkey", DistroXClusterTestDto.class).withClouderaManager("cmanager").given(clusterName, DistroXTestDto.class).withName(clusterName).withCluster("cmpclusterkey").when(distroXTestClient.create(), key(clusterName)).mockCm().profile(PROFILE_RETURN_HTTP_500, 1).await(STACK_AVAILABLE, key(clusterName).withIgnoredStatues(Set.of(Status.UNREACHABLE))).when(distroXTestClient.scale("worker", 15)).await(STACK_AVAILABLE, key(clusterName).withPollingInterval(POLLING_INTERVAL).withIgnoredStatues(Set.of(Status.UNREACHABLE))).when(distroXTestClient.scale("worker", 6)).await(STACK_AVAILABLE, key(clusterName).withPollingInterval(POLLING_INTERVAL).withIgnoredStatues(Set.of(Status.UNREACHABLE))).validate();
}
Aggregations