feat: add file-based grain storage provider
Merged
BE
2mo ago+1114+1114+0123456789012345678901234567890123456789-93-93-01234567890123456789
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.FileStorageto 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
FileGrainStorageclass, 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
FileGrainStorageFactoryto create instances ofFileGrainStorage(src/File/Orleans.Persistence.FileStorage/FileGrainStorageFactory.cs). - Created
FileGrainStorageOptionsto configure the root directory and serializer for the storage provider (src/File/Orleans.Persistence.FileStorage/FileGrainStorageOptions.cs). - Added extension methods in
FileSiloBuilderExtensionsto 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.mdfile with an introduction, setup instructions, and examples for configuring and using the file storage provider (src/File/Orleans.Persistence.FileStorage/README.md).