Class LineageGraphStorageService

  • All Implemented Interfaces:
    LineageGraph

    public class LineageGraphStorageService
    extends java.lang.Object
    implements LineageGraph
    • Constructor Detail

      • LineageGraphStorageService

        public LineageGraphStorageService​(GraphHelper graphHelper,
                                          AuditLog auditLog)
    • Method Detail

      • storeToGraph

        public void storeToGraph​(java.util.Set<GraphContext> graphContext)
        Creates vertices and the relationships between them
        Specified by:
        storeToGraph in interface LineageGraph
        Parameters:
        graphContext - - graph Collection that contains vertices and edges to be stored
      • updateNeighbours

        public void updateNeighbours​(LineageSyncUpdateContext syncUpdateContext)
        Updates the neighbours of a node by removing all the entities that no longer have a relationship with it.

        SyncUpdateContext contains the context for syncing the relationships of a node after an update.

        Specified by:
        updateNeighbours in interface LineageGraph
      • updateEntity

        public void updateEntity​(LineageEntity lineageEntity)
        Updates the properties of a vertex
        Specified by:
        updateEntity in interface LineageGraph
        Parameters:
        lineageEntity - - LineageEntity object that has the updated values
      • upsertRelationship

        public void upsertRelationship​(LineageRelationship lineageRelationship)
        Create or update the relationship between two edges In case the vertexes are not created, they are firstly created
        Specified by:
        upsertRelationship in interface LineageGraph
        Parameters:
        lineageRelationship - relationship to be updated or created
      • updateRelationship

        public void updateRelationship​(LineageRelationship lineageRelationship)
        Updates the properties of an edge
        Specified by:
        updateRelationship in interface LineageGraph
        Parameters:
        lineageRelationship - - lineageRelationship object that has the updated values
      • updateClassification

        public void updateClassification​(java.util.Set<GraphContext> classificationContext)
        Updates the classification of a vertex
        Specified by:
        updateClassification in interface LineageGraph
        Parameters:
        classificationContext - - LineageEntity object that has the updated values
      • deleteClassification

        public void deleteClassification​(java.util.Set<GraphContext> classificationContext)
        Deletes a classification of a vertex
        Specified by:
        deleteClassification in interface LineageGraph
        Parameters:
        classificationContext - - any remaining classifications, empty map if none
      • deleteRelationship

        public void deleteRelationship​(java.lang.String guid)
        Description copied from interface: LineageGraph
        Deletes a relationship in the graph
        Specified by:
        deleteRelationship in interface LineageGraph
        Parameters:
        guid - unique identifier of the entity to be deleted
      • deleteEntity

        public void deleteEntity​(java.lang.String guid,
                                 java.lang.Object version)
        Description copied from interface: LineageGraph
        /** Deletes a vertex in the graph
        Specified by:
        deleteEntity in interface LineageGraph
        Parameters:
        guid - unique identifier of the entity to be deleted
        version - version of the entity to be deleted
      • saveAssetLineageUpdateTime

        public void saveAssetLineageUpdateTime​(java.lang.Long lastUpdateTime)
        Description copied from interface: LineageGraph
        Save last asset lineage update time in the graph
        Specified by:
        saveAssetLineageUpdateTime in interface LineageGraph
        Parameters:
        lastUpdateTime - the standard epoch time in milliseconds
      • handleSaveAssetLineageUpdateTimeException

        public void handleSaveAssetLineageUpdateTimeException​(java.lang.Exception e)
      • getAssetLineageUpdateTime

        public java.util.Optional<java.lang.Long> getAssetLineageUpdateTime()
        Description copied from interface: LineageGraph
        Gets last asset lineage update time from the graph
        Specified by:
        getAssetLineageUpdateTime in interface LineageGraph
        Returns:
        last update time represented as epoch time milliseconds
      • isEntityInGraph

        public java.lang.Boolean isEntityInGraph​(java.lang.String guid)
        Returns whether an entity exists in the graph or not
        Specified by:
        isEntityInGraph in interface LineageGraph
        Parameters:
        guid - the lineage entity guid
        Returns: