Skip to content

Conversation

@hadv
Copy link
Owner

@hadv hadv commented Oct 2, 2025

Overview

This PR adds a Redis AFS (Abstract File System) connector module to NebulaStore, porting the Eclipse Store Redis AFS functionality to .NET Core.

Changes

Core Implementation

  • RedisConnector: Full implementation using StackExchange.Redis (the .NET equivalent of Java's Lettuce client)

    • All CRUD operations: Create, Read, Write, Delete, Move, Copy, Truncate
    • Directory operations: Create, Exists, IsEmpty, VisitChildren
    • Thread-safe operations with optional caching
    • Blob-based storage with numbered keys
  • BlobMetadata: Simple class for tracking blob keys and sizes

  • RedisConfiguration: Comprehensive configuration with fluent API

    • Connection string, database selection
    • Timeouts (command, connect, sync)
    • Authentication and SSL/TLS support
    • Converts to StackExchange.Redis ConfigurationOptions

Integration

  • ✅ Integrated with AfsStorageConnection factory to support "redis" storage type
  • ✅ Works seamlessly with EmbeddedStorage.StartWithAfs()

Documentation

  • ✅ Comprehensive README with:

    • Installation instructions
    • Quick start examples
    • Configuration options
    • Architecture overview
    • Performance considerations
    • Troubleshooting guide
  • RedisExample.cs: Multiple usage scenarios

    • Basic Redis storage with EmbeddedStorage
    • Direct AFS API usage
    • Advanced configuration
    • Multiple operations
    • Authentication setup

Tests

  • RedisConnectorTests: 20+ unit tests covering all operations
  • RedisConfigurationTests: Configuration validation and fluent API tests
  • ✅ Tests gracefully skip when Redis is unavailable

Other

  • ✅ Updated .gitignore to exclude .DS_Store files (macOS)

Usage Example

// Simple usage with EmbeddedStorage
var config = EmbeddedStorageConfiguration.New()
    .SetAfsStorageType("redis")
    .SetAfsConnectionString("localhost:6379")
    .SetAfsUseCache(true);

using var storage = EmbeddedStorage.StartWithAfs(config);
var root = storage.Root<MyData>();
root.Value = "Hello, Redis!";
storage.StoreRoot();

Architecture

Follows the Eclipse Store AFS pattern:

  • Files stored as numbered blobs: container/path/to/file.0, container/path/to/file.1, etc.
  • Virtual directories (no explicit creation needed)
  • Atomic Redis operations for data consistency
  • Optional in-memory caching for read-heavy workloads

Dependencies

  • StackExchange.Redis 2.8.16
  • .NET 9.0
  • NebulaStore.Afs.Blobstore (base classes)

Testing

✅ All projects build successfully
✅ Tests pass (when Redis is available on localhost:6379)
✅ No compilation errors

Checklist

  • Code follows existing patterns
  • Tests included and passing
  • Documentation updated
  • Examples provided
  • Builds without errors
  • Follows Eclipse Store architecture

Related


Pull Request opened by Augment Code with guidance from the PR author

- Implement RedisConnector using StackExchange.Redis
- Port Eclipse Store Redis AFS module to .NET Core
- Add BlobMetadata class for blob key/size tracking
- Add RedisConfiguration with fluent API
- Integrate with AfsStorageConnection factory
- Add comprehensive tests for connector and configuration
- Add README with usage examples and documentation
- Add RedisExample.cs with multiple usage scenarios
- Update .gitignore to exclude .DS_Store files

The Redis connector provides:
- Thread-safe operations with optional caching
- Full CRUD operations for files and directories
- Configurable connection, timeouts, and authentication
- Compatible with NebulaStore embedded storage system
- Follows Eclipse Store AFS patterns
@hadv hadv merged commit a2aee6e into main Oct 2, 2025
5 checks passed
@hadv hadv deleted the feature/redis-afs-connector branch October 2, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants