Skip to content

Commit

Permalink
Fix merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
david-leifker committed Jul 24, 2023
1 parent e795eca commit f87b74e
Show file tree
Hide file tree
Showing 67 changed files with 346 additions and 324 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public CompletableFuture<Boolean> get(DataFetchingEnvironment environment) throw
updateEmbed(embed, input);

final MetadataChangeProposal proposal = buildMetadataChangeProposalWithUrn(entityUrn, EMBED_ASPECT_NAME, embed);
_entityService.ingestSingleProposal(
_entityService.ingestProposal(
proposal,
new AuditStamp().setActor(UrnUtils.getUrn(context.getActorUrn())).setTime(System.currentTimeMillis()),
false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private MutationUtils() { }

public static void persistAspect(Urn urn, String aspectName, RecordTemplate aspect, Urn actor, EntityService entityService) {
final MetadataChangeProposal proposal = buildMetadataChangeProposalWithUrn(urn, aspectName, aspect);
entityService.ingestSingleProposal(proposal, getAuditStamp(actor), false);
entityService.ingestProposal(proposal, getAuditStamp(actor), false);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public CompletableFuture<Boolean> get(DataFetchingEnvironment environment) throw
MetadataChangeProposal proposal =
buildMetadataChangeProposalWithUrn(actor, CORP_USER_SETTINGS_ASPECT_NAME, newSettings);

_entityService.ingestSingleProposal(proposal, getAuditStamp(actor), false);
_entityService.ingestProposal(proposal, getAuditStamp(actor), false);

return true;
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.linkedin.metadata.Constants;
import com.linkedin.metadata.authorization.PoliciesConfig;
import com.linkedin.metadata.entity.EntityService;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatch;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatchImpl;
import com.linkedin.mxe.MetadataChangeProposal;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -73,7 +73,7 @@ private static MetadataChangeProposal buildSoftDeleteProposal(
}

private static void ingestChangeProposals(List<MetadataChangeProposal> changes, EntityService entityService, Urn actor) {
entityService.ingestProposal(AspectsBatch.builder()
entityService.ingestProposal(AspectsBatchImpl.builder()
.mcps(changes, entityService.getEntityRegistry()).build(), getAuditStamp(actor), false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.linkedin.metadata.Constants;
import com.linkedin.metadata.authorization.PoliciesConfig;
import com.linkedin.metadata.entity.EntityService;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatch;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatchImpl;
import com.linkedin.mxe.MetadataChangeProposal;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -88,7 +88,7 @@ private static MetadataChangeProposal buildUpdateDeprecationProposal(
}

private static void ingestChangeProposals(List<MetadataChangeProposal> changes, EntityService entityService, Urn actor) {
entityService.ingestProposal(AspectsBatch.builder()
entityService.ingestProposal(AspectsBatchImpl.builder()
.mcps(changes, entityService.getEntityRegistry()).build(), getAuditStamp(actor), false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.linkedin.metadata.Constants;
import com.linkedin.metadata.authorization.PoliciesConfig;
import com.linkedin.metadata.entity.EntityService;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatch;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatchImpl;
import com.linkedin.mxe.MetadataChangeProposal;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -87,7 +87,7 @@ public static void validateDomain(Urn domainUrn, EntityService entityService) {
}

private static void ingestChangeProposals(List<MetadataChangeProposal> changes, EntityService entityService, Urn actor) {
entityService.ingestProposal(AspectsBatch.builder()
entityService.ingestProposal(AspectsBatchImpl.builder()
.mcps(changes, entityService.getEntityRegistry()).build(), getAuditStamp(actor), false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.linkedin.datahub.graphql.resolvers.mutate.MutationUtils;
import com.linkedin.metadata.authorization.PoliciesConfig;
import com.linkedin.metadata.entity.EntityService;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatch;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatchImpl;
import com.linkedin.mxe.MetadataChangeProposal;
import com.linkedin.schema.EditableSchemaFieldInfo;
import com.linkedin.schema.EditableSchemaMetadata;
Expand Down Expand Up @@ -559,7 +559,7 @@ private static GlossaryTermAssociationArray removeTermsIfExists(GlossaryTerms te
}

private static void ingestChangeProposals(List<MetadataChangeProposal> changes, EntityService entityService, Urn actor) {
entityService.ingestProposal(AspectsBatch.builder()
entityService.ingestProposal(AspectsBatchImpl.builder()
.mcps(changes, entityService.getEntityRegistry()).build(), getAuditStamp(actor), false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.linkedin.metadata.Constants;
import com.linkedin.metadata.authorization.PoliciesConfig;
import com.linkedin.metadata.entity.EntityService;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatch;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatchImpl;
import com.linkedin.mxe.MetadataChangeProposal;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -270,7 +270,7 @@ public static Boolean validateRemoveInput(
}

private static void ingestChangeProposals(List<MetadataChangeProposal> changes, EntityService entityService, Urn actor) {
entityService.ingestProposal(AspectsBatch.builder()
entityService.ingestProposal(AspectsBatchImpl.builder()
.mcps(changes, entityService.getEntityRegistry()).build(), getAuditStamp(actor), false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.linkedin.common.AuditStamp;
import com.linkedin.common.urn.UrnUtils;
import com.linkedin.metadata.entity.EntityService;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatch;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatchImpl;
import com.linkedin.metadata.models.registry.ConfigEntityRegistry;
import com.linkedin.metadata.models.registry.EntityRegistry;
import com.linkedin.mxe.MetadataChangeProposal;
Expand Down Expand Up @@ -104,7 +104,7 @@ public static void verifyIngestProposal(EntityService mockService, int numberOfI
}

public static void verifyIngestProposal(EntityService mockService, int numberOfInvocations, List<MetadataChangeProposal> proposals) {
AspectsBatch batch = AspectsBatch.builder()
AspectsBatchImpl batch = AspectsBatchImpl.builder()
.mcps(proposals, mockService.getEntityRegistry())
.build();
Mockito.verify(mockService, Mockito.times(numberOfInvocations)).ingestProposal(
Expand All @@ -115,7 +115,7 @@ public static void verifyIngestProposal(EntityService mockService, int numberOfI
}

public static void verifySingleIngestProposal(EntityService mockService, int numberOfInvocations, MetadataChangeProposal proposal) {
Mockito.verify(mockService, Mockito.times(numberOfInvocations)).ingestSingleProposal(
Mockito.verify(mockService, Mockito.times(numberOfInvocations)).ingestProposal(
Mockito.eq(proposal),
Mockito.any(AuditStamp.class),
Mockito.eq(false)
Expand All @@ -124,14 +124,14 @@ public static void verifySingleIngestProposal(EntityService mockService, int num

public static void verifyIngestProposal(EntityService mockService, int numberOfInvocations) {
Mockito.verify(mockService, Mockito.times(numberOfInvocations)).ingestProposal(
Mockito.any(AspectsBatch.class),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class),
Mockito.eq(false)
);
}

public static void verifySingleIngestProposal(EntityService mockService, int numberOfInvocations) {
Mockito.verify(mockService, Mockito.times(numberOfInvocations)).ingestSingleProposal(
Mockito.verify(mockService, Mockito.times(numberOfInvocations)).ingestProposal(
Mockito.any(MetadataChangeProposal.class),
Mockito.any(AuditStamp.class),
Mockito.eq(false)
Expand All @@ -140,8 +140,7 @@ public static void verifySingleIngestProposal(EntityService mockService, int num

public static void verifyNoIngestProposal(EntityService mockService) {
Mockito.verify(mockService, Mockito.times(0)).ingestProposal(
Mockito.any(),
Mockito.any(AuditStamp.class), Mockito.anyBoolean());
Mockito.any(AspectsBatchImpl.class), Mockito.any(AuditStamp.class), Mockito.anyBoolean());
}

private TestUtils() { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.linkedin.datahub.graphql.resolvers.mutate.MutationUtils;
import com.linkedin.metadata.Constants;
import com.linkedin.metadata.entity.EntityService;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatchImpl;
import com.linkedin.mxe.MetadataChangeProposal;
import graphql.schema.DataFetchingEnvironment;

Expand Down Expand Up @@ -165,7 +166,7 @@ public void testGetEntityClientException() throws Exception {
EntityService mockService = getMockEntityService();

Mockito.doThrow(RuntimeException.class).when(mockService).ingestProposal(
Mockito.any(),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class), Mockito.anyBoolean());

BatchUpdateSoftDeletedResolver resolver = new BatchUpdateSoftDeletedResolver(mockService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.linkedin.datahub.graphql.resolvers.mutate.MutationUtils;
import com.linkedin.metadata.Constants;
import com.linkedin.metadata.entity.EntityService;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatchImpl;
import com.linkedin.mxe.MetadataChangeProposal;
import graphql.schema.DataFetchingEnvironment;

Expand Down Expand Up @@ -183,7 +184,7 @@ public void testGetEntityClientException() throws Exception {
EntityService mockService = getMockEntityService();

Mockito.doThrow(RuntimeException.class).when(mockService).ingestProposal(
Mockito.any(),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class), Mockito.anyBoolean());

BatchUpdateDeprecationResolver resolver = new BatchUpdateDeprecationResolver(mockService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.linkedin.events.metadata.ChangeType;
import com.linkedin.metadata.Constants;
import com.linkedin.metadata.entity.EntityService;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatchImpl;
import com.linkedin.metadata.utils.GenericRecordUtils;
import com.linkedin.mxe.MetadataChangeProposal;
import graphql.schema.DataFetchingEnvironment;
Expand Down Expand Up @@ -277,7 +278,7 @@ public void testGetEntityClientException() throws Exception {
EntityService mockService = getMockEntityService();

Mockito.doThrow(RuntimeException.class).when(mockService).ingestProposal(
Mockito.any(),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class), Mockito.anyBoolean());

BatchSetDomainResolver resolver = new BatchSetDomainResolver(mockService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.linkedin.entity.client.EntityClient;
import com.linkedin.metadata.Constants;
import com.linkedin.metadata.entity.EntityService;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatchImpl;
import com.linkedin.mxe.MetadataChangeProposal;
import com.linkedin.r2.RemoteInvocationException;
import graphql.schema.DataFetchingEnvironment;
Expand Down Expand Up @@ -136,7 +137,7 @@ public void testGetFailureEntityDoesNotExist() throws Exception {

assertThrows(CompletionException.class, () -> resolver.get(mockEnv).join());
Mockito.verify(mockService, Mockito.times(0)).ingestProposal(
Mockito.any(),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class),
Mockito.eq(false)
);;
Expand All @@ -156,7 +157,7 @@ public void testGetUnauthorized() throws Exception {

assertThrows(CompletionException.class, () -> resolver.get(mockEnv).join());
Mockito.verify(mockService, Mockito.times(0)).ingestProposal(
Mockito.any(),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class),
Mockito.eq(false)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.linkedin.datahub.graphql.resolvers.mutate.util.OwnerUtils;
import com.linkedin.metadata.Constants;
import com.linkedin.metadata.entity.EntityService;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatchImpl;
import graphql.schema.DataFetchingEnvironment;
import java.util.concurrent.CompletionException;
import org.mockito.Mockito;
Expand Down Expand Up @@ -198,7 +199,7 @@ public void testGetEntityClientException() throws Exception {
EntityService mockService = getMockEntityService();

Mockito.doThrow(RuntimeException.class).when(mockService).ingestProposal(
Mockito.any(),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class), Mockito.anyBoolean());

AddOwnersResolver resolver = new AddOwnersResolver(Mockito.mock(EntityService.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.linkedin.datahub.graphql.resolvers.mutate.util.OwnerUtils;
import com.linkedin.metadata.Constants;
import com.linkedin.metadata.entity.EntityService;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatchImpl;
import graphql.schema.DataFetchingEnvironment;
import java.util.concurrent.CompletionException;
import org.mockito.Mockito;
Expand Down Expand Up @@ -280,7 +281,7 @@ public void testGetEntityClientException() throws Exception {
EntityService mockService = getMockEntityService();

Mockito.doThrow(RuntimeException.class).when(mockService).ingestProposal(
Mockito.any(),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class), Mockito.anyBoolean());

BatchAddOwnersResolver resolver = new BatchAddOwnersResolver(mockService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.linkedin.datahub.graphql.resolvers.mutate.BatchRemoveOwnersResolver;
import com.linkedin.metadata.Constants;
import com.linkedin.metadata.entity.EntityService;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatchImpl;
import graphql.schema.DataFetchingEnvironment;
import java.util.concurrent.CompletionException;
import org.mockito.Mockito;
Expand Down Expand Up @@ -175,7 +176,7 @@ public void testGetEntityClientException() throws Exception {
EntityService mockService = getMockEntityService();

Mockito.doThrow(RuntimeException.class).when(mockService).ingestProposal(
Mockito.any(),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class), Mockito.anyBoolean());

BatchRemoveOwnersResolver resolver = new BatchRemoveOwnersResolver(mockService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.linkedin.datahub.graphql.resolvers.mutate.AddTagsResolver;
import com.linkedin.datahub.graphql.resolvers.mutate.MutationUtils;
import com.linkedin.metadata.entity.EntityService;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatchImpl;
import com.linkedin.mxe.MetadataChangeProposal;
import graphql.schema.DataFetchingEnvironment;
import java.util.concurrent.CompletionException;
Expand Down Expand Up @@ -206,7 +207,7 @@ public void testGetEntityClientException() throws Exception {
EntityService mockService = getMockEntityService();

Mockito.doThrow(RuntimeException.class).when(mockService).ingestProposal(
Mockito.any(),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class), Mockito.eq(false));

AddTagsResolver resolver = new AddTagsResolver(Mockito.mock(EntityService.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.linkedin.datahub.graphql.resolvers.mutate.MutationUtils;
import com.linkedin.metadata.Constants;
import com.linkedin.metadata.entity.EntityService;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatchImpl;
import com.linkedin.mxe.MetadataChangeProposal;
import graphql.schema.DataFetchingEnvironment;

Expand Down Expand Up @@ -184,7 +185,7 @@ public void testGetFailureTagDoesNotExist() throws Exception {

assertThrows(CompletionException.class, () -> resolver.get(mockEnv).join());
Mockito.verify(mockService, Mockito.times(0)).ingestProposal(
Mockito.any(),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class), Mockito.anyBoolean());
}

Expand Down Expand Up @@ -223,7 +224,7 @@ public void testGetFailureResourceDoesNotExist() throws Exception {

assertThrows(CompletionException.class, () -> resolver.get(mockEnv).join());
Mockito.verify(mockService, Mockito.times(0)).ingestProposal(
Mockito.any(),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class), Mockito.anyBoolean());
}

Expand All @@ -247,7 +248,7 @@ public void testGetUnauthorized() throws Exception {

assertThrows(CompletionException.class, () -> resolver.get(mockEnv).join());
Mockito.verify(mockService, Mockito.times(0)).ingestProposal(
Mockito.any(),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class), Mockito.anyBoolean());
}

Expand All @@ -256,7 +257,7 @@ public void testGetEntityClientException() throws Exception {
EntityService mockService = getMockEntityService();

Mockito.doThrow(RuntimeException.class).when(mockService).ingestProposal(
Mockito.any(),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class), Mockito.anyBoolean());

BatchAddTagsResolver resolver = new BatchAddTagsResolver(mockService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.linkedin.events.metadata.ChangeType;
import com.linkedin.metadata.Constants;
import com.linkedin.metadata.entity.EntityService;
import com.linkedin.metadata.entity.ebean.transactions.AspectsBatchImpl;
import com.linkedin.metadata.utils.GenericRecordUtils;
import com.linkedin.mxe.MetadataChangeProposal;
import graphql.schema.DataFetchingEnvironment;
Expand Down Expand Up @@ -179,7 +180,7 @@ public void testGetFailureResourceDoesNotExist() throws Exception {

assertThrows(CompletionException.class, () -> resolver.get(mockEnv).join());
Mockito.verify(mockService, Mockito.times(0)).ingestProposal(
Mockito.any(),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class), Mockito.anyBoolean());
}

Expand All @@ -203,7 +204,7 @@ public void testGetUnauthorized() throws Exception {

assertThrows(CompletionException.class, () -> resolver.get(mockEnv).join());
Mockito.verify(mockService, Mockito.times(0)).ingestProposal(
Mockito.any(),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class), Mockito.anyBoolean());
}

Expand All @@ -212,7 +213,7 @@ public void testGetEntityClientException() throws Exception {
EntityService mockService = getMockEntityService();

Mockito.doThrow(RuntimeException.class).when(mockService).ingestProposal(
Mockito.any(),
Mockito.any(AspectsBatchImpl.class),
Mockito.any(AuditStamp.class), Mockito.anyBoolean());

BatchRemoveTagsResolver resolver = new BatchRemoveTagsResolver(mockService);
Expand Down
Loading

0 comments on commit f87b74e

Please sign in to comment.