本文整理汇总了Golang中github.com/pachyderm/pachyderm/src/pps/persist.JobInfo.GetPipelineName方法的典型用法代码示例。如果您正苦于以下问题:Golang JobInfo.GetPipelineName方法的具体用法?Golang JobInfo.GetPipelineName怎么用?Golang JobInfo.GetPipelineName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/pachyderm/pachyderm/src/pps/persist.JobInfo
的用法示例。
在下文中一共展示了JobInfo.GetPipelineName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: runJobInfo
func (j *jobRunner) runJobInfo(persistJobInfo *persist.JobInfo) error {
switch {
case persistJobInfo.GetTransform() != nil:
return j.reallyRunJobInfo(
uuid.NewWithoutDashes(),
persistJobInfo.JobId,
persistJobInfo.GetTransform(),
persistJobInfo.Input,
persistJobInfo.OutputParent,
1,
)
case persistJobInfo.GetPipelineName() != "":
persistPipelineInfo, err := j.persistAPIClient.GetPipelineInfo(
context.Background(),
&pps.Pipeline{Name: persistJobInfo.GetPipelineName()},
)
if err != nil {
return err
}
if persistPipelineInfo.GetTransform() == nil {
return fmt.Errorf("pachyderm.pps.server: transform not set on pipeline info %v", persistPipelineInfo)
}
return j.reallyRunJobInfo(
persistPipelineInfo.PipelineName,
persistJobInfo.JobId,
persistPipelineInfo.GetTransform(),
persistJobInfo.Input,
persistJobInfo.OutputParent,
1,
)
default:
return fmt.Errorf("pachyderm.pps.server: neither transform or pipeline name set on job info %v", persistJobInfo)
}
}
示例2: persistJobInfoToJobInfo
func (a *apiServer) persistJobInfoToJobInfo(ctx context.Context, persistJobInfo *persist.JobInfo) (*pps.JobInfo, error) {
job := &pps.Job{Id: persistJobInfo.JobId}
jobInfo := &pps.JobInfo{
Job: job,
Shards: persistJobInfo.Shards,
InputCommit: persistJobInfo.InputCommit,
}
if persistJobInfo.GetTransform() != nil {
jobInfo.Spec = &pps.JobInfo_Transform{
Transform: persistJobInfo.GetTransform(),
}
}
if persistJobInfo.GetPipelineName() != "" {
jobInfo.Spec = &pps.JobInfo_Pipeline{
Pipeline: &pps.Pipeline{
Name: persistJobInfo.GetPipelineName(),
},
}
}
persistJobOutput, err := a.persistAPIClient.GetJobOutput(ctx, job)
if err != nil {
return nil, err
}
if persistJobOutput != nil {
jobInfo.OutputCommit = persistJobOutput.OutputCommit
}
return jobInfo, nil
}
示例3: persistJobInfoToJobInfo
// TODO: bulk get
func (a *apiServer) persistJobInfoToJobInfo(ctx context.Context, persistJobInfo *persist.JobInfo) (*pps.JobInfo, error) {
job := &pps.Job{Id: persistJobInfo.JobId}
persistJobStatuses, err := a.persistAPIClient.GetJobStatuses(ctx, job)
if err != nil {
return nil, err
}
persistJobOutput, err := a.persistAPIClient.GetJobOutput(ctx, job)
if err != nil {
return nil, err
}
jobInfo := &pps.JobInfo{
Job: job,
Input: persistJobInfo.Input,
}
if persistJobInfo.GetTransform() != nil {
jobInfo.Spec = &pps.JobInfo_Transform{
Transform: persistJobInfo.GetTransform(),
}
}
if persistJobInfo.GetPipelineName() != "" {
jobInfo.Spec = &pps.JobInfo_Pipeline{
Pipeline: &pps.Pipeline{
Name: persistJobInfo.GetPipelineName(),
},
}
}
jobInfo.JobStatus = make([]*pps.JobStatus, len(persistJobStatuses.JobStatus))
for i, persistJobStatus := range persistJobStatuses.JobStatus {
jobInfo.JobStatus[i] = &pps.JobStatus{
Type: persistJobStatus.Type,
Timestamp: persistJobStatus.Timestamp,
Message: persistJobStatus.Message,
}
}
if persistJobOutput != nil {
jobInfo.Output = persistJobOutput.Output
}
return jobInfo, nil
}