-
Notifications
You must be signed in to change notification settings - Fork 800
/
visibilityInterfaces.go
120 lines (106 loc) · 5.02 KB
/
visibilityInterfaces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// Copyright (c) 2017 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
package persistence
import s "github.com/uber/cadence/.gen/go/shared"
// Interfaces for the Visibility Store.
// This is a secondary store that is eventually consistent with the main
// executions store, and stores workflow execution records for visibility
// purposes.
type (
// RecordWorkflowExecutionStartedRequest is used to add a record of a newly
// started execution
RecordWorkflowExecutionStartedRequest struct {
DomainUUID string
Execution s.WorkflowExecution
WorkflowTypeName string
StartTimestamp int64
}
// RecordWorkflowExecutionClosedRequest is used to add a record of a newly
// closed execution
RecordWorkflowExecutionClosedRequest struct {
DomainUUID string
Execution s.WorkflowExecution
WorkflowTypeName string
StartTimestamp int64
CloseTimestamp int64
Status s.WorkflowExecutionCloseStatus
HistoryLength int64
RetentionSeconds int64
}
// ListWorkflowExecutionsRequest is used to list executions in a domain
ListWorkflowExecutionsRequest struct {
DomainUUID string
EarliestStartTime int64
LatestStartTime int64
// Maximum number of workflow executions per page
PageSize int
// Token to continue reading next page of workflow executions.
// Pass in empty slice for first page.
NextPageToken []byte
}
// ListWorkflowExecutionsResponse is the response to ListWorkflowExecutionsRequest
ListWorkflowExecutionsResponse struct {
Executions []*s.WorkflowExecutionInfo
// Token to read next page if there are more workflow executions beyond page size.
// Use this to set NextPageToken on ListWorkflowExecutionsRequest to read the next page.
NextPageToken []byte
}
// ListWorkflowExecutionsByTypeRequest is used to list executions of
// a specific type in a domain
ListWorkflowExecutionsByTypeRequest struct {
ListWorkflowExecutionsRequest
WorkflowTypeName string
}
// ListWorkflowExecutionsByWorkflowIDRequest is used to list executions that
// have specific WorkflowID in a domain
ListWorkflowExecutionsByWorkflowIDRequest struct {
ListWorkflowExecutionsRequest
WorkflowID string
}
// ListClosedWorkflowExecutionsByStatusRequest is used to list executions that
// have specific close status
ListClosedWorkflowExecutionsByStatusRequest struct {
ListWorkflowExecutionsRequest
Status s.WorkflowExecutionCloseStatus
}
// GetClosedWorkflowExecutionRequest is used retrieve the record for a specific execution
GetClosedWorkflowExecutionRequest struct {
DomainUUID string
Execution s.WorkflowExecution
}
// GetClosedWorkflowExecutionResponse is the response to GetClosedWorkflowExecutionRequest
GetClosedWorkflowExecutionResponse struct {
Execution *s.WorkflowExecutionInfo
}
// VisibilityManager is used to manage the visibility store
VisibilityManager interface {
Closeable
RecordWorkflowExecutionStarted(request *RecordWorkflowExecutionStartedRequest) error
RecordWorkflowExecutionClosed(request *RecordWorkflowExecutionClosedRequest) error
ListOpenWorkflowExecutions(request *ListWorkflowExecutionsRequest) (*ListWorkflowExecutionsResponse, error)
ListClosedWorkflowExecutions(request *ListWorkflowExecutionsRequest) (*ListWorkflowExecutionsResponse, error)
ListOpenWorkflowExecutionsByType(request *ListWorkflowExecutionsByTypeRequest) (*ListWorkflowExecutionsResponse, error)
ListClosedWorkflowExecutionsByType(request *ListWorkflowExecutionsByTypeRequest) (*ListWorkflowExecutionsResponse, error)
ListOpenWorkflowExecutionsByWorkflowID(request *ListWorkflowExecutionsByWorkflowIDRequest) (*ListWorkflowExecutionsResponse, error)
ListClosedWorkflowExecutionsByWorkflowID(request *ListWorkflowExecutionsByWorkflowIDRequest) (*ListWorkflowExecutionsResponse, error)
ListClosedWorkflowExecutionsByStatus(request *ListClosedWorkflowExecutionsByStatusRequest) (*ListWorkflowExecutionsResponse, error)
GetClosedWorkflowExecution(request *GetClosedWorkflowExecutionRequest) (*GetClosedWorkflowExecutionResponse, error)
}
)