Skip to content

Commit 3c380c1

Browse files
DavidS-ovmactions-user
authored andcommitted
Cleanups (#1029)
This is a bunch of cleanups and exploratory testing in preparation for implementing #1006 GitOrigin-RevId: 6b455e766f47574720c5f07bbcfb776dbd6ec8dd
1 parent a684ba0 commit 3c380c1

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

discovery/enginerequests.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func (e *Engine) ExecuteQuery(ctx context.Context, query *sdp.Query, items chan<
268268
expandedMutex.RLock()
269269
for q, adapter := range expanded {
270270
log.WithContext(ctx).WithFields(log.Fields{
271-
"ovm.query.uuid": q.ParseUuid().String(),
271+
"ovm.query.uuid": q.GetUUIDParsed().String(),
272272
"ovm.query.type": q.GetType(),
273273
"ovm.query.scope": q.GetScope(),
274274
"ovm.query.method": q.GetMethod().String(),

sdp-go/items.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ func (q *Query) Reference() *Reference {
393393

394394
// Subject returns a NATS subject for all traffic relating to this query
395395
func (q *Query) Subject() string {
396-
return fmt.Sprintf("query.%v", q.ParseUuid())
396+
return fmt.Sprintf("query.%v", q.GetUUIDParsed())
397397
}
398398

399399
// Copy copies all information from one Query pointer to another
@@ -426,9 +426,9 @@ func (q *Query) TimeoutContext(ctx context.Context) (context.Context, context.Ca
426426
return context.WithDeadline(ctx, q.GetDeadline().AsTime())
427427
}
428428

429-
// ParseUuid returns this request's UUID. If there's an error parsing it,
429+
// GetUUIDParsed returns this request's UUID. If there's an error parsing it,
430430
// generates and stores a fresh one
431-
func (r *Query) ParseUuid() uuid.UUID {
431+
func (r *Query) GetUUIDParsed() uuid.UUID {
432432
if r == nil {
433433
return uuid.UUID{}
434434
}

stdlib-source/adapters/test/data.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
// S S
3434
// v |
3535
// +--------+ |
36-
// | london | <+
36+
// HOBBIES <--S-- | london | <+
3737
// +--------+
3838
// |b
3939
// |
@@ -42,8 +42,8 @@ import (
4242
// | gb |
4343
// +----+
4444
//
45-
// arrows indicate edge directions. b annotations indicate blast radius
46-
// propagation. L indicates a LIST edge, S indicates a SEARCH edge.
45+
// arrows indicate edge directions. `b` annotations indicate blast radius
46+
// propagation. `L` indicates a LIST edge, `S` indicates a SEARCH edge.
4747

4848
// this global atomic variable keeps track of the generation count for test
4949
// items. It is increased every time a new item is created, and is used to
@@ -223,6 +223,18 @@ func london() *sdp.Item {
223223
Out: true,
224224
},
225225
},
226+
{
227+
Query: &sdp.Query{
228+
Type: "test-hobby",
229+
Method: sdp.QueryMethod_SEARCH,
230+
Query: "*",
231+
Scope: "test",
232+
},
233+
BlastPropagation: &sdp.BlastPropagation{
234+
In: false,
235+
Out: false,
236+
},
237+
},
226238
}
227239

228240
return l

0 commit comments

Comments
 (0)