public class ExternalCheckpointManager extends Object
| Constructor and Description |
|---|
ExternalCheckpointManager(String checkpointPath,
org.apache.hadoop.fs.FileSystem fs)
This constructor creates a new Expternal Checkpoint Manager at the specified path in the
specified file system.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanPath()
This method cleans all the directories and files that are present in the checkpoint path.
|
void |
cleanUpHigherVersions(int currentRound)
This method cleans up all the checkpoint versions that are higher than the current round.
|
List<Integer> |
getCheckpointRounds(int firstRound,
int checkpointInterval,
int numOfRounds)
Get a list of iterations that need checkpointing.
|
Booster |
loadCheckpointAsBooster()
Read the checkpoint from the checkpoint path.
|
void |
updateCheckpoint(Booster boosterToCheckpoint)
This method updates the booster checkpoint to the the latest or current
version and deleted all the previous versions of the checkpoint.
|
public ExternalCheckpointManager(String checkpointPath, org.apache.hadoop.fs.FileSystem fs) throws XGBoostError
checkpointPath - The directory path where checkpoints will be stored.fs - The file system to use for storing checkpoints.XGBoostError - the error that is thrown is the checkpoint path is null or empty.public void cleanPath()
throws IOException
IOException - exception that is thrown when there is an error deleting the
checkpoint path.public Booster loadCheckpointAsBooster() throws IOException, XGBoostError
IOException - Any expection that occurs when reading the checkpoint path.XGBoostError - Any exception that occurs when loading the model into the booster.public void updateCheckpoint(Booster boosterToCheckpoint) throws IOException, XGBoostError
boosterToCheckpoint - The booster object that is to be checkpointed and
saved as a model file.IOException - Any exception that occurs when writing the model file to the
checkpoint path.XGBoostError - Any exception that occurs when saving the model from the booster.public void cleanUpHigherVersions(int currentRound)
throws IOException
currentRound - The current round of training.IOException - Any exception that occurs when deleting the checkpoint files.public List<Integer> getCheckpointRounds(int firstRound, int checkpointInterval, int numOfRounds) throws IOException
firstRound - The first round of training.checkpointInterval - The interval at which checkpoints are to be saved.numOfRounds - The number of rounds to be trained.IOException - Any exception that occurs when getting the list of rounds.Copyright © 2026. All rights reserved.