factory.go ×10

Frontier kind: Code frontier

unlabeled · c_2afec1adb587

82 tests · 3394 LOC · 173 files · introduces 0 tests · 132 LOC · 4 files

Introduces — evidence that enters the hierarchy at this concept

Code
19 ranges132 lines · 4 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
529 ranges3394 lines · 173 files · Browse complete extent
All tests (intent)
82 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

4 files ranked by introduced lines: 132 introduced LOC across 19 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/visibility/factory.go 100 introduced LOC · 10 ranges

Open complete file

56 logger log.Logger,
57 serializer serialization.Serializer,
58 > ) (manager.VisibilityManager, error) { factory.go
59 > visibilityManager, err := newVisibilityManagerFromDataStoreConfig(
60 > persistenceCfg.GetVisibilityStoreConfig(),
61 > persistenceResolver,
62 > customVisibilityStoreFactory,
63 > esProcessorConfig,
64 > searchAttributesProvider,
65 > searchAttributesMapperProvider,
66 > namespaceRegistry,
67 > chasmRegistry,
68 > maxReadQPS,
69 > maxWriteQPS,
70 > operatorRPSRatio,
71 > slowQueryThreshold,
72 > visibilityDisableOrderByClause,
73 > visibilityEnableManualPagination,
74 > visibilityEnableUnifiedQueryConverter,
75 > metricsHandler,
76 > logger,
77 > serializer,
78 > )
79 > if err != nil {
80 return nil, err
81 }
82 > if visibilityManager == nil { factory.go
83 logger.Fatal("invalid config: visibility store must be configured")
84 return nil, nil
85 }
86
87 > secondaryVisibilityManager, err := newVisibilityManagerFromDataStoreConfig( factory.go
88 > persistenceCfg.GetSecondaryVisibilityStoreConfig(),
89 > persistenceResolver,
90 > customVisibilityStoreFactory,
91 > esProcessorConfig,
92 > searchAttributesProvider,
93 > searchAttributesMapperProvider,
94 > namespaceRegistry,
95 > chasmRegistry,
96 > maxReadQPS,
97 > maxWriteQPS,
98 > operatorRPSRatio,
99 > slowQueryThreshold,
100 > visibilityDisableOrderByClause,
101 > visibilityEnableManualPagination,
102 > visibilityEnableUnifiedQueryConverter,
103 > metricsHandler,
104 > logger,
105 > serializer,
106 > )
107 > if err != nil {
108 return nil, err
109 }
110
111 > if secondaryVisibilityManager != nil { factory.go
112 managerSelector := newDefaultManagerSelector(
113 visibilityManager,
124 }
125
126 > return visibilityManager, nil factory.go
127 }
128
197 logger log.Logger,
198 serializer serialization.Serializer,
199 > ) (manager.VisibilityManager, error) { factory.go
200 > visStore, err := newVisibilityStoreFromDataStoreConfig(
201 > dsConfig,
202 > persistenceResolver,
203 > customVisibilityStoreFactory,
204 > esProcessorConfig,
205 > searchAttributesProvider,
206 > searchAttributesMapperProvider,
207 > namespaceRegistry,
208 > chasmRegistry,
209 > visibilityDisableOrderByClause,
210 > visibilityEnableManualPagination,
211 > visibilityEnableUnifiedQueryConverter,
212 > metricsHandler,
213 > logger,
214 > serializer,
215 > )
216 > if err != nil {
217 return nil, err
218 }
219 > if visStore == nil { factory.go
220 > return nil, nil
221 > }
222 > return newVisibilityManager(
223 > visStore,
224 > maxReadQPS,
225 > maxWriteQPS,
226 > operatorRPSRatio,
227 > slowQueryThreshold,
228 > metricsHandler,
229 > metrics.VisibilityPluginNameTag(visStore.GetName()),
230 > metrics.VisibilityIndexNameTag(visStore.GetIndexName()),
231 > logger,
232 > searchAttributesMapperProvider,
233 > chasmRegistry,
234 > ), nil
235 }
236
252 logger log.Logger,
253 serializer serialization.Serializer,
254 > ) (store.VisibilityStore, error) { factory.go
255 > var (
256 > visStore store.VisibilityStore
257 > err error
258 > )
259 > if dsConfig.SQL != nil {
260 > visStore, err = sql.NewSQLVisibilityStore(
261 > *dsConfig.SQL,
262 > persistenceResolver,
263 > searchAttributesProvider,
264 > searchAttributesMapperProvider,
265 > chasmRegistry,
266 > visibilityEnableUnifiedQueryConverter,
267 > logger,
268 > metricsHandler,
269 > serializer,
270 > )
271 > } else if dsConfig.Elasticsearch != nil {
272 visStore, err = elasticsearch.NewVisibilityStore(
273 dsConfig.Elasticsearch,
282 logger,
283 )
284 > } else if dsConfig.CustomDataStoreConfig != nil { factory.go
285 if customVisibilityStoreFactory == nil {
286 logger.Fatal("custom visibility store factory must be defined")
298 )
299 }
300 > return visStore, err factory.go
301 }
go.temporal.io/server/common/persistence/visibility/store/sql/visibility_store.go 20 introduced LOC · 4 ranges

