diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index f8a09b5589..189de0b9e2 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -26,6 +26,7 @@ on: - development - master - lineageondemand + - policyendpointsmasterss jobs: build: diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java index f9b2f30a7c..a5b168f1e7 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java @@ -135,12 +135,12 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore { private final ESAliasStore esAliasStore; - private final IAtlasAlternateChangeNotifier atlasAlternateChangeNotifier; + private final IAtlasMinimalChangeNotifier atlasAlternateChangeNotifier; @Inject public AtlasEntityStoreV2(AtlasGraph graph, DeleteHandlerDelegate deleteDelegate, RestoreHandlerV1 restoreHandlerV1, AtlasTypeRegistry typeRegistry, IAtlasEntityChangeNotifier entityChangeNotifier, EntityGraphMapper entityGraphMapper, TaskManagement taskManagement, AtlasRelationshipStore atlasRelationshipStore, FeatureFlagStore featureFlagStore, - IAtlasAlternateChangeNotifier atlasAlternateChangeNotifier) { + IAtlasMinimalChangeNotifier atlasAlternateChangeNotifier) { this.graph = graph; this.deleteDelegate = deleteDelegate; this.restoreHandlerV1 = restoreHandlerV1; @@ -2765,11 +2765,6 @@ public void unlinkBusinessPolicy(String policyGuid, Set unlinkGuids) thr private void handleBusinessPolicyMutation(List vertices) throws AtlasBaseException { AtlasPerfMetrics.MetricRecorder metricRecorder = RequestContext.get().startMetricRecord("handleBusinessPolicyMutation"); - vertices.forEach(vertex -> { - Map attributes = new HashMap<>(0); - attributes.put(ASSET_POLICY_GUIDS, vertex.getMultiValuedSetProperty(ASSET_POLICY_GUIDS, String.class)); - attributes.put(ASSET_POLICIES_COUNT, vertex.getPropertyValues(ASSET_POLICIES_COUNT, Long.class)); - }); this.atlasAlternateChangeNotifier.onEntitiesMutation(vertices); RequestContext.get().endMetricRecord(metricRecorder); } diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/BusinessPolicyNotifierImpl.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/BusinessPolicyNotifierImpl.java index 7de6b94702..fab059cfbe 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/BusinessPolicyNotifierImpl.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/BusinessPolicyNotifierImpl.java @@ -4,22 +4,19 @@ import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.listener.EntityChangeListenerV2; import org.apache.atlas.model.instance.AtlasEntity; -import org.apache.atlas.model.instance.AtlasEntityHeader; -import org.apache.atlas.model.instance.EntityMutationResponse; import org.apache.atlas.repository.graphdb.AtlasVertex; import org.apache.atlas.utils.AtlasPerfMetrics; import org.springframework.stereotype.Component; import javax.inject.Inject; import java.util.*; -import java.util.stream.Collectors; import static org.apache.atlas.repository.Constants.*; import static org.apache.atlas.repository.graph.GraphHelper.*; @Component -public class BusinessPolicyNotifierImpl implements IAtlasAlternateChangeNotifier { +public class BusinessPolicyNotifierImpl implements IAtlasMinimalChangeNotifier { private final Set entityChangeListenersV2; @@ -56,14 +53,9 @@ private AtlasEntity createAtlasEntity(AtlasVertex vertex) { atlasEntity.setIsIncomplete(vertex.getProperty(IS_INCOMPLETE_PROPERTY_KEY, Boolean.class)); atlasEntity.setStatus(getStatus(vertex)); atlasEntity.setProvenanceType(getProvenanceType(vertex)); - atlasEntity.setCustomAttributes(getCustomAttributes(vertex)); atlasEntity.setHomeId(getHomeId(vertex)); atlasEntity.setVersion(getVersion(vertex)); - atlasEntity.setAttribute(NAME, vertex.getProperty(NAME, String.class)); - atlasEntity.setAttribute(EntityGraphRetriever.DESCRIPTION, vertex.getProperty(EntityGraphRetriever.DESCRIPTION, String.class)); - atlasEntity.setAttribute(OWNER_ATTRIBUTE, vertex.getProperty(OWNER_ATTRIBUTE, String.class)); - atlasEntity.setAttribute(EntityGraphRetriever.CREATE_TIME, new Date(vertex.getProperty(TIMESTAMP_PROPERTY_KEY, Long.class))); return atlasEntity; } diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/IAtlasAlternateChangeNotifier.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/IAtlasMinimalChangeNotifier.java similarity index 90% rename from repository/src/main/java/org/apache/atlas/repository/store/graph/v2/IAtlasAlternateChangeNotifier.java rename to repository/src/main/java/org/apache/atlas/repository/store/graph/v2/IAtlasMinimalChangeNotifier.java index cbaf3a1d6e..35c2d9e757 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/IAtlasAlternateChangeNotifier.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/IAtlasMinimalChangeNotifier.java @@ -18,12 +18,10 @@ package org.apache.atlas.repository.store.graph.v2; import org.apache.atlas.exception.AtlasBaseException; -import org.apache.atlas.model.instance.*; import org.apache.atlas.repository.graphdb.AtlasVertex; import java.util.List; -import java.util.Map; -public interface IAtlasAlternateChangeNotifier { +public interface IAtlasMinimalChangeNotifier { void onEntitiesMutation(final List vertices) throws AtlasBaseException; } diff --git a/webapp/src/main/java/org/apache/atlas/web/rest/BusinessPolicyREST.java b/webapp/src/main/java/org/apache/atlas/web/rest/BusinessPolicyREST.java index 883607c8a3..ef252293a0 100644 --- a/webapp/src/main/java/org/apache/atlas/web/rest/BusinessPolicyREST.java +++ b/webapp/src/main/java/org/apache/atlas/web/rest/BusinessPolicyREST.java @@ -28,7 +28,7 @@ public class BusinessPolicyREST { private static final Logger LOG = LoggerFactory.getLogger(BusinessPolicyREST.class); - private static final Logger PERF_LOG = AtlasPerfTracer.getPerfLogger("rest.AlternateREST"); + private static final Logger PERF_LOG = AtlasPerfTracer.getPerfLogger("rest.BusinessPolicyREST"); private final AtlasEntityStore entitiesStore; @@ -62,7 +62,7 @@ public void linkBusinessPolicy(@PathParam("policyId") final String policyGuid, f try { // Start performance tracing if enabled if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) { - perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "AlternateREST.linkBusinessPolicy(" + policyGuid + ")"); + perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "BusinessPolicyREST.linkBusinessPolicy(" + policyGuid + ")"); } // Link the business policy to the specified entities @@ -99,7 +99,7 @@ public void unlinkBusinessPolicy(@PathParam("policyId") final String policyGuid, try { // Start performance tracing if enabled if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) { - perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "AlternateREST.unlinkBusinessPolicy(" + policyGuid + ")"); + perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "BusinessPolicyREST.unlinkBusinessPolicy(" + policyGuid + ")"); } // Unlink the business policy from the specified entities