feat: Add AWS S3 adapter for AFS #25
Merged
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.
Overview
This PR implements a comprehensive AWS S3 adapter for NebulaStore's Abstract File System (AFS), migrating and adapting the Eclipse Store AWS S3 adapter to work with NebulaStore's .NET architecture.
✅ Build Status
Latest Updates:
IAwsS3PathValidatorto extendIAfsPathValidatorpath.Validate(validator)patternFeatures
Core Implementation
IBlobStoreConnectorinterfaceAWS S3 Support
File Operations
Files Added
Core Implementation
afs/aws/s3/NebulaStore.Afs.Aws.S3.csproj- Main project fileafs/aws/s3/src/AwsS3Connector.cs- Main S3 connector implementationafs/aws/s3/src/AwsS3PathValidator.cs- S3 path validationafs/aws/s3/src/AwsS3Configuration.cs- Configuration managementTesting
afs/aws/s3/test/NebulaStore.Afs.Aws.S3.Tests.csproj- Test projectafs/aws/s3/test/AwsS3ConnectorTests.cs- Comprehensive unit tests with mockingDocumentation & Examples
afs/aws/s3/README.md- Detailed documentation with usage examplesexamples/AwsS3Example.cs- Complete usage examples for different scenariosFiles Modified
NebulaStore.sln- Added new AWS S3 projects to solutionafs/README.md- Updated with AWS S3 adapter documentationUsage Examples
Basic Usage
Advanced Configuration
S3-Compatible Services (MinIO)
Architecture
The implementation follows the same patterns as the existing NebulaStore AFS adapters:
Testing
Unit Tests
Integration Testing
To test with real AWS S3:
examples/AwsS3Example.csDependencies
AWSSDK.S3(version 3.7.401) - AWS SDK for .NET S3 operationsValidation
The implementation includes comprehensive S3 bucket name validation according to AWS rules:
Performance Considerations
Security
Breaking Changes
None - this is a new feature addition that doesn't affect existing functionality.
Recent Fixes
Build Issues Resolved ✅
Commit:
4f8b338- Fixed path validator interface usage:IAwsS3PathValidatorto extendIAfsPathValidatorinstead of non-existentBlobStorePath.IValidatorValidatemethod to acceptIAfsPathparameter with proper type checkingAwsS3Connectorto usepath.Validate(validator)patternCommit:
029819e- Added missing using statement:NebulaStore.Afs.Blobstore.Typesusing statement to ensure proper interface resolutionCommit:
14ad272- Updated package versions for better compatibility:AWSSDK.S3from3.7.400.44to3.7.300for better stabilityCommit:
5511b92- Resolved AWS SDK package version issues:AWSSDK.S3version to3.7.401(the version that was actually resolved by NuGet)NU1603toWarningsNotAsErrorsto prevent package version resolution warnings from failing the buildNebulaStore.Afs.Aws.S3 depends on AWSSDK.S3 (>= 3.7.400.44) but AWSSDK.S3 3.7.400.44 was not found. AWSSDK.S3 3.7.401 was resolved instead.Commit:
5047faf- Fixed AWS SDK API compatibility and code analysis issues:ContentLengthproperty fromPutObjectRequest(not available in current AWS SDK version)Stream.Read()with proper read loop patternCS0117: 'PutObjectRequest' does not contain a definition for 'ContentLength'CA2022: Avoid inexact read with 'System.IO.Stream.Read(byte[], int, int)'Error Analysis 🔍
Latest Issues Resolved:
AWS SDK API Changes: The
ContentLengthproperty was removed fromPutObjectRequestin newer AWS SDK versions. The SDK now automatically determines content length from the input stream.Code Analysis Rules: .NET code analysis flagged the use of
Stream.Read()as potentially unsafe because it doesn't guarantee reading the requested number of bytes. Replaced with a proper read loop that continues until all bytes are read or end of stream is reached.Checklist
Related Issues
This implements the AWS S3 adapter migration as requested, bringing Eclipse Store's AWS S3 functionality to NebulaStore's .NET ecosystem.
Pull Request opened by Augment Code with guidance from the PR author