HADOOP-14194. Aliyun OSS should not use empty endpoint as default. Contributed by Genmao Yu
This commit is contained in:
parent
7a82d7bcea
commit
267e19a09f
@ -129,6 +129,10 @@ public void initialize(URI uri, Configuration conf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
String endPoint = conf.getTrimmed(ENDPOINT_KEY, "");
|
String endPoint = conf.getTrimmed(ENDPOINT_KEY, "");
|
||||||
|
if (StringUtils.isEmpty(endPoint)) {
|
||||||
|
throw new IllegalArgumentException("Aliyun OSS endpoint should not be " +
|
||||||
|
"null or empty. Please set proper endpoint with 'fs.oss.endpoint'.");
|
||||||
|
}
|
||||||
CredentialsProvider provider =
|
CredentialsProvider provider =
|
||||||
AliyunOSSUtils.getCredentialsProvider(conf);
|
AliyunOSSUtils.getCredentialsProvider(conf);
|
||||||
ossClient = new OSSClient(endPoint, provider, clientConf);
|
ossClient = new OSSClient(endPoint, provider, clientConf);
|
||||||
|
Loading…
Reference in New Issue
Block a user