nosqlplugin

package
v0.22.4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConditionFailure added in v0.22.0

func NewConditionFailure(name string) error

Types

type ClientErrorChecker added in v0.22.0

type ClientErrorChecker interface {
	IsTimeoutError(error) bool
	IsNotFoundError(error) bool
	IsThrottlingError(error) bool
}

ClientErrorChecker checks for common nosql errors on client

type ConditionFailure added in v0.22.0

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

Condition Errors for NoSQL interfaces

func (*ConditionFailure) Error added in v0.22.0

func (e *ConditionFailure) Error() string

type ConflictedShardRow added in v0.22.0

type ConflictedShardRow struct {
	ShardID int
	// PreviousRangeID is the condition of previous change that used for conditional update
	PreviousRangeID int64
	// optional detailed information for logging purpose
	Details string
}

ConflictedShardRow contains the partial information about a shard returned when a conditional write fails

type CrossClusterTask added in v0.22.0

type CrossClusterTask struct {
	TransferTask
	TargetCluster string
}

type CurrentWorkflowRow added in v0.22.0

type CurrentWorkflowRow struct {
	ShardID          int
	DomainID         string
	WorkflowID       string
	RunID            string
	State            int
	CloseStatus      int
	CreateRequestID  string
	LastWriteVersion int64
}

type CurrentWorkflowWriteCondition added in v0.22.0

type CurrentWorkflowWriteCondition struct {
	CurrentRunID     *string
	LastWriteVersion *int64
	State            *int
}

func (*CurrentWorkflowWriteCondition) GetCurrentRunID added in v0.22.0

func (w *CurrentWorkflowWriteCondition) GetCurrentRunID() string

type CurrentWorkflowWriteMode added in v0.22.0

type CurrentWorkflowWriteMode int
const (
	CurrentWorkflowWriteModeNoop CurrentWorkflowWriteMode = iota
	CurrentWorkflowWriteModeUpdate
	CurrentWorkflowWriteModeInsert
)

type CurrentWorkflowWriteRequest added in v0.22.0

type CurrentWorkflowWriteRequest struct {
	WriteMode CurrentWorkflowWriteMode
	Row       CurrentWorkflowRow
	Condition *CurrentWorkflowWriteCondition
}

type DB

type DB interface {
	PluginName() string
	Close()

	ClientErrorChecker
	// contains filtered or unexported methods
}

DB defines the API for regular NoSQL operations of a Cadence server

type DomainRow added in v0.17.0

type DomainRow struct {
	Info                        *persistence.DomainInfo
	Config                      *NoSQLInternalDomainConfig
	ReplicationConfig           *persistence.DomainReplicationConfig
	ConfigVersion               int64
	FailoverVersion             int64
	FailoverNotificationVersion int64
	PreviousFailoverVersion     int64
	FailoverEndTime             *time.Time
	NotificationVersion         int64
	LastUpdatedTime             time.Time
	IsGlobalDomain              bool
}

DomainRow defines the row struct for queue message

type HistoryNodeFilter

type HistoryNodeFilter struct {
	ShardID  int
	TreeID   string
	BranchID string
	// Inclusive
	MinNodeID int64
	// Exclusive
	MaxNodeID     int64
	NextPageToken []byte
	PageSize      int
}

HistoryNodeFilter contains the column names within history_node table that can be used to filter results through a WHERE clause

type HistoryNodeRow

type HistoryNodeRow struct {
	ShardID  int
	TreeID   string
	BranchID string
	NodeID   int64
	// Note: use pointer so that it's easier to multiple by -1 if needed
	TxnID        *int64
	Data         []byte
	DataEncoding string
}

HistoryNodeRow represents a row in history_node table

type HistoryTreeFilter

type HistoryTreeFilter struct {
	ShardID  int
	TreeID   string
	BranchID *string
}

HistoryTreeFilter contains the column names within history_tree table that can be used to filter results through a WHERE clause

type HistoryTreeRow

