feat: add file-based grain storage provider

Merged
BE
2mo ago
+1114-93

This pull request introduces a new file-based grain storage provider for Microsoft Orleans. The changes include adding a new project for the provider, implementing its core functionality, and providing documentation and configuration examples.

New File-Based Grain Storage Provider

Project Setup:

  • Added a new project Orleans.Persistence.FileStorage to the solution with the necessary project references and metadata (Orleans.sln, src/File/Orleans.Persistence.FileStorage/Orleans.Persistence.FileStorage.csproj) [1] [2].

Core Implementation:

  • Implemented the FileGrainStorage class, which provides methods for reading, writing, and clearing grain state using a file-based approach (src/File/Orleans.Persistence.FileStorage/FileGrainStorage.cs).
  • Added a factory class FileGrainStorageFactory to create instances of FileGrainStorage (src/File/Orleans.Persistence.FileStorage/FileGrainStorageFactory.cs).
  • Created FileGrainStorageOptions to configure the root directory and serializer for the storage provider (src/File/Orleans.Persistence.FileStorage/FileGrainStorageOptions.cs).
  • Added extension methods in FileSiloBuilderExtensions to simplify the configuration of the file storage provider in Orleans silo builders (src/File/Orleans.Persistence.FileStorage/FileSiloBuilderExtensions.cs).

Documentation and Examples:

  • Added a README.md file with an introduction, setup instructions, and examples for configuring and using the file storage provider (src/File/Orleans.Persistence.FileStorage/README.md).
Microsoft Reviewers: Open in CodeFlow