@ThreadSafe public final class LineageStore extends Object implements JournalEntryIterable
Constructor and Description |
---|
LineageStore(LineageIdGenerator lineageIdGenerator)
Constructs the lineage store.
|
Modifier and Type | Method and Description |
---|---|
void |
addLineageFromJournal(Lineage.LineageEntry entry)
Constructs the lineage store from the journal.
|
long |
createLineage(List<Long> inputFiles,
List<Long> outputFiles,
Job job)
Creates a lineage.
|
void |
deleteLineage(long lineageId)
Deletes a lineage.
|
List<Lineage> |
getAllInTopologicalOrder() |
List<Lineage> |
getChildren(Lineage lineage)
Gets all the children of a given lineage.
|
Iterator<Journal.JournalEntry> |
getJournalEntryIterator()
Note that this method is not threadsafe.
|
Lineage |
getLineage(long lineageId)
Gets the lineage.
|
Lineage |
getLineageOfOutputFile(long fileId)
Gets the lineage that has the given output file.
|
List<Lineage> |
getParents(Lineage lineage)
Gets all the parents of a given lineage.
|
List<Lineage> |
getRootLineages() |
boolean |
hasOutputFile(long fileId)
Checks if there's an output file with given file id.
|
List<Lineage> |
sortLineageTopologically(Set<Lineage> lineages)
Sorts a given set of lineages topologically.
|
public LineageStore(LineageIdGenerator lineageIdGenerator)
lineageIdGenerator
- the lineage id generatorpublic void addLineageFromJournal(Lineage.LineageEntry entry)
entry
- the journal entrypublic long createLineage(List<Long> inputFiles, List<Long> outputFiles, Job job)
inputFiles
- the input filesoutputFiles
- the output filesjob
- the jobpublic void deleteLineage(long lineageId) throws LineageDoesNotExistException
lineageId
- the lineage idLineageDoesNotExistException
- if the lineage does not existpublic Lineage getLineage(long lineageId)
lineageId
- the lineage idpublic List<Lineage> getChildren(Lineage lineage) throws LineageDoesNotExistException
lineage
- the lineageLineageDoesNotExistException
- if the lineage does not existpublic Lineage getLineageOfOutputFile(long fileId) throws LineageDoesNotExistException
fileId
- the file idLineageDoesNotExistException
- if the lineage does not existpublic List<Lineage> getParents(Lineage lineage) throws LineageDoesNotExistException
lineage
- the lineageLineageDoesNotExistException
- if the lineage does not existpublic List<Lineage> sortLineageTopologically(Set<Lineage> lineages)
lineages
- lineages to sortpublic List<Lineage> getAllInTopologicalOrder()
public Iterator<Journal.JournalEntry> getJournalEntryIterator()
getJournalEntryIterator
in interface JournalEntryIterable
public boolean hasOutputFile(long fileId)
fileId
- the file idCopyright © 2023. All Rights Reserved.