client

package
Version: v0.5.28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderContentType = "Content-Type"
	ContentTypeJSON   = "application/json"
	ErrRequestFailed  = "REQUEST_FAILED"
)

Variables

Functions

This section is empty.

Types

type CommandMetadata added in v0.5.0

type CommandMetadata struct {
	TaskName            string
	Domain              string
	Project             string
	Labels              map[string]string
	AttemptNumber       uint32
	MaxAttempts         uint32
	WorkflowID          string
	WorkflowExecutionID string
}

type QuboleClient

type QuboleClient interface {
	ExecuteHiveCommand(ctx context.Context, commandStr string, timeoutVal uint32, clusterPrimaryLabel string,
		accountKey string, tags []string, commandMetadata CommandMetadata) (*QuboleCommandDetails, error)
	KillCommand(ctx context.Context, commandID string, accountKey string) error
	GetCommandStatus(ctx context.Context, commandID string, accountKey string) (QuboleStatus, error)
}

Interface to interact with QuboleClient for hive tasks

func NewQuboleClient

func NewQuboleClient(cfg *config.Config) QuboleClient

type QuboleCommandDetails

type QuboleCommandDetails struct {
	ID     int64
	Status QuboleStatus
	URI    url.URL
}

type QuboleStatus

type QuboleStatus string

This type is meant only to encapsulate the response coming from Qubole as a type, it is not meant to be stored locally.

const (
	QuboleStatusUnknown   QuboleStatus = "UNKNOWN"
	QuboleStatusWaiting   QuboleStatus = "WAITING"
	QuboleStatusRunning   QuboleStatus = "RUNNING"
	QuboleStatusDone      QuboleStatus = "DONE"
	QuboleStatusError     QuboleStatus = "ERROR"
	QuboleStatusCancelled QuboleStatus = "CANCELLED"
)

func NewQuboleStatus

func NewQuboleStatus(ctx context.Context, status string) QuboleStatus

type RequestBody

type RequestBody struct {
	Query        string   `json:"query,omitempty"`
	ClusterLabel string   `json:"label,omitempty"`
	CommandType  string   `json:"command_type,omitempty"`
	Retry        uint32   `json:"retry,omitempty"`
	Status       string   `json:"status,omitempty"`
	Tags         []string `json:"tags,omitempty"`
	Timeout      uint32   `json:"timeout,omitempty"`
	InlineScript string   `json:"inline,omitempty"`
	Files        string   `json:"files,omitempty"`
}

QuboleClient API Request Body, meant to be passed into JSON.marshal Any nil, 0 or "" fields will not be marshaled

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL