Skip to content

Commit

Permalink
feat: add the option for the symbolic feature
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyang733 committed Jan 3, 2023
1 parent 3036262 commit 7461946
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.qcloud.cos</groupId>
<artifactId>hadoop-cos</artifactId>
<version>8.1.9</version>
<version>8.2.0</version>
<packaging>jar</packaging>

<name>Apache Hadoop Tencent Cloud COS Support</name>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/apache/hadoop/fs/CosNConfigKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@InterfaceStability.Unstable
public class CosNConfigKeys extends CommonConfigurationKeys {
public static final String USER_AGENT = "fs.cosn.user.agent";
public static final String DEFAULT_USER_AGENT = "cos-hadoop-plugin-v8.1.8";
public static final String DEFAULT_USER_AGENT = "cos-hadoop-plugin-v8.2.0";

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

Expand Down Expand Up @@ -201,8 +201,8 @@ public class CosNConfigKeys extends CommonConfigurationKeys {

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

// create() recursive check dst dir which increase the getFileStatus call which increase head and list qps.
// please notice when set to false may lose data, so only change to false when you know what are you doing.
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/org/apache/hadoop/fs/CosNFileSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.qcloud.chdfs.permission.RangerAccessType;
import com.qcloud.cos.model.ObjectMetadata;
import com.qcloud.cos.utils.StringUtils;
import org.apache.hadoop.HadoopIllegalArgumentException;
import org.apache.hadoop.conf.Configuration;
Expand Down Expand Up @@ -1303,12 +1302,9 @@ public FileStatus getFileLinkStatus(final Path f)

@Override
public boolean supportsSymlinks() {
if (this.isPosixBucket) {
return this.getConf().getBoolean(
CosNConfigKeys.COSN_POSIX_BUCKET_SUPPORT_SYMLINK_ENABLED,
CosNConfigKeys.DEFAULT_COSN_POSIX_BUCKET_SUPPORT_SYMLINK_ENABLED);
}
return true;
return this.getConf().getBoolean(
CosNConfigKeys.COSN_SUPPORT_SYMLINK_ENABLED,
CosNConfigKeys.DEFAULT_COSN_SUPPORT_SYMLINK_ENABLED);
}

@Override
Expand Down

0 comments on commit 7461946

Please sign in to comment.