cluster

package
v0.0.0-...-fd1d5d9 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	HostURL     url.URL
	ConfigURL   url.URL
	ClusterURL  url.URL
	DatasetsURL url.URL
	OverviewURL url.URL
	Jobs        struct {
		URL         url.URL
		MetricsURL  url.URL
		OverviewURL url.URL
	}
	Jars struct {
		URL       url.URL
		UploadURL url.URL
	}
	Jobmanager struct {
		ConfigURL  url.URL
		LogsURL    url.URL
		MetricsURL url.URL
	}
	Taskmanagers struct {
		URL        url.URL
		MetricsURL url.URL
	}
	// TODO: Add support to use custom headers when calling cluster
	Headers struct{}
}

func New

func New(hostURL string) Cluster

func (*Cluster) DescribeJob

func (c *Cluster) DescribeJob(jid string) (JobDescription, error)

func (*Cluster) GetConfig

func (c *Cluster) GetConfig() (ClusterConfig, error)

func (*Cluster) GetJobs

func (c *Cluster) GetJobs() (Jobs, error)

func (*Cluster) GetJobsOverview

func (c *Cluster) GetJobsOverview() (JobsOverview, error)

func (*Cluster) GetOverview

func (c *Cluster) GetOverview() (ClusterOverview, error)

type ClusterConfig

type ClusterConfig struct {
	Features struct {
		WebSubmit bool `json:"web-submit" header:"web-submit"`
	} `json:"features" header:"features"`
	FlinkRevision   string `json:"flink-revision" header:"flink-revision"`
	FlinkVersion    string `json:"flink-version" header:"flink-version"`
	RefreshInterval int64  `json:"refresh-interval" header:"refresh-interval"`
	TimezoneName    string `json:"timezone-name" header:"timezone-name"`
	TimezoneOffset  int64  `json:"timezone-offset" header:"timezone-offset"`
}

type ClusterOverview

type ClusterOverview struct {
	FlinkCommit    string `json:"flink-commit" header:"flink-commit"`
	FlinkVersion   string `json:"flink-version" header:"flink-version"`
	JobsCancelled  int64  `json:"jobs-cancelled" header:"jobs-cancelled"`
	JobsFailed     int64  `json:"jobs-failed" header:"jobs-failed"`
	JobsFinished   int64  `json:"jobs-finished" header:"jobs-finished"`
	JobsRunning    int64  `json:"jobs-running" header:"jobs-running"`
	SlotsAvailable int64  `json:"slots-available" header:"slots-available"`
	SlotsTotal     int64  `json:"slots-total" header:"slots-total"`
	Taskmanagers   int64  `json:"taskmanagers" header:"taskmanagers"`
}

type JobDescription

