HBASE-22870 reflection fails to access a private nested class

Signed-off-by Reid Chan <reidchan@apache.org>

Conflicts:
	hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
This commit is contained in:
satanson 2019-08-18 09:47:06 +08:00 committed by Reid Chan
parent befbcbaca8
commit 9e18049957
1 changed files with 5 additions and 3 deletions

View File

@ -1047,9 +1047,11 @@ public class HRegionServer extends HasThread implements
Timer abortMonitor = new Timer("Abort regionserver monitor", true); Timer abortMonitor = new Timer("Abort regionserver monitor", true);
TimerTask abortTimeoutTask = null; TimerTask abortTimeoutTask = null;
try { try {
abortTimeoutTask = Constructor<? extends TimerTask> timerTaskCtor =
Class.forName(conf.get(ABORT_TIMEOUT_TASK, SystemExitWhenAbortTimeout.class.getName())) Class.forName(conf.get(ABORT_TIMEOUT_TASK, SystemExitWhenAbortTimeout.class.getName()))
.asSubclass(TimerTask.class).getDeclaredConstructor().newInstance(); .asSubclass(TimerTask.class).getDeclaredConstructor();
timerTaskCtor.setAccessible(true);
abortTimeoutTask = timerTaskCtor.newInstance();
} catch (Exception e) { } catch (Exception e) {
LOG.warn("Initialize abort timeout task failed", e); LOG.warn("Initialize abort timeout task failed", e);
} }