-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Remove SASI indices #1328
Remove SASI indices #1328
Changes from all commits
11c2cce
1c24fb5
24da016
5ecb6d5
98b58fb
d9f8b91
f39eb35
f3df053
0dbea68
fdb18f5
05a3834
18aa185
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) 2019 The Jaeger Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package model | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestDependencyLinkApplyDefaults(t *testing.T) { | ||
dl := DependencyLink{}.ApplyDefaults() | ||
assert.Equal(t, JaegerDependencyLinkSource, dl.Source) | ||
|
||
networkSource := DependencyLinkSource("network") | ||
dl = DependencyLink{Source: networkSource}.ApplyDefaults() | ||
assert.Equal(t, networkSource, dl.Source) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ type Dependency struct { | |
Parent string `cql:"parent"` | ||
Child string `cql:"child"` | ||
CallCount int64 `cql:"call_count"` // always unsigned, but we cannot explicitly read uint64 from Cassandra | ||
Source string `cql:"source"` | ||
} | ||
|
||
// MarshalUDT handles marshalling a Dependency. | ||
|
@@ -36,6 +37,8 @@ func (d *Dependency) MarshalUDT(name string, info gocql.TypeInfo) ([]byte, error | |
return gocql.Marshal(info, d.Child) | ||
case "call_count": | ||
return gocql.Marshal(info, d.CallCount) | ||
case "source": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what happens if you run this code against the schema where UDT was not upgraded? Will gocql simply not invoke this function for "source"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
return gocql.Marshal(info, d.Source) | ||
default: | ||
return nil, fmt.Errorf("unknown column for position: %q", name) | ||
} | ||
|
@@ -50,6 +53,8 @@ func (d *Dependency) UnmarshalUDT(name string, info gocql.TypeInfo, data []byte) | |
return gocql.Unmarshal(info, data, &d.Child) | ||
case "call_count": | ||
return gocql.Unmarshal(info, data, &d.CallCount) | ||
case "source": | ||
return gocql.Unmarshal(info, data, &d.Source) | ||
default: | ||
return fmt.Errorf("unknown column for position: %q", name) | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,19 +24,21 @@ import ( | |
|
||
func TestDependencyUDT(t *testing.T) { | ||
dependency := &Dependency{ | ||
Parent: "goo", | ||
Child: "gle", | ||
Parent: "bi", | ||
Child: "ng", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. quit raising entropy |
||
CallCount: 123, | ||
Source: "jaeger", | ||
} | ||
|
||
testCase := testutils.UDTTestCase{ | ||
Obj: dependency, | ||
New: func() gocql.UDTUnmarshaler { return &Dependency{} }, | ||
ObjName: "Dependency", | ||
Fields: []testutils.UDTField{ | ||
{Name: "parent", Type: gocql.TypeAscii, ValIn: []byte("goo"), Err: false}, | ||
{Name: "child", Type: gocql.TypeAscii, ValIn: []byte("gle"), Err: false}, | ||
{Name: "parent", Type: gocql.TypeAscii, ValIn: []byte("bi"), Err: false}, | ||
{Name: "child", Type: gocql.TypeAscii, ValIn: []byte("ng"), Err: false}, | ||
{Name: "call_count", Type: gocql.TypeBigInt, ValIn: []byte{0, 0, 0, 0, 0, 0, 0, 123}, Err: false}, | ||
{Name: "source", Type: gocql.TypeAscii, ValIn: []byte("jaeger"), Err: false}, | ||
{Name: "wrong-field", Err: true}, | ||
}, | ||
} | ||
|
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.
this should rather say "update Spark job to version N"
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.
I'll punt on this until I've actually made the change in spark.