mirror of https://github.com/dragonflyoss/api.git
* # Description This pull request introduces APIs for the new Cache Task mechanism, enabling support for memory cache operations. Additionally, by refactoring the Download model and removing the load_to_cache field, the Task component now focuses exclusively on disk I/O operations, while the Cache Task handles memory cache operations. Finally, the version number of the dragonfly-api package has been incremented. ## Key Changes ### common.proto - Added a new enum type Cache to TaskType to identify CacheTask. - Introduced a new structure CachePeer to represent peers handling cache tasks. - Added a new structure CacheTask to define metadata for cache tasks. - Removed the load_to_cache field from the Download structure, as Tasks will no longer handle cache operations. ### dfdaemon.proto - Added three RPC calls (DownloadCacheTask, StatCacheTask, DeleteCacheTask) to the DfdaemonUpload and DfdaemonDownload services for cache task management. - Added two RPC calls (SyncCachePieces, DownloadCachePiece) to the DfdaemonUpload service for cache piece synchronization. - Introduced 9 new message types to support requests and responses for CacheTask downloads. ### scheduler.proto - Added five RPC calls to the Scheduler service: AnnounceCachePeer, StatCachePeer, DeleteCachePeer for cache peer management. StatCacheTask, DeleteCacheTask for cache task management. - Introduced 16 new message types to cover the full lifecycle state transitions of cache tasks. ## Version Update - Incremented the version of the dragonfly-api package from 2.1.47 to 2.1.48 in Cargo.toml to reflect the new changes. ## Related Issue ## Motivation and Context - Separation of Responsibilities: Tasks now focus exclusively on disk I/O operations, while CacheTask independently handles memory cache management. Signed-off-by: fu220 <2863318196@qq.com> * Changed Download and introduced CacheDownload. - Added more detailed descriptions for the CACHE type in TaskType, while clarifying that the STANDARD type interacts exclusively with disk operations. - Removed the load_to_cache field and related information from the Download structure. - Introduced CacheDownload for handling CacheTask downloads. Signed-off-by: fu220 <2863318196@qq.com> * Removed CacheDownload and directly merged into the Request Signed-off-by: fu220 <2863318196@qq.com> * Allow large_enum_variant in RegisterCachePeerRequest Signed-off-by: fu220 <2863318196@qq.com> --------- Signed-off-by: fu220 <2863318196@qq.com> |
||
---|---|---|
.. | ||
dfdaemon_mock.go | ||
mocks.go |