Open complete file

69 metricsHandler metrics.Handler,
70 serializer serialization.Serializer,
71 > ) (*VisibilityStore, error) { visibility_store.go
72 > refDbConn := persistencesql.NewRefCountedDBConn(sqlplugin.DbKindVisibility, &cfg, r, logger, metricsHandler)
73 > db, err := refDbConn.Get()
74 > if err != nil {
75 return nil, err
76 }
77 > return &VisibilityStore{ visibility_store.go
78 > sqlStore: persistencesql.NewSQLStore(db, logger, serializer),
79 > searchAttributesProvider: searchAttributesProvider,
80 > searchAttributesMapperProvider: searchAttributesMapperProvider,
81 > chasmRegistry: chasmRegistry,
82 > metricsHandler: metricsHandler,
83 > logger: logger,
84 >
85 > enableUnifiedQueryConverter: enableUnifiedQueryConverter,
86 > }, nil
87 }
88
91 }
92
93 > func (s *VisibilityStore) GetName() string { visibility_store.go
94 > return s.sqlStore.GetName()
95 > }
96
97 func convertSQLError(message string, err error) error {
102 }
103
104 > func (s *VisibilityStore) GetIndexName() string { visibility_store.go
105 > return s.sqlStore.GetDbName()
106 > }
107
108 func (s *VisibilityStore) ValidateCustomSearchAttributes(
go.temporal.io/server/common/config/persistence.go 9 introduced LOC · 4 ranges

Open complete file

116 }
117
118 > func (c *Persistence) GetVisibilityStoreConfig() DataStore { persistence.go
119 > return c.DataStores[c.VisibilityStore]
120 > }
121
122 > func (c *Persistence) GetSecondaryVisibilityStoreConfig() DataStore { persistence.go
123 > if c.SecondaryVisibilityStore != "" {
124 return c.DataStores[c.SecondaryVisibilityStore]
125 }
126 > if c.VisibilityStore != "" { persistence.go
127 > ds := c.DataStores[c.VisibilityStore]
128 > if ds.Elasticsearch != nil && ds.Elasticsearch.GetSecondaryVisibilityIndex() != "" {
129 esConfig := *ds.Elasticsearch
130 esConfig.Indices = map[string]string{
go.temporal.io/server/common/persistence/sql/common.go 3 introduced LOC · 1 range

Open complete file

37 }
38
39 > func (m *SqlStore) GetDbName() string { common.go
40 > return m.DB.DbName()
41 > }
42
43 func (m *SqlStore) Close() {