jobs

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WhJobWaiting   string = "waiting"
	WhJobExecuting string = "executing"
	WhJobSucceeded string = "succeeded"
	WhJobAborted   string = "aborted"
	WhJobFailed    string = "failed"
	AsyncJobType   string = "async_job"
)

Variables

This section is empty.

Functions

func WithConfig added in v1.4.0

func WithConfig(a *AsyncJobWh, config *config.Config)

Types

type AsyncJobPayload added in v1.7.0

type AsyncJobPayload struct {
	Id            string          `json:"id"`
	SourceID      string          `json:"source_id"`
	DestinationID string          `json:"destination_id"`
	TableName     string          `json:"tablename"`
	AsyncJobType  string          `json:"async_job_type"`
	WorkspaceID   string          `json:"workspace_id"`
	MetaData      json.RawMessage `json:"metadata"`
}

AsyncJobPayload For creating job payload to wh_async_jobs table

type AsyncJobStatus added in v1.3.0

type AsyncJobStatus struct {
	Id     string
	Status string
	Error  error
}

type AsyncJobWh added in v1.7.0

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

func InitWarehouseJobsAPI

func InitWarehouseJobsAPI(
	ctx context.Context,
	dbHandle *sql.DB,
	notifier *pgnotifier.PGNotifier,
) *AsyncJobWh

InitWarehouseJobsAPI Initializes AsyncJobWh structure with appropriate variabless

func (*AsyncJobWh) AddWarehouseJobHandler added in v1.7.0

func (a *AsyncJobWh) AddWarehouseJobHandler(w http.ResponseWriter, r *http.Request)

AddWarehouseJobHandler The following handler gets called for adding async

func (*AsyncJobWh) InitAsyncJobRunner added in v1.7.0

func (a *AsyncJobWh) InitAsyncJobRunner() error

InitAsyncJobRunner Async Job runner's main job is to 1. Scan the database for entries into wh_async_jobs 2. Publish data to pg_notifier queue 3. Move any executing jobs to waiting

func (*AsyncJobWh) StatusWarehouseJobHandler added in v1.7.0

func (a *AsyncJobWh) StatusWarehouseJobHandler(w http.ResponseWriter, r *http.Request)

type PGNotifierOutput

type PGNotifierOutput struct {
	Id string `json:"id"`
}

type StartJobReqPayload

type StartJobReqPayload struct {
	SourceID      string `json:"source_id"`
	Type          string `json:"type"`
	Channel       string `json:"channel"`
	DestinationID string `json:"destination_id"`
	StartTime     string `json:"start_time"`
	JobRunID      string `json:"job_run_id"`
	TaskRunID     string `json:"task_run_id"`
	AsyncJobType  string `json:"async_job_type"`
	WorkspaceID   string `json:"workspace_id"`
}

StartJobReqPayload For processing requests payload in handlers.go

type WhAddJobResponse

type WhAddJobResponse struct {
	JobIds []int64 `json:"jobids"`
	Err    error   `json:"error"`
}

type WhAsyncJob

type WhAsyncJob struct{}

func (*WhAsyncJob) GetFirstLastEvent

func (*WhAsyncJob) GetFirstLastEvent() (time.Time, time.Time)

func (*WhAsyncJob) GetLoadFileGenStartTIme

func (*WhAsyncJob) GetLoadFileGenStartTIme() time.Time

func (*WhAsyncJob) GetLoadFileType

func (*WhAsyncJob) GetLoadFileType() string

func (*WhAsyncJob) GetLoadFilesMetadata

func (*WhAsyncJob) GetLocalSchema

func (*WhAsyncJob) GetLocalSchema() (model.Schema, error)

func (*WhAsyncJob) GetSampleLoadFileLocation

func (*WhAsyncJob) GetSampleLoadFileLocation(string) (string, error)

func (*WhAsyncJob) GetSchemaInWarehouse

func (*WhAsyncJob) GetSchemaInWarehouse() model.Schema

func (*WhAsyncJob) GetSingleLoadFile

func (*WhAsyncJob) GetSingleLoadFile(string) (warehouseutils.LoadFile, error)

func (*WhAsyncJob) GetTableSchemaInUpload

func (*WhAsyncJob) GetTableSchemaInUpload(string) model.TableSchema

func (*WhAsyncJob) GetTableSchemaInWarehouse

func (*WhAsyncJob) GetTableSchemaInWarehouse(string) model.TableSchema

func (*WhAsyncJob) ShouldOnDedupUseNewRecord

func (*WhAsyncJob) ShouldOnDedupUseNewRecord() bool

func (*WhAsyncJob) UpdateLocalSchema

func (*WhAsyncJob) UpdateLocalSchema(model.Schema) error

func (*WhAsyncJob) UseRudderStorage

func (*WhAsyncJob) UseRudderStorage() bool

type WhAsyncJobRunner

type WhAsyncJobRunner interface {
	// contains filtered or unexported methods
}

type WhJobsMetaData

type WhJobsMetaData struct {
	JobRunID  string `json:"job_run_id"`
	TaskRunID string `json:"task_run_id"`
	JobType   string `json:"jobtype"`
	StartTime string `json:"start_time"`
}

type WhStatusResponse

type WhStatusResponse struct {
	Status string
	Err    string
}

Jump to

Keyboard shortcuts

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