client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ContentTypeJSON = "application/json"
View Source
const HeaderContentType = "Content-Type"
View Source
const QuboleLogLinkFormat = "https://api.qubole.com/v2/analyze?command_id=%s"

Variables

Functions

This section is empty.

Types

type QuboleClient

type QuboleClient interface {
	ExecuteHiveCommand(ctx context.Context, commandStr string, timeoutVal uint32, clusterLabel string,
		accountKey string, tags []string) (*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() QuboleClient

type QuboleCommandDetails

type QuboleCommandDetails struct {
	ID     int64
	Status QuboleStatus
}

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"
)

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