Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeResponse(target interface{}, res *http.Response) error
- func JSONReader(v interface{}) (io.Reader, error)
- func SendRequest(client *http.Client, req *http.Request) (*http.Response, error)
- type Batch
- type BatchLogResponse
- type BatchState
- type Batches
- type BatchesDeleteCall
- type BatchesGetCall
- type BatchesInsertCall
- type BatchesListCall
- type BatchesLogCall
- type BatchesService
- func (r *BatchesService) Delete(batchID int) *BatchesDeleteCall
- func (r *BatchesService) Get(batchID int) *BatchesGetCall
- func (r *BatchesService) Insert(insertBatchRequest *InsertBatchRequest) *BatchesInsertCall
- func (r *BatchesService) List() *BatchesListCall
- func (r *BatchesService) Log(batchID int) *BatchesLogCall
- func (r *BatchesService) State(batchID int) *BatchesStateCall
- type BatchesStateCall
- type ErrorResponse
- type InsertBatchRequest
- type InsertSessionRequest
- type InsertStatementRequest
- type Service
- type Session
- type SessionKind
- type SessionLogResponse
- type SessionState
- type SessionStateResponse
- type Sessions
- type SessionsDeleteCall
- type SessionsGetCall
- type SessionsGetStateCall
- type SessionsInsertCall
- type SessionsListCall
- type SessionsLogCall
- type SessionsService
- func (r *SessionsService) Delete(sessionID int) *SessionsDeleteCall
- func (r *SessionsService) Get(sessionID int) *SessionsGetCall
- func (r *SessionsService) Insert(insertSessionRequest *InsertSessionRequest) *SessionsInsertCall
- func (r *SessionsService) List() *SessionsListCall
- func (r *SessionsService) Log(sessionID int) *SessionsLogCall
- func (r *SessionsService) State(sessionID int) *SessionsGetStateCall
- type Statement
- type StatementOutput
- type StatementState
- type Statements
- type StatementsCancelCall
- type StatementsGetCall
- type StatementsInsertCall
- type StatementsListCall
- type StatementsService
- func (r *StatementsService) Cancel(sessionID, statementID int) *StatementsCancelCall
- func (r *StatementsService) Get(sessionID, statementID int) *StatementsGetCall
- func (r *StatementsService) Insert(sessionID int, insertStatementRequest *InsertStatementRequest, wait bool) *StatementsInsertCall
- func (r *StatementsService) List(sessionID int) *StatementsListCall
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 ¶
View Source
var ( SessionKindList = []SessionKind{ SessionKind_Spark, SessionKind_PySpark, SessionKind_SparkR, SessionKind_Sql, } )
Functions ¶
func DecodeResponse ¶
DecodeResponse decodes the body of res into target. If there is no body, target is unchanged.
func JSONReader ¶
Types ¶
type BatchState ¶
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 ¶
func (c *BatchesLogCall) Do() (*BatchLogResponse, error)
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 NewService ¶
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 SessionState ¶
type SessionState string
type SessionStateResponse ¶
type SessionStateResponse struct {
ID int `json:"id"`
State SessionState `json:"state"`
}
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 ¶
func (c *SessionsGetStateCall) Do() (*SessionStateResponse, error)
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 ¶
func (c *SessionsLogCall) Do() (*SessionLogResponse, error)
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 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
Click to show internal directories.
Click to hide internal directories.