Documentation ¶
Index ¶
- type Client
- func (c *Client) GetJobExceptions(apiBaseURL string, jobId string) (*JobExceptions, error)
- func (c *Client) GetJobsOverview(apiBaseURL string) (*JobsOverview, error)
- func (c *Client) GetSavepointStatus(apiBaseURL string, jobID string, triggerID string) (*SavepointStatus, error)
- func (c *Client) StopJob(apiBaseURL string, jobID string) error
- func (c *Client) TakeSavepoint(apiBaseURL string, jobID string, dir string) (*SavepointStatus, error)
- func (c *Client) TakeSavepointAsync(apiBaseURL string, jobID string, dir string) (string, error)
- func (c *Client) TriggerSavepoint(apiBaseURL string, jobID string, dir string, cancel bool) (*SavepointTriggerID, error)
- type Job
- type JobByStartTime
- type JobException
- type JobExceptions
- type JobsOverview
- type SavepointFailureCause
- type SavepointStateID
- type SavepointStatus
- type SavepointTriggerID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client - Flink API client.
func NewDefaultClient ¶
func (*Client) GetJobExceptions ¶
func (c *Client) GetJobExceptions(apiBaseURL string, jobId string) (*JobExceptions, error)
func (*Client) GetJobsOverview ¶
func (c *Client) GetJobsOverview(apiBaseURL string) (*JobsOverview, error)
func (*Client) GetSavepointStatus ¶
func (c *Client) GetSavepointStatus( apiBaseURL string, jobID string, triggerID string) (*SavepointStatus, error)
GetSavepointStatus returns savepoint status.
Flink API response examples:
1) success:
{ "status":{"id":"COMPLETED"}, "operation":{ "location":"file:/tmp/savepoint-ad4025-dd46c1bd1c80" } }
2) failure:
{ "status":{"id":"COMPLETED"}, "operation":{ "failure-cause":{ "class": "java.util.concurrent.CompletionException", "stack-trace": "..." } } }
func (*Client) TakeSavepoint ¶
func (c *Client) TakeSavepoint(apiBaseURL string, jobID string, dir string) (*SavepointStatus, error)
TakeSavepoint takes savepoint, blocks until it succeeds or fails.
func (*Client) TakeSavepointAsync ¶
func (*Client) TriggerSavepoint ¶
func (c *Client) TriggerSavepoint(apiBaseURL string, jobID string, dir string, cancel bool) (*SavepointTriggerID, error)
TriggerSavepoint triggers an async savepoint operation.
type Job ¶
type Job struct { Id string `json:"jid"` State string `json:"state"` Name string `json:"name"` StartTime int64 `json:"start-time"` EndTime int64 `json:"end-time"` Duration int64 `json:"duration"` }
Job defines Flink job status.
type JobByStartTime ¶
type JobByStartTime []Job
func (JobByStartTime) Len ¶
func (jst JobByStartTime) Len() int
func (JobByStartTime) Less ¶
func (jst JobByStartTime) Less(i, j int) bool
func (JobByStartTime) Swap ¶
func (jst JobByStartTime) Swap(i, j int)
type JobException ¶
type JobExceptions ¶
type JobExceptions struct {
Exceptions []JobException `json:"all-exceptions"`
}
type JobsOverview ¶
type JobsOverview struct {
Jobs []Job
}
JobsOverview defines Flink job overview list.
type SavepointFailureCause ¶
type SavepointFailureCause struct { ExceptionClass string `json:"class"` StackTrace string `json:"stack-trace"` }
SavepointFailureCause defines the cause of savepoint failure.
type SavepointStateID ¶
type SavepointStateID struct {
ID string `json:"id"`
}
SavepointStateID - enum("IN_PROGRESS", "COMPLETED").
type SavepointStatus ¶
type SavepointStatus struct { // Flink job ID. JobID string // Savepoint operation trigger ID. TriggerID string // Completed or not. Completed bool // Savepoint location URI, non-empty when savepoint succeeded. Location string // Cause of the failure, non-empyt when savepoint failed FailureCause SavepointFailureCause }
SavepointStatus defines savepoint status of a job.
func (*SavepointStatus) IsFailed ¶
func (s *SavepointStatus) IsFailed() bool
func (*SavepointStatus) IsSuccessful ¶
func (s *SavepointStatus) IsSuccessful() bool
type SavepointTriggerID ¶
type SavepointTriggerID struct {
RequestID string `json:"request-id"`
}
SavepointTriggerID defines trigger ID of an async savepoint operation.
Click to show internal directories.
Click to hide internal directories.