in common/src/main/java/com/amazonaws/services/schemaregistry/common/AWSSchemaRegistryClient.java [366:404]
private GetSchemaVersionResponse waitForSchemaEvolutionCheckToComplete(GetSchemaVersionRequest getSchemaVersionRequest) {
GetSchemaVersionResponse response;
try {
int retries = 0;
Thread.sleep(MAX_WAIT_INTERVAL);
do {
response = client.getSchemaVersion(getSchemaVersionRequest);
if (AWSSchemaRegistryConstants.SchemaVersionStatus.AVAILABLE.toString()
.equals(response.statusAsString())) {
return response;
} else if (!AWSSchemaRegistryConstants.SchemaVersionStatus.PENDING.toString()
.equals(response.statusAsString())) {
throw new AWSSchemaRegistryException(String.format("Schema evolution check failed. "
+ "schemaVersionId %s is in %s status.",
getSchemaVersionRequest.schemaVersionId(),
response.statusAsString()));
}
} while (retries++ < MAX_ATTEMPTS - 1);
if (retries >= MAX_ATTEMPTS && !AWSSchemaRegistryConstants.SchemaVersionStatus.AVAILABLE.toString()
.equals(response.statusAsString())) {
throw new AWSSchemaRegistryException(String.format("Retries exhausted for schema evolution check for "
+ "schemaVersionId = %s",
getSchemaVersionRequest.schemaVersionId()));
}
} catch (Exception ex) {
String message =
String.format("Exception occurred, while performing schema evolution check for schemaVersionId = "
+ "%s", getSchemaVersionRequest.schemaVersionId());
throw new AWSSchemaRegistryException(message, ex);
}
return response;
}