@@ -375,20 +375,21 @@ func (j *job) preheatV2SingleSeedPeerByURL(ctx context.Context, url string, req
375375
376376 stream , err := client .DownloadTask (ctx , taskID , & dfdaemonv2.DownloadTaskRequest {
377377 Download : & commonv2.Download {
378- Url : url ,
379- PieceLength : req .PieceLength ,
380- Type : commonv2 .TaskType_STANDARD ,
381- Tag : & req .Tag ,
382- Application : & req .Application ,
383- Priority : commonv2 .Priority (req .Priority ),
384- FilteredQueryParams : filteredQueryParams ,
385- RequestHeader : req .Headers ,
386- CertificateChain : req .CertificateChain ,
387- RemoteIp : & advertiseIP ,
388- Timeout : durationpb .New (req .Timeout ),
389- ObjectStorage : req .ObjectStorage ,
390- Hdfs : req .Hdfs ,
391- OutputPath : req .OutputPath ,
378+ Url : url ,
379+ PieceLength : req .PieceLength ,
380+ Type : commonv2 .TaskType_STANDARD ,
381+ Tag : & req .Tag ,
382+ Application : & req .Application ,
383+ Priority : commonv2 .Priority (req .Priority ),
384+ FilteredQueryParams : filteredQueryParams ,
385+ RequestHeader : req .Headers ,
386+ CertificateChain : req .CertificateChain ,
387+ RemoteIp : & advertiseIP ,
388+ Timeout : durationpb .New (req .Timeout ),
389+ ObjectStorage : req .ObjectStorage ,
390+ Hdfs : req .Hdfs ,
391+ OutputPath : req .OutputPath ,
392+ EnableTaskIdBasedBlobDigest : getEnableTaskIDBasedBlobDigest (req .EnableTaskIDBasedBlobDigest ),
392393 }})
393394 if err != nil {
394395 log .Errorf ("[preheat]: preheat failed: %s" , err .Error ())
@@ -476,20 +477,21 @@ func (j *job) PreheatAllSeedPeers(ctx context.Context, req *internaljob.PreheatR
476477 ctx ,
477478 taskID ,
478479 & dfdaemonv2.DownloadTaskRequest {Download : & commonv2.Download {
479- Url : url ,
480- PieceLength : req .PieceLength ,
481- Type : commonv2 .TaskType_STANDARD ,
482- Tag : & req .Tag ,
483- Application : & req .Application ,
484- Priority : commonv2 .Priority (req .Priority ),
485- FilteredQueryParams : filteredQueryParams ,
486- RequestHeader : req .Headers ,
487- Timeout : durationpb .New (req .Timeout ),
488- CertificateChain : req .CertificateChain ,
489- RemoteIp : & advertiseIP ,
490- ObjectStorage : req .ObjectStorage ,
491- Hdfs : req .Hdfs ,
492- OutputPath : req .OutputPath ,
480+ Url : url ,
481+ PieceLength : req .PieceLength ,
482+ Type : commonv2 .TaskType_STANDARD ,
483+ Tag : & req .Tag ,
484+ Application : & req .Application ,
485+ Priority : commonv2 .Priority (req .Priority ),
486+ FilteredQueryParams : filteredQueryParams ,
487+ RequestHeader : req .Headers ,
488+ Timeout : durationpb .New (req .Timeout ),
489+ CertificateChain : req .CertificateChain ,
490+ RemoteIp : & advertiseIP ,
491+ ObjectStorage : req .ObjectStorage ,
492+ Hdfs : req .Hdfs ,
493+ OutputPath : req .OutputPath ,
494+ EnableTaskIdBasedBlobDigest : getEnableTaskIDBasedBlobDigest (req .EnableTaskIDBasedBlobDigest ),
493495 }})
494496 if err != nil {
495497 log .Errorf ("[preheat]: preheat failed: %s" , err .Error ())
@@ -696,20 +698,21 @@ func (j *job) PreheatAllPeers(ctx context.Context, req *internaljob.PreheatReque
696698 ctx ,
697699 taskID ,
698700 & dfdaemonv2.DownloadTaskRequest {Download : & commonv2.Download {
699- Url : url ,
700- PieceLength : req .PieceLength ,
701- Type : commonv2 .TaskType_STANDARD ,
702- Tag : & req .Tag ,
703- Application : & req .Application ,
704- Priority : commonv2 .Priority (req .Priority ),
705- FilteredQueryParams : filteredQueryParams ,
706- RequestHeader : req .Headers ,
707- Timeout : durationpb .New (req .Timeout ),
708- CertificateChain : req .CertificateChain ,
709- RemoteIp : & advertiseIP ,
710- ObjectStorage : req .ObjectStorage ,
711- Hdfs : req .Hdfs ,
712- OutputPath : req .OutputPath ,
701+ Url : url ,
702+ PieceLength : req .PieceLength ,
703+ Type : commonv2 .TaskType_STANDARD ,
704+ Tag : & req .Tag ,
705+ Application : & req .Application ,
706+ Priority : commonv2 .Priority (req .Priority ),
707+ FilteredQueryParams : filteredQueryParams ,
708+ RequestHeader : req .Headers ,
709+ Timeout : durationpb .New (req .Timeout ),
710+ CertificateChain : req .CertificateChain ,
711+ RemoteIp : & advertiseIP ,
712+ ObjectStorage : req .ObjectStorage ,
713+ Hdfs : req .Hdfs ,
714+ OutputPath : req .OutputPath ,
715+ EnableTaskIdBasedBlobDigest : getEnableTaskIDBasedBlobDigest (req .EnableTaskIDBasedBlobDigest ),
713716 }})
714717 if err != nil {
715718 log .Errorf ("[preheat]: preheat failed: %s" , err .Error ())
@@ -1095,3 +1098,12 @@ func (j *job) ListTaskEntries(ctx context.Context, req *internaljob.ListTaskEntr
10951098 SchedulerID : j .config .Manager .SchedulerClusterID ,
10961099 }, nil
10971100}
1101+
1102+ // getEnableTaskIDBasedBlobDigest returns the value of EnableTaskIDBasedBlobDigest.
1103+ // If nil, returns true as the default value.
1104+ func getEnableTaskIDBasedBlobDigest (enable * bool ) bool {
1105+ if enable == nil {
1106+ return true
1107+ }
1108+ return * enable
1109+ }
0 commit comments