Package org.deltafi.common.types
Class DeltaFile
java.lang.Object
org.deltafi.common.types.DeltaFile
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledgeError(OffsetDateTime now, String reason) actionNamed(String flow, String name) addAction(String flow, String name, ActionType type, ActionState state) voidaddAnnotationIfAbsent(String key, String value) voidaddAnnotations(Map<String, String> metadata) voidaddAnnotationsIfAbsent(Map<String, String> metadata) voidaddEgressFlow(String flow) voidaddPendingAnnotationsForFlow(String flowName) Add the given flow to the set of pendingAnnotationsForFlows for this DeltaFile Do nothing if the given set is null or emptyvoidaddReadyToCollectAction(String flow, String name, ActionType type) booleanvoidcancel()voidvoidvoidcollectedAction(String flow, String name, OffsetDateTime start, OffsetDateTime stop) voidcollectingAction(String flow, String name, OffsetDateTime start, OffsetDateTime stop) completeAction(String flow, String name, OffsetDateTime start, OffsetDateTime stop) completeAction(String flow, String name, OffsetDateTime start, OffsetDateTime stop, List<Content> content, Map<String, String> metadata, List<String> deleteMetadataKeys, List<Domain> domains, List<Enrichment> enrichments) completeAction(ActionEvent event) voidcompleteAction(ActionEvent event, List<Content> content, Map<String, String> metadata, List<String> deleteMetadataKeys, List<Domain> domains, List<Enrichment> enrichments) domains()voidensurePendingAction(String flow, String name) voiderrorAction(String flow, String name, OffsetDateTime start, OffsetDateTime stop, String errorCause, String errorContext) voiderrorAction(String flow, String name, OffsetDateTime start, OffsetDateTime stop, String errorCause, String errorContext, OffsetDateTime nextAutoResume) voiderrorAction(ActionEvent event) voiderrorAction(ActionEvent event, String policyName, Integer delay) voiderrorAction(ActionEvent event, String errorCause, String errorContext) voidfilterAction(ActionEvent event, String filterMessage) booleanformatComplete(String flow) formatContent(String flow) formatMetadata(String flow) Assemble formatted metadata based on a given flow.org.springframework.data.mongodb.core.query.UpdategetErrorMetadata(Action action) Get metadata, considering whether the given action is post-formatting.Get the cumulative metadata from all actions that amend data through the load and enrich actions as well as retried format actions This method retrieves a copy of source metadata, and then applies changes from all actions that amended data.getPendingAction(String flow, String name) booleanhasActionInState(String flow, String name, ActionState state) booleanhasActionInState(ActionState actionState) booleanhasCollectedAction(String flow, String name) booleanhasCompletedAction(String flow, String name) booleanhasCompletedActions(String flow, List<String> names) booleanhasDomains(List<String> domains) booleanhasEnrichments(List<String> enrichments) booleanbooleanbooleanbooleanbooleanhasTerminalAction(String flow, String name) booleanvoidbooleanisNewAction(String flow, String name) lastAction(String actionName) lastFormatAction(String flow) pendingAnnotations(Set<String> expectedAnnotations) Get the set of annotations that are still pending from the given set of expected annotationsqueueAction(String flow, String name, ActionType type, boolean coldQueue) queueNewAction(String flow, String name, ActionType type, boolean coldQueue) voidvoidreinjectAction(ActionEvent event) voidretriedEgressActions(String flow) retryErrors(List<ResumeMetadata> resumeMetadata) voidsetContentDeleted(OffsetDateTime contentDeleted) voidvoidsetStage(DeltaFileStage stage) voidsetTestModeReason(String reason) voidsnapshot()sourceMetadata(String key) sourceMetadata(String key, String defaultValue) voidvoidupdatePendingAnnotationsForFlows(String flow, Set<String> expectedAnnotations) Check if the set of expected annotations are satisfied for the given flow.
-
Field Details
-
CURRENT_SCHEMA_VERSION
public static final int CURRENT_SCHEMA_VERSION- See Also:
-
-
Constructor Details
-
DeltaFile
-
-
Method Details
-
snapshot
public void snapshot() -
getActions
-
getAnnotations
-
getAnnotationKeys
-
setStage
-
updateFlags
public void updateFlags() -
setContentDeleted
-
getMetadata
Get the cumulative metadata from all actions that amend data through the load and enrich actions as well as retried format actions This method retrieves a copy of source metadata, and then applies changes from all actions that amended data. For each such action, the method adds its metadata to the Map. If any metadata key is present in the action's deleteMetadataKeys, the corresponding entry is removed from the Map.- Returns:
- A Map containing the resulting metadata
-
metadataWithFormatRetries
-
getErrorMetadata
Get metadata, considering whether the given action is post-formatting. This method checks if the provided action follows a format action. If it does, the method retrieves formatted metadata for the action's associated egress flow. Otherwise, it retrieves the current ingress/transform flow metadata.- Parameters:
action- The action based on which the decision to format or not is made.- Returns:
- A Map containing either the formatted metadata for the action's flow, or the current transform/load metadata.
-
erroredActions
-
queueAction
-
queueNewAction
-
addAction
-
addReadyToCollectAction
-
actionNamed
-
firstActionError
-
isNewAction
-
completeAction
-
completeAction
-
completeAction
-
completeAction
-
collectingAction
-
collectedAction
-
filterAction
-
reinjectAction
-
lastAction
-
setLastActionReinjected
public void setLastActionReinjected() -
removeLastAction
public void removeLastAction() -
errorAction
-
errorAction
-
errorAction
-
errorAction
public void errorAction(String flow, String name, OffsetDateTime start, OffsetDateTime stop, String errorCause, String errorContext) -
errorAction
public void errorAction(String flow, String name, OffsetDateTime start, OffsetDateTime stop, String errorCause, String errorContext, OffsetDateTime nextAutoResume) -
retryErrors
-
setTestModeReason
-
queuedActions
-
readyToCollectActions
-
hasDomains
-
addAnnotations
-
addAnnotationsIfAbsent
-
addAnnotationIfAbsent
-
addEgressFlow
-
hasEnrichments
-
hasErroredAction
public boolean hasErroredAction() -
hasPendingActions
public boolean hasPendingActions() -
hasFilteredAction
public boolean hasFilteredAction() -
hasReinjectedAction
public boolean hasReinjectedAction() -
hasActionInState
-
ensurePendingAction
-
getPendingAction
-
hasTerminalAction
-
hasCompletedAction
-
hasCompletedActions
-
hasCollectedAction
-
hasActionInState
-
sourceMetadata
-
sourceMetadata
-
addPendingAnnotationsForFlow
Add the given flow to the set of pendingAnnotationsForFlows for this DeltaFile Do nothing if the given set is null or empty- Parameters:
flowName- name of the flow that requires annotations for this DeltaFile
-
updatePendingAnnotationsForFlows
Check if the set of expected annotations are satisfied for the given flow. If the all the annotations are present, remove the flow from the pendingAnnotationsForFlows set. If pendingAnnotationsForFlows is empty after removing the flow, set it to null.- Parameters:
flow- name of the flow that could be removed from pendingAnnotationsForFlowsexpectedAnnotations- set of annotations expected for the given flow
-
pendingAnnotations
Get the set of annotations that are still pending from the given set of expected annotations- Parameters:
expectedAnnotations- annotations that are expected to be set on the DeltaFile- Returns:
- annotations that have not been added to the DeltaFile yet
-
lastCompleteDataAmendedAction
-
lastDataAmendedContent
-
domains
-
enrichments
-
getEgress
-
lastFormatAction
-
retriedEgressActions
-
formatComplete
-
formatMetadata
Assemble formatted metadata based on a given flow. This method prepares metadata by iterating through the format actions and retried egress actions associated with the provided flow. The metadata from each format action is added to a Map. If any metadata key is present in the action's deleteMetadataKeys, the corresponding entry is removed from the Map.- Parameters:
flow- The flow containing the format actions- Returns:
- A Map containing the formatted metadata
-
formatContent
-
forQueue
-
referencedSegments
-
storedSegments
-
recalculateBytes
public void recalculateBytes() -
cancel
public void cancel() -
cancelQueuedActions
public void cancelQueuedActions() -
incrementRequeueCount
public void incrementRequeueCount() -
canBeCancelled
public boolean canBeCancelled() -
inactiveStage
public boolean inactiveStage() -
lastAction
-
acknowledgeError
-
clearErrorAcknowledged
public void clearErrorAcknowledged() -
generateUpdate
public org.springframework.data.mongodb.core.query.Update generateUpdate()
-