Skip to content

Commit

Permalink
ci fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vdarulis committed Dec 1, 2020
1 parent 8db0066 commit 7cf1806
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 16 deletions.
9 changes: 3 additions & 6 deletions src/aggregator/aggregator/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,9 @@ func TestSetStreamOptions(t *testing.T) {
}

func TestSetAdminClient(t *testing.T) {
c, err := client.NewClient(client.NewOptions())
require.NoError(t, err)
value, ok := c.(client.AdminClient)
require.True(t, ok)
o := NewOptions().SetAdminClient(value)
require.True(t, value == o.AdminClient())
var c client.AdminClient = &client.M3MsgClient{}
o := NewOptions().SetAdminClient(c)
require.True(t, c == o.AdminClient())
}

func TestSetRuntimeOptionsManager(t *testing.T) {
Expand Down
20 changes: 20 additions & 0 deletions src/aggregator/client/m3msg_client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

package client

import (
Expand Down
20 changes: 20 additions & 0 deletions src/aggregator/client/m3msg_client_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

package client

import (
Expand Down
34 changes: 24 additions & 10 deletions src/aggregator/client/tcp_client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

package client

import (
Expand Down Expand Up @@ -67,26 +87,20 @@ func NewTCPClient(opts Options) (*TCPClient, error) {
placementWatcher = placement.NewStagedPlacementWatcher(opts.StagedPlacementWatcherOptions().
SetActiveStagedPlacementOptions(activeStagedPlacementOpts))

c := &TCPClient{
return &TCPClient{
nowFn: opts.ClockOptions().NowFn(),
shardCutoverWarmupDuration: opts.ShardCutoverWarmupDuration(),
shardCutoffLingerDuration: opts.ShardCutoffLingerDuration(),
writerMgr: writerMgr,
shardFn: opts.ShardFn(),
placementWatcher: placementWatcher,
metrics: newTCPClientMetrics(instrumentOpts.MetricsScope()),
}

if err := c.placementWatcher.Watch(); err != nil {
return nil, err
}

return c, nil
}, nil
}

// Init does nothing for TCPClient, just satisfies Client interface.
// Init initializes TCPClient.
func (c *TCPClient) Init() error {
return nil
return c.placementWatcher.Watch()
}

// WriteUntimedCounter writes untimed counter metrics.
Expand Down

0 comments on commit 7cf1806

Please sign in to comment.