Skip to content

Commit 7461946

Browse files
committed
feat: add the option for the symbolic feature
1 parent 3036262 commit 7461946

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.qcloud.cos</groupId>
88
<artifactId>hadoop-cos</artifactId>
9-
<version>8.1.9</version>
9+
<version>8.2.0</version>
1010
<packaging>jar</packaging>
1111

1212
<name>Apache Hadoop Tencent Cloud COS Support</name>

src/main/java/org/apache/hadoop/fs/CosNConfigKeys.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@InterfaceStability.Unstable
1313
public class CosNConfigKeys extends CommonConfigurationKeys {
1414
public static final String USER_AGENT = "fs.cosn.user.agent";
15-
public static final String DEFAULT_USER_AGENT = "cos-hadoop-plugin-v8.1.8";
15+
public static final String DEFAULT_USER_AGENT = "cos-hadoop-plugin-v8.2.0";
1616

1717
public static final String TENCENT_EMR_VERSION_KEY = "fs.emr.version";
1818

@@ -201,8 +201,8 @@ public class CosNConfigKeys extends CommonConfigurationKeys {
201201

202202
// POSIX bucket does not support the SYMLINK interface by default.
203203
@Deprecated
204-
public static final String COSN_POSIX_BUCKET_SUPPORT_SYMLINK_ENABLED = "fs.cosn.posix_bucket.support_symlink.enabled";
205-
public static final boolean DEFAULT_COSN_POSIX_BUCKET_SUPPORT_SYMLINK_ENABLED = false;
204+
public static final String COSN_SUPPORT_SYMLINK_ENABLED = "fs.cosn.support_symlink.enabled";
205+
public static final boolean DEFAULT_COSN_SUPPORT_SYMLINK_ENABLED = false;
206206

207207
// create() recursive check dst dir which increase the getFileStatus call which increase head and list qps.
208208
// please notice when set to false may lose data, so only change to false when you know what are you doing.

src/main/java/org/apache/hadoop/fs/CosNFileSystem.java

+3-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.google.common.base.Preconditions;
44
import com.google.common.util.concurrent.ThreadFactoryBuilder;
55
import com.qcloud.chdfs.permission.RangerAccessType;
6-
import com.qcloud.cos.model.ObjectMetadata;
76
import com.qcloud.cos.utils.StringUtils;
87
import org.apache.hadoop.HadoopIllegalArgumentException;
98
import org.apache.hadoop.conf.Configuration;
@@ -1303,12 +1302,9 @@ public FileStatus getFileLinkStatus(final Path f)
13031302

13041303
@Override
13051304
public boolean supportsSymlinks() {
1306-
if (this.isPosixBucket) {
1307-
return this.getConf().getBoolean(
1308-
CosNConfigKeys.COSN_POSIX_BUCKET_SUPPORT_SYMLINK_ENABLED,
1309-
CosNConfigKeys.DEFAULT_COSN_POSIX_BUCKET_SUPPORT_SYMLINK_ENABLED);
1310-
}
1311-
return true;
1305+
return this.getConf().getBoolean(
1306+
CosNConfigKeys.COSN_SUPPORT_SYMLINK_ENABLED,
1307+
CosNConfigKeys.DEFAULT_COSN_SUPPORT_SYMLINK_ENABLED);
13121308
}
13131309

13141310
@Override

0 commit comments

Comments
 (0)