Documentation
¶
Index ¶
- Constants
- func ClusterConsoleURL(projectID, region, clusterName string) string
- func ClusterConsoleURLFromProto(clusterPb *dataprocpb.Cluster, region string) string
- func ClusterLogsURL(projectID, region, clusterName, clusterUUID string, ...) string
- func ClusterLogsURLFromProto(clusterPb *dataprocpb.Cluster, region string) string
- func JobConsoleURL(projectID, region, jobID string) string
- func JobConsoleURLFromProto(jobPb *dataprocpb.Job, region string) string
- func JobLogsURL(projectID, region, clusterName, jobID string, startTime, endTime time.Time) string
- func JobLogsURLFromProto(jobPb *dataprocpb.Job, region string) (string, error)
- type Cluster
- type Config
- type Job
- type ListClustersResponse
- type ListJobsResponse
- type Source
- func (s *Source) Close() error
- func (s *Source) GetCluster(ctx context.Context, clusterName string) (any, error)
- func (s *Source) GetClusterControllerClient() *dataproc.ClusterControllerClient
- func (s *Source) GetJob(ctx context.Context, jobId string) (any, error)
- func (s *Source) GetJobControllerClient() *dataproc.JobControllerClient
- func (s *Source) GetOperationsClient(ctx context.Context) (*longrunning.OperationsClient, error)
- func (s *Source) ListClusters(ctx context.Context, pageSize *int, pageToken, filter string) (any, error)
- func (s *Source) ListJobs(ctx context.Context, pageSize *int, pageToken, filter, jobStateMatcher string) (any, error)
- func (s *Source) SourceType() string
- func (s *Source) ToConfig() sources.SourceConfig
Constants ¶
const SourceType string = "dataproc"
Variables ¶
This section is empty.
Functions ¶
func ClusterConsoleURL ¶
ClusterConsoleURL builds a URL to the Google Cloud Console linking to the cluster monitoring page.
func ClusterConsoleURLFromProto ¶
func ClusterConsoleURLFromProto(clusterPb *dataprocpb.Cluster, region string) string
ClusterConsoleURLFromProto builds a URL to the Google Cloud Console linking to the cluster monitoring page.
func ClusterLogsURL ¶
func ClusterLogsURL(projectID, region, clusterName, clusterUUID string, startTime, endTime time.Time) string
ClusterLogsURL builds a URL to the Google Cloud Console showing Cloud Logging for the given cluster and time range.
func ClusterLogsURLFromProto ¶
func ClusterLogsURLFromProto(clusterPb *dataprocpb.Cluster, region string) string
ClusterLogsURLFromProto builds a URL to the Google Cloud Console showing Cloud Logging for the given cluster.
func JobConsoleURL ¶
JobConsoleURL builds a URL to the Google Cloud Console linking to the job page.
func JobConsoleURLFromProto ¶
func JobConsoleURLFromProto(jobPb *dataprocpb.Job, region string) string
JobConsoleURLFromProto builds a URL to the Google Cloud Console linking to the job page.
func JobLogsURL ¶
JobLogsURL builds a URL to the Google Cloud Console showing Cloud Logging for the given job and time range.
func JobLogsURLFromProto ¶
func JobLogsURLFromProto(jobPb *dataprocpb.Job, region string) (string, error)
JobLogsURLFromProto builds a URL to the Google Cloud Console showing Cloud Logging for the given job.
Types ¶
type Cluster ¶
type Cluster struct {
Name string `json:"name"` // Full resource name
UUID string `json:"uuid"`
State string `json:"state"`
CreateTime string `json:"createTime"`
ConsoleURL string `json:"consoleUrl"`
LogsURL string `json:"logsUrl"`
}
Cluster represents a single Dataproc cluster.
func ToClusters ¶
func ToClusters(clusterPbs []*dataprocpb.Cluster, region string) ([]Cluster, error)
ToClusters converts a slice of protobuf Cluster messages to a slice of Cluster structs.
type Config ¶
type Config struct {
Name string `yaml:"name" validate:"required"`
Type string `yaml:"type" validate:"required"`
Project string `yaml:"project" validate:"required"`
Region string `yaml:"region" validate:"required"`
}
func (Config) Initialize ¶
func (Config) SourceConfigType ¶
type Job ¶
type Job struct {
ID string `json:"id"`
Status string `json:"status"`
SubStatus string `json:"subStatus,omitempty"`
StartTime string `json:"startTime"`
EndTime string `json:"endTime,omitempty"`
ClusterName string `json:"clusterName"`
ConsoleURL string `json:"consoleUrl"`
LogsURL string `json:"logsUrl"`
}
Job represents a single Dataproc job.
type ListClustersResponse ¶
type ListClustersResponse struct {
Clusters []Cluster `json:"clusters"`
NextPageToken string `json:"nextPageToken"`
}
ListClustersResponse is the response from the list clusters API.
type ListJobsResponse ¶
type ListJobsResponse struct {
Jobs []Job `json:"jobs"`
NextPageToken string `json:"nextPageToken"`
}
ListJobsResponse is the response from the list jobs API.
type Source ¶
type Source struct {
Config
Client *dataproc.ClusterControllerClient
OpsClient *longrunning.OperationsClient
JobClient *dataproc.JobControllerClient
}
func (*Source) GetCluster ¶
GetCluster gets a single cluster.
func (*Source) GetClusterControllerClient ¶
func (s *Source) GetClusterControllerClient() *dataproc.ClusterControllerClient
func (*Source) GetJobControllerClient ¶
func (s *Source) GetJobControllerClient() *dataproc.JobControllerClient
func (*Source) GetOperationsClient ¶
func (s *Source) GetOperationsClient(ctx context.Context) (*longrunning.OperationsClient, error)
func (*Source) ListClusters ¶
func (s *Source) ListClusters(ctx context.Context, pageSize *int, pageToken, filter string) (any, error)
ListClusters executes the list clusters operation.
func (*Source) ListJobs ¶
func (s *Source) ListJobs(ctx context.Context, pageSize *int, pageToken, filter, jobStateMatcher string) (any, error)
ListJobs executes the list jobs operation.
func (*Source) SourceType ¶
func (*Source) ToConfig ¶
func (s *Source) ToConfig() sources.SourceConfig