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

Added ListObjectsV2 support to gateway #4547

Merged
merged 1 commit into from Jun 17, 2017
Merged

Added ListObjectsV2 support to gateway #4547

merged 1 commit into from Jun 17, 2017

Conversation

nitisht
Copy link
Contributor

@nitisht nitisht commented Jun 15, 2017

Description

Added ListObjectsV2 and ListObjectsV2 Anon support to Gateway S3 and Azure

Motivation and Context

  • Added ListObjectsV2 to GatewayLayer
  • Added AnonListObjectsV2 in S3/Azure gateway
  • Added ListObjectsV2 to Azure gateway implementation

How Has This Been Tested?

This adds anonymous list object V2 support to S3 gateway.
Methods ListObjectsV2and AnonListObjectsV2 are now added to GatewayLayer interface.

Partially fixes #4413. Will send another PR to feature-gcs branch.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov-io
Copy link

codecov-io commented Jun 15, 2017

Codecov Report

Merging #4547 into master will decrease coverage by 0.18%.
The diff coverage is 4.51%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4547      +/-   ##
==========================================
- Coverage    66.4%   66.22%   -0.19%     
==========================================
  Files         179      179              
  Lines       25757    25903     +146     
==========================================
+ Hits        17105    17155      +50     
- Misses       7502     7596      +94     
- Partials     1150     1152       +2
Impacted Files Coverage Δ
cmd/gateway-router.go 0% <ø> (ø) ⬆️
cmd/gateway-s3-anonymous.go 0% <0%> (ø) ⬆️
cmd/gateway-azure-anonymous.go 0% <0%> (ø) ⬆️
cmd/gateway-azure.go 19.33% <0%> (+7.27%) ⬆️
cmd/gateway-handlers.go 0% <0%> (ø) ⬆️
cmd/bucket-handlers-listobjects.go 73.75% <100%> (ø) ⬆️
cmd/api-response.go 91.36% <75%> (ø) ⬆️
cmd/xl-v1-common.go 84.61% <0%> (-5.13%) ⬇️
cmd/fs-v1-background-append.go 78.52% <0%> (-1.35%) ⬇️
cmd/posix.go 73.3% <0%> (-0.15%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b283a2c...b3ec44e. Read the comment docs.

Copy link
Contributor

@krishnasrinivas krishnasrinivas left a comment

Choose a reason for hiding this comment

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

Just remember to send another commit to use azureAnonRequest() once #4543 is merged.

MaxResults: uint(maxKeys),
}

q := azureListBlobsGetParameters(params)
Copy link
Member

Choose a reason for hiding this comment

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

We need to add unit tests for all this parsing logic.. and converting to S3 compatible format.

Copy link
Contributor Author

@nitisht nitisht Jun 16, 2017

Choose a reason for hiding this comment

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

Added tests for azureListBlobsGetParameters. Will check if there are more such parsing methods, will add tests for those as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added tests for anonErrToObjectErr. Looks like there are no more parsing/response translation methods without unit tests in gateway-azure.go

@@ -269,6 +269,41 @@ func (a *azureObjects) ListObjects(bucket, prefix, marker, delimiter string, max
return result, nil
}

// ListObjectsV2 - lists all blobs in GCS bucket filtered by prefix
Copy link
Member

Choose a reason for hiding this comment

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

s/list all blobs in GCS bucket/list all blobs in Azure bucket/

// marshalled into S3 compatible XML header.
listObjectsV2Info, err := listObjectsV2(bucket, prefix, token, fetchOwner, delimiter, maxKeys)
if err != nil {
errorIf(err, "Unable to list objects.")
Copy link
Member

Choose a reason for hiding this comment

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

We could improve the error log by adding bucket, prefix, delimiter and marker. This will help debug when such an error does occur.

}
// Inititate a list objects operation based on the input params.
// On success would return back ListObjectsInfo object to be
// marshalled into S3 compatible XML header.
Copy link
Member

Choose a reason for hiding this comment

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

ListObjectsInfo is serialized as XML and is sent as part of the response body, not header.

@nitisht
Copy link
Contributor Author

nitisht commented Jun 17, 2017

Updated, @harshavardhana @krisis PTAL

Copy link
Member

@krisis krisis left a comment

Choose a reason for hiding this comment

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

LGTM. Tested locally and works as expected.

@harshavardhana harshavardhana merged commit 5883371 into minio:master Jun 17, 2017
@nitisht nitisht deleted the listobjectv2 branch June 30, 2017 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[gateway] Implement ListObjectsV2 anonymous support
5 participants