Skip to content
Snippets Groups Projects
Commit e3bb9093 authored by Harshika Dhoot's avatar Harshika Dhoot
Browse files

Merge branch 'harshika-sch-del-latency' into 'master'

Removed retry attempts and call to storage service

See merge request !384
parents 2c9dcdf6 21e773d4
Branches
Tags
1 merge request!384Removed retry attempts and call to storage service
Pipeline #140142 failed
......@@ -377,11 +377,9 @@ The following software have components provided under the terms of this license:
- Byte Buddy Java agent (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent)
- ClassMate (from http://github.com/cowtowncoder/java-classmate)
- Cloud Key Management Service (KMS) API v1-rev20220407-1.32.1 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms)
- Cloud Key Management Service (KMS) API v1-rev20220617-1.32.1 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms)
- Cloud Key Management Service (KMS) API v1-rev20220701-1.32.1 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms)
- Cloud Storage JSON API v1-rev20220604-1.32.1 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage)
- Cloud Storage JSON API v1-rev20220608-1.32.1 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage)
- Cloud Storage JSON API v1-rev20220705-1.32.1 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage)
- Cloud Storage JSON API v1-rev20220705-2.0.0 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage)
- CloudWatch Metrics for AWS Java SDK (from https://aws.amazon.com/sdkforjava)
- Cobertura (from http://cobertura.sourceforge.net)
......@@ -432,7 +430,7 @@ The following software have components provided under the terms of this license:
- IBM COS SDK For Java (from https://github.com/ibm/ibm-cos-sdk-java)
- IBM COS SDK for Java - Core (from https://github.com/ibm/ibm-cos-sdk-java)
- Identity and Access Management (IAM) API v2beta-rev20220421-1.32.1 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-iam)
- Identity and Access Management (IAM) API v2beta-rev20220526-1.32.1 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-iam)
- Identity and Access Management (IAM) API v2beta-rev20220713-2.0.0 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-iam)
- J2ObjC Annotations (from https://github.com/google/j2objc/)
- JBoss Logging 3 (from http://www.jboss.org)
- JBoss Marshalling API (from https://repo1.maven.org/maven2/org/jboss/marshalling/jboss-marshalling)
......
......@@ -62,7 +62,7 @@ public class SchemaProviderImpl implements SchemaService {
@Override
public String getSchema(String kind) throws URISyntaxException, UnsupportedEncodingException {
String schemaServiceSchema = getFromSchemaService(kind);
return Objects.nonNull(schemaServiceSchema) ? schemaServiceSchema : getFromStorageService(kind);
return schemaServiceSchema;
}
protected String getFromSchemaService(String kind) throws UnsupportedEncodingException, URISyntaxException {
......
......@@ -147,25 +147,6 @@ public class SchemaProviderImplTest {
assertNull(recordSchemaResponse);
}
@Test
public void should_call_Schema_then_Storage() throws Exception {
String kind = "tenant:test:test:1.0.0";
SchemaProviderImpl schemaService = Mockito.mock(SchemaProviderImpl.class);
when(schemaService.getSchema(any())).thenCallRealMethod();
InOrder inOrder = inOrder(schemaService);
String recordSchemaResponse = schemaService.getSchema(kind);
assertNull(recordSchemaResponse);
inOrder.verify(schemaService).getSchema(any());
inOrder.verify(schemaService).getFromSchemaService(any());
inOrder.verify(schemaService).getFromStorageService(any());
verify(schemaService, times(1)).getFromStorageService(any());
verify(schemaService, times(1)).getFromSchemaService(any());
}
@Test
public void should_call_only_SchemaService_if_it_returns_result() throws Exception {
String kind = "tenant:test:test:1.0.0";
......
......@@ -85,13 +85,11 @@ public class RetryPolicy {
public boolean schemaRetryPolicy(HttpResponse response) {
if (retryOnEmptyResponse(response)) return false;
if (defaultResponseRetry(response)) return true;
if (response.getResponseCode() == 404) {
if (defaultResponseRetry(response)) {
log.info("Schema API retry");
return true;
}
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment