sqlplugin

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityInfoMapsDeleteFilter added in v1.1.0

type ActivityInfoMapsDeleteFilter struct {
	ShardID     int32
	NamespaceID primitives.UUID
	WorkflowID  string
	RunID       primitives.UUID
	ScheduleID  *int64
}

type ActivityInfoMapsRow

type ActivityInfoMapsRow struct {
	ShardID      int32
	NamespaceID  primitives.UUID
	WorkflowID   string
	RunID        primitives.UUID
	ScheduleID   int64
	Data         []byte
	DataEncoding string
}

ActivityInfoMapsRow represents a row in activity_info_maps table

type ActivityInfoMapsSelectFilter added in v1.1.0

type ActivityInfoMapsSelectFilter struct {
	ShardID     int32
	NamespaceID primitives.UUID
	WorkflowID  string
	RunID       primitives.UUID
}

type AdminDB

type AdminDB interface {
	PluginName() string
	Close() error
	// contains filtered or unexported methods
}

AdminDB defines the API for admin SQL operations for CLI and testing suites

type BufferedEventsFilter

type BufferedEventsFilter struct {
	ShardID     int32
	NamespaceID primitives.UUID
	WorkflowID  string
	RunID       primitives.UUID
}

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

type BufferedEventsRow

type BufferedEventsRow struct {
	ShardID      int32
	NamespaceID  primitives.UUID
	WorkflowID   string
	RunID        primitives.UUID
	Data         []byte
	DataEncoding string
}

BufferedEventsRow represents a row in buffered_events table

type ChildExecutionInfoMapsDeleteFilter added in v1.1.0

type ChildExecutionInfoMapsDeleteFilter struct {
	ShardID     int32
	NamespaceID primitives.UUID
	WorkflowID  string
	RunID       primitives.UUID
	InitiatedID *int64
}

type ChildExecutionInfoMapsRow

type ChildExecutionInfoMapsRow struct {
	ShardID      int32
	NamespaceID  primitives.UUID
	WorkflowID   string
	RunID        primitives.UUID
	InitiatedID  int64
	Data         []byte
	DataEncoding string
}

ChildExecutionInfoMapsRow represents a row in child_execution_info_maps table

type ChildExecutionInfoMapsSelectFilter added in v1.1.0

type ChildExecutionInfoMapsSelectFilter struct {
	ShardID     int32
	NamespaceID primitives.UUID
	WorkflowID  string
	RunID       primitives.UUID
}

type ClusterMembershipFilter

type ClusterMembershipFilter struct {
	RPCAddressEquals    string
	HostIDEquals        []byte
	HostIDGreaterThan   []byte
	RoleEquals          persistence.ServiceType
	LastHeartbeatAfter  time.Time
	RecordExpiryAfter   time.Time
	SessionStartedAfter time.Time
	MaxRecordCount      int
}

ClusterMembershipFilter is used for GetClusterMembership queries

type ClusterMembershipRow

type ClusterMembershipRow struct {
	Role           persistence.ServiceType
	HostID         []byte
	RPCAddress     string
	RPCPort        uint16
	SessionStart   time.Time
	LastHeartbeat  time.Time
	RecordExpiry   time.Time
	InsertionOrder uint64
}

ClusterMembershipRow represents a row in the cluster_membership table

type ClusterMetadataRow

type ClusterMetadataRow struct {
	Data         []byte
	DataEncoding string
	Version      int64
	// TODO(vitarb): immutable metadata is needed for backward compatibility only, remove after 1.1 release.
	ImmutableData         []byte
	ImmutableDataEncoding string
}

ClusterMetadataRow represents a row in the cluster_metadata table

type Conn

type Conn interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
	NamedExec(query string, arg interface{}) (sql.Result, error)
	Get(dest interface{}, query string, args ...interface{}) error
	Select(dest interface{}, query string, args ...interface{}) error
}

Conn defines the API for a single database connection

type CurrentExecutionsFilter

type CurrentExecutionsFilter struct {
	ShardID     int32
	NamespaceID primitives.UUID
	WorkflowID  string
	RunID       primitives.UUID
}

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

type CurrentExecutionsRow

type CurrentExecutionsRow struct {
	ShardID          int32
	NamespaceID      primitives.UUID
	WorkflowID       string
	RunID            primitives.UUID
	CreateRequestID  string
	StartVersion     int64
	LastWriteVersion int64
	State            enumsspb.WorkflowExecutionState
	Status           enumspb.WorkflowExecutionStatus
}

CurrentExecutionsRow represents a row in current_executions table

type DB

type DB interface {
	BeginTx() (Tx, error)
	PluginName() string
	IsDupEntryError(err error) bool
	Close() error
	// contains filtered or unexported methods
}

DB defines the API for regular SQL operations of a Temporal server

type EventsFilter

type EventsFilter struct {
	NamespaceID  primitives.UUID
	WorkflowID   string
	RunID        primitives.UUID
	FirstEventID *int64
	NextEventID  *int64
	PageSize     *int
}

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

type EventsRow

type EventsRow struct {
	NamespaceID  primitives.UUID
	WorkflowID   string
	RunID        primitives.UUID
	FirstEventID int64
	BatchVersion int64
	RangeID      int64
	TxID         int64
	Data         []byte
	DataEncoding string
}

EventsRow represents a row in events table

type ExecutionsFilter

type ExecutionsFilter struct {
	ShardID     int32
	NamespaceID primitives.UUID
	WorkflowID  string
	RunID       primitives.UUID
}

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

type ExecutionsRow

type ExecutionsRow struct {
	ShardID          int32
	NamespaceID      primitives.UUID
	WorkflowID       string
	RunID            primitives.UUID
	NextEventID      int64
	LastWriteVersion int64
	Data             []byte
	DataEncoding     string
	State            []byte
	StateEncoding    string
}

ExecutionsRow represents a row in executions table

type HistoryExecution added in v1.1.0

type HistoryExecution interface {
	InsertIntoExecutions(row *ExecutionsRow) (sql.Result, error)
	UpdateExecutions(row *ExecutionsRow) (sql.Result, error)
	SelectFromExecutions(filter ExecutionsFilter) (*ExecutionsRow, error)
	DeleteFromExecutions(filter ExecutionsFilter) (sql.Result, error)
	ReadLockExecutions(filter ExecutionsFilter) (int64, error)
	WriteLockExecutions(filter ExecutionsFilter) (int64, error)

	LockCurrentExecutionsJoinExecutions(filter CurrentExecutionsFilter) ([]CurrentExecutionsRow, error)

	InsertIntoCurrentExecutions(row *CurrentExecutionsRow) (sql.Result, error)
	UpdateCurrentExecutions(row *CurrentExecutionsRow) (sql.Result, error)
	// SelectFromCurrentExecutions returns one or more rows from current_executions table
	// Required params - {shardID, namespaceID, workflowID}
	SelectFromCurrentExecutions(filter CurrentExecutionsFilter) (*CurrentExecutionsRow, error)
	// DeleteFromCurrentExecutions deletes a single row that matches the filter criteria
	// If a row exist, that row will be deleted and this method will return success
	// If there is no row matching the filter criteria, this method will still return success
	// Callers can check the output of Result.RowsAffected() to see if a row was deleted or not
	// Required params - {shardID, namespaceID, workflowID, runID}
	DeleteFromCurrentExecutions(filter CurrentExecutionsFilter) (sql.Result, error)
	LockCurrentExecutions(filter CurrentExecutionsFilter) (*CurrentExecutionsRow, error)
}

HistoryExecution is the SQL persistence interface for history nodes and history executions

type HistoryExecutionActivity added in v1.1.0

type HistoryExecutionActivity interface {
	ReplaceIntoActivityInfoMaps(rows []ActivityInfoMapsRow) (sql.Result, error)
	// SelectFromActivityInfoMaps returns one or more rows from activity_info_maps
	SelectFromActivityInfoMaps(filter ActivityInfoMapsSelectFilter) ([]ActivityInfoMapsRow, error)
	// DeleteFromActivityInfoMaps deletes a row from activity_info_maps table
	// Required filter params
	// - single row delete - {shardID, namespaceID, workflowID, runID, scheduleID}
	// - range delete - {shardID, namespaceID, workflowID, runID}
	DeleteFromActivityInfoMaps(filter ActivityInfoMapsDeleteFilter) (sql.Result, error)
}

HistoryExecutionActivity is the SQL persistence interface for history nodes and history execution activities

type HistoryExecutionBuffer added in v1.1.0

type HistoryExecutionBuffer interface {
	InsertIntoBufferedEvents(rows []BufferedEventsRow) (sql.Result, error)
	SelectFromBufferedEvents(filter *BufferedEventsFilter) ([]BufferedEventsRow, error)
	DeleteFromBufferedEvents(filter *BufferedEventsFilter) (sql.Result, error)
}

HistoryExecutionBuffer is the SQL persistence interface for history nodes and history execution buffer events

type HistoryExecutionChildWorkflow added in v1.1.0

type HistoryExecutionChildWorkflow interface {
	ReplaceIntoChildExecutionInfoMaps(rows []ChildExecutionInfoMapsRow) (sql.Result, error)
	// SelectFromChildExecutionInfoMaps returns one or more rows form child_execution_info_maps table
	SelectFromChildExecutionInfoMaps(filter ChildExecutionInfoMapsSelectFilter) ([]ChildExecutionInfoMapsRow, error)
	// DeleteFromChildExecutionInfoMaps deletes one or more rows from child_execution_info_maps
	// Required filter params
	// - single row - {shardID, namespaceID, workflowID, runID, initiatedID}
	// - multiple rows - {shardID, namespaceID, workflowID, runID}
	DeleteFromChildExecutionInfoMaps(filter ChildExecutionInfoMapsDeleteFilter) (sql.Result, error)
}

HistoryExecutionChildWorkflow is the SQL persistence interface for history nodes and history execution child workflows

type HistoryExecutionRequestCancel added in v1.1.0

type HistoryExecutionRequestCancel interface {
	ReplaceIntoRequestCancelInfoMaps(rows []RequestCancelInfoMapsRow) (sql.Result, error)
	// SelectFromRequestCancelInfoMaps returns one or more rows form request_cancel_info_maps table
	SelectFromRequestCancelInfoMaps(filter RequestCancelInfoMapsSelectFilter) ([]RequestCancelInfoMapsRow, error)
	// DeleteFromRequestCancelInfoMaps deletes one or more rows from request_cancel_info_maps
	// Required filter params
	// - single row - {shardID, namespaceID, workflowID, runID, initiatedID}
	// - multiple rows - {shardID, namespaceID, workflowID, runID}
	DeleteFromRequestCancelInfoMaps(filter RequestCancelInfoMapsDeleteFilter) (sql.Result, error)
}

HistoryExecutionRequestCancel is the SQL persistence interface for history nodes and history execution request cancels

type HistoryExecutionSignal added in v1.1.0

type HistoryExecutionSignal interface {
	ReplaceIntoSignalInfoMaps(rows []SignalInfoMapsRow) (sql.Result, error)
	// SelectFromSignalInfoMaps returns one or more rows form signal_info_maps table
	SelectFromSignalInfoMaps(filter SignalInfoMapsSelectFilter) ([]SignalInfoMapsRow, error)
	// DeleteFromSignalInfoMaps deletes one or more rows from signal_info_maps table
	// Required filter params
	// - single row - {shardID, namespaceID, workflowID, runID, initiatedID}
	// - multiple rows - {shardID, namespaceID, workflowID, runID}
	DeleteFromSignalInfoMaps(filter SignalInfoMapsDeleteFilter) (sql.Result, error)
}

HistoryExecutionSignal is the SQL persistence interface for history nodes and history execution signals

type HistoryExecutionSignalRequest added in v1.1.0

type HistoryExecutionSignalRequest interface {
	ReplaceIntoSignalsRequestedSets(rows []SignalsRequestedSetsRow) (sql.Result, error)
	// SelectFromSignalInfoMaps returns one or more rows form signals_requested_sets table
	SelectFromSignalsRequestedSets(filter SignalsRequestedSetsSelectFilter) ([]SignalsRequestedSetsRow, error)
	// DeleteFromSignalsRequestedSets deletes one or more rows from signals_requested_sets
	// Required filter params
	// - single row - {shardID, namespaceID, workflowID, runID, signalID}
	// - multiple rows - {shardID, namespaceID, workflowID, runID}
	DeleteFromSignalsRequestedSets(filter SignalsRequestedSetsDeleteFilter) (sql.Result, error)
}

HistoryExecutionSignalRequest is the SQL persistence interface for history nodes and history execution signal request

type HistoryExecutionTimer added in v1.1.0

type HistoryExecutionTimer interface {
	ReplaceIntoTimerInfoMaps(rows []TimerInfoMapsRow) (sql.Result, error)
	// SelectFromTimerInfoMaps returns one or more rows form timer_info_maps table
	SelectFromTimerInfoMaps(filter TimerInfoMapsSelectFilter) ([]TimerInfoMapsRow, error)
	// DeleteFromTimerInfoMaps deletes one or more rows from timer_info_maps
	// Required filter params
	// - single row - {shardID, namespaceID, workflowID, runID, timerID}
	// - multiple rows - {shardID, namespaceID, workflowID, runID}
	DeleteFromTimerInfoMaps(filter TimerInfoMapsDeleteFilter) (sql.Result, error)
}

HistoryExecutionTimer is the SQL persistence interface for history nodes and history execution timers

type HistoryNode added in v1.1.0

type HistoryNode interface {
	InsertIntoHistoryNode(row *HistoryNodeRow) (sql.Result, error)
	SelectFromHistoryNode(filter HistoryNodeSelectFilter) ([]HistoryNodeRow, error)
	DeleteFromHistoryNode(filter HistoryNodeDeleteFilter) (sql.Result, error)
}

HistoryNode is the SQL persistence interface for history nodes

type HistoryNodeDeleteFilter added in v1.1.0

type HistoryNodeDeleteFilter struct {
	ShardID   int32
	TreeID    primitives.UUID
	BranchID  primitives.UUID
	MinNodeID int64
}

HistoryNodeDeleteFilter 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      int32
	TreeID       primitives.UUID
	BranchID     primitives.UUID
	NodeID       int64
	TxnID        int64
	Data         []byte
	DataEncoding string
}

HistoryNodeRow represents a row in history_node table

type HistoryNodeSelectFilter added in v1.1.0

type HistoryNodeSelectFilter struct {
	ShardID   int32
	TreeID    primitives.UUID
	BranchID  primitives.UUID
	MinNodeID int64
	MaxNodeID int64
	PageSize  int
}

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

type HistoryReplicationTask added in v1.1.0

type HistoryReplicationTask interface {
	InsertIntoReplicationTasks(rows []ReplicationTasksRow) (sql.Result, error)
	// SelectFromReplicationTasks returns one or more rows from replication_tasks table
	// Required filter params - {shardID, minTaskID, maxTaskID, pageSize}
	SelectFromReplicationTasks(filter *ReplicationTasksFilter) ([]ReplicationTasksRow, error)
	// DeleteFromReplicationTasks deletes a row from replication_tasks table
	// Required filter params - {shardID, inclusiveEndTaskID}
	DeleteFromReplicationTasks(filter *ReplicationTasksFilter) (sql.Result, error)
	// DeleteFromReplicationTasks deletes multi rows from replication_tasks table
	// Required filter params - {shardID, inclusiveEndTaskID}
	RangeDeleteFromReplicationTasks(filter *ReplicationTasksFilter) (sql.Result, error)

	// InsertIntoReplicationTasksDLQ puts the replication task into DLQ
	InsertIntoReplicationTasksDLQ(row *ReplicationTaskDLQRow) (sql.Result, error)
	// SelectFromReplicationTasksDLQ returns one or more rows from replication_tasks_dlq table
	// Required filter params - {sourceClusterName, shardID, minTaskID, pageSize}
	SelectFromReplicationTasksDLQ(filter *ReplicationTasksDLQFilter) ([]ReplicationTasksRow, error)
	// DeleteMessageFromReplicationTasksDLQ deletes one row from replication_tasks_dlq table
	// Required filter params - {sourceClusterName, shardID, taskID}
	DeleteMessageFromReplicationTasksDLQ(filter *ReplicationTasksDLQFilter) (sql.Result, error)
	// RangeDeleteMessageFromReplicationTasksDLQ deletes one or more rows from replication_tasks_dlq table
	// Required filter params - {sourceClusterName, shardID, taskID, inclusiveTaskID}
	RangeDeleteMessageFromReplicationTasksDLQ(filter *ReplicationTasksDLQFilter) (sql.Result, error)
}

HistoryReplicationTask is the SQL persistence interface for history nodes and history replication tasks

type HistoryShard added in v1.1.0

type HistoryShard interface {
	InsertIntoShards(rows *ShardsRow) (sql.Result, error)
	UpdateShards(row *ShardsRow) (sql.Result, error)
	SelectFromShards(filter *ShardsFilter) (*ShardsRow, error)
	ReadLockShards(filter *ShardsFilter) (int64, error)
	WriteLockShards(filter *ShardsFilter) (int64, error)
}

HistoryShard is the SQL persistence interface for history shards

type HistoryTimerTask added in v1.1.0

type HistoryTimerTask interface {
	InsertIntoTimerTasks(rows []TimerTasksRow) (sql.Result, error)
	// SelectFromTimerTasks returns one or more rows from timer_tasks table
	SelectFromTimerTasks(filter TimerTasksFilter) ([]TimerTasksRow, error)
	// RangeSelectFromTimerTasks returns one or more rows from timer_tasks table
	RangeSelectFromTimerTasks(filter TimerTasksRangeFilter) ([]TimerTasksRow, error)
	// DeleteFromTimerTasks deletes one or more rows from timer_tasks table
	DeleteFromTimerTasks(filter TimerTasksFilter) (sql.Result, error)
	// RangeDeleteFromTimerTasks deletes one or more rows from timer_tasks table
	//  TimerTasksRangeFilter {TaskID, PageSize} will be ignored
	RangeDeleteFromTimerTasks(filter TimerTasksRangeFilter) (sql.Result, error)
}

HistoryTimerTask is the SQL persistence interface for history nodes and history timer tasks

type HistoryTransferTask added in v1.1.0

type HistoryTransferTask interface {
	InsertIntoTransferTasks(rows []TransferTasksRow) (sql.Result, error)
	// SelectFromTransferTasks returns rows that match filter criteria from transfer_tasks table.
	SelectFromTransferTasks(filter TransferTasksFilter) ([]TransferTasksRow, error)
	// RangeSelectFromTransferTasks returns rows that match filter criteria from transfer_tasks table.
	RangeSelectFromTransferTasks(filter TransferTasksRangeFilter) ([]TransferTasksRow, error)
	// DeleteFromTransferTasks deletes one rows from transfer_tasks table.
	DeleteFromTransferTasks(filter TransferTasksFilter) (sql.Result, error)
	// RangeDeleteFromTransferTasks deletes one or more rows from transfer_tasks table.
	RangeDeleteFromTransferTasks(filter TransferTasksRangeFilter) (sql.Result, error)
}

HistoryTransferTask is the SQL persistence interface for history nodes and history transfer tasks

type HistoryTree added in v1.1.0

type HistoryTree interface {
	InsertIntoHistoryTree(row *HistoryTreeRow) (sql.Result, error)
	SelectFromHistoryTree(filter HistoryTreeSelectFilter) ([]HistoryTreeRow, error)
	DeleteFromHistoryTree(filter HistoryTreeDeleteFilter) (sql.Result, error)
}

HistoryNode is the SQL persistence interface for history trees

type HistoryTreeDeleteFilter added in v1.1.0

type HistoryTreeDeleteFilter struct {
	ShardID  int32
	TreeID   primitives.UUID
	BranchID primitives.UUID
}

HistoryTreeDeleteFilter 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      int32
	TreeID       primitives.UUID
	BranchID     primitives.UUID
	Data         []byte
	DataEncoding string
}

HistoryTreeRow represents a row in history_tree table

type HistoryTreeSelectFilter added in v1.1.0

type HistoryTreeSelectFilter struct {
	ShardID int32
	TreeID  primitives.UUID
}

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

type MatchingTask added in v1.1.0

type MatchingTask interface {
	InsertIntoTasks(rows []TasksRow) (sql.Result, error)
	// SelectFromTasks retrieves one or more rows from the tasks table
	// Required filter params - {namespaceID, taskqueueName, taskType, minTaskID, maxTaskID, pageSize}
	SelectFromTasks(filter *TasksFilter) ([]TasksRow, error)
	// DeleteFromTasks deletes a row from tasks table
	// Required filter params:
	//  to delete single row
	//     - {namespaceID, taskqueueName, taskType, taskID}
	//  to delete multiple rows
	//    - {namespaceID, taskqueueName, taskType, taskIDLessThanEquals, limit }
	//    - this will delete upto limit number of tasks less than or equal to the given task id
	DeleteFromTasks(filter *TasksFilter) (sql.Result, error)
}

MatchingTask is the SQL persistence interface for matching tasks

type MatchingTaskQueue added in v1.1.0

type MatchingTaskQueue interface {
	InsertIntoTaskQueues(row *TaskQueuesRow) (sql.Result, error)
	ReplaceIntoTaskQueues(row *TaskQueuesRow) (sql.Result, error)
	UpdateTaskQueues(row *TaskQueuesRow) (sql.Result, error)
	// SelectFromTaskQueues returns one or more rows from task_queues table
	// Required Filter params:
	//  to read a single row: {shardID, namespaceID, name, taskType}
	//  to range read multiple rows: {shardID, namespaceIDGreaterThan, nameGreaterThan, taskTypeGreaterThan, pageSize}
	SelectFromTaskQueues(filter *TaskQueuesFilter) ([]TaskQueuesRow, error)
	DeleteFromTaskQueues(filter *TaskQueuesFilter) (sql.Result, error)
	LockTaskQueues(filter *TaskQueuesFilter) (int64, error)
}

MatchingTaskQueue is the SQL persistence interface for matching task queues

type Namespace added in v1.1.0

type Namespace interface {
	InsertIntoNamespace(rows *NamespaceRow) (sql.Result, error)
	UpdateNamespace(row *NamespaceRow) (sql.Result, error)
	// SelectFromNamespace returns namespaces that match filter criteria. Either ID or
	// Name can be specified to filter results. If both are not specified, all rows
	// will be returned
	SelectFromNamespace(filter *NamespaceFilter) ([]NamespaceRow, error)
	// DeleteNamespace deletes a single row. One of ID or Name MUST be specified
	DeleteFromNamespace(filter *NamespaceFilter) (sql.Result, error)

	LockNamespaceMetadata() (*NamespaceMetadataRow, error)
	UpdateNamespaceMetadata(row *NamespaceMetadataRow) (sql.Result, error)
	SelectFromNamespaceMetadata() (*NamespaceMetadataRow, error)
}

Namespace is the SQL persistence interface for namespaces

type NamespaceFilter

type NamespaceFilter struct {
	ID            *primitives.UUID
	Name          *string
	GreaterThanID *primitives.UUID
	PageSize      *int
}

NamespaceFilter contains the column names within namespace table that can be used to filter results through a WHERE clause. When ID is not nil, it will be used for WHERE condition. If ID is nil and Name is non-nil, Name will be used for WHERE condition. When both ID and Name are nil, no WHERE clause will be used

type NamespaceMetadataRow

type NamespaceMetadataRow struct {
	NotificationVersion int64
}

NamespaceMetadataRow represents a row in namespace_metadata table

type NamespaceRow

type NamespaceRow struct {
	ID                  primitives.UUID
	Name                string
	Data                []byte
	DataEncoding        string
	IsGlobal            bool
	NotificationVersion int64
}

NamespaceRow represents a row in namespace table

type Plugin

type Plugin interface {
	CreateDB(cfg *config.SQL) (DB, error)
	CreateAdminDB(cfg *config.SQL) (AdminDB, error)
}

Plugin defines the interface for any SQL database that needs to implement

type PruneClusterMembershipFilter

type PruneClusterMembershipFilter struct {
	PruneRecordsBefore time.Time
	MaxRecordsAffected int
}

PruneClusterMembershipFilter is used for PruneClusterMembership queries

type QueueMetadataRow

type QueueMetadataRow struct {
	QueueType persistence.QueueType
	Data      []byte
}

QueueMetadataRow represents a row in queue_metadata table

type QueueRow

type QueueRow struct {
	QueueType      persistence.QueueType
	MessageID      int64
	MessagePayload []byte
}

QueueRow represents a row in queue table

type ReplicationTaskDLQRow

type ReplicationTaskDLQRow struct {
	SourceClusterName string
	ShardID           int32
	TaskID            int64
	Data              []byte
	DataEncoding      string
}

ReplicationTaskDLQRow represents a row in replication_tasks_dlq table

type ReplicationTasksDLQFilter

type ReplicationTasksDLQFilter struct {
	ReplicationTasksFilter
	SourceClusterName string
}

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

type ReplicationTasksFilter

type ReplicationTasksFilter struct {
	ShardID            int32
	TaskID             int64
	InclusiveEndTaskID int64
	MinTaskID          int64
	MaxTaskID          int64
	PageSize           int
}

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

type ReplicationTasksRow

type ReplicationTasksRow struct {
	ShardID      int32
	TaskID       int64
	Data         []byte
	DataEncoding string
}

ReplicationTasksRow represents a row in replication_tasks table

type RequestCancelInfoMapsDeleteFilter added in v1.1.0

type RequestCancelInfoMapsDeleteFilter struct {
	ShardID     int32
	NamespaceID primitives.UUID
	WorkflowID  string
	RunID       primitives.UUID
	InitiatedID *int64
}

type RequestCancelInfoMapsRow

type RequestCancelInfoMapsRow struct {
	ShardID      int32
	NamespaceID  primitives.UUID
	WorkflowID   string
	RunID        primitives.UUID
	InitiatedID  int64
	Data         []byte
	DataEncoding string
}

RequestCancelInfoMapsRow represents a row in request_cancel_info_maps table

type RequestCancelInfoMapsSelectFilter added in v1.1.0

type RequestCancelInfoMapsSelectFilter struct {
	ShardID     int32
	NamespaceID primitives.UUID
	WorkflowID  string
	RunID       primitives.UUID
}

type ShardsFilter

type ShardsFilter struct {
	ShardID int32
}

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

type ShardsRow

type ShardsRow struct {
	ShardID      int32
	RangeID      int64
	Data         []byte
	DataEncoding string
}

ShardsRow represents a row in shards table

type SignalInfoMapsDeleteFilter added in v1.1.0

type SignalInfoMapsDeleteFilter struct {
	ShardID     int32
	NamespaceID primitives.UUID
	WorkflowID  string
	RunID       primitives.UUID
	InitiatedID *int64
}

type SignalInfoMapsRow

type SignalInfoMapsRow struct {
	ShardID      int32
	NamespaceID  primitives.UUID
	WorkflowID   string
	RunID        primitives.UUID
	InitiatedID  int64
	Data         []byte
	DataEncoding string
}

SignalInfoMapsRow represents a row in signal_info_maps table

type SignalInfoMapsSelectFilter added in v1.1.0

type SignalInfoMapsSelectFilter struct {
	ShardID     int32
	NamespaceID primitives.UUID
	WorkflowID  string
	RunID       primitives.UUID
}

type SignalsRequestedSetsDeleteFilter added in v1.1.0

type SignalsRequestedSetsDeleteFilter struct {
	ShardID     int32
	NamespaceID primitives.UUID
	WorkflowID  string
	RunID       primitives.UUID
	SignalID    *string
}

type SignalsRequestedSetsRow

type SignalsRequestedSetsRow struct {
	ShardID     int32
	NamespaceID primitives.UUID
	WorkflowID  string
	RunID       primitives.UUID
	SignalID    string
}

SignalsRequestedSetsRow represents a row in signals_requested_sets table

type SignalsRequestedSetsSelectFilter added in v1.1.0

type SignalsRequestedSetsSelectFilter struct {
	ShardID     int32
	NamespaceID primitives.UUID
	WorkflowID  string
	RunID       primitives.UUID
}

type TaskQueuesFilter

type TaskQueuesFilter struct {
	RangeHash                   uint32
	RangeHashGreaterThanEqualTo uint32
	RangeHashLessThanEqualTo    uint32
	TaskQueueID                 []byte
	TaskQueueIDGreaterThan      []byte
	RangeID                     *int64
	PageSize                    *int
}

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

type TaskQueuesRow

type TaskQueuesRow struct {
	RangeHash    uint32
	TaskQueueID  []byte
	RangeID      int64
	Data         []byte
	DataEncoding string
}

TaskQueuesRow represents a row in task_queues table

type TasksFilter

type TasksFilter struct {
	RangeHash            uint32
	TaskQueueID          []byte
	TaskID               *int64
	MinTaskID            *int64
	MaxTaskID            *int64
	TaskIDLessThanEquals *int64
	Limit                *int
	PageSize             *int
}

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

type TasksRow

