Skip to content

Commit

Permalink
Remove deprecated admin list tasks APIs (#2592)
Browse files Browse the repository at this point in the history
  • Loading branch information
yycptt authored Mar 9, 2022
1 parent 4375f94 commit 1e3bc68
Show file tree
Hide file tree
Showing 10 changed files with 5,055 additions and 8,560 deletions.
12,775 changes: 5,001 additions & 7,774 deletions api/adminservice/v1/request_response.pb.go

Large diffs are not rendered by default.

264 changes: 54 additions & 210 deletions api/adminservice/v1/service.pb.go

Large diffs are not rendered by default.

140 changes: 0 additions & 140 deletions api/adminservicemock/v1/service.pb.mock.go

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

56 changes: 0 additions & 56 deletions client/admin/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,62 +175,6 @@ func (c *clientImpl) ListHistoryTasks(
return client.ListHistoryTasks(ctx, request, opts...)
}

func (c *clientImpl) ListTimerTasks(
ctx context.Context,
request *adminservice.ListTimerTasksRequest,
opts ...grpc.CallOption,
) (*adminservice.ListTimerTasksResponse, error) {
client, err := c.getRandomClient()
if err != nil {
return nil, err
}
ctx, cancel := c.createContext(ctx)
defer cancel()
return client.ListTimerTasks(ctx, request, opts...)
}

func (c *clientImpl) ListReplicationTasks(
ctx context.Context,
request *adminservice.ListReplicationTasksRequest,
opts ...grpc.CallOption,
) (*adminservice.ListReplicationTasksResponse, error) {
client, err := c.getRandomClient()
if err != nil {
return nil, err
}
ctx, cancel := c.createContext(ctx)
defer cancel()
return client.ListReplicationTasks(ctx, request, opts...)
}

func (c *clientImpl) ListTransferTasks(
ctx context.Context,
request *adminservice.ListTransferTasksRequest,
opts ...grpc.CallOption,
) (*adminservice.ListTransferTasksResponse, error) {
client, err := c.getRandomClient()
if err != nil {
return nil, err
}
ctx, cancel := c.createContext(ctx)
defer cancel()
return client.ListTransferTasks(ctx, request, opts...)
}

func (c *clientImpl) ListVisibilityTasks(
ctx context.Context,
request *adminservice.ListVisibilityTasksRequest,
opts ...grpc.CallOption,
) (*adminservice.ListVisibilityTasksResponse, error) {
client, err := c.getRandomClient()
if err != nil {
return nil, err
}
ctx, cancel := c.createContext(ctx)
defer cancel()
return client.ListVisibilityTasks(ctx, request, opts...)
}

func (c *clientImpl) RebuildMutableState(
ctx context.Context,
request *adminservice.RebuildMutableStateRequest,
Expand Down
72 changes: 0 additions & 72 deletions client/admin/metricClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,78 +191,6 @@ func (c *metricClient) ListHistoryTasks(
return resp, err
}

func (c *metricClient) ListTimerTasks(
ctx context.Context,
request *adminservice.ListTimerTasksRequest,
opts ...grpc.CallOption,
) (*adminservice.ListTimerTasksResponse, error) {

c.metricsClient.IncCounter(metrics.AdminClientListTimerTasksScope, metrics.ClientRequests)

sw := c.metricsClient.StartTimer(metrics.AdminClientListTimerTasksScope, metrics.ClientLatency)
resp, err := c.client.ListTimerTasks(ctx, request, opts...)
sw.Stop()

if err != nil {
c.metricsClient.IncCounter(metrics.AdminClientListTimerTasksScope, metrics.ClientFailures)
}
return resp, err
}

func (c *metricClient) ListReplicationTasks(
ctx context.Context,
request *adminservice.ListReplicationTasksRequest,
opts ...grpc.CallOption,
) (*adminservice.ListReplicationTasksResponse, error) {

c.metricsClient.IncCounter(metrics.AdminClientListReplicationTasksScope, metrics.ClientRequests)

sw := c.metricsClient.StartTimer(metrics.AdminClientListReplicationTasksScope, metrics.ClientLatency)
resp, err := c.client.ListReplicationTasks(ctx, request, opts...)
sw.Stop()

if err != nil {
c.metricsClient.IncCounter(metrics.AdminClientListReplicationTasksScope, metrics.ClientFailures)
}
return resp, err
}

func (c *metricClient) ListTransferTasks(
ctx context.Context,
request *adminservice.ListTransferTasksRequest,
opts ...grpc.CallOption,
) (*adminservice.ListTransferTasksResponse, error) {

c.metricsClient.IncCounter(metrics.AdminClientListTransferTasksScope, metrics.ClientRequests)

sw := c.metricsClient.StartTimer(metrics.AdminClientListTransferTasksScope, metrics.ClientLatency)
resp, err := c.client.ListTransferTasks(ctx, request, opts...)
sw.Stop()

if err != nil {
c.metricsClient.IncCounter(metrics.AdminClientListTransferTasksScope, metrics.ClientFailures)
}
return resp, err
}

func (c *metricClient) ListVisibilityTasks(
ctx context.Context,
request *adminservice.ListVisibilityTasksRequest,
opts ...grpc.CallOption,
) (*adminservice.ListVisibilityTasksResponse, error) {

c.metricsClient.IncCounter(metrics.AdminClientListVisibilityTasksScope, metrics.ClientRequests)

sw := c.metricsClient.StartTimer(metrics.AdminClientListVisibilityTasksScope, metrics.ClientLatency)
resp, err := c.client.ListVisibilityTasks(ctx, request, opts...)
sw.Stop()

if err != nil {
c.metricsClient.IncCounter(metrics.AdminClientListVisibilityTasksScope, metrics.ClientFailures)
}
return resp, err
}

func (c *metricClient) RebuildMutableState(
ctx context.Context,
request *adminservice.RebuildMutableStateRequest,
Expand Down
64 changes: 0 additions & 64 deletions client/admin/retryableClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,70 +178,6 @@ func (c *retryableClient) ListHistoryTasks(
return resp, err
}

func (c *retryableClient) ListTimerTasks(
ctx context.Context,
request *adminservice.ListTimerTasksRequest,
opts ...grpc.CallOption,
) (*adminservice.ListTimerTasksResponse, error) {

var resp *adminservice.ListTimerTasksResponse
op := func() error {
var err error
resp, err = c.client.ListTimerTasks(ctx, request, opts...)
return err
}
err := backoff.Retry(op, c.policy, c.isRetryable)
return resp, err
}

func (c *retryableClient) ListReplicationTasks(
ctx context.Context,
request *adminservice.ListReplicationTasksRequest,
opts ...grpc.CallOption,
) (*adminservice.ListReplicationTasksResponse, error) {

var resp *adminservice.ListReplicationTasksResponse
op := func() error {
var err error
resp, err = c.client.ListReplicationTasks(ctx, request, opts...)
return err
}
err := backoff.Retry(op, c.policy, c.isRetryable)
return resp, err
}

func (c *retryableClient) ListTransferTasks(
ctx context.Context,
request *adminservice.ListTransferTasksRequest,
opts ...grpc.CallOption,
) (*adminservice.ListTransferTasksResponse, error) {

var resp *adminservice.ListTransferTasksResponse
op := func() error {
var err error
resp, err = c.client.ListTransferTasks(ctx, request, opts...)
return err
}
err := backoff.Retry(op, c.policy, c.isRetryable)
return resp, err
}

func (c *retryableClient) ListVisibilityTasks(
ctx context.Context,
request *adminservice.ListVisibilityTasksRequest,
opts ...grpc.CallOption,
) (*adminservice.ListVisibilityTasksResponse, error) {

var resp *adminservice.ListVisibilityTasksResponse
op := func() error {
var err error
resp, err = c.client.ListVisibilityTasks(ctx, request, opts...)
return err
}
err := backoff.Retry(op, c.policy, c.isRetryable)
return resp, err
}

func (c *retryableClient) RebuildMutableState(
ctx context.Context,
request *adminservice.RebuildMutableStateRequest,
Expand Down
Loading

0 comments on commit 1e3bc68

Please sign in to comment.