Skip to content

Commit 197cbf8

Browse files
committed
Update spacing after merge
1 parent 905a318 commit 197cbf8

File tree

4 files changed

+18
-23
lines changed

4 files changed

+18
-23
lines changed

chasm/search_attribute.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ func NewSearchAttributesMap(values map[string]VisibilityValue) SearchAttributesM
450450
// If the value is not found, the zero value for the type T is returned and the second return value is false.
451451
// Before casting the VisibilityValue to the target type, the value is checked to ensure it is of the correct type.
452452
// If the value is found but the type does not match, the zero value for the type T is returned and the second return value is false.
453-
func Get[T any](m SearchAttributesMap, sa typedSearchAttribute[T]) (val T, ok bool) {
453+
func GetSearchAttributeValue[T any](m SearchAttributesMap, sa typedSearchAttribute[T]) (val T, ok bool) {
454454
var zero T
455455
if m.values == nil {
456456
return zero, false

chasm/search_attribute_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,51 +30,51 @@ func TestSearchAttributesMap_Get(t *testing.T) {
3030
m := NewSearchAttributesMap(values)
3131

3232
t.Run("GetBool", func(t *testing.T) {
33-
val, ok := Get(m, boolAttr)
33+
val, ok := GetSearchAttributeValue(m, boolAttr)
3434
assert.True(t, ok)
3535
assert.True(t, val)
3636
})
3737

3838
t.Run("GetInt64", func(t *testing.T) {
39-
val, ok := Get(m, intAttr)
39+
val, ok := GetSearchAttributeValue(m, intAttr)
4040
assert.True(t, ok)
4141
assert.Equal(t, int64(42), val)
4242
})
4343

4444
t.Run("GetFloat64", func(t *testing.T) {
45-
val, ok := Get(m, doubleAttr)
45+
val, ok := GetSearchAttributeValue(m, doubleAttr)
4646
assert.True(t, ok)
4747
assert.InDelta(t, 3.14, val, 0.0001)
4848
})
4949

5050
t.Run("GetString", func(t *testing.T) {
51-
val, ok := Get(m, keywordAttr)
51+
val, ok := GetSearchAttributeValue(m, keywordAttr)
5252
assert.True(t, ok)
5353
assert.Equal(t, "active", val)
5454
})
5555

5656
t.Run("GetTime", func(t *testing.T) {
57-
val, ok := Get(m, datetimeAttr)
57+
val, ok := GetSearchAttributeValue(m, datetimeAttr)
5858
assert.True(t, ok)
5959
assert.True(t, now.Equal(val))
6060
})
6161

6262
t.Run("GetStringSlice", func(t *testing.T) {
63-
val, ok := Get(m, keywordListAttr)
63+
val, ok := GetSearchAttributeValue(m, keywordListAttr)
6464
assert.True(t, ok)
6565
assert.Equal(t, []string{"tag1", "tag2"}, val)
6666
})
6767

6868
t.Run("NotFound", func(t *testing.T) {
6969
missingAttr := NewSearchAttributeBool("missing", SearchAttributeFieldBool02)
70-
val, ok := Get(m, missingAttr)
70+
val, ok := GetSearchAttributeValue(m, missingAttr)
7171
assert.False(t, ok)
7272
assert.False(t, val)
7373
})
7474

7575
t.Run("NilMap", func(t *testing.T) {
7676
emptyMap := NewSearchAttributesMap(nil)
77-
val, ok := Get(emptyMap, boolAttr)
77+
val, ok := GetSearchAttributeValue(emptyMap, boolAttr)
7878
assert.False(t, ok)
7979
assert.False(t, val)
8080
})

common/searchattribute/mapper.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ func AliasFields(
133133

134134
newIndexedFields := make(map[string]*commonpb.Payload, len(searchAttributes.GetIndexedFields()))
135135
mapped := false
136-
137136
for saName, saPayload := range searchAttributes.GetIndexedFields() {
138137
if !sadefs.IsMappable(saName) {
139138
newIndexedFields[saName] = saPayload
@@ -151,7 +150,6 @@ func AliasFields(
151150
}
152151
return nil, err
153152
}
154-
155153
if aliasName != saName {
156154
mapped = true
157155
}

service/history/chasm_engine.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ func newChasmEngine(
7474
visibilityMgr manager.VisibilityManager,
7575
) *ChasmEngine {
7676
return &ChasmEngine{
77-
executionCache: executionCache,
78-
registry: registry,
79-
config: config,
80-
visibilityMgr: visibilityMgr,
77+
executionCache: executionCache,
78+
registry: registry,
79+
config: config,
80+
visibilityMgr: visibilityMgr,
8181
}
8282
}
8383

@@ -642,16 +642,11 @@ func (e *ChasmEngine) ListExecutions(
642642
return nil, serviceerror.NewInternal("unknown chasm component type: " + archetypeType.String())
643643
}
644644

645-
pageSize := request.PageSize
646-
if pageSize <= 0 {
647-
pageSize = e.config.HistoryMaxPageSize(namespace.Name(request.NamespaceName).String())
648-
}
649-
650645
visReq := &manager.ListChasmExecutionsRequest{
651646
ArchetypeID: archetypeID,
652647
NamespaceID: namespace.ID(request.NamespaceID),
653648
Namespace: namespace.Name(request.NamespaceName),
654-
PageSize: pageSize,
649+
PageSize: request.PageSize,
655650
NextPageToken: request.NextPageToken,
656651
Query: request.Query,
657652
}
@@ -670,10 +665,12 @@ func (e *ChasmEngine) CountExecutions(
670665
return nil, serviceerror.NewInternal("unknown chasm component type: " + archetypeType.String())
671666
}
672667

673-
return e.visibilityMgr.CountChasmExecutions(ctx, &manager.CountChasmExecutionsRequest{
668+
visReq := &manager.CountChasmExecutionsRequest{
674669
ArchetypeID: archetypeID,
675670
NamespaceID: namespace.ID(request.NamespaceID),
676671
Namespace: namespace.Name(request.NamespaceName),
677672
Query: request.Query,
678-
})
673+
}
674+
675+
return e.visibilityMgr.CountChasmExecutions(ctx, visReq)
679676
}

0 commit comments

Comments
 (0)