livy

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

README

livy-go

Actions Status Go Report Card Documentation

Getting Started

Livy Setup
  1. livy install
make livy.install
  1. livy start
make livy.start
  1. livy stop
make livy.stop

リリース方法

  1. yarn install
  2. git checkout -b master origin/master
  3. yarn semantic-release --no-ci --branches master

Documentation

Index

Constants

View Source
const (
	SessionKind_Spark   = SessionKind("spark")
	SessionKind_PySpark = SessionKind("pyspark")
	SessionKind_SparkR  = SessionKind("sparkr")
	SessionKind_Sql     = SessionKind("sql")
)
View Source
const (
	SessionState_NotStarted   = SessionState("not_started")
	SessionState_Starting     = SessionState("starting")
	SessionState_Idle         = SessionState("idle")
	SessionState_Busy         = SessionState("busy")
	SessionState_ShuttingDown = SessionState("shutting_down")
	SessionState_Error        = SessionState("error")
	SessionState_Dead         = SessionState("dead")
	SessionState_Killed       = SessionState("killed")
	SessionState_Success      = SessionState("success")
)
View Source
const (
	StatementState_Waiting    = StatementState("waiting")
	StatementState_Running    = StatementState("running")
	StatementState_Available  = StatementState("available")
	StatementState_Error      = StatementState("error")
	StatementState_Cancelling = StatementState("cancelling")
	StatementState_Cancelled  = StatementState("cancelled")
)

Variables

Functions

func DecodeResponse

func DecodeResponse(target interface{}, res *http.Response) error

DecodeResponse decodes the body of res into target. If there is no body, target is unchanged.

func JSONReader

func JSONReader(v interface{}) (io.Reader, error)

func SendRequest

func SendRequest(client *http.Client, req *http.Request) (*http.Response, error)

Types

type Batch

type Batch struct {
	ID      int               `json:"id"`
	AppID   string            `json:"appid"`
	AppInfo map[string]string `json:"appInfo"`
	Log     []string          `json:"log"`
	State   string            `json:"state"`
}

type BatchLogResponse

type BatchLogResponse struct {
	ID   int
	From int
	Size int
	Log  []string
}

type BatchState

type BatchState struct {
	ID    int
	State string
}

type Batches

type Batches struct {
	From     int      `json:"from"`
	Total    int      `json:"total"`
	Sessions []*Batch `json:"sessions"`
}

type BatchesDeleteCall

type BatchesDeleteCall struct {
	// contains filtered or unexported fields
}

func (*BatchesDeleteCall) Do

func (c *BatchesDeleteCall) Do() error

type BatchesGetCall

type BatchesGetCall struct {
	// contains filtered or unexported fields
}

func (*BatchesGetCall) Do

func (c *BatchesGetCall) Do() (*Batch, error)

type BatchesInsertCall

type BatchesInsertCall struct {
	// contains filtered or unexported fields
}

func (*BatchesInsertCall) Do

func (c *BatchesInsertCall) Do() (*Batch, error)

type BatchesListCall

type BatchesListCall struct {
	// contains filtered or unexported fields
}

func (*BatchesListCall) Do

func (c *BatchesListCall) Do() (*Batches, error)

type BatchesLogCall

type BatchesLogCall struct {
	// contains filtered or unexported fields
}

func (*BatchesLogCall) Do

type BatchesService

type BatchesService struct {
	// contains filtered or unexported fields
}

func NewBatchesService

func NewBatchesService(s *Service) *BatchesService

func (*BatchesService) Delete

func (r *BatchesService) Delete(batchID int) *BatchesDeleteCall

func (*BatchesService) Get

func (r *BatchesService) Get(batchID int) *BatchesGetCall

func (*BatchesService) Insert

func (r *BatchesService) Insert(insertBatchRequest *InsertBatchRequest) *BatchesInsertCall

Insert: Creates a new batch.

func (*BatchesService) List

func (r *BatchesService) List() *BatchesListCall

func (*BatchesService) Log

func (r *BatchesService) Log(batchID int) *BatchesLogCall

func (*BatchesService) State

func (r *BatchesService) State(batchID int) *BatchesStateCall

type BatchesStateCall

type BatchesStateCall struct {
	// contains filtered or unexported fields
}

