Skip to content

Commit aebddc3

Browse files
committed
Don't need DynamoDB request wrapper to do so much now
Now we are calling QueryPagesWithContext directly we don't need the paging interface and we never re-use request objects. Signed-off-by: Bryan Boreham <[email protected]>
1 parent e5b02c1 commit aebddc3

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

pkg/chunk/aws/dynamodb_storage_client.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,9 @@ func (a dynamoDBStorageClient) query(ctx context.Context, query chunk.IndexQuery
358358
}
359359

360360
type dynamoDBRequest interface {
361-
NextPage() dynamoDBRequest
362361
Send() error
363362
Data() interface{}
364363
Error() error
365-
HasNextPage() bool
366364
Retryable() bool
367365
}
368366

@@ -382,33 +380,18 @@ type dynamoDBRequestAdapter struct {
382380
request *request.Request
383381
}
384382

385-
func (a dynamoDBRequestAdapter) NextPage() dynamoDBRequest {
386-
next := a.request.NextPage()
387-
if next == nil {
388-
return nil
389-
}
390-
return dynamoDBRequestAdapter{next}
391-
}
392-
393383
func (a dynamoDBRequestAdapter) Data() interface{} {
394384
return a.request.Data
395385
}
396386

397387
func (a dynamoDBRequestAdapter) Send() error {
398-
// Clear error in case we are retrying the same operation - if we
399-
// don't do this then the same error will come back again immediately
400-
a.request.Error = nil
401388
return a.request.Send()
402389
}
403390

404391
func (a dynamoDBRequestAdapter) Error() error {
405392
return a.request.Error
406393
}
407394

408-
func (a dynamoDBRequestAdapter) HasNextPage() bool {
409-
return a.request.HasNextPage()
410-
}
411-
412395
func (a dynamoDBRequestAdapter) Retryable() bool {
413396
return aws.BoolValue(a.request.Retryable)
414397
}

pkg/chunk/aws/mock.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,6 @@ type dynamoDBMockRequest struct {
250250
err error
251251
}
252252

253-
func (m *dynamoDBMockRequest) NextPage() dynamoDBRequest {
254-
return m
255-
}
256253
func (m *dynamoDBMockRequest) Send() error {
257254
return m.err
258255
}
@@ -262,9 +259,6 @@ func (m *dynamoDBMockRequest) Data() interface{} {
262259
func (m *dynamoDBMockRequest) Error() error {
263260
return m.err
264261
}
265-
func (m *dynamoDBMockRequest) HasNextPage() bool {
266-
return false
267-
}
268262
func (m *dynamoDBMockRequest) Retryable() bool {
269263
return false
270264
}

0 commit comments

Comments
 (0)