public class HeaderProcessing extends AbstractStoreOperation
Modifier and Type | Class and Description |
---|---|
static interface |
HeaderProcessing.HeaderProcessingCallbacks |
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_TYPE_APPLICATION_XML
XML content type : "application/xml".
|
static String |
CONTENT_TYPE_OCTET_STREAM
Content type of generic binary objects.
|
static String |
CONTENT_TYPE_X_DIRECTORY
Directory content type : "application/x-directory".
|
static String |
HEADER_REFERRER
HTTP Referrer for logs: "Referer".
|
static String |
XA_ARCHIVE_STATUS
object archive status; empty if not on S3 Glacier
(i.e all normal files should be non-archived as
S3A and applications don't handle archived data)
Value "header.x-amz-archive-status".
|
static String |
XA_CACHE_CONTROL
Standard HTTP header found on some S3 objects: "header.Cache-Control".
|
static String |
XA_CONTENT_DISPOSITION
Standard HTTP header found on some S3 objects: "header.Content-Disposition".
|
static String |
XA_CONTENT_ENCODING
Content encoding; can be configured: "header.Content-Encoding".
|
static String |
XA_CONTENT_LANGUAGE
Standard HTTP header found on some S3 objects: "header.Content-Language".
|
static String |
XA_CONTENT_LENGTH
Length XAttr: "header.Content-Length".
|
static String |
XA_CONTENT_MD5
Standard HTTP header found on some S3 objects: "header.Content-MD5".
|
static String |
XA_CONTENT_RANGE
Content range: "header.Content-Range".
|
static String |
XA_CONTENT_TYPE
Content type: may be set when uploading.
|
static String |
XA_ENCRYPTION_KEY_ID |
static String |
XA_ETAG
Etag Header "header.ETag".
|
static String |
XA_LAST_MODIFIED
last modified XAttr: "header.Last-Modified".
|
static String |
XA_OBJECT_LOCK_LEGAL_HOLD_STATUS
Object legal hold status.
|
static String |
XA_OBJECT_LOCK_MODE
Object lock mode.
|
static String |
XA_OBJECT_LOCK_RETAIN_UNTIL_DATE
ISO8601 expiry date of object lock hold.
|
static String |
XA_OBJECT_REPLICATION_STATUS
Replication status for cross-region replicated objects.
|
static String |
XA_S3_VERSION_ID
Version ID; empty for non-versioned buckets/data.
|
static String |
XA_SERVER_SIDE_ENCRYPTION
The server-side encryption algorithm to use
with AWS-managed keys: "header.x-amz-server-side-encryption".
|
static String[] |
XA_STANDARD_HEADERS
Standard headers which are retrieved from HEAD Requests
and set as XAttrs if the response included the relevant header.
|
static String |
XA_STORAGE_CLASS
Storage Class XAttr: "header.x-amz-storage-class".
|
Constructor and Description |
---|
HeaderProcessing(StoreContext storeContext,
HeaderProcessing.HeaderProcessingCallbacks callbacks)
Construct.
|
Modifier and Type | Method and Description |
---|---|
static void |
cloneObjectMetadata(software.amazon.awssdk.services.s3.model.HeadObjectResponse source,
Map<String,String> dest,
software.amazon.awssdk.services.s3.model.CopyObjectRequest.Builder copyObjectRequestBuilder)
Creates a copy of the passed metadata.
|
static String |
decodeBytes(byte[] bytes)
Get the string value from the bytes.
|
static byte[] |
encodeBytes(Object s)
Stringify an object and return its bytes in UTF-8 encoding.
|
static Optional<Long> |
extractXAttrLongValue(byte[] data)
Convert an XAttr byte array to a long.
|
byte[] |
getXAttr(org.apache.hadoop.fs.Path path,
String name)
Get an XAttr name and value for a file or directory.
|
Map<String,byte[]> |
getXAttrs(org.apache.hadoop.fs.Path path)
See
FileSystem.getXAttrs(path . |
Map<String,byte[]> |
getXAttrs(org.apache.hadoop.fs.Path path,
List<String> names)
See
FileSystem.getXAttrs(path, names . |
List<String> |
listXAttrs(org.apache.hadoop.fs.Path path)
See
FileSystem.listXAttrs(path) . |
activateAuditSpan, getAuditSpan, getStoreContext
public static final String XA_CACHE_CONTROL
public static final String XA_CONTENT_DISPOSITION
public static final String XA_CONTENT_ENCODING
public static final String XA_CONTENT_LANGUAGE
public static final String XA_CONTENT_LENGTH
public static final String XA_CONTENT_MD5
public static final String XA_CONTENT_RANGE
public static final String XA_CONTENT_TYPE
public static final String XA_ETAG
ObjectMetadata.getEtag()
, where
it can be retrieved via getFileChecksum(path)
if
the S3A connector is enabled.public static final String XA_LAST_MODIFIED
public static final String XA_ARCHIVE_STATUS
public static final String XA_OBJECT_LOCK_LEGAL_HOLD_STATUS
public static final String XA_OBJECT_LOCK_MODE
public static final String XA_OBJECT_LOCK_RETAIN_UNTIL_DATE
public static final String XA_OBJECT_REPLICATION_STATUS
public static final String XA_S3_VERSION_ID
public static final String XA_SERVER_SIDE_ENCRYPTION
public static final String XA_ENCRYPTION_KEY_ID
public static final String XA_STORAGE_CLASS
public static final String HEADER_REFERRER
public static final String[] XA_STANDARD_HEADERS
public static final String CONTENT_TYPE_OCTET_STREAM
public static final String CONTENT_TYPE_APPLICATION_XML
public static final String CONTENT_TYPE_X_DIRECTORY
public HeaderProcessing(StoreContext storeContext, HeaderProcessing.HeaderProcessingCallbacks callbacks)
storeContext
- store context.callbacks
- callbacks to the storepublic static byte[] encodeBytes(@Nullable Object s)
s
- sourcepublic static String decodeBytes(byte[] bytes)
bytes
- source bytespublic byte[] getXAttr(org.apache.hadoop.fs.Path path, String name) throws IOException
path
- Path to get extended attributename
- XAttr name.IOException
- IO failurepublic Map<String,byte[]> getXAttrs(org.apache.hadoop.fs.Path path) throws IOException
FileSystem.getXAttrs(path
.path
- Path to get extended attributesIOException
- IO failurepublic List<String> listXAttrs(org.apache.hadoop.fs.Path path) throws IOException
FileSystem.listXAttrs(path)
.path
- Path to get extended attributesIOException
- IO failurepublic Map<String,byte[]> getXAttrs(org.apache.hadoop.fs.Path path, List<String> names) throws IOException
FileSystem.getXAttrs(path, names
.path
- Path to get extended attributesnames
- XAttr names.IOException
- IO failurepublic static Optional<Long> extractXAttrLongValue(byte[] data)
data
- data to parsepublic static void cloneObjectMetadata(software.amazon.awssdk.services.s3.model.HeadObjectResponse source, Map<String,String> dest, software.amazon.awssdk.services.s3.model.CopyObjectRequest.Builder copyObjectRequestBuilder)
X_HEADER_MAGIC_MARKER
header to avoid confusion. If a marker file is renamed,
it loses information about any remapped file.
If new fields are added to ObjectMetadata which are not
present in the user metadata headers, they will not be picked
up or cloned unless this operation is updated.source
- the source metadata to copydest
- the metadata to update; this is the return value.copyObjectRequestBuilder
- CopyObjectRequest builderCopyright © 2008–2024 Apache Software Foundation. All rights reserved.