Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service/s3/s3manager: adding cleanup function to batch objects #1375

Merged
merged 1 commit into from
Jun 30, 2017

Conversation

xibz
Copy link
Contributor

@xibz xibz commented Jun 27, 2017

No description provided.

@xibz xibz requested a review from jasdel June 27, 2017 17:41
@xibz xibz force-pushed the s3manager_batch_after branch from 737efa6 to d014570 Compare June 27, 2017 17:43
Copy link
Contributor

@jasdel jasdel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a side note It would also be really helpful to have an example_test.go file.

key,
}
}

func (err *Error) Error() string {
return err.OrigErr.Error()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be helpful for the Error message to include the bucket and object key that the error failed on.

@@ -382,4 +396,6 @@ func (batcher *UploadObjectsIterator) UploadObject() BatchUploadObject {
// BatchUploadObject contains all necessary information to run a batch operation once.
type BatchUploadObject struct {
Object *UploadInput
// After will run after each iteration during the batch process
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll clarify this statement to stay after the object has been attempted to be uploaded. Regardless of success/failure.

Same for the other After functions

downloader := NewDownloaderWithClient(svc)
deleter := NewBatchDeleteWithClient(svc)

iter := &testAfterIter{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should create a new iterator for each test case to prevent pollution. Sharing the iterator value can hide or introduce bugs in the test.

}

func (iter *testAfterIter) Next() bool {
next := (iter.index & 1) == 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit this will only wouldn't this be similar to just do something like the following, or change from an index, to a boolean flag.

func (iter *testAfterIter) Next() bool {
    defer func() { iter.index++ }
    return iter.index == 0
}

@xibz xibz force-pushed the s3manager_batch_after branch from d014570 to 30a00d3 Compare June 27, 2017 22:02
@xibz xibz merged commit c51a820 into aws:master Jun 30, 2017
@awstools awstools mentioned this pull request Jul 5, 2017
@xibz xibz deleted the s3manager_batch_after branch October 2, 2017 19:48
@diehlaws diehlaws added needs-review This issue or pull request needs review from a core team member. and removed review-needed labels Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review This issue or pull request needs review from a core team member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants