Skip to content

Commit

Permalink
feat: fixed the comments for PersistentCacheTask (#396)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Sep 29, 2024
1 parent 0b031ea commit cc23703
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions pkg/apis/common/v2/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ message PersistentCachePeer {
string id = 1 [(validate.rules).string.min_len = 1];
// Persistent represents whether the persistent cache peer is persistent.
// If the persistent cache peer is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection.
// not be deleted when dfdaemon runs garbage collection. It only be deleted
// when the task is deleted by the user.
bool persistent = 2;
// Peer downloads costs time.
google.protobuf.Duration cost = 3 [(validate.rules).duration.required = true];
Expand Down Expand Up @@ -208,9 +209,12 @@ message Task {
message PersistentCacheTask {
// Task id.
string id = 1 [(validate.rules).string.min_len = 1];
// Replica count of the persistent cache task.
// Replica count of the persistent cache task. The persistent cache task will
// not be deleted when dfdamon runs garbage collection. It only be deleted
// when the task is deleted by the user.
uint64 persistent_replica_count = 2 [(validate.rules).uint64.gte = 1];
// Replica count of the persistent cache task.
// Replica count of the cache task. If cache task is not persistent,
// the persistent cache task will be deleted when dfdaemon runs garbage collection.
uint64 replica_count = 3 [(validate.rules).uint64.gte = 1];
// Digest of the task digest, for example blake3:xxx or sha256:yyy.
string digest = 4 [(validate.rules).string = {pattern: "^(md5:[a-fA-F0-9]{32}|sha1:[a-fA-F0-9]{40}|sha256:[a-fA-F0-9]{64}|sha512:[a-fA-F0-9]{128}|blake3:[a-fA-F0-9]{64}|crc32:[a-fA-F0-9]{8})$"}];
Expand Down
10 changes: 7 additions & 3 deletions proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ message PersistentCachePeer {
string id = 1;
// Persistent represents whether the persistent cache peer is persistent.
// If the persistent cache peer is persistent, the persistent cache peer will
// not be deleted when dfdaemon runs garbage collection.
// not be deleted when dfdaemon runs garbage collection. It only be deleted
// when the task is deleted by the user.
bool persistent = 2;
// Peer downloads costs time.
google.protobuf.Duration cost = 3;
Expand Down Expand Up @@ -202,9 +203,12 @@ message Task {
message PersistentCacheTask {
// Task id.
string id = 1;
// Replica count of the persistent cache task.
// Replica count of the persistent cache task. The persistent cache task will
// not be deleted when dfdamon runs garbage collection. It only be deleted
// when the task is deleted by the user.
uint64 persistent_replica_count = 2;
// Replica count of the persistent cache task.
// Replica count of the cache task. If cache task is not persistent,
// the persistent cache task will be deleted when dfdaemon runs garbage collection.
uint64 replica_count = 3;
// Digest of the task digest, for example blake3:xxx or sha256:yyy.
string digest = 4;
Expand Down

0 comments on commit cc23703

Please sign in to comment.