Skip to content

Commit

Permalink
Rename JobUri to CommandUri
Browse files Browse the repository at this point in the history
  • Loading branch information
chetcode committed Sep 10, 2019
1 parent 2eec400 commit a725b4d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
6 changes: 4 additions & 2 deletions go/tasks/v1/qubole/client/qubole_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ type quboleCmdDetailsInternal struct {
Status string
}

type QuboleUri = string

type QuboleCommandDetails struct {
ID int64
Status QuboleStatus
JobUri string
Uri QuboleUri
}

// QuboleClient API Request Body, meant to be passed into JSON.marshal
Expand Down Expand Up @@ -196,7 +198,7 @@ func (q *quboleClient) ExecuteHiveCommand(
}

status := NewQuboleStatus(ctx, cmd.Status)
return &QuboleCommandDetails{ID: cmd.ID, Status: status, JobUri: fmt.Sprintf(QuboleLogLinkFormat, cmd.ID)}, nil
return &QuboleCommandDetails{ID: cmd.ID, Status: status, Uri: fmt.Sprintf(QuboleLogLinkFormat, cmd.ID)}, nil
}

/*
Expand Down
2 changes: 1 addition & 1 deletion go/tasks/v1/qubole/hive_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func (h HiveExecutor) CheckTaskStatus(ctx context.Context, taskCtx types.TaskCon
commandId := strconv.FormatInt(cmdDetails.ID, 10)
logger.Infof(ctx, "Created Qubole ID %s for %s", commandId, workCacheKey)
item.CommandId = commandId
item.JobUri = cmdDetails.JobUri
item.CommandUri = cmdDetails.Uri
item.Status = QuboleWorkRunning
item.Query = "" // Clear the query to save space in etcd once we've successfully launched
err := h.executionBuffer.ConfirmExecution(ctx, workCacheKey, commandId)
Expand Down
11 changes: 6 additions & 5 deletions go/tasks/v1/qubole/qubole_work.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package qubole

import (
"fmt"
"encoding/json"
"fmt"

"github.com/lyft/flyteidl/gen/pb-go/flyteidl/core"
"github.com/lyft/flyteplugins/go/tasks/v1/events"
"github.com/lyft/flyteplugins/go/tasks/v1/qubole/client"
Expand Down Expand Up @@ -44,7 +45,7 @@ type QuboleWorkItem struct {

TimeoutSec uint32 `json:"timeout,omitempty"`

JobUri string `json:"job_uri,omitempty"`
CommandUri string `json:"command_uri,omitempty"`
}

// This ID will be used in a process-wide cache, so it needs to be unique across all concurrent work being done by
Expand Down Expand Up @@ -150,10 +151,10 @@ func constructEventInfoFromQuboleWorkItems(taskCtx types.TaskContext, quboleWork
workItem := v.(QuboleWorkItem)
if workItem.CommandId != "" {
logs = append(logs, &core.TaskLog{
Name: fmt.Sprintf("Retry: %d Status: %s [%s]",
Name: fmt.Sprintf("Retry: %d Status: %s [%s]",
taskCtx.GetTaskExecutionID().GetID().RetryAttempt, workItem.Status, workItem.CommandId),
MessageFormat: core.TaskLog_UNKNOWN,
Uri: workItem.JobUri,
Uri: workItem.CommandUri,
})
}
}
Expand Down Expand Up @@ -201,4 +202,4 @@ func InterfaceConverter(cachedInterface interface{}) (QuboleWorkItem, error) {
}

return *item, nil
}
}

0 comments on commit a725b4d

Please sign in to comment.