client

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelJobRequest

type CancelJobRequest struct {
	CancelJob       bool   `json:"cancel-job"`
	TargetDirectory string `json:"target-directory,omitempty"`
}

type CancelJobResponse

type CancelJobResponse struct {
	TriggerID string `json:"request-id"`
}

type CheckpointResponse

type CheckpointResponse struct {
	Counts  map[string]int32       `json:"counts"`
	Latest  LatestCheckpoints      `json:"latest"`
	History []CheckpointStatistics `json:"history"`
}

type CheckpointStatistics

type CheckpointStatistics struct {
	ID                 uint             `json:"id"`
	Status             CheckpointStatus `json:"status"`
	IsSavepoint        bool             `json:"is_savepoint"`
	TriggerTimestamp   int64            `json:"trigger_timestamp"`
	LatestAckTimestamp int64            `json:"latest_ack_timestamp"`
	StateSize          int64            `json:"state_size"`
	EndToEndDuration   int64            `json:"end_to_end_duration"`
	AlignmentBuffered  int64            `json:"alignment_buffered"`
	NumSubtasks        int64            `json:"num_subtasks"`
	FailureTimestamp   int64            `json:"failure_timestamp"`
	FailureMessage     string           `json:"failure_message"`
	ExternalPath       string           `json:"external_path"`
	Discarded          bool             `json:"discarded"`
	RestoredTimeStamp  int64            `json:"restore_timestamp"`
}

type CheckpointStatus

type CheckpointStatus string
const (
	CheckpointInProgress CheckpointStatus = "IN_PROGRESS"
	CheckpointFailed     CheckpointStatus = "FAILED"
	CheckpointCompleted  CheckpointStatus = "COMPLETED"
)

type ClusterOverviewResponse

type ClusterOverviewResponse struct {
	TaskManagerCount  int32 `json:"taskmanagers"`
	SlotsAvailable    int32 `json:"slots-available"`
	NumberOfTaskSlots int32 `json:"slots-total"`
}

type FailureCause

type FailureCause struct {
	Class      string `json:"class"`
	StackTrace string `json:"stack-trace"`
}

type FlinkAPIInterface

type FlinkAPIInterface interface {
	CancelJobWithSavepoint(ctx context.Context, url string, jobID string) (string, error)
	ForceCancelJob(ctx context.Context, url string, jobID string) error
	SubmitJob(ctx context.Context, url string, jarID string, submitJobRequest SubmitJobRequest) (*SubmitJobResponse, error)
	CheckSavepointStatus(ctx context.Context, url string, jobID, triggerID string) (*SavepointResponse, error)
	GetJobs(ctx context.Context, url string) (*GetJobsResponse, error)
	GetClusterOverview(ctx context.Context, url string) (*ClusterOverviewResponse, error)
	GetLatestCheckpoint(ctx context.Context, url string, jobID string) (*CheckpointStatistics, error)
	GetJobConfig(ctx context.Context, url string, jobID string) (*JobConfigResponse, error)
	GetTaskManagers(ctx context.Context, url string) (*TaskManagersResponse, error)
	GetCheckpointCounts(ctx context.Context, url string, jobID string) (*CheckpointResponse, error)
	GetJobOverview(ctx context.Context, url string, jobID string) (*FlinkJobOverview, error)
}

func NewFlinkJobManagerClient

func NewFlinkJobManagerClient(config config.RuntimeConfig) FlinkAPIInterface

type FlinkJob

type FlinkJob struct {
	JobID  string   `json:"id"`
	Status JobState `json:"status"`
}

type FlinkJobManagerClient

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

func (*FlinkJobManagerClient) CancelJobWithSavepoint

func (c *FlinkJobManagerClient) CancelJobWithSavepoint(ctx context.Context, url string, jobID string) (string, error)

func (*FlinkJobManagerClient) CheckSavepointStatus

func (c *FlinkJobManagerClient) CheckSavepointStatus(ctx context.Context, url string, jobID, triggerID string) (*SavepointResponse, error)

func (*FlinkJobManagerClient) ForceCancelJob

func (c *FlinkJobManagerClient) ForceCancelJob(ctx context.Context, url string, jobID string) error

func (*FlinkJobManagerClient) GetCheckpointCounts

func (c *FlinkJobManagerClient) GetCheckpointCounts(ctx context.Context, url string, jobID string) (*CheckpointResponse, error)

