Skip to content

Commit b0eadb4

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 5f8efcc commit b0eadb4

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
@@ -359,11 +359,9 @@ func (a dynamoDBStorageClient) query(ctx context.Context, query chunk.IndexQuery
359359
}
360360

361361
type dynamoDBRequest interface {
362-
NextPage() dynamoDBRequest
363362
Send() error
364363
Data() interface{}
365364
Error() error
366-
HasNextPage() bool
367365
Retryable() bool
368366
}
369367

@@ -383,33 +381,18 @@ type dynamoDBRequestAdapter struct {
383381
request *request.Request
384382
}
385383

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

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

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

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

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)