Skip to content

Conversation

@Laukkala
Copy link
Contributor

Description

First iteration of new filesystem.
NotebookRepository - A middleware for compatibility between legacy Zeppelin objects and new objects.
Implements NotebookRepo interface.
Replaces NotebookRepoSync within ZeppelinServer.
Communication to filesystem is currently unchanged, and all communication goes via NotebookRepository for now.
Source of truth is files saved on disk.

Directory - Immutable representation of a directory saved on disk containing Notebooks or other Directories.
Can be moved, renamed, copied and searched from.
Represents a snapshot of the state of saved .zpln files and directories on disk at the time of it's creation.
To get updated contents of files saved on disk, create a new root Directory via NotebookRepository.init()

Notebook - Immutable reprentation of a Notebook.
Contains Paragraphs.
Is a snapshot of the contents in a .zpln file at the time of object creation.
Any modifying operations create a new Notebook instance, which can be saved to file to persist the changes.

UnloadedNotebook - Represents a Notebook, the contents of which have not yet been loaded from a file. This allows for lazy loading, so that we don't need to read all the file contents of every existing Notebook to list them in the UI. UnloadedNotebooks can be loaded with their load() method to get a fully functional Notebook instance.

Paragraph - Represents one paragraph within a Notebook.
Contains one script and one Result object. Can initiate an execution.

Script - Represents the user-supplied text to be run by an Interpreter. Contains a reference to an Interpreter instance, which will be called to execute the Script
Result - Represents a result created by an Interpreter running a Script. Currently contains legacy objects, as Interpreters have not been refactored yet.

NullParagraph, NullResult, NullScript - Representations of unloaded objects, that have not yet been initialized from a file. Can be initialized from JSON contents via fromJson() methods.

Changes to legacy classes:

ZeppelinServer - Replaced NotebookRepoSync with NotebookRepository to actually use the new objects.

InterpreterFactory - Added a static instance of InterpreterFactory to allow Script objects to instantiate Interpreters correctly.

Interpreter - Added json() method to turn interpreter information into JSON to save to a Script

InterpreterResultMessage - Added json() method to turn result into JSON to save to a Result

LegacyNotebookRepoRestApiTest - Added Ignore flags to these tests as they depend on ZeppelinServer having a NotebookRepoSync as the implementation of NotebookRepo.

Note - Added a toNotebook() method to be able to turn a legacy Note object into a Notebook.

NotebookRepository - A middleware for compatibility between legacy Zeppelin objects and new objects.
Implements NotebookRepo interface.
Replaces NotebookRepoSync within ZeppelinServer.
Communication to filesystem is currently unchanged, and all communication goes via NotebookRepository for now.
Source of truth is files saved on disk.

Directory - Immutable representation of a directory saved on disk containing Notebooks or other Directories.
Can be moved, renamed, copied and searched from.
Represents a snapshot of the state of saved .zpln files and directories on disk at the time of it's creation.
To get updated contents of files saved on disk, create a new root Directory via NotebookRepository.init()

Notebook - Immutable reprentation of a Notebook.
Contains Paragraphs.
Is a snapshot of the contents in a .zpln file at the time of object creation.
Any modifying operations create a new Notebook instance, which can be saved to file to persist the changes.

UnloadedNotebook - Represents a Notebook, the contents of which have not yet been loaded from a file. This allows for lazy loading, so that we don't need to read all the file contents of every existing Notebook to list them in the UI. UnloadedNotebooks can be loaded with their load() method to get a fully functional Notebook instance.

Paragraph - Represents one paragraph within a Notebook.
Contains one script and one Result object. Can initiate an execution.

Script - Represents the user-supplied text to be run by an Interpreter. Contains a reference to an Interpreter instance, which will be called to execute the Script
Result - Represents a result created by an Interpreter running a Script. Currently contains legacy objects, as Interpreters have not been refactored yet.

NullParagraph, NullResult, NullScript - Representations of unloaded objects, that have not yet been initialized from a file. Can be initialized from JSON contents via fromJson() methods.

Changes to legacy classes:

ZeppelinServer - Replaced NotebookRepoSync with NotebookRepository to actually use the new objects.

InterpreterFactory - Added a static instance of InterpreterFactory to allow Script objects to instantiate Interpreters correctly.

Interpreter - Added json() method to turn interpreter information into JSON to save to a Script

InterpreterResultMessage - Added json() method to turn result into JSON to save to a Result

LegacyNotebookRepoRestApiTest - Added Ignore flags to these tests as they depend on ZeppelinServer having a NotebookRepoSync as the implementation of NotebookRepo.

Note - Added a toNotebook() method to be able to turn a legacy Note object into a Notebook.
@Laukkala Laukkala requested a review from kortemik March 26, 2025 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant