Skip to content

Commit

Permalink
Remove mentions of elasticsearch (#1186)
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinn-With-Two-Ns authored Aug 4, 2023
1 parent 1ec43ad commit 3aba985
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 28 deletions.
18 changes: 12 additions & 6 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,15 @@ type (
// - "(WorkflowID = 'wid1' or (WorkflowType = 'type2' and WorkflowID = 'wid2'))".
// - "CloseTime between '2019-08-27T15:04:05+00:00' and '2019-08-28T15:04:05+00:00'".
// - to list only open workflow use "CloseTime = missing"
// Advanced queries require ElasticSearch, but simple queries do not.
// For supported operations on different server versions see [Visibility].
// Retrieved workflow executions are sorted by StartTime in descending order when list open workflow,
// and sorted by CloseTime in descending order for other queries.
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
//
// [Visibility]: https://docs.temporal.io/visibility
ListWorkflow(ctx context.Context, request *workflowservice.ListWorkflowExecutionsRequest) (*workflowservice.ListWorkflowExecutionsResponse, error)

// ListArchivedWorkflow gets archived workflow executions based on query. This API will return BadRequest if Temporal
Expand All @@ -420,25 +422,29 @@ type (
// - serviceerror.Unavailable
ListArchivedWorkflow(ctx context.Context, request *workflowservice.ListArchivedWorkflowExecutionsRequest) (*workflowservice.ListArchivedWorkflowExecutionsResponse, error)

// ScanWorkflow gets workflow executions based on query. This API only works with ElasticSearch,
// and will return serviceerror.InvalidArgument when using Cassandra or MySQL. The query is basically the SQL WHERE clause
// ScanWorkflow gets workflow executions based on query. The query is basically the SQL WHERE clause
// (see ListWorkflow for query examples).
// For supported operations on different server versions see [Visibility].
// ScanWorkflow should be used when retrieving large amount of workflows and order is not needed.
// It will use more ElasticSearch resources than ListWorkflow, but will be several times faster
// It will use more resources than ListWorkflow, but will be several times faster
// when retrieving millions of workflows.
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
//
// [Visibility]: https://docs.temporal.io/visibility
ScanWorkflow(ctx context.Context, request *workflowservice.ScanWorkflowExecutionsRequest) (*workflowservice.ScanWorkflowExecutionsResponse, error)

// CountWorkflow gets number of workflow executions based on query. This API only works with ElasticSearch,
// and will return serviceerror.InvalidArgument when using Cassandra or MySQL. The query is basically the SQL WHERE clause
// CountWorkflow gets number of workflow executions based on query. The query is basically the SQL WHERE clause
// (see ListWorkflow for query examples).
// For supported operations on different server versions see [Visibility].
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
//
// [Visibility]: https://docs.temporal.io/visibility
CountWorkflow(ctx context.Context, request *workflowservice.CountWorkflowExecutionsRequest) (*workflowservice.CountWorkflowExecutionsResponse, error)

// GetSearchAttributes returns valid search attributes keys and value types.
Expand Down
25 changes: 16 additions & 9 deletions internal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,20 @@ type (
// - serviceerror.NamespaceNotFound
ListOpenWorkflow(ctx context.Context, request *workflowservice.ListOpenWorkflowExecutionsRequest) (*workflowservice.ListOpenWorkflowExecutionsResponse, error)

// ListWorkflow gets workflow executions based on query. This API only works with ElasticSearch,
// and will return serviceerror.InvalidArgument when using Cassandra or MySQL. The query is basically the SQL WHERE clause,
// ListWorkflow gets workflow executions based on query.The query is basically the SQL WHERE clause,
// examples:
// - "(WorkflowID = 'wid1' or (WorkflowType = 'type2' and WorkflowID = 'wid2'))".
// - "CloseTime between '2019-08-27T15:04:05+00:00' and '2019-08-28T15:04:05+00:00'".
// - to list only open workflow use "CloseTime = missing"
// Retrieved workflow executions are sorted by StartTime in descending order when list open workflow,
// and sorted by CloseTime in descending order for other queries.
// For supported operations on different server versions see [Visibility].
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
//
// [Visibility]: https://docs.temporal.io/visibility
ListWorkflow(ctx context.Context, request *workflowservice.ListWorkflowExecutionsRequest) (*workflowservice.ListWorkflowExecutionsResponse, error)

// ListArchivedWorkflow gets archived workflow executions based on query. This API will return BadRequest if Temporal
Expand All @@ -257,25 +259,28 @@ type (
// - serviceerror.Unavailable
ListArchivedWorkflow(ctx context.Context, request *workflowservice.ListArchivedWorkflowExecutionsRequest) (*workflowservice.ListArchivedWorkflowExecutionsResponse, error)

// ScanWorkflow gets workflow executions based on query. This API only works with ElasticSearch,
// and will return serviceerror.InvalidArgument when using Cassandra or MySQL. The query is basically the SQL WHERE clause
// ScanWorkflow gets workflow executions based on query. The query is basically the SQL WHERE clause
// (see ListWorkflow for query examples).
// ScanWorkflow should be used when retrieving large amount of workflows and order is not needed.
// It will use more ElasticSearch resources than ListWorkflow, but will be several times faster
// It will use more resources than ListWorkflow, but will be several times faster
// when retrieving millions of workflows.
// For supported operations on different server versions see [Visibility].
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
// [Visibility]: https://docs.temporal.io/visibility
ScanWorkflow(ctx context.Context, request *workflowservice.ScanWorkflowExecutionsRequest) (*workflowservice.ScanWorkflowExecutionsResponse, error)

// CountWorkflow gets number of workflow executions based on query. This API only works with ElasticSearch,
// and will return serviceerror.InvalidArgument when using Cassandra or MySQL. The query is basically the SQL WHERE clause
// CountWorkflow gets number of workflow executions based on query. The query is basically the SQL WHERE clause
// (see ListWorkflow for query examples).
// For supported operations on different server versions see [Visibility].
// The errors it can return:
// - serviceerror.InvalidArgument
// - serviceerror.Internal
// - serviceerror.Unavailable
//
// [Visibility]: https://docs.temporal.io/visibility
CountWorkflow(ctx context.Context, request *workflowservice.CountWorkflowExecutionsRequest) (*workflowservice.CountWorkflowExecutionsResponse, error)

// GetSearchAttributes returns valid search attributes keys and value types.
Expand Down Expand Up @@ -592,9 +597,11 @@ type (
// Memo - Optional non-indexed info that will be shown in list workflow.
Memo map[string]interface{}

// SearchAttributes - Optional indexed info that can be used in query of List/Scan/Count workflow APIs (only
// supported when Temporal server is using ElasticSearch). The key and value type must be registered on Temporal server side.
// SearchAttributes - Optional indexed info that can be used in query of List/Scan/Count workflow APIs. The key and value type must be registered on Temporal server side.
// Use GetSearchAttributes API to get valid key and corresponding value type.
// For supported operations on different server versions see [Visibility].
//
// [Visibility]: https://docs.temporal.io/visibility
SearchAttributes map[string]interface{}

// EnableEagerStart - request eager execution for this workflow, if a local worker is available.
Expand Down
26 changes: 17 additions & 9 deletions internal/schedule_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,12 @@ type (
// On ScheduleHandle.Describe() or ScheduleHandle.Update() Memo will be returned as *commonpb.Payload.
Memo map[string]interface{}

// SearchAttributes - Optional indexed info that can be used in query of List/Scan/Count workflow APIs (only
// supported when Temporal server is using advanced visiblity). The key and value type must be registered on Temporal server side.
// SearchAttributes - Optional indexed info that can be used in query of List/Scan/Count workflow APIs. The key and value type must be registered on Temporal server side.
// Use GetSearchAttributes API to get valid key and corresponding value type.
// On ScheduleHandle.Describe() or ScheduleHandle.Update() SearchAttributes will be returned as *commonpb.Payload.
// For supported operations on different server versions see [Visibility].
//
// [Visibility]: https://docs.temporal.io/visibility
SearchAttributes map[string]interface{}
}

Expand Down Expand Up @@ -338,9 +340,11 @@ type (
// Memo - Optional non-indexed info that will be shown in list schedules.
Memo map[string]interface{}

// SearchAttributes - Optional indexed info that can be used in query of List schedules APIs (only
// supported when Temporal server is using advanced visibility). The key and value type must be registered on Temporal server side.
// SearchAttributes - Optional indexed info that can be used in query of List schedules APIs. The key and value type must be registered on Temporal server side.
// Use GetSearchAttributes API to get valid key and corresponding value type.
// For supported operations on different server versions see [Visibility].
//
// [Visibility]: https://docs.temporal.io/visibility
SearchAttributes map[string]interface{}
}

Expand Down Expand Up @@ -395,9 +399,11 @@ type (
// Memo - Non-indexed user supplied information.
Memo *commonpb.Memo

// SearchAttributes - Indexed info that can be used in query of List schedules APIs (only
// supported when Temporal server is using advanced visibility). The key and value type must be registered on Temporal server side.
// SearchAttributes - Indexed info that can be used in query of List schedules APIs. The key and value type must be registered on Temporal server side.
// Use GetSearchAttributes API to get valid key and corresponding value type.
// For supported operations on different server versions see [Visibility].
//
// [Visibility]: https://docs.temporal.io/visibility
SearchAttributes *commonpb.SearchAttributes
}

Expand Down Expand Up @@ -571,9 +577,11 @@ type (
// Memo - Non-indexed user supplied information.
Memo *commonpb.Memo

// SearchAttributes - Indexed info that can be used in query of List schedules APIs (only
// supported when Temporal server is using advanced visibility). The key and value type must be registered on Temporal server side.
// SearchAttributes - Indexed info that can be used in query of List schedules APIs. The key and value type must be registered on Temporal server side.
// Use GetSearchAttributes API to get valid key and corresponding value type.
// For supported operations on different server versions see [Visibility].
//
// [Visibility]: https://docs.temporal.io/visibility
SearchAttributes *commonpb.SearchAttributes
}

Expand All @@ -599,7 +607,7 @@ type (
// Create a new Schedule.
Create(ctx context.Context, options ScheduleOptions) (ScheduleHandle, error)

// List returns an interator to list all schedules
// List returns an iterator to list all schedules
//
// Note: When using advanced visibility List is eventually consistent.
List(ctx context.Context, options ScheduleListOptions) (ScheduleListIterator, error)
Expand Down
10 changes: 7 additions & 3 deletions internal/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,11 @@ type (
// Memo - Optional non-indexed info that will be shown in list workflow.
Memo map[string]interface{}

// SearchAttributes - Optional indexed info that can be used in query of List/Scan/Count workflow APIs (only
// supported when Temporal server is using ElasticSearch). The key and value type must be registered on Temporal server side.
// SearchAttributes - Optional indexed info that can be used in query of List/Scan/Count workflow APIs. The key and value type must be registered on Temporal server side.
// Use GetSearchAttributes API to get valid key and corresponding value type.
// For supported operations on different server versions see [Visibility].
//
// [Visibility]: https://docs.temporal.io/visibility
SearchAttributes map[string]interface{}

// ParentClosePolicy - Optional policy to decide what to do for the child.
Expand Down Expand Up @@ -1278,7 +1280,9 @@ func signalExternalWorkflow(ctx Context, workflowID, runID, signalName string, a
// "CustomKeywordField": "seattle",
// }
//
// This is only supported when using ElasticSearch.
// For supported operations on different server versions see [Visibility].
//
// [Visibility]: https://docs.temporal.io/visibility
func UpsertSearchAttributes(ctx Context, attributes map[string]interface{}) error {
assertNotInReadOnlyState(ctx)
i := getWorkflowOutboundInterceptor(ctx)
Expand Down
4 changes: 3 additions & 1 deletion workflow/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,9 @@ func GetLastError(ctx Context) error {
// "CustomKeywordField": "seattle",
// }
//
// This is only supported when using ElasticSearch.
// For supported operations on different server versions see [Visibility].
//
// [Visibility]: https://docs.temporal.io/visibility
func UpsertSearchAttributes(ctx Context, attributes map[string]interface{}) error {
return internal.UpsertSearchAttributes(ctx, attributes)
}
Expand Down

0 comments on commit 3aba985

Please sign in to comment.