Class ObjectEndpoint
java.lang.Object
org.apache.hadoop.ozone.s3.endpoint.EndpointBase
org.apache.hadoop.ozone.s3.endpoint.ObjectEndpoint
- All Implemented Interfaces:
org.apache.hadoop.ozone.audit.Auditor
Key level rest endpoints.
-
Field Summary
Fields inherited from class org.apache.hadoop.ozone.s3.endpoint.EndpointBase
AUDIT, ETAG_CUSTOM, signatureInfo -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckCopySourceModificationTime(Long lastModificationTime, String copySourceIfModifiedSinceStr, String copySourceIfUnmodifiedSinceStr) javax.ws.rs.core.ResponsecompleteMultipartUpload(String bucket, String key, String uploadID, CompleteMultipartUploadRequest multipartUploadRequest) Complete a multipart upload.javax.ws.rs.core.ResponseDelete a specific object from a bucket, if query param uploadId is specified, this request is for abort multipart upload.javax.ws.rs.core.Responseget(String bucketName, String keyPath, int partNumber, String uploadId, int maxParts, String partNumberMarker, String taggingMarker) Rest endpoint to download object from a bucket, if query param uploadId is specified, request for list parts of a multipart upload key with specific uploadId.javax.ws.rs.core.ResponseRest endpoint to check existence of an object in a bucket.voidinit()javax.ws.rs.core.ResponseinitializeMultipartUpload(String bucket, String key) Initialize MultiPartUpload request.booleanparseSourceHeader(String copyHeader) Parse the key and bucket name from copy header.javax.ws.rs.core.Responseput(String bucketName, String keyPath, long length, int partNumber, String uploadID, String taggingMarker, String aclMarker, InputStream body) Rest endpoint to upload object to a bucket.voidsetContext(javax.ws.rs.container.ContainerRequestContext context) voidsetHeaders(javax.ws.rs.core.HttpHeaders headers) voidsetOzoneConfiguration(org.apache.hadoop.hdds.conf.OzoneConfiguration config) Methods inherited from class org.apache.hadoop.ozone.s3.endpoint.EndpointBase
addCustomMetadataHeaders, auditReadFailure, auditWriteFailure, buildAuditMessageForFailure, buildAuditMessageForSuccess, buildAuditMessageForSuccess, createS3Bucket, deleteS3Bucket, getAuditParameters, getBucket, getBucket, getClient, getClientProtocol, getCustomMetadataFromHeaders, getMetrics, getTaggingFromHeaders, getVolume, initialization, isAccessDenied, listS3Buckets, listS3Buckets, setClient, setRequestIdentifier, setSignatureInfo, validateAndGetTagging
-
Constructor Details
-
ObjectEndpoint
public ObjectEndpoint()
-
-
Method Details
-
init
- Specified by:
initin classEndpointBase
-
put
@PUT public javax.ws.rs.core.Response put(@PathParam("bucket") String bucketName, @PathParam("path") String keyPath, @HeaderParam("Content-Length") long length, @QueryParam("partNumber") int partNumber, @QueryParam("uploadId") @DefaultValue("") String uploadID, @QueryParam("tagging") String taggingMarker, @QueryParam("acl") String aclMarker, InputStream body) throws IOException, OS3Exception Rest endpoint to upload object to a bucket.See: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html for more details.
- Throws:
IOExceptionOS3Exception
-
get
@GET public javax.ws.rs.core.Response get(@PathParam("bucket") String bucketName, @PathParam("path") String keyPath, @QueryParam("partNumber") int partNumber, @QueryParam("uploadId") String uploadId, @QueryParam("max-parts") @DefaultValue("1000") int maxParts, @QueryParam("part-number-marker") String partNumberMarker, @QueryParam("tagging") String taggingMarker) throws IOException, OS3Exception Rest endpoint to download object from a bucket, if query param uploadId is specified, request for list parts of a multipart upload key with specific uploadId.See: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectGET.html https://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadListParts.html for more details.
- Throws:
IOExceptionOS3Exception
-
head
@HEAD public javax.ws.rs.core.Response head(@PathParam("bucket") String bucketName, @PathParam("path") String keyPath) throws IOException, OS3Exception Rest endpoint to check existence of an object in a bucket.See: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectHEAD.html for more details.
- Throws:
IOExceptionOS3Exception
-
delete
@DELETE public javax.ws.rs.core.Response delete(@PathParam("bucket") String bucketName, @PathParam("path") String keyPath, @QueryParam("uploadId") @DefaultValue("") String uploadId, @QueryParam("tagging") String taggingMarker) throws IOException, OS3Exception Delete a specific object from a bucket, if query param uploadId is specified, this request is for abort multipart upload.See: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html https://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadAbort.html for more details.
- Throws:
IOExceptionOS3Exception
-
initializeMultipartUpload
@POST @Produces("application/xml") @Consumes("ozone/mpu") public javax.ws.rs.core.Response initializeMultipartUpload(@PathParam("bucket") String bucket, @PathParam("path") String key) throws IOException, OS3Exception Initialize MultiPartUpload request.Note: the specific content type is set by the HeaderPreprocessor.
- Throws:
IOExceptionOS3Exception
-
completeMultipartUpload
@POST @Produces("application/xml") public javax.ws.rs.core.Response completeMultipartUpload(@PathParam("bucket") String bucket, @PathParam("path") String key, @QueryParam("uploadId") @DefaultValue("") String uploadID, CompleteMultipartUploadRequest multipartUploadRequest) throws IOException, OS3Exception Complete a multipart upload.- Throws:
IOExceptionOS3Exception
-
setHeaders
public void setHeaders(javax.ws.rs.core.HttpHeaders headers) -
setContext
public void setContext(javax.ws.rs.container.ContainerRequestContext context) -
parseSourceHeader
public static org.apache.commons.lang3.tuple.Pair<String,String> parseSourceHeader(String copyHeader) throws OS3Exception Parse the key and bucket name from copy header.- Throws:
OS3Exception
-
checkCopySourceModificationTime
-
setOzoneConfiguration
public void setOzoneConfiguration(org.apache.hadoop.hdds.conf.OzoneConfiguration config) -
isDatastreamEnabled
public boolean isDatastreamEnabled() -
getMessageDigestInstance
-