-
-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Overview
Migrate the Oracle Cloud Object Storage AFS adapter from Eclipse Store to NebulaStore .NET Core. This adapter enables NebulaStore to use Oracle Cloud Infrastructure (OCI) Object Storage as a backend storage system.
Source Repository
Eclipse Store Module: https://github.com/eclipse-store/store/tree/main/afs/oraclecloud/objectstorage
Module Structure
The Oracle Cloud Object Storage module consists of:
Core Components (Java)
-
OracleCloudObjectStorageConnector.java - Main connector implementing
BlobStoreConnector- Handles blob operations (read, write, delete)
- Manages multipart uploads for large files (up to 50 GiB per blob)
- Supports caching and non-caching modes
- Uses Oracle's UploadManager for efficient transfers
-
OracleCloudObjectStorageFileSystemCreator.java - Configuration-based factory
- Parses configuration files (supports classpath, URL, file paths)
- Creates authenticated OCI clients
- Configures client settings (timeouts, async threads, etc.)
- Supports region and endpoint configuration
-
OracleCloudObjectStoragePathValidator.java - Path validation for OCI Object Storage
Dependencies
Java (Eclipse Store):
com.oracle.oci.sdk:oci-java-sdk-objectstorage(provided scope - user must supply)org.eclipse.store:afs-blobstoreorg.eclipse.serializer:configuration
Expected .NET Dependencies:
OCI.DotNetSDK.Objectstorage- Official Oracle Cloud Infrastructure .NET SDKNebulaStore.Afs.Blobstore- Existing blobstore abstraction
Implementation Requirements
1. Create Project Structure
afs/oraclecloud/
├── objectstorage/
│ ├── NebulaStore.Afs.OracleCloud.ObjectStorage.csproj
│ ├── README.md
│ ├── src/
│ │ ├── OracleCloudObjectStorageConnector.cs
│ │ ├── OracleCloudObjectStorageConfiguration.cs
│ │ ├── OracleCloudObjectStoragePathValidator.cs
│ │ └── OracleCloudObjectStorageAfsIntegration.cs
│ └── test/
│ ├── NebulaStore.Afs.OracleCloud.ObjectStorage.Tests.csproj
│ ├── OracleCloudObjectStorageConnectorTests.cs
│ └── OracleCloudObjectStorageConfigurationTests.cs
2. Core Classes to Implement
OracleCloudObjectStorageConnector
- Extend
BlobStoreConnectorBase - Implement blob operations using OCI .NET SDK:
GetFileSize()- Get total size across all blobsDirectoryExists()- Check if bucket/prefix existsFileExists()- Check if object existsReadData()- Read blob data with range supportWriteData()- Write data with multipart upload supportDeleteFile()- Delete all blobs for a fileMoveFile()- Move/rename objectsCopyFile()- Copy objectsVisitChildren()- List objects with prefix
- Support both caching and non-caching modes
- Handle large files (split into multiple blobs, max 50 GiB per blob)
- Use OCI's multipart upload for efficient transfers
OracleCloudObjectStorageConfiguration
- Configuration builder pattern (similar to
AwsS3Configuration) - Properties:
ConfigFilePath- Path to OCI config fileProfile- Profile name in config fileRegion- OCI regionNamespace- OCI Object Storage namespaceEndpoint- Custom endpoint URLUseCache- Enable/disable cachingConnectionTimeout- Connection timeout in millisecondsReadTimeout- Read timeout in millisecondsMaxAsyncThreads- Maximum async threads
- Support authentication via:
- Config file (default
~/.oci/config) - Instance principal (for OCI compute instances)
- Resource principal (for OCI functions)
- API key authentication
- Config file (default
OracleCloudObjectStoragePathValidator
- Validate bucket names (OCI naming rules)
- Validate object names/paths
- Implement
IPathValidatorinterface
OracleCloudObjectStorageAfsIntegration
- Extension methods for
EmbeddedStorageConfiguration - Factory methods for creating file systems
- Integration with NebulaStore's AFS system
3. Key Features
-
Multipart Upload Support
- Split large files into multiple blobs (max 50 GiB each)
- Use OCI's multipart upload API for efficiency
- Support parallel uploads
-
Namespace Management
- Auto-detect namespace from OCI client
- Support explicit namespace configuration
-
Authentication Methods
- Config file authentication (default)
- Instance principal (for OCI VMs)
- Resource principal (for OCI Functions)
- API key authentication
-
Caching
- Optional blob metadata caching
- Reduce API calls for repeated operations
-
Configuration
- Support OCI config file format
- Support classpath, URL, and file path loading
- Configurable timeouts and connection settings
4. Usage Examples
Basic Usage
using OCI.ObjectStorage;
using NebulaStore.Afs.OracleCloud.ObjectStorage;
using NebulaStore.Storage.Embedded;
// Create OCI Object Storage client
var config = OracleCloudObjectStorageConfiguration.New()
.SetConfigFilePath("~/.oci/config")
.SetProfile("DEFAULT")
.SetRegion("us-ashburn-1")
.SetUseCache(true);
var client = config.CreateClient();
var connector = OracleCloudObjectStorageConnector.New(client);
var fileSystem = BlobStoreFileSystem.New(connector);
// Use with EmbeddedStorage
var storageConfig = EmbeddedStorageConfiguration.New()
.SetStorageDirectory("oci-storage")
.SetUseAfs(true)
.SetAfsStorageType("oraclecloud.objectstorage")
.SetAfsConnectionString("~/.oci/config")
.Build();
using var storage = EmbeddedStorage.Start(storageConfig);With Instance Principal
var config = OracleCloudObjectStorageConfiguration.New()
.SetAuthenticationType(OciAuthType.InstancePrincipal)
.SetRegion("us-ashburn-1");
var connector = OracleCloudObjectStorageConnector.New(config.CreateClient());5. Testing Requirements
- Unit tests for connector operations
- Unit tests for configuration parsing
- Unit tests for path validation
- Integration tests (optional, requires OCI account)
- Mock-based tests using test doubles for OCI client
6. Documentation
- README.md with:
- Overview and features
- Installation instructions
- Configuration guide
- Usage examples
- Authentication methods
- Troubleshooting
- XML documentation comments on all public APIs
- Example code in
examples/directory
Implementation Notes
License Considerations
The Oracle OCI .NET SDK is licensed under the Universal Permissive License (UPL) v1.0 or Apache License 2.0, which should be compatible with EPL 2.0. However, similar to the Java implementation, the SDK should be marked as a user-provided dependency (not bundled).
Differences from Eclipse Store
- .NET SDK vs Java SDK - Use
OCI.DotNetSDK.Objectstorageinstead ofoci-java-sdk-objectstorage - Async/Await - Leverage .NET async patterns for I/O operations
- Configuration - Use .NET configuration patterns (builder pattern, options pattern)
- Streams - Use .NET Stream API instead of Java InputStream
Reference Implementations
Refer to existing NebulaStore AFS adapters for patterns:
afs/aws/s3/- AWS S3 connector (similar cloud object storage)afs/azure/storage/- Azure Blob Storage connectorafs/googlecloud/firestore/- Google Cloud Firestore connector
Acceptance Criteria
- Project structure created following NebulaStore conventions
-
OracleCloudObjectStorageConnectorimplements allIBlobStoreConnectormethods -
OracleCloudObjectStorageConfigurationsupports all authentication methods - Path validator implements OCI naming rules
- Integration with
EmbeddedStorageConfigurationvia AFS system - Unit tests with >80% code coverage
- README.md with comprehensive documentation
- Example code demonstrating usage
- All public APIs have XML documentation
- Follows existing NebulaStore code style and patterns
Related Issues
None