Add support for Checkpoints-only feature and multiple checkpoints per file #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is for adding two features:
Both of these features are inspired from PGContents, which is a PostgresQL-backed ContentsManager and supports these features.
For checkpoints-only, the attributes of the
HDFSContentsManager
class (hdfs_namenode_host
,hdfs_namenode_port
,root_dir
,hdfs_user
) were move to the Base classHDFSManagerMixin
, so that the attributes are accessible by bothHDFSCheckpoints
andHDFSContentsManager
.The checkpoints are stored following the same relative path on the HDFS, as that of the Notebook on the local file system. If the Notebook server is started in <local_root> and a checkpoint is saved for a Notebook in <local_root>/Folder1/Notebook1.ipynb, then the checkpoints would be stored in <hdfs_root>/Folder1/.ipynb_checkpoints
For multiple checkpoints, the default value of
checkpoint_id
was changed from "checkpoint" to a number (starting from 1) which increments on every checkpoint. There's no limit on the number of checkpoints per file.When a Notebook is deleted, all the associated checkpoints are also deleted.
Example configuration files for using Checkpoints-only and the whole ContentsManager have been included in the examples folder.
Note: JupyterLab UI does not support multiple checkpoints. You can only see the last checkpoint.