type TasksRow struct {
	RangeHash    uint32
	TaskQueueID  []byte
	TaskID       int64
	Data         []byte
	DataEncoding string
}

TasksRow represents a row in tasks table

type TimerInfoMapsDeleteFilter added in v1.1.0

type TimerInfoMapsDeleteFilter struct {
	ShardID     int32
	NamespaceID primitives.UUID
	WorkflowID  string
	RunID       primitives.UUID
	TimerID     *string
}

type TimerInfoMapsRow

type TimerInfoMapsRow struct {
	ShardID      int32
	NamespaceID  primitives.UUID
	WorkflowID   string
	RunID        primitives.UUID
	TimerID      string
	Data         []byte
	DataEncoding string
}

TimerInfoMapsRow represents a row in timer_info_maps table

type TimerInfoMapsSelectFilter added in v1.1.0

type TimerInfoMapsSelectFilter struct {
	ShardID     int32
	NamespaceID primitives.UUID
	WorkflowID  string
	RunID       primitives.UUID
}

type TimerTasksFilter

type TimerTasksFilter struct {
	ShardID             int32
	TaskID              int64
	VisibilityTimestamp time.Time
}

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

type TimerTasksRangeFilter added in v1.1.0

type TimerTasksRangeFilter struct {
	ShardID                int32
	TaskID                 int64
	MinVisibilityTimestamp time.Time
	MaxVisibilityTimestamp time.Time
	PageSize               int
}

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

type TimerTasksRow

type TimerTasksRow struct {
	ShardID             int32
	VisibilityTimestamp time.Time
	TaskID              int64
	Data                []byte
	DataEncoding        string
}

TimerTasksRow represents a row in timer_tasks table

type TransferTasksFilter

type TransferTasksFilter struct {
	ShardID int32
	TaskID  int64
}

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

type TransferTasksRangeFilter added in v1.1.0

type TransferTasksRangeFilter struct {
	ShardID   int32
	MinTaskID int64
	MaxTaskID int64
}

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

type TransferTasksRow

type TransferTasksRow struct {
	ShardID      int32
	TaskID       int64
	Data         []byte
	DataEncoding string
}

TransferTasksRow represents a row in transfer_tasks table

type Tx

type Tx interface {
	Commit() error
	Rollback() error
	// contains filtered or unexported methods
}

Tx defines the API for a SQL transaction

type Visibility added in v1.1.0

type Visibility interface {
	// InsertIntoVisibility inserts a row into visibility table. If a row already exist,
	// no changes will be made by this API
	InsertIntoVisibility(row *VisibilityRow) (sql.Result, error)
	// ReplaceIntoVisibility deletes old row (if it exist) and inserts new row into visibility table
	ReplaceIntoVisibility(row *VisibilityRow) (sql.Result, error)
	// SelectFromVisibility returns one or more rows from visibility table
	// Required filter params:
	// - getClosedWorkflowExecution - retrieves single row - {namespaceID, runID, closed=true}
	// - All other queries retrieve multiple rows (range):
	//   - MUST specify following required params:
	//     - namespaceID, minStartTime, maxStartTime, runID and pageSize where some or all of these may come from previous page token
	//   - OPTIONALLY specify one of following params
	//     - workflowID, workflowTypeName, status (along with closed=true)
	SelectFromVisibility(filter VisibilitySelectFilter) ([]VisibilityRow, error)
	DeleteFromVisibility(filter VisibilityDeleteFilter) (sql.Result, error)
}

type VisibilityDeleteFilter added in v1.1.0

type VisibilityDeleteFilter struct {
	NamespaceID string
	RunID       string
}

type VisibilityRow

type VisibilityRow struct {
	NamespaceID      string
	RunID            string
	WorkflowTypeName string
	WorkflowID       string
	StartTime        time.Time
	ExecutionTime    time.Time
	Status           int32
	CloseTime        *time.Time
	HistoryLength    *int64
	Memo             []byte
	Encoding         string
}

VisibilityRow represents a row in executions_visibility table

type VisibilitySelectFilter added in v1.1.0

type VisibilitySelectFilter struct {
	NamespaceID      string
	RunID            *string
	WorkflowID       *string
	WorkflowTypeName *string
	Status           int32
	MinTime          *time.Time
	MaxTime          *time.Time
	PageSize         *int
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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