type JobDescription struct {
	Duration    int64  `json:"duration" header:"duration"`
	EndTime     int64  `json:"end-time" header:"end-time"`
	IsStoppable bool   `json:"isStoppable" header:"isStoppable"`
	Jid         string `json:"jid" header:"jid"`
	Name        string `json:"name" header:"name"`
	Now         int64  `json:"now" header:"now"`
	Plan        struct {
		Jid   string `json:"jid"`
		Name  string `json:"name"`
		Nodes []struct {
			Description string `json:"description"`
			ID          string `json:"id"`
			Inputs      []struct {
				Exchange     string `json:"exchange"`
				ID           string `json:"id"`
				Num          int64  `json:"num"`
				ShipStrategy string `json:"ship_strategy"`
			} `json:"inputs"`
			Operator            string   `json:"operator"`
			OperatorStrategy    string   `json:"operator_strategy"`
			OptimizerProperties struct{} `json:"optimizer_properties"`
			Parallelism         int64    `json:"parallelism"`
		} `json:"nodes"`
	} `json:"plan"`
	StartTime    int64  `json:"start-time" header:"start-time"`
	State        string `json:"state" header:"state"`
	StatusCounts struct {
		Canceled    int64 `json:"CANCELED"`
		Canceling   int64 `json:"CANCELING"`
		Created     int64 `json:"CREATED"`
		Deploying   int64 `json:"DEPLOYING"`
		Failed      int64 `json:"FAILED"`
		Finished    int64 `json:"FINISHED"`
		Reconciling int64 `json:"RECONCILING"`
		Running     int64 `json:"RUNNING"`
		Scheduled   int64 `json:"SCHEDULED"`
	} `json:"status-counts"`
	Timestamps struct {
		Canceled    int64 `json:"CANCELED"`
		Cancelling  int64 `json:"CANCELLING"`
		Created     int64 `json:"CREATED"`
		Failed      int64 `json:"FAILED"`
		Failing     int64 `json:"FAILING"`
		Finished    int64 `json:"FINISHED"`
		Reconciling int64 `json:"RECONCILING"`
		Restarting  int64 `json:"RESTARTING"`
		Running     int64 `json:"RUNNING"`
		Suspended   int64 `json:"SUSPENDED"`
	} `json:"timestamps"`
	Vertices []struct {
		Duration int64  `json:"duration"`
		EndTime  int64  `json:"end-time"`
		ID       string `json:"id"`
		Metrics  struct {
			ReadBytes            int64 `json:"read-bytes"`
			ReadBytesComplete    bool  `json:"read-bytes-complete"`
			ReadRecords          int64 `json:"read-records"`
			ReadRecordsComplete  bool  `json:"read-records-complete"`
			WriteBytes           int64 `json:"write-bytes"`
			WriteBytesComplete   bool  `json:"write-bytes-complete"`
			WriteRecords         int64 `json:"write-records"`
			WriteRecordsComplete bool  `json:"write-records-complete"`
		} `json:"metrics"`
		Name        string `json:"name"`
		Parallelism int64  `json:"parallelism"`
		StartTime   int64  `json:"start-time"`
		Status      string `json:"status"`
		Tasks       struct {
			Canceled    int64 `json:"CANCELED"`
			Canceling   int64 `json:"CANCELING"`
			Created     int64 `json:"CREATED"`
			Deploying   int64 `json:"DEPLOYING"`
			Failed      int64 `json:"FAILED"`
			Finished    int64 `json:"FINISHED"`
			Reconciling int64 `json:"RECONCILING"`
			Running     int64 `json:"RUNNING"`
			Scheduled   int64 `json:"SCHEDULED"`
		} `json:"tasks"`
	} `json:"vertices"`
}

type Jobs

type Jobs struct {
	Jobs []struct {
		ID     string `json:"id" header:"id"`
		Status string `json:"status" header:"status"`
	} `json:"jobs" header:"jobs"`
}

type JobsOverview

type JobsOverview struct {
	Jobs []struct {
		Duration         int64  `json:"duration" header:"duration"`
		EndTime          int64  `json:"end-time" header:"end-time"`
		Jid              string `json:"jid" header:"jid"`
		LastModification int64  `json:"last-modification" header:"last-modification"`
		Name             string `json:"name" header:"name"`
		StartTime        int64  `json:"start-time" header:"start-time"`
		State            string `json:"state" header:"state"`
		Tasks            struct {
			Canceled    int64 `json:"canceled" header:"canceled"`
			Canceling   int64 `json:"canceling" header:"canceling"`
			Created     int64 `json:"created" header:"created"`
			Deploying   int64 `json:"deploying" header:"deploying"`
			Failed      int64 `json:"failed" header:"failed"`
			Finished    int64 `json:"finished" header:"finished"`
			Reconciling int64 `json:"reconciling" header:"reconciling"`
			Running     int64 `json:"running" header:"running"`
			Scheduled   int64 `json:"scheduled" header:"scheduled"`
			Total       int64 `json:"total" header:"total"`
		} `json:"tasks" header:"tasks"`
	} `json:"jobs" header:"jobs"`
}

Jump to

Keyboard shortcuts

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