Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DG1924: Param changes in task vertex for add tags propagation to increase observability. #3878

Merged
merged 13 commits into from
Jan 13, 2025

Conversation

abhijeet-atlan
Copy link

@abhijeet-atlan abhijeet-atlan commented Dec 11, 2024

Change description

This PR contains changes for DG-1924 that:

  1. adds assetsCountToPropagate and assetsCountPropagated initialised with 0 in the task vertex when a task is created.
  2. updates assetsCountToPropagate with the value of propagation once impacted vertices calculation is finished.
  3. increments assetsCountPropagated in chunks of 100 as the task progresses (in case of tasks less than 100 its updated in one go.)
image image image image

Type of change

  • Bug fix (fixes an issue)
  • New feature (adds functionality)

Code review

  • Pull request has a descriptive title and context useful to a reviewer. Screenshots or screencasts are attached as necessary
  • "Ready for review" label attached and reviewers assigned
  • Changes have been reviewed by at least one other contributor
  • Pull request linked to task tracker where applicable

This commit streamlines the handling of asset propagation counts across task-related classes by removing outdated configurations and simplifications in the code:

- **Constants.java**: Removed the 'MODIFICATION_TASK_ASSET_COUNT_TO_PROPAGATE_PROPERTY_KEY', eliminating the configuration property for asset count thresholds.

- **AtlasTask.java**: Deleted the 'incrementAssetCountPropagated' method to reduce manual asset count manipulations.

- **ClassificationTask.java & MeaningsTask.java**: Removed methods setting asset counts to propagate, simplifying task executions.

- **AtlasTaskService.java**: Updated task initialization to set asset counts to zero, aligning with the new simplified approach.

- **TaskRegistry.java**: Removed an unnecessary sleep operation from the task update process.
Copy link
Collaborator

@hr2904 hr2904 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

}


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space. Though minor but good to change

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@@ -78,6 +78,7 @@

import javax.inject.Inject;
import java.util.*;
import java.util.concurrent.TimeUnit;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this if not being used in the code. found at 2 places, being imported but not used.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@@ -3459,7 +3462,7 @@ public List<String> propagateClassification(String entityGuid, String classifica
List<String> edgeLabelsToCheck = CLASSIFICATION_PROPAGATION_MODE_LABELS_MAP.get(propagationMode);
Boolean toExclude = propagationMode == CLASSIFICATION_PROPAGATION_MODE_RESTRICT_LINEAGE ? true:false;
List<AtlasVertex> impactedVertices = entityRetriever.getIncludedImpactedVerticesV2(entityVertex, relationshipGuid, classificationVertexId, edgeLabelsToCheck,toExclude);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix the indents please

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

currentTask.setAssetsCountToPropagate((long) verticesToPropagate.size());

//update the 'assetsCountToPropagate' in the current task vertex.
AtlasVertex currentTaskVertex = (AtlasVertex) graph.query().has(TASK_GUID, currentTask.getGuid()).vertices().iterator().next();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a method instead of using this 1 liner please

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for all the comments asking to make the graph call into a method instead of a one liner, me and janaki has discussed this and I will be doing that in version 2. Thats part of the code cleanup.

@@ -26,7 +27,7 @@ public interface TaskFactory {
* @param atlasTask
* @return
*/
AbstractTask create(AtlasTask atlasTask);
AbstractTask create(AtlasTask atlasTask) throws AtlasException;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious to know why are we allowing to throw error here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has been removed now, an implementation was complaining about missing exception. Corrected that in this PR, forgot to remove throwing this exception. Thanks

Copy link
Collaborator

@hr2904 hr2904 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@abhijeet-atlan abhijeet-atlan merged commit 08436df into beta Jan 13, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants