in aws-sagemaker-featuregroup/src/main/java/software/amazon/sagemaker/featuregroup/CreateHandler.java [74:109]
private boolean stabilizedOnCreate(
final CreateFeatureGroupRequest awsRequest,
final CreateFeatureGroupResponse awsResponse,
final ProxyClient<SageMakerClient> proxyClient,
final ResourceModel model,
final CallbackContext callbackContext) {
if (model.getFeatureGroupName() == null) {
model.setFeatureGroupName(awsRequest.featureGroupName());
}
final FeatureGroupStatus featureGroupStatus;
try {
featureGroupStatus = proxyClient.injectCredentialsAndInvokeV2(
TranslatorForRequest.translateToReadRequest(model),
proxyClient.client()::describeFeatureGroup).featureGroupStatus();
} catch (ResourceNotFoundException rnfe) {
logger.log(String.format("Resource not found for %s, stabilizing.", model.getPrimaryIdentifier()));
return false;
}
switch (featureGroupStatus) {
case CREATED:
logger.log(String.format("%s [%s] has been stabilized with status %s.", ResourceModel.TYPE_NAME,
model.getPrimaryIdentifier(), featureGroupStatus));
return true;
case CREATING:
logger.log(String.format("%s [%s] is stabilizing.", ResourceModel.TYPE_NAME,
model.getPrimaryIdentifier()));
return false;
default:
logger.log(String.format("%s [%s] failed to stabilize with status: %s.", ResourceModel.TYPE_NAME,
model.getPrimaryIdentifier(), featureGroupStatus));
throw new CfnNotStabilizedException(ResourceModel.TYPE_NAME, model.getFeatureGroupName());
}
}