Skip to content

Commit

Permalink
Cleanup unused setters in client.Bean (cadence-workflow#4555)
Browse files Browse the repository at this point in the history
  • Loading branch information
vytautas-karpavicius authored Oct 20, 2021
1 parent 0bfd2f7 commit a3fdf4c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 81 deletions.
33 changes: 0 additions & 33 deletions client/clientBean.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,11 @@ type (
// Bean in an collection of clients
Bean interface {
GetHistoryClient() history.Client
SetHistoryClient(client history.Client)
GetMatchingClient(domainIDToName DomainIDToNameFunc) (matching.Client, error)
SetMatchingClient(client matching.Client)
GetFrontendClient() frontend.Client
SetFrontendClient(client frontend.Client)
GetRemoteAdminClient(cluster string) admin.Client
SetRemoteAdminClient(cluster string, client admin.Client)
GetRemoteFrontendClient(cluster string) frontend.Client
SetRemoteFrontendClient(cluster string, client frontend.Client)
}

clientBeanImpl struct {
Expand Down Expand Up @@ -114,38 +110,17 @@ func (h *clientBeanImpl) GetHistoryClient() history.Client {
return h.historyClient
}

func (h *clientBeanImpl) SetHistoryClient(
client history.Client,
) {

h.historyClient = client
}

func (h *clientBeanImpl) GetMatchingClient(domainIDToName DomainIDToNameFunc) (matching.Client, error) {
if client := h.matchingClient.Load(); client != nil {
return client.(matching.Client), nil
}
return h.lazyInitMatchingClient(domainIDToName)
}

func (h *clientBeanImpl) SetMatchingClient(
client matching.Client,
) {

h.matchingClient.Store(client)
}

func (h *clientBeanImpl) GetFrontendClient() frontend.Client {
return h.frontendClient
}

func (h *clientBeanImpl) SetFrontendClient(
client frontend.Client,
) {

h.frontendClient = client
}

func (h *clientBeanImpl) GetRemoteAdminClient(cluster string) admin.Client {
client, ok := h.remoteAdminClients[cluster]
if !ok {
Expand Down Expand Up @@ -178,14 +153,6 @@ func (h *clientBeanImpl) GetRemoteFrontendClient(cluster string) frontend.Client
return client
}

func (h *clientBeanImpl) SetRemoteFrontendClient(
cluster string,
client frontend.Client,
) {

h.remoteFrontendClients[cluster] = client
}

func (h *clientBeanImpl) lazyInitMatchingClient(domainIDToName DomainIDToNameFunc) (matching.Client, error) {
h.Lock()
defer h.Unlock()
Expand Down
48 changes: 0 additions & 48 deletions client/clientBean_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a3fdf4c

Please sign in to comment.