Skip to content

Commit

Permalink
change the name of flag
Browse files Browse the repository at this point in the history
  • Loading branch information
vintmd committed Nov 6, 2020
1 parent 40baa9a commit 966f447
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/main/java/org/apache/hadoop/fs/CosNativeFileSystemStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 966f447

Please sign in to comment.