v1

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package process provides protocol buffers for background process state.

Index

Constants

This section is empty.

Variables

View Source
var Process_Status_State_name = map[int32]string{
	0: "UNSPECIFIED",
	1: "NEW",
	2: "ACTIVE",
	3: "ABORTED",
	4: "INCOMPLETE",
	5: "COMPLETED",
}
View Source
var Process_Status_State_value = map[string]int32{
	"UNSPECIFIED": 0,
	"NEW":         1,
	"ACTIVE":      2,
	"ABORTED":     3,
	"INCOMPLETE":  4,
	"COMPLETED":   5,
}

Functions

This section is empty.

Types

type Process

type Process struct {
	// Name of the process.
	ProcessName string `protobuf:"bytes,1,opt,name=process_name,json=processName,proto3" json:"process_name,omitempty"`
	// A GUID or other unique identifier for the last process instance that has
	// updated the process. This is a means of tracking state as multiple
	// background processes can attempt to grab and lock process state. It may
	// be used as a means to detect that locks have been lost.
	Instance string `protobuf:"bytes,2,opt,name=instance,proto3" json:"instance,omitempty"`
	// Frequency of how often a process is scheduled to start processing.
	ScheduleFrequency *duration.Duration `protobuf:"bytes,3,opt,name=schedule_frequency,json=scheduleFrequency,proto3" json:"schedule_frequency,omitempty"`
	// A set of active work items being processed. The key is the name of the work
	// item.
	ActiveWork map[string]*Process_Work `` /* 179-byte string literal not displayed */
	// Work to be dropped during a future active period. Is a map of the work
	// item name to timestamp of request. Some workers may treat this as a no-op
	// while others may have critical cleanup to do before dropping the work.
	// The key is the name of the work item.
	CleanupWork map[string]*timestamp.Timestamp `` /* 182-byte string literal not displayed */
	// Work that are no longer active (i.e. dropped) as a form of tracking
	// previous state. Is a map of work item name to timestamp of when the work
	// item was dropped. The key is the name of the work item.
	DroppedWork map[string]*timestamp.Timestamp `` /* 182-byte string literal not displayed */
	// Input parameters for the worker to use across work items.
	Settings *Process_Params `protobuf:"bytes,7,opt,name=settings,proto3" json:"settings,omitempty"`
	// Time of most recent change to the ProcessStatus.Params settings.
	SettingsTime *timestamp.Timestamp `protobuf:"bytes,8,opt,name=settings_time,json=settingsTime,proto3" json:"settings_time,omitempty"`
	// Status over all work items for the most recent period or active period.
	ProcessStatus *Process_Status `protobuf:"bytes,9,opt,name=process_status,json=processStatus,proto3" json:"process_status,omitempty"`
	// Aggregate stats over all time periods for all work items since last reset.
	AggregateStats       map[string]float64 `` /* 194-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

Background process state

func (*Process) Descriptor

func (*Process) Descriptor() ([]byte, []int)

func (*Process) GetActiveWork

func (m *Process) GetActiveWork() map[string]*Process_Work

func (*Process) GetAggregateStats

func (m *Process) GetAggregateStats() map[string]float64

func (*Process) GetCleanupWork

func (m *Process) GetCleanupWork() map[string]*timestamp.Timestamp

func (*Process) GetDroppedWork

func (m *Process) GetDroppedWork() map[string]*timestamp.Timestamp

func (*Process) GetInstance

func (m *Process) GetInstance() string

func (*Process) GetProcessName

func (m *Process) GetProcessName() string

func (*Process) GetProcessStatus

func (m *Process) GetProcessStatus() *Process_Status

func (*Process) GetScheduleFrequency

func (m *Process) GetScheduleFrequency() *duration.Duration

func (*Process) GetSettings

func (m *Process) GetSettings() *Process_Params

func (*Process) GetSettingsTime

func (m *Process) GetSettingsTime() *timestamp.Timestamp

func (*Process) ProtoMessage

func (*Process) ProtoMessage()

func (*Process) Reset

func (m *Process) Reset()

func (*Process) String

func (m *Process) String() string

func (*Process) XXX_DiscardUnknown

func (m *Process) XXX_DiscardUnknown()

func (*Process) XXX_Marshal

func (m *Process) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Process) XXX_Merge

func (m *Process) XXX_Merge(src proto.Message)

func (*Process) XXX_Size

func (m *Process) XXX_Size() int

func (*Process) XXX_Unmarshal

func (m *Process) XXX_Unmarshal(b []byte) error

type Process_Error

type Process_Error struct {
	// Timestamp of the error.
	Time *timestamp.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"`
	// Error message.
	Text                 string   `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Error message that is kept in context with the background process for debugging.

func (*Process_Error) Descriptor

func (*Process_Error) Descriptor() ([]byte, []int)

func (*Process_Error) GetText

func (m *Process_Error) GetText() string

func (*Process_Error) GetTime

func (m *Process_Error) GetTime() *timestamp.Timestamp

func (*Process_Error) ProtoMessage

func (*Process_Error) ProtoMessage()

func (*Process_Error) Reset

func (m *Process_Error) Reset()

func (*Process_Error) String

func (m *Process_Error) String() string

func (*Process_Error) XXX_DiscardUnknown

func (m *Process_Error) XXX_DiscardUnknown()

func (*Process_Error) XXX_Marshal

func (m *Process_Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Process_Error) XXX_Merge

func (m *Process_Error) XXX_Merge(src proto.Message)

func (*Process_Error) XXX_Size

func (m *Process_Error) XXX_Size() int

func (*Process_Error) XXX_Unmarshal

func (m *Process_Error) XXX_Unmarshal(b []byte) error

type Process_Params

type Process_Params struct {
	// Process-specific map of integer parameter name to parameter value.
	IntParams map[string]int64 `` /* 177-byte string literal not displayed */
	// Process-specific map of string parameter name to parameter value.
	StringParams         map[string]string `` /* 185-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

Input parameters configured for the background process that control its behavior.

func (*Process_Params) Descriptor

func (*Process_Params) Descriptor() ([]byte, []int)

func (*Process_Params) GetIntParams

func (m *Process_Params) GetIntParams() map[string]int64

func (*Process_Params) GetStringParams

func (m *Process_Params) GetStringParams() map[string]string

func (*Process_Params) ProtoMessage

func (*Process_Params) ProtoMessage()

func (*Process_Params) Reset

func (m *Process_Params) Reset()

func (*Process_Params) String

func (m *Process_Params) String() string

func (*Process_Params) XXX_DiscardUnknown

func (m *Process_Params) XXX_DiscardUnknown()

func (*Process_Params) XXX_Marshal

func (m *Process_Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Process_Params) XXX_Merge

func (m *Process_Params) XXX_Merge(src proto.Message)

func (*Process_Params) XXX_Size

func (m *Process_Params) XXX_Size() int

func (*Process_Params) XXX_Unmarshal

func (m *Process_Params) XXX_Unmarshal(b []byte) error

type Process_Status

type Process_Status struct {
	// Time period start.
	StartTime *timestamp.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	// Time of last progress status update. This will be equal to the
	// finish_time if the processing has completed.
	ProgressTime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=progress_time,json=progressTime,proto3" json:"progress_time,omitempty"`
	// Time period end.
	FinishTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=finish_time,json=finishTime,proto3" json:"finish_time,omitempty"`
	// Time of most recent error.
	LastErrorTime *timestamp.Timestamp `protobuf:"bytes,4,opt,name=last_error_time,json=lastErrorTime,proto3" json:"last_error_time,omitempty"`
	// Statistics collected of statistic label to statistic value.
	Stats map[string]float64 `` /* 153-byte string literal not displayed */
	// Recent errors, which may have less entries than total errors to reduce
	// space and noise.
	Errors []*Process_Error `protobuf:"bytes,6,rep,name=errors,proto3" json:"errors,omitempty"`
	// Total number of errors before the process completed or aborted.
	TotalErrors          int64                `protobuf:"varint,7,opt,name=total_errors,json=totalErrors,proto3" json:"total_errors,omitempty"`
	State                Process_Status_State `protobuf:"varint,8,opt,name=state,proto3,enum=process.Process_Status_State" json:"state,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

Execution status for a particular run or snapshot of the process.

func (*Process_Status) Descriptor

func (*Process_Status) Descriptor() ([]byte, []int)

func (*Process_Status) GetErrors

func (m *Process_Status) GetErrors() []*Process_Error

func (*Process_Status) GetFinishTime

func (m *Process_Status) GetFinishTime() *timestamp.Timestamp

func (*Process_Status) GetLastErrorTime

func (m *Process_Status) GetLastErrorTime() *timestamp.Timestamp

func (*Process_Status) GetProgressTime

func (m *Process_Status) GetProgressTime() *timestamp.Timestamp

func (*Process_Status) GetStartTime

func (m *Process_Status) GetStartTime() *timestamp.Timestamp

func (*Process_Status) GetState

func (m *Process_Status) GetState() Process_Status_State

func (*Process_Status) GetStats

func (m *Process_Status) GetStats() map[string]float64

func (*Process_Status) GetTotalErrors

func (m *Process_Status) GetTotalErrors() int64

func (*Process_Status) ProtoMessage

func (*Process_Status) ProtoMessage()

func (*Process_Status) Reset

func (m *Process_Status) Reset()

func (*Process_Status) String

func (m *Process_Status) String() string

func (*Process_Status) XXX_DiscardUnknown

func (m *Process_Status) XXX_DiscardUnknown()

func (*Process_Status) XXX_Marshal

func (m *Process_Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Process_Status) XXX_Merge

func (m *Process_Status) XXX_Merge(src proto.Message)

func (*Process_Status) XXX_Size

func (m *Process_Status) XXX_Size() int

func (*Process_Status) XXX_Unmarshal

func (m *Process_Status) XXX_Unmarshal(b []byte) error

type Process_Status_State

type Process_Status_State int32
const (
	Process_Status_UNSPECIFIED Process_Status_State = 0
	Process_Status_NEW         Process_Status_State = 1
	Process_Status_ACTIVE      Process_Status_State = 2
	Process_Status_ABORTED     Process_Status_State = 3
	Process_Status_INCOMPLETE  Process_Status_State = 4
	Process_Status_COMPLETED   Process_Status_State = 5
)

func (Process_Status_State) EnumDescriptor

func (Process_Status_State) EnumDescriptor() ([]byte, []int)

func (Process_Status_State) String

func (x Process_Status_State) String() string

type Process_Work

type Process_Work struct {
	// Time when the work item's settings was last modified.
	Modified *timestamp.Timestamp `protobuf:"bytes,1,opt,name=modified,proto3" json:"modified,omitempty"`
	// Input parameters for the work item. These will vary depending on the
	// needs of process workers that may need input parameters to complete their
	// work.
	// Example: if there were a rename process that occationally updates the
	// names of objects in the storage layer, then it may have params of:
	//   {
	//     "stringParams": {
	//       "find": "old_name",
	//       "replace": "new_name"
	//     }
	//     "intParams": {
	//       "maxReplacements": 1
	//     }
	//   }
	// Note: this structure allows input parameters to vary between work items.
	Params *Process_Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"`
	// Work status. Changes here do not cause "modified" settings timestamp
	// to change.
	Status               *Process_Status `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

Processes may act on a set of work items, and may have different input parameters per item. What work items represent may be different between different types of workers. A worker gets called for each item on a work list (stored as maps, but can be iterated over as a list). A named work item can only appear on one of three maps: 1. active_work 2. cleanup_work 3. dropped_work

func (*Process_Work) Descriptor

func (*Process_Work) Descriptor() ([]byte, []int)

func (*Process_Work) GetModified

func (m *Process_Work) GetModified() *timestamp.Timestamp

func (*Process_Work) GetParams

func (m *Process_Work) GetParams() *Process_Params

func (*Process_Work) GetStatus

func (m *Process_Work) GetStatus() *Process_Status

func (*Process_Work) ProtoMessage

func (*Process_Work) ProtoMessage()

func (*Process_Work) Reset

func (m *Process_Work) Reset()

func (*Process_Work) String

func (m *Process_Work) String() string

func (*Process_Work) XXX_DiscardUnknown

func (m *Process_Work) XXX_DiscardUnknown()

func (*Process_Work) XXX_Marshal

func (m *Process_Work) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Process_Work) XXX_Merge

func (m *Process_Work) XXX_Merge(src proto.Message)

func (*Process_Work) XXX_Size

func (m *Process_Work) XXX_Size() int

func (*Process_Work) XXX_Unmarshal

func (m *Process_Work) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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