Package org.apache.hadoop.fs
Class DelegationTokenRenewer
java.lang.Object
java.lang.Thread
org.apache.hadoop.util.concurrent.SubjectInheritingThread
org.apache.hadoop.fs.DelegationTokenRenewer
- All Implemented Interfaces:
Runnable
A daemon thread that waits for the next file system to renew.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe renewable interface used by the renewer.static classAn action that will renew and replace the file system's delegation tokens automatically.Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Method Summary
Modifier and TypeMethodDescriptionaddRenewAction(T fs) Add a renew action to the queue.static DelegationTokenRenewerprotected intFor testing purposes.<T extends FileSystem & DelegationTokenRenewer.Renewable>
voidremoveRenewAction(T fs) Remove the associated renew action from the queuevoidwork()This is the equivalent ofThread.run().Methods inherited from class org.apache.hadoop.util.concurrent.SubjectInheritingThread
run, startMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, suspend, toString, yield
-
Field Details
-
renewCycle
@Private @VisibleForTesting public static long renewCycle
-
-
Method Details
-
getRenewQueueLength
@VisibleForTesting protected int getRenewQueueLength()For testing purposes.- Returns:
- renew queue length.
-
getInstance
-
addRenewAction
public <T extends FileSystem & DelegationTokenRenewer.Renewable> DelegationTokenRenewer.RenewAction<T> addRenewAction(T fs) Add a renew action to the queue.- Type Parameters:
T- generic type T.- Parameters:
fs- file system.- Returns:
- renew action.
-
removeRenewAction
public <T extends FileSystem & DelegationTokenRenewer.Renewable> void removeRenewAction(T fs) throws IOException Remove the associated renew action from the queue- Type Parameters:
T- generic type T.- Parameters:
fs- file system.- Throws:
IOException- raised on errors performing I/O.
-
work
public void work()Description copied from class:SubjectInheritingThreadThis is the equivalent ofThread.run(). Override this instead ofSubjectInheritingThread.run()Subject will be propagated like in pre-Java 22 Thread.- Overrides:
workin classSubjectInheritingThread
-