type HistoryTreeRow struct {
	ShardID         int
	TreeID          string
	BranchID        string
	Ancestors       []*types.HistoryBranchRange
	CreateTimestamp time.Time
	Info            string
}

HistoryTreeRow represents a row in history_tree table

type ListTaskListResult added in v0.22.0

type ListTaskListResult struct {
	TaskLists     []*TaskListRow
	NextPageToken []byte
}

type NoSQLInternalDomainConfig added in v0.17.0

type NoSQLInternalDomainConfig struct {
	Retention                time.Duration
	EmitMetric               bool                 // deprecated
	ArchivalBucket           string               // deprecated
	ArchivalStatus           types.ArchivalStatus // deprecated
	HistoryArchivalStatus    types.ArchivalStatus
	HistoryArchivalURI       string
	VisibilityArchivalStatus types.ArchivalStatus
	VisibilityArchivalURI    string
	BadBinaries              *persistence.DataBlob
}

NoSQLInternalDomainConfig defines the struct for the domainConfig

type QueueMessageRow

type QueueMessageRow struct {
	QueueType persistence.QueueType
	ID        int64
	Payload   []byte
}

QueueMessageRow defines the row struct for queue message

type QueueMetadataRow

type QueueMetadataRow struct {
	QueueType        persistence.QueueType
	ClusterAckLevels map[string]int64
	Version          int64
}

QueueMetadataRow defines the row struct for metadata

type ReplicationTask added in v0.22.0

type ReplicationTask struct {
	Type int

	DomainID            string
	WorkflowID          string
	RunID               string
	VisibilityTimestamp time.Time
	TaskID              int64
	FirstEventID        int64
	NextEventID         int64
	Version             int64
	ActivityScheduleID  int64
	EventStoreVersion   int
	BranchToken         []byte
	NewRunBranchToken   []byte
}

type SelectMessagesBetweenRequest

type SelectMessagesBetweenRequest struct {
	QueueType               persistence.QueueType
	ExclusiveBeginMessageID int64
	InclusiveEndMessageID   int64
	PageSize                int
	NextPageToken           []byte
}

SelectMessagesBetweenRequest is a request struct for SelectMessagesBetween

type SelectMessagesBetweenResponse

type SelectMessagesBetweenResponse struct {
	Rows          []QueueMessageRow
	NextPageToken []byte
}

SelectMessagesBetweenResponse is a response struct for SelectMessagesBetween

type SelectVisibilityResponse added in v0.22.0

type SelectVisibilityResponse struct {
	Executions    []*VisibilityRow
	NextPageToken []byte
}

type ShardCondition added in v0.22.0

type ShardCondition struct {
	ShardID int
	RangeID int64
}

type ShardOperationConditionFailure added in v0.22.0

type ShardOperationConditionFailure struct {
	RangeID int64
	Details string // detail info for logging
}

Condition Errors for NoSQL interfaces

func (*ShardOperationConditionFailure) Error added in v0.22.0

type ShardRow added in v0.22.0

type ShardRow = persistence.InternalShardInfo

For now ShardRow is the same as persistence.InternalShardInfo Separate them later when there is a need.

type TaskListFilter added in v0.22.0

type TaskListFilter struct {
	DomainID     string
	TaskListName string
	TaskListType int
}

type TaskListRow added in v0.22.0

type TaskListRow struct {
	DomainID     string
	TaskListName string
	TaskListType int

	RangeID         int64
	TaskListKind    int
	AckLevel        int64
	LastUpdatedTime time.Time
}

type TaskOperationConditionFailure added in v0.22.0

type TaskOperationConditionFailure struct {
	RangeID int64
	Details string // detail info for logging
}

Condition Errors for NoSQL interfaces

func (*TaskOperationConditionFailure) Error added in v0.22.0

type TaskRow added in v0.22.0

type TaskRow struct {
	DomainID     string
	TaskListName string
	TaskListType int
	TaskID       int64

	WorkflowID  string
	RunID       string
	ScheduledID int64
	CreatedTime time.Time
}

