From 078ce98de2db76c992e64144391466f03155cc4c Mon Sep 17 00:00:00 2001 From: Yang Yu Date: Fri, 29 Jan 2021 20:31:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Bounded=20IO=20=E7=BA=BF=E7=A8=8B?= =?UTF-8?q?=E6=B1=A0=E6=8B=92=E7=BB=9D=E7=AD=96=E7=95=A5=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正Bounded IO 线程池在等待新任务加入被中断时,抛出 Reject 异常 --- pom.xml | 2 +- src/main/java/org/apache/hadoop/fs/CosFileSystem.java | 5 +++++ src/main/java/org/apache/hadoop/fs/CosNConfigKeys.java | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8fea7f91..678671b2 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.qcloud.cos hadoop-cos - 5.9.1 + 5.9.2 jar Apache Hadoop Tencent Qcloud COS Support diff --git a/src/main/java/org/apache/hadoop/fs/CosFileSystem.java b/src/main/java/org/apache/hadoop/fs/CosFileSystem.java index f4610e2a..b4e5bb32 100644 --- a/src/main/java/org/apache/hadoop/fs/CosFileSystem.java +++ b/src/main/java/org/apache/hadoop/fs/CosFileSystem.java @@ -141,7 +141,12 @@ public void rejectedExecution(Runnable r, } catch (InterruptedException e) { LOG.error("put a io task into the download " + "thread pool occurs an exception.", e); + throw new RejectedExecutionException( + "Putting the io task failed due to the interruption", e); } + } else { + LOG.error("The bounded io thread pool has been shutdown."); + throw new RejectedExecutionException("The bounded io thread pool has been shutdown"); } } } diff --git a/src/main/java/org/apache/hadoop/fs/CosNConfigKeys.java b/src/main/java/org/apache/hadoop/fs/CosNConfigKeys.java index 3e65d3bc..4220e600 100644 --- a/src/main/java/org/apache/hadoop/fs/CosNConfigKeys.java +++ b/src/main/java/org/apache/hadoop/fs/CosNConfigKeys.java @@ -10,7 +10,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-v5.9.1"; + public static final String DEFAULT_USER_AGENT = "cos-hadoop-plugin-v5.9.2"; public static final String TENCENT_EMR_VERSION_KEY = "fs.emr.version";