public final class UfsCheckpointManager extends Object
update(URI)method will update the journal's checkpoint to the specified location, and
recover()will recover from any failures that may occur during
update(URI). The checkpoint updating process goes
1. Write a new checkpoint named checkpoint.data.tmp 2. Rename checkpoint.data to checkpoint.data.backup.tmp 3. Rename checkpoint.data.backup.tmp to checkpoint.data.backup 4. Rename checkpoint.data.tmp to checkpoint.data 5. Delete completed logs 6. Delete checkpoint.data.backup
|Constructor and Description|
Creates a new instance of
|Modifier and Type||Method and Description|
Recovers the checkpoint in case the master crashed while updating it.
Updates the checkpoint to the specified URI.
public UfsCheckpointManager(UnderFileSystem ufs, URI checkpoint, UfsJournalWriter writer)
ufs- the under file system holding the journal
checkpoint- the location of the checkpoint
writer- a journal writer which can be used to delete completed logs
public void recover()
public void update(URI location)
location- the location of the new checkpoint
Copyright © 2022. All Rights Reserved.