From 966f447eb00ec77cb43649022e55d3875bda97c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?alantong=28=E4=BD=9F=E6=98=8E=E8=BE=BE=29?= Date: Fri, 6 Nov 2020 16:05:37 +0800 Subject: [PATCH] change the name of flag --- .../hadoop/fs/CosNativeFileSystemStore.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java b/src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java index edf3a8c7..923f2668 100644 --- a/src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java +++ b/src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java @@ -42,7 +42,7 @@ public class CosNativeFileSystemStore implements NativeFileSystemStore { private StorageClass storageClass; private int maxRetryTimes; private int trafficLimit; - private boolean openCrc32c; + private boolean crc32cEnabled; private CosEncryptionSecrets encryptionSecrets; private CustomerDomainEndpointResolver customerDomainEndpointResolver; @@ -92,7 +92,7 @@ private void initCOSClient(URI uri, Configuration conf) throws IOException { config.setHttpProtocol(HttpProtocol.https); } - this.openCrc32c = conf.getBoolean(CosNConfigKeys.CRC32C_CHECKSUM_ENABLED, + this.crc32cEnabled = conf.getBoolean(CosNConfigKeys.CRC32C_CHECKSUM_ENABLED, CosNConfigKeys.DEFAULT_CRC32C_CHECKSUM_ENABLED); // Proxy settings @@ -205,7 +205,7 @@ private void storeFileWithRetry(String key, InputStream inputStream, objectMetadata.setContentMD5(Base64.encodeAsString(md5Hash)); } objectMetadata.setContentLength(length); - if (openCrc32c) { + if (crc32cEnabled) { objectMetadata.setHeader(Constants.CRC32C_REQ_HEADER, Constants.CRC32C_REQ_HEADER_VAL); } @@ -273,7 +273,7 @@ public void storeEmptyFile(String key) throws IOException { ObjectMetadata objectMetadata = new ObjectMetadata(); objectMetadata.setContentLength(0); - if (openCrc32c) { + if (crc32cEnabled) { objectMetadata.setHeader(Constants.CRC32C_REQ_HEADER, Constants.CRC32C_REQ_HEADER_VAL); } @@ -323,7 +323,7 @@ public PartETag uploadPart( LOG.debug("Upload the part to the cos key [{}]. upload id: {}, part number: {}, part size: {}", key, uploadId, partNum, partSize); ObjectMetadata objectMetadata = new ObjectMetadata(); - if (openCrc32c) { + if (crc32cEnabled) { objectMetadata.setHeader(Constants.CRC32C_REQ_HEADER, Constants.CRC32C_REQ_HEADER_VAL); } @@ -379,7 +379,7 @@ public String getUploadId(String key) throws IOException { } ObjectMetadata objectMetadata = new ObjectMetadata(); - if (openCrc32c) { + if (crc32cEnabled) { objectMetadata.setHeader(Constants.CRC32C_REQ_HEADER, Constants.CRC32C_REQ_HEADER_VAL); } @@ -414,7 +414,7 @@ public int compare(PartETag o1, PartETag o2) { }); try { ObjectMetadata objectMetadata = new ObjectMetadata(); - if (openCrc32c) { + if (crc32cEnabled) { objectMetadata.setHeader(Constants.CRC32C_REQ_HEADER, Constants.CRC32C_REQ_HEADER_VAL); } CompleteMultipartUploadRequest completeMultipartUploadRequest = @@ -603,7 +603,7 @@ private void storeAttribute(String key, String attribute, byte[] value, boolean objectMetadata.setUserMetadata(userMetadata); // 构造原地copy请求来设置用户自定义属性 - if (openCrc32c) { + if (crc32cEnabled) { objectMetadata.setHeader(Constants.CRC32C_REQ_HEADER, Constants.CRC32C_REQ_HEADER_VAL); } @@ -861,7 +861,7 @@ public void rename(String srcKey, String dstKey) throws IOException { LOG.debug("Rename the source cos key [{}] to the dest cos key [{}].", srcKey, dstKey); try { ObjectMetadata objectMetadata = new ObjectMetadata(); - if (openCrc32c) { + if (crc32cEnabled) { objectMetadata.setHeader(Constants.CRC32C_REQ_HEADER, Constants.CRC32C_REQ_HEADER_VAL); } CopyObjectRequest copyObjectRequest = @@ -897,7 +897,7 @@ public void rename(String srcKey, String dstKey) throws IOException { public void copy(String srcKey, String dstKey) throws IOException { try { ObjectMetadata objectMetadata = new ObjectMetadata(); - if (openCrc32c) { + if (crc32cEnabled) { objectMetadata.setHeader(Constants.CRC32C_REQ_HEADER, Constants.CRC32C_REQ_HEADER_VAL); }