func (*FlinkJobManagerClient) GetClusterOverview

func (c *FlinkJobManagerClient) GetClusterOverview(ctx context.Context, url string) (*ClusterOverviewResponse, error)

func (*FlinkJobManagerClient) GetJobConfig

func (c *FlinkJobManagerClient) GetJobConfig(ctx context.Context, url, jobID string) (*JobConfigResponse, error)

func (*FlinkJobManagerClient) GetJobOverview

func (c *FlinkJobManagerClient) GetJobOverview(ctx context.Context, url string, jobID string) (*FlinkJobOverview, error)

func (*FlinkJobManagerClient) GetJobs

func (*FlinkJobManagerClient) GetLatestCheckpoint

func (c *FlinkJobManagerClient) GetLatestCheckpoint(ctx context.Context, url string, jobID string) (*CheckpointStatistics, error)

func (*FlinkJobManagerClient) GetTaskManagers

func (c *FlinkJobManagerClient) GetTaskManagers(ctx context.Context, url string) (*TaskManagersResponse, error)

func (*FlinkJobManagerClient) SubmitJob

func (c *FlinkJobManagerClient) SubmitJob(ctx context.Context, url string, jarID string, submitJobRequest SubmitJobRequest) (*SubmitJobResponse, error)

type FlinkJobOverview

type FlinkJobOverview struct {
	JobID     string   `json:"jid"`
	State     JobState `json:"state"`
	StartTime int64    `json:"start-time"`
	EndTime   int64    `json:"end-time"`
}

type GetJobsResponse

type GetJobsResponse struct {
	Jobs []FlinkJob `json:"jobs"`
}

type JobConfigResponse

type JobConfigResponse struct {
	JobID           string             `json:"jid"`
	ExecutionConfig JobExecutionConfig `json:"execution-config"`
}

type JobExecutionConfig

type JobExecutionConfig struct {
	Parallelism int32 `json:"job-parallelism"`
}

type JobState

type JobState string
const (
	Created     JobState = "CREATED"
	Running     JobState = "RUNNING"
	Failing     JobState = "FAILING"
	Failed      JobState = "FAILED"
	Cancelling  JobState = "CANCELLING"
	Canceled    JobState = "CANCELED"
	Finished    JobState = "FINISHED"
	Restarting  JobState = "RESTARTING"
	Suspended   JobState = "SUSPENDED"
	Reconciling JobState = "RECONCILING"
)

type LatestCheckpoints

type LatestCheckpoints struct {
	Completed *CheckpointStatistics `json:"completed,omitempty"`
	Savepoint *CheckpointStatistics `json:"savepoint,omitempty"`
	Failed    *CheckpointStatistics `json:"failed,omitempty"`
	Restored  *CheckpointStatistics `json:"restored,omitempty"`
}

type SavepointOperationResponse

type SavepointOperationResponse struct {
	Location     string       `json:"location"`
	FailureCause FailureCause `json:"failure-cause"`
}

type SavepointResponse

type SavepointResponse struct {
	SavepointStatus SavepointStatusResponse    `json:"status"`
	Operation       SavepointOperationResponse `json:"operation"`
}

type SavepointStatus

type SavepointStatus string
const (
	SavePointInvalid    SavepointStatus = ""
	SavePointInProgress SavepointStatus = "IN_PROGRESS"
	SavePointCompleted  SavepointStatus = "COMPLETED"
)

type SavepointStatusResponse

type SavepointStatusResponse struct {
	Status SavepointStatus `json:"id"`
}

type SubmitJobRequest

type SubmitJobRequest struct {
	SavepointPath string `json:"savepointPath"`
	Parallelism   int32  `json:"parallelism"`
	ProgramArgs   string `json:"programArgs"`
	EntryClass    string `json:"entryClass"`
}

type SubmitJobResponse

type SubmitJobResponse struct {
	JobID string `json:"jobid"`
}

type TaskManagerStats

type TaskManagerStats struct {
	Path                   string `json:"path"`
	DataPort               int32  `json:"dataPort"`
	TimeSinceLastHeartbeat int64  `json:"timeSinceLastHeartbeat"`
	SlotsNumber            int32  `json:"slotsNumber"`
	FreeSlots              int32  `json:"freeSlots"`
}

type TaskManagersResponse

type TaskManagersResponse struct {
	TaskManagers []TaskManagerStats `json:"taskmanagers"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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