type TaskRowForInsert added in v0.22.0

type TaskRowForInsert struct {
	TaskRow
	// <= 0 means no TTL
	TTLSeconds int
}

type TasksFilter added in v0.22.0

type TasksFilter struct {
	TaskListFilter
	// Exclusive
	MinTaskID int64
	// Inclusive
	MaxTaskID int64
	BatchSize int
}

type TimerTask added in v0.22.0

type TimerTask struct {
	Type int

	DomainID            string
	WorkflowID          string
	RunID               string
	VisibilityTimestamp time.Time
	TaskID              int64

	TimeoutType int
	EventID     int64
	Attempt     int64
	Version     int64
}

type TransferTask added in v0.22.0

type TransferTask struct {
	Type                    int
	DomainID                string
	WorkflowID              string
	RunID                   string
	VisibilityTimestamp     time.Time
	TaskID                  int64
	TargetDomainID          string
	TargetWorkflowID        string
	TargetRunID             string
	TargetChildWorkflowOnly bool
	TaskList                string
	ScheduleID              int64
	RecordVisibility        bool
	Version                 int64
}

type VisibilityFilter added in v0.22.0

type VisibilityFilter struct {
	ListRequest  persistence.InternalListWorkflowExecutionsRequest
	FilterType   VisibilityFilterType
	SortType     VisibilitySortType
	WorkflowType string
	WorkflowID   string
	CloseStatus  int32
}

VisibilityFilter contains the column names within executions_visibility table that can be used to filter results through a WHERE clause

type VisibilityFilterType added in v0.22.0

type VisibilityFilterType int
const (
	AllOpen VisibilityFilterType = iota
	AllClosed
	OpenByWorkflowType
	ClosedByWorkflowType
	OpenByWorkflowID
	ClosedByWorkflowID
	ClosedByClosedStatus
)

type VisibilityRow added in v0.22.0

TODO separate in the future when need it

type VisibilityRowForInsert added in v0.22.0

type VisibilityRowForInsert struct {
	VisibilityRow
	DomainID string
}

type VisibilityRowForUpdate added in v0.22.0

type VisibilityRowForUpdate struct {
	VisibilityRow
	DomainID string
	// NOTE: this is only for some implementation (e.g. Cassandra) that uses multiple tables,
	// they needs to delete record from the open execution table. Ignore this field if not need it
	UpdateOpenToClose bool
	//  Similar as UpdateOpenToClose
	UpdateCloseToOpen bool
}

type VisibilitySortType added in v0.22.0

type VisibilitySortType int
const (
	SortByStartTime VisibilitySortType = iota
	SortByClosedTime
)

type WorkflowExecutionAlreadyExists added in v0.22.0

type WorkflowExecutionAlreadyExists struct {
	RunID            string
	CreateRequestID  string
	State            int
	CloseStatus      int
	LastWriteVersion int64
	OtherInfo        string
}

Condition Errors for NoSQL interfaces

type WorkflowExecutionRow added in v0.22.0

type WorkflowExecutionRow struct {
	persistence.InternalWorkflowExecutionInfo
	VersionHistories *persistence.DataBlob
	Checksums        *checksum.Checksum
	LastWriteVersion int64
}

type WorkflowOperationConditionFailure added in v0.22.0

type WorkflowOperationConditionFailure struct {
	UnknownConditionFailureDetails   *string // return some info for logging
	ShardRangeIDNotMatch             *int64  // return the previous shardRangeID
	WorkflowExecutionAlreadyExists   *WorkflowExecutionAlreadyExists
	CurrentWorkflowConditionFailInfo *string // return the logging info if fail on condition of CurrentWorkflow
}

Only one of the fields must be non-nil

func (*WorkflowOperationConditionFailure) Error added in v0.22.0

Directories

Path Synopsis
gocql
Package gocql is a generated GoMock package.
Package gocql is a generated GoMock package.

Jump to

Keyboard shortcuts

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