-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[cassandra] Refactor TagFilter to accept dbmodel.Span
#7707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
5c26d69
12e1627
57ac8d8
12a5e33
f51c3c4
9fbadc1
53bed0c
959a5db
a9bc1ac
7f92357
a1423a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,9 @@ package dbmodel | |||||||||||||||
| import ( | ||||||||||||||||
| "bytes" | ||||||||||||||||
| "encoding/binary" | ||||||||||||||||
| "encoding/hex" | ||||||||||||||||
| "sort" | ||||||||||||||||
| "strconv" | ||||||||||||||||
|
|
||||||||||||||||
| "github.com/jaegertracing/jaeger-idl/model/v1" | ||||||||||||||||
| ) | ||||||||||||||||
|
|
@@ -53,6 +56,136 @@ type KeyValue struct { | |||||||||||||||
| ValueBinary []byte `cql:"value_binary"` | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| func (t *KeyValue) compareValues(that *KeyValue) int { | ||||||||||||||||
| switch t.ValueType { | ||||||||||||||||
| case stringType: | ||||||||||||||||
| if t.ValueString != that.ValueString { | ||||||||||||||||
| if t.ValueString < that.ValueString { | ||||||||||||||||
| return -1 | ||||||||||||||||
| } | ||||||||||||||||
| return 1 | ||||||||||||||||
| } | ||||||||||||||||
| case boolType: | ||||||||||||||||
| if t.ValueBool != that.ValueBool { | ||||||||||||||||
| if !t.ValueBool { | ||||||||||||||||
| return -1 | ||||||||||||||||
| } | ||||||||||||||||
| return 1 | ||||||||||||||||
| } | ||||||||||||||||
| case int64Type: | ||||||||||||||||
| if t.ValueInt64 != that.ValueInt64 { | ||||||||||||||||
| if t.ValueInt64 < that.ValueInt64 { | ||||||||||||||||
| return -1 | ||||||||||||||||
| } | ||||||||||||||||
| return 1 | ||||||||||||||||
| } | ||||||||||||||||
|
||||||||||||||||
| if t.ValueInt64 != that.ValueInt64 { | |
| if t.ValueInt64 < that.ValueInt64 { | |
| return -1 | |
| } | |
| return 1 | |
| } | |
| return t.ValueInt64 < that.ValueInt64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this will only give 0 or 1 and would miss the -1 case
Manik2708 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Manik2708 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Manik2708 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Manik2708 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TagInsertion accepts TagValue only in form of string
Uh oh!
There was an error while loading. Please reload this page.