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 emptybooleanvoidcancel()voidvoidvoidcollectedAction(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) voidcompleteAction(ActionEvent event) voidcompleteAction(ActionEvent event, List<Content> content, Map<String, String> metadata, List<String> deleteMetadataKeys) 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) forQueue()org.springframework.data.mongodb.core.query.UpdateGet 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.booleanhasActionInState(String flow, String name, ActionState state) booleanhasActionInState(ActionState actionState) booleanhasCollectedAction(String flow, String name) booleanbooleanhasCompletedAction(String flow, String name) booleanhasCompletedActions(String flow, List<String> names) booleanbooleanbooleanbooleanhasTerminalAction(String flow, String name) booleanvoidbooleanisNewAction(String flow, String name) lastAction(String actionName) 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) voidretryErrors(List<ResumeMetadata> resumeMetadata) voidsetContentDeleted(OffsetDateTime contentDeleted) voidsetStage(DeltaFileStage stage) voidsetTestModeReason(String reason) voidsnapshot()sourceMetadata(String key) sourceMetadata(String key, String defaultValue) split(ActionEvent event, List<String> childDids) 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
-
erroredActions
-
queueAction
-
queueNewAction
-
addAction
-
actionNamed
-
firstActionError
-
isNewAction
-
completeAction
-
completeAction
-
completeAction
-
completeAction
-
split
-
collectedAction
-
filterAction
-
lastAction
-
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
-
addAnnotations
-
addAnnotationsIfAbsent
-
addAnnotationIfAbsent
-
addEgressFlow
-
hasErroredAction
public boolean hasErroredAction() -
hasPendingActions
public boolean hasPendingActions() -
hasFilteredAction
public boolean hasFilteredAction() -
hasCollectingAction
public boolean hasCollectingAction() -
hasActionInState
-
ensurePendingAction
-
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
-
lastCompleteAction
-
lastContent
-
getEgress
-
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() -
getImmutableMetadata
-
getImmutableContent
-