metadata_persistence_v2.go ×2

Frontier kind: Joint frontier

unlabeled · c_3c115aeb9dba

1 test · 5010 LOC · 204 files · introduces 1 test · 70 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
2 ranges70 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
939 ranges5010 lines · 204 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

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

1 file ranked by introduced lines: 70 introduced LOC across 2 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/persistence-tests/metadata_persistence_v2.go 70 introduced LOC · 2 ranges

Open complete file

105 // This is only relevant for cassandra
106 switch m.DefaultTestCluster.(type) {
107 > case *cassandra.TestCluster: metadata_persistence_v2.go
108 default:
109 return
110 }
111 > id := uuid.NewString() metadata_persistence_v2.go
112 > name := "create-partial-namespace-test-name"
113 > m.createPartialNamespace(id, name)
114 >
115 > state := enumspb.NAMESPACE_STATE_REGISTERED
116 > description := "create-namespace-test-description"
117 > owner := "create-namespace-test-owner"
118 > data := map[string]string{"k1": "v1"}
119 > retention := int32(10)
120 > historyArchivalState := enumspb.ARCHIVAL_STATE_ENABLED
121 > historyArchivalURI := "test://history/uri"
122 > visibilityArchivalState := enumspb.ARCHIVAL_STATE_ENABLED
123 > visibilityArchivalURI := "test://visibility/uri"
124 > badBinaries := &namespacepb.BadBinaries{Binaries: map[string]*namespacepb.BadBinaryInfo{}}
125 > isGlobalNamespace := false
126 > configVersion := int64(0)
127 > failoverVersion := int64(0)
128 >
129 > resp0, err0 := m.CreateNamespace(
130 > &persistencespb.NamespaceInfo{
131 > Id: id,
132 > Name: name,
133 > State: state,
134 > Description: description,
135 > Owner: owner,
136 > Data: data,
137 > },
138 > &persistencespb.NamespaceConfig{
139 > Retention: timestamp.DurationFromDays(retention),
140 > HistoryArchivalState: historyArchivalState,
141 > HistoryArchivalUri: historyArchivalURI,
142 > VisibilityArchivalState: visibilityArchivalState,
143 > VisibilityArchivalUri: visibilityArchivalURI,
144 > BadBinaries: badBinaries,
145 > },
146 > &persistencespb.NamespaceReplicationConfig{},
147 > isGlobalNamespace,
148 > configVersion,
149 > failoverVersion,
150 > )
151 > m.NoError(err0)
152 > m.NotNil(resp0)
153 > m.EqualValues(id, resp0.ID)
154 >
155 > // for namespace which do not have replication config set, will default to
156 > // use current cluster as active, with current cluster as all clusters
157 > resp1, err1 := m.GetNamespace(id, "")
158 > m.NoError(err1)
159 > m.NotNil(resp1)
160 > m.EqualValues(id, resp1.Namespace.Info.Id)
161 > m.Equal(name, resp1.Namespace.Info.Name)
162 > m.Equal(state, resp1.Namespace.Info.State)
163 > m.Equal(description, resp1.Namespace.Info.Description)
164 > m.Equal(owner, resp1.Namespace.Info.Owner)
165 > m.Equal(data, resp1.Namespace.Info.Data)
166 > m.EqualValues(time.Duration(retention)*time.Hour*24, resp1.Namespace.Config.Retention.AsDuration())
167 > m.Equal(historyArchivalState, resp1.Namespace.Config.HistoryArchivalState)
168 > m.Equal(historyArchivalURI, resp1.Namespace.Config.HistoryArchivalUri)
169 > m.Equal(visibilityArchivalState, resp1.Namespace.Config.VisibilityArchivalState)
170 > m.Equal(visibilityArchivalURI, resp1.Namespace.Config.VisibilityArchivalUri)
171 > m.ProtoEqual(badBinaries, resp1.Namespace.Config.BadBinaries)
172 > m.Equal(cluster.TestCurrentClusterName, resp1.Namespace.ReplicationConfig.ActiveClusterName)
173 > m.Equal(1, len(resp1.Namespace.ReplicationConfig.Clusters))
174 > m.Equal(isGlobalNamespace, resp1.IsGlobalNamespace)
175 > m.Equal(configVersion, resp1.Namespace.ConfigVersion)
176 > m.Equal(failoverVersion, resp1.Namespace.FailoverVersion)
177 > m.True(resp1.Namespace.ReplicationConfig.Clusters[0] == cluster.TestCurrentClusterName)
178 > m.Equal(p.InitialFailoverNotificationVersion, resp1.Namespace.FailoverNotificationVersion)
179 > m.truncatePartialNamespace()
180 }
181