Skip to content

Commit

Permalink
fix: fix the default value for fs.cosn.useHttps
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyang733 committed Jan 23, 2022
1 parent 63b20f1 commit e61d33a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/apache/hadoop/fs/CosNConfigKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class CosNConfigKeys extends CommonConfigurationKeys {
public static final String COSN_ENDPOINT_SUFFIX_PREV_KEY = "fs.cosn.userinfo.endpoint_suffix";

public static final String COSN_USE_HTTPS_KEY = "fs.cosn.useHttps";
public static final boolean DEFAULT_USE_HTTPS = false;
public static final boolean DEFAULT_USE_HTTPS = true; // 现在 COS 强制使用 https 作为访问协议

public static final String COSN_TMP_DIR = "fs.cosn.tmp.dir";
public static final String DEFAULT_TMP_DIR = "/tmp/hadoop_cos";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ private void initCOSClient(URI uri, Configuration conf) throws IOException {
CosNConfigKeys.DEFAULT_USE_HTTPS);
if (useHttps) {
config.setHttpProtocol(HttpProtocol.https);
} else {
// 这里 config 的默认值改过了,默认值变成了https了。
config.setHttpProtocol(HttpProtocol.http);
}

int socketTimeoutSec = conf.getInt(
Expand Down

0 comments on commit e61d33a

Please sign in to comment.