func (*BatchesStateCall) Do

func (c *BatchesStateCall) Do() (*BatchState, error)

type ErrorResponse

type ErrorResponse struct {
	ErrorMessage string `json:"error_message"`
}

func (*ErrorResponse) Error

func (err *ErrorResponse) Error() string

type InsertBatchRequest

type InsertBatchRequest struct {
	// File containing the application to execute
	File string `json:"file"`
	// User to impersonate when starting the batch
	ProxyUser string `json:"proxyUser,omitempty"`
	// Application Java/Spark main class
	ClassName string `json:"className,omitempty"`
	// Command line arguments for the application
	Args []string `json:"args,omitempty"`
	// jars to be used in this session
	Jars []string `json:"jars,omitempty"`
	// Python files to be used in this session
	PyFiles []string `json:"pyFiles,omitempty"`
	// files to be used in this session
	Files []string `json:"files,omitempty"`
	// Amount of memory to use for the driver process
	DriverMemory string `json:"driverMemory,omitempty"`
	// Number of cores to use for the driver process
	DriverCores int `json:"driverCores,omitempty"`
	// Amount of memory to use per executor process
	ExecutorMemory string `json:"executorMemory,omitempty"`
	// Number of cores to use for each executor
	ExecutorCores int `json:"executorCores,omitempty"`
	// Number of executors to launch for this session
	NumExecutors int `json:"numExecutors,omitempty"`
	// Archives to be used in this session
	Archives []string `json:"archives,omitempty"`
	// The name of the YARN queue to which submitted
	Queue string `json:"queue,omitempty"`
	// The name of this session
	Name string `json:"name,omitempty"`
	// Spark configuration properties
	Conf map[string]string `json:"conf,omitempty"`
}

type InsertSessionRequest

type InsertSessionRequest struct {
	// The name of this session
	Name string `json:"name,omitempty"`
	// The session kind
	Kind SessionKind `json:"kind"`
	// User to impersonate when starting the session
	ProxyUser string `json:"proxyUser,omitempty"`
	// jars to be used in this session
	Jars []string `json:"jars,omitempty"`
	// Python files to be used in this session
	PyFiles []string `json:"pyFiles,omitempty"`
	// files to be used in this session
	Files []string `json:"files,omitempty"`
	// Amount of memory to use for the driver process
	DriverMemory string `json:"driverMemory,omitempty"`
	// Number of cores to use for the driver process
	DriverCores int `json:"driverCores,omitempty"`
	// Amount of memory to use per executor process
	ExecutorMemory string `json:"executorMemory,omitempty"`
	// Number of cores to use for each executor
	ExecutorCores int `json:"executorCores,omitempty"`
	// Number of executors to launch for this session
	NumExecutors int `json:"numExecutors,omitempty"`
	// Archives to be used in this session
	Archives []string `json:"archives,omitempty"`
	// The name of the YARN queue to which submitted
	Queue string `json:"queue,omitempty"`
	// Spark configuration properties
	Conf map[string]string `json:"conf,omitempty"`
	// Timeout in second to which session be orphaned
	HeartbeatTimeoutInSecond int `json:"heartbeatTimeoutInSecond,omitempty"`
}

type InsertStatementRequest

type InsertStatementRequest struct {
	// The code to execute
	Code string `json:"code"`
}

type Service

type Service struct {
	BasePath string // API endpoint base URL

	Batches *BatchesService

	Sessions *SessionsService

	Statements *StatementsService
	// contains filtered or unexported fields
}

func New

func New(client *http.Client) *Service

func NewService

func NewService(ctx context.Context) *Service

type Session

type Session struct {
	ID        int               `json:"id"`
	AppID     string            `json:"appId"`
	Owner     string            `json:"owner"`
	ProxyUser string            `json:"proxyUser"`
	Kind      SessionKind       `json:"kind"`
	Log       []string          `json:"log"`
	State     SessionState      `json:"state"`
	AppInfo   map[string]string `json:"appInfo"`

	//  Not officially https://livy.incubator.apache.org/docs/latest/rest-api.html#session
	Name string `json:"name"`

	// error message
	Message string `json:"msg"`
}

type SessionKind

type SessionKind string

type SessionLogResponse

type SessionLogResponse struct {
	ID   int
	From int
	Size int
	Log  []string
}

type SessionState

type SessionState string

type SessionStateResponse

type SessionStateResponse struct {
	ID    int          `json:"id"`
	State SessionState `json:"state"`
}

type Sessions

type Sessions struct {
	From  int        `json:"from"`
	Size  int        `json:"size"`
	Items []*Session `json:"sessions"`
}

type SessionsDeleteCall

type SessionsDeleteCall struct {
	// contains filtered or unexported fields
}

func (*SessionsDeleteCall) Do

func (c *SessionsDeleteCall) Do() error

type SessionsGetCall

type SessionsGetCall struct {
	// contains filtered or unexported fields
}

func (*SessionsGetCall) Do

func (c *SessionsGetCall) Do() (*Session, error)

type SessionsGetStateCall

type SessionsGetStateCall struct {
	// contains filtered or unexported fields
}

func (*SessionsGetStateCall) Do

type SessionsInsertCall

type SessionsInsertCall struct {
	// contains filtered or unexported fields
}

func (*SessionsInsertCall) Do

func (c *SessionsInsertCall) Do() (*Session, error)

type SessionsListCall

type SessionsListCall struct {
	// contains filtered or unexported fields
}

func (*SessionsListCall) Do

func (c *SessionsListCall) Do() (*Sessions, error)

type SessionsLogCall

type SessionsLogCall struct {
	// contains filtered or unexported fields
}

func (*SessionsLogCall) Do

type SessionsService

type SessionsService struct {
	// contains filtered or unexported fields
}

func NewSessionsService

func NewSessionsService(s *Service) *SessionsService

func (*SessionsService) Delete

func (r *SessionsService) Delete(sessionID int) *SessionsDeleteCall

func (*SessionsService) Get

func (r *SessionsService) Get(sessionID int) *SessionsGetCall

func (*SessionsService) Insert

func (r *SessionsService) Insert(insertSessionRequest *InsertSessionRequest) *SessionsInsertCall

Insert: Creates a new session.

func (*SessionsService) List

func (r *SessionsService) List() *SessionsListCall

func (*SessionsService) Log

func (r *SessionsService) Log(sessionID int) *SessionsLogCall

func (*SessionsService) State

func (r *SessionsService) State(sessionID int) *SessionsGetStateCall

type Statement

type Statement struct {
	ID      int
	Code    string
	State   StatementState
	Output  StatementOutput
	Started int64
}

type StatementOutput

type StatementOutput struct {
	Status         string
	ExecutionCount int
	Data           *json.RawMessage
}

type StatementState

type StatementState string

type Statements

type Statements struct {
	TotalStatements int          `json:"total_statements"`
	Statements      []*Statement `json:"statements"`
}

type StatementsCancelCall

type StatementsCancelCall struct {
	// contains filtered or unexported fields
}

func (*StatementsCancelCall) Do

func (c *StatementsCancelCall) Do() (*Statement, error)

type StatementsGetCall

type StatementsGetCall struct {
	// contains filtered or unexported fields
}

func (*StatementsGetCall) Do

func (c *StatementsGetCall) Do() (*Statement, error)

type StatementsInsertCall

type StatementsInsertCall struct {
	// contains filtered or unexported fields
}

func (*StatementsInsertCall) Do

func (c *StatementsInsertCall) Do() (*Statement, error)

type StatementsListCall

type StatementsListCall struct {
	// contains filtered or unexported fields
}

func (*StatementsListCall) Do

func (c *StatementsListCall) Do() (*Statements, error)

type StatementsService

type StatementsService struct {
	// contains filtered or unexported fields
}

func NewStatementsService

func NewStatementsService(s *Service) *StatementsService

func (*StatementsService) Cancel

func (r *StatementsService) Cancel(sessionID, statementID int) *StatementsCancelCall

func (*StatementsService) Get

func (r *StatementsService) Get(sessionID, statementID int) *StatementsGetCall

func (*StatementsService) Insert

func (r *StatementsService) Insert(sessionID int, insertStatementRequest *InsertStatementRequest, wait bool) *StatementsInsertCall

func (*StatementsService) List

func (r *StatementsService) List(sessionID int) *StatementsListCall

Jump to

Keyboard shortcuts

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