dataproc

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const SourceType string = "dataproc"

Variables

This section is empty.

Functions

func ClusterConsoleURL

func ClusterConsoleURL(projectID, region, clusterName string) string

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

func JobConsoleURL(projectID, region, jobID string) string

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

func JobLogsURL(projectID, region, clusterName, jobID string, startTime, endTime time.Time) string

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 (r Config) Initialize(ctx context.Context, tracer trace.Tracer) (sources.Source, error)

func (Config) SourceConfigType

func (r Config) SourceConfigType() string

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.

func ToJobs

func ToJobs(jobPbs []*dataprocpb.Job, region string) ([]Job, error)

ToJobs converts a slice of protobuf Job messages to a slice of Job structs.

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) Close

func (s *Source) Close() error

func (*Source) GetCluster

func (s *Source) GetCluster(ctx context.Context, clusterName string) (any, error)

GetCluster gets a single cluster.

func (*Source) GetClusterControllerClient

func (s *Source) GetClusterControllerClient() *dataproc.ClusterControllerClient

func (*Source) GetJob

func (s *Source) GetJob(ctx context.Context, jobId string) (any, error)

GetJob gets a single job.

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 (s *Source) SourceType() string

func (*Source) ToConfig

func (s *Source) ToConfig() sources.SourceConfig

Jump to

Keyboard shortcuts

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