From 267e19a09f366a965b30c8d4dc75e377b0d92fff Mon Sep 17 00:00:00 2001 From: Kai Zheng Date: Mon, 21 Aug 2017 13:36:28 +0800 Subject: [PATCH] HADOOP-14194. Aliyun OSS should not use empty endpoint as default. Contributed by Genmao Yu --- .../apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystemStore.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystemStore.java b/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystemStore.java index a944fc1794..a85a739fb3 100644 --- a/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystemStore.java +++ b/hadoop-tools/hadoop-aliyun/src/main/java/org/apache/hadoop/fs/aliyun/oss/AliyunOSSFileSystemStore.java @@ -129,6 +129,10 @@ public void initialize(URI uri, Configuration conf, } 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 = AliyunOSSUtils.getCredentialsProvider(conf); ossClient = new OSSClient(endPoint, provider, clientConf);