public class DeletionVectorsMaintainer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DeletionVectorsMaintainer.Factory
Factory to restore
DeletionVectorsMaintainer . |
Modifier and Type | Method and Description |
---|---|
Optional<DeletionVector> |
deletionVectorOf(String fileName)
Retrieves the deletion vector associated with the specified file name.
|
Map<String,DeletionVector> |
deletionVectors() |
static DeletionVectorsMaintainer.Factory |
factory(IndexFileHandler handler) |
IndexFileHandler |
indexFileHandler() |
void |
mergeNewDeletion(String fileName,
DeletionVector deletionVector)
Merge a new deletion which marks the specified deletion vector with the given file name, if
the previous deletion vector exist, merge the old one.
|
void |
notifyNewDeletion(String fileName,
DeletionVector deletionVector)
Notifies a new deletion which marks the specified deletion vector with the given file name.
|
void |
notifyNewDeletion(String fileName,
long position)
Notifies a new deletion which marks the specified row position as deleted with the given file
name.
|
void |
removeDeletionVectorOf(String fileName)
Removes the specified file's deletion vector, this method is typically used for remove before
files' deletion vector in compaction.
|
List<IndexFileMeta> |
writeDeletionVectorsIndex()
Write new deletion vectors index file if any modifications have been made.
|
public void notifyNewDeletion(String fileName, long position)
fileName
- The name of the file where the deletion occurred.position
- The row position within the file that has been deleted.public void notifyNewDeletion(String fileName, DeletionVector deletionVector)
fileName
- The name of the file where the deletion occurred.deletionVector
- The deletion vectorpublic void mergeNewDeletion(String fileName, DeletionVector deletionVector)
fileName
- The name of the file where the deletion occurred.deletionVector
- The deletion vectorpublic void removeDeletionVectorOf(String fileName)
fileName
- The name of the file whose deletion vector should be removed.public List<IndexFileMeta> writeDeletionVectorsIndex()
public Optional<DeletionVector> deletionVectorOf(String fileName)
fileName
- The name of the file for which the deletion vector is requested.Optional
containing the deletion vector if it exists, or an empty Optional
if not.public IndexFileHandler indexFileHandler()
@VisibleForTesting public Map<String,DeletionVector> deletionVectors()
public static DeletionVectorsMaintainer.Factory factory(IndexFileHandler handler)
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.