session.go ×8

Frontier kind: Code frontier

unlabeled · c_62a06bfc1c63

212 tests · 2224 LOC · 111 files · introduces 0 tests · 42 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
14 ranges42 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
360 ranges2224 lines · 111 files · Browse complete extent
All tests (intent)
212 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.

3 files ranked by introduced lines: 42 introduced LOC across 14 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/nosql/nosqlplugin/cassandra/gocql/session.go 31 introduced LOC · 8 ranges

Open complete file

42 logger log.Logger,
43 metricsHandler metrics.Handler,
44 > ) (*session, error) { session.go
45 >
46 > gocqlSession, err := initSession(logger, newClusterConfigFunc, metricsHandler)
47 > if err != nil {
48 return nil, err
49 }
50
51 > session := &session{ session.go
52 > status: common.DaemonStatusStarted,
53 > newClusterConfigFunc: newClusterConfigFunc,
54 > logger: logger,
55 > metricsHandler: metricsHandler,
56 >
57 > sessionInitTime: time.Now().UTC(),
58 > }
59 > session.Value.Store(gocqlSession)
60 > return session, nil
61 }
62
112 stmt string,
113 values ...any,
114 > ) Query { session.go
115 > q := s.Value.Load().(*gocql.Session).Query(stmt, values...)
116 > if q == nil {
117 return nil
118 }
119
120 > return &query{ session.go
121 > session: s,
122 > gocqlQuery: q,
123 > }
124 }
125
163 }
164
165 > func (s *session) Close() { session.go
166 > if !atomic.CompareAndSwapInt32(
167 > &s.status,
168 > common.DaemonStatusStarted,
169 > common.DaemonStatusStopped,
170 > ) {
171 return
172 }
173 > s.Value.Load().(*gocql.Session).Close() session.go
174 }
175
176 func (s *session) handleError(
177 err error,
178 > ) { session.go
179 > switch err {
180 case gocql.ErrNoConnections,
181 gocql.ErrSessionClosed:
182 s.refresh()
183 > default: session.go
184 // noop
185 }
go.temporal.io/server/common/persistence/nosql/nosqlplugin/cassandra/gocql/client.go 8 introduced LOC · 4 ranges

Open complete file

25 var resolvedHosts []string
26 for _, host := range parseHosts(cfg.Hosts) {
27 > resolvedHosts = append(resolvedHosts, resolver.Resolve(host)...) client.go
28 > }
29
30 cluster := gocql.NewCluster(resolvedHosts...)
42 cluster.ProtoVersion = 4
43 if cfg.Port > 0 {
44 > cluster.Port = cfg.Port client.go
45 > }
46 if cfg.User != "" && cfg.Password != "" {
47 cluster.Authenticator = gocql.PasswordAuthenticator{
52 }
53 if cfg.Keyspace != "" {
54 > cluster.Keyspace = cfg.Keyspace client.go
55 > }
56 if cfg.Datacenter != "" {
57 cluster.HostFilter = gocql.DataCentreHostFilter(cfg.Datacenter)
176 for h := range strings.SplitSeq(input, ",") {
177 if host := strings.TrimSpace(h); len(host) > 0 {
178 > hosts = append(hosts, host) client.go
179 > }
180 }
181 return hosts
go.temporal.io/server/common/persistence/nosql/nosqlplugin/cassandra/gocql/query.go 3 introduced LOC · 2 ranges

Open complete file

26 }
27
28 > func (q *query) Exec() (retError error) { query.go
29 > defer func() { q.session.handleError(retError) }()
30
31 > return q.gocqlQuery.Exec() query.go
32 }
33