( ctx context.Context, request *adminservice.GetSearchAttributesRequest, searchAttributes searchattribute.NameTypeMap, )
| 619 | } |
| 620 | |
| 621 | func (adh *AdminHandler) getSearchAttributesSQL( |
| 622 | ctx context.Context, |
| 623 | request *adminservice.GetSearchAttributesRequest, |
| 624 | searchAttributes searchattribute.NameTypeMap, |
| 625 | ) (*adminservice.GetSearchAttributesResponse, error) { |
| 626 | _, client, err := adh.clientFactory.NewLocalFrontendClientWithTimeout( |
| 627 | frontend.DefaultTimeout, |
| 628 | frontend.DefaultLongPollTimeout, |
| 629 | ) |
| 630 | if err != nil { |
| 631 | return nil, serviceerror.NewUnavailablef(errUnableToCreateFrontendClientMessage, err) |
| 632 | } |
| 633 | |
| 634 | nsName := request.GetNamespace() |
| 635 | if nsName == "" { |
| 636 | return nil, errNamespaceNotSet |
| 637 | } |
| 638 | resp, err := client.DescribeNamespace( |
| 639 | ctx, |
| 640 | &workflowservice.DescribeNamespaceRequest{Namespace: nsName}, |
| 641 | ) |
| 642 | if err != nil { |
| 643 | return nil, serviceerror.NewUnavailablef( |
| 644 | errUnableToGetNamespaceInfoMessage, nsName, err, |
| 645 | ) |
| 646 | } |
| 647 | |
| 648 | fieldToAliasMap := resp.Config.CustomSearchAttributeAliases |
| 649 | customSearchAttributes := make(map[string]enumspb.IndexedValueType) |
| 650 | for field, tp := range searchAttributes.Custom() { |
| 651 | if alias, ok := fieldToAliasMap[field]; ok { |
| 652 | customSearchAttributes[alias] = tp |
| 653 | } |
| 654 | } |
| 655 | return &adminservice.GetSearchAttributesResponse{ |
| 656 | CustomAttributes: customSearchAttributes, |
| 657 | SystemAttributes: searchAttributes.System(), |
| 658 | }, nil |
| 659 | } |
| 660 | |
| 661 | func (adh *AdminHandler) RebuildMutableState( |
| 662 | ctx context.Context, |
no test coverage detected