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

POC for S3 API experiments (Not to be checked in) #2664

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Arun-LinkedIn
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Dec 1, 2023

Codecov Report

Attention: 554 lines in your changes are missing coverage. Please review.

Comparison is base (6edfb75) 72.63% compared to head (399af24) 39.76%.
Report is 23 commits behind head on master.

Files Patch % Lines
...om/github/ambry/frontend/NamedBlobPostHandler.java 0.00% 228 Missing ⚠️
...ava/com/github/ambry/frontend/HeadBlobHandler.java 0.00% 46 Missing ⚠️
...om/github/ambry/frontend/NamedBlobListHandler.java 0.00% 44 Missing ⚠️
...a/com/github/ambry/router/OperationController.java 2.38% 41 Missing ⚠️
...com/github/ambry/frontend/NamedBlobPutHandler.java 0.00% 35 Missing ⚠️
...hub/ambry/frontend/FrontendRestRequestService.java 0.00% 25 Missing ⚠️
...va/com/github/ambry/frontend/ListBucketResult.java 0.00% 25 Missing ⚠️
...c/main/java/com/github/ambry/rest/RequestPath.java 0.00% 20 Missing ⚠️
.../main/java/com/github/ambry/frontend/Contents.java 0.00% 16 Missing ⚠️
.../ambry/frontend/CompleteMultipartUploadResult.java 0.00% 13 Missing ⚠️
... and 10 more
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #2664       +/-   ##
=============================================
- Coverage     72.63%   39.76%   -32.88%     
+ Complexity    11537     5956     -5581     
=============================================
  Files           809      819       +10     
  Lines         65545    66408      +863     
  Branches       7997     8086       +89     
=============================================
- Hits          47611    26404    -21207     
- Misses        15334    37683    +22349     
+ Partials       2600     2321      -279     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This handles:
1. PUT, GET, DELETE, HEAD, LIST
2. Multipart uploads
3. Also made changes in frontend.properties file to start frontend on ssl port and talk to mysql
@JingQianCloud
Copy link
Collaborator

JingQianCloud commented Jan 9, 2024

I'm thinking of adding a enum of AmazonS3_Action
https://docs.aws.amazon.com/AmazonS3/latest/API/API_Operations_Amazon_Simple_Storage_Service.html

For example, followings are related to multiple part upload.

  • CreateMultipartUpload
  • UploadPart
  • CompleteMultipartUpload
  • AbortMultipartUpload
  • ListParts
  • ListMultipartUploads

At the early stage like somewhere at preProcessAndRouteRequest
We generate the action type. In our handling code, we don't parse or rely on keywords like "upload", "uploadId" etc.

And we also generate the related parameter per each type. For example, class S3CreateMultipleUploadContext.
RestRequest has a field called RestRequestContext. We can set the command context to that variable.

// S3 can issue "HEAD /s3/named-blob-sandbox" on the bucket-name.
// The converted named blob would be /named/named-blob-sandbox/container-a. So, don't check for number of expected
// segments for S3 as of now
/*
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the case we hit the exception?
After the naming translation from S3 to "named",

  • For Get, we do have four parts, "named", account, container and key.
  • For list, we have three parts, "named", account, container. At least for flink case, looks like it's still true. If we support list under any key, this is another case.

One small issue I saw was that for listing, the path is "/named/named-blob-sandbox/container-a/". With the ending "/", we split it to four parts. But if we trim the ending "/", it works fine.

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;


public class InitiateMultipartUploadResult {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably we can follow S3 naming:
CreateMultipartUploadResponse

// We convert it to named blob request in the form "/named/named-blob-sandbox/container-a/checkpoints/87833badf879a3fc7bf151adfe928eac/chk-1/_metadata"
// i.e. we hardcode container name to 'container-a'

logger.info("S3 API | Input path: {}", path);
Copy link
Collaborator

Choose a reason for hiding this comment

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

As another comment, probably we can have one function to parse all S3 command and generate context for each S3 commands.

@@ -541,7 +556,7 @@ public static BlobProperties buildBlobProperties(Map<String, Object> args) throw
* @throws RestServiceException if required arguments aren't present or if they aren't in the format expected.
*/
public static long getTtlFromRequestHeader(Map<String, Object> args) throws RestServiceException {
long ttl = Utils.Infinite_Time;
long ttl = 86400;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did we ever discuss the life cycle management with flink and TiKV team?

@JingQianCloud
Copy link
Collaborator

JingQianCloud commented Jan 10, 2024

We ever discussed for S3, do we need dedicated handler for it?
I'm thinking inherit namedBlob handler and create s3 handler.
In S3 handler, we only overwrite the code which we need change.

@Arun-LinkedIn Arun-LinkedIn changed the title Changes for S3 API experiments (Not to be checked in) POC for S3 API experiments (Not to be checked in) Jan 23, 2024
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.

None yet

3 participants