@NotThreadSafe public final class HeartbeatThread extends Object implements Runnable
Modifier and Type | Class and Description |
---|---|
static class |
HeartbeatThread.Status
Enum representing the status of HeartbeatThread.
|
Modifier and Type | Method and Description |
---|---|
static String |
generateThreadName(String executorName,
String threadId) |
HeartbeatThread.Status |
getStatus() |
void |
run() |
public HeartbeatThread(String executorName, String threadId, HeartbeatExecutor executor, java.util.function.Supplier<SleepIntervalSupplier> intervalSupplier, AlluxioConfiguration conf, UserState userState, java.time.Clock clock)
Runnable
to execute heartbeats for the given HeartbeatExecutor
.
This class is responsible for closing the given HeartbeatExecutor
when it finishes.executorName
- identifies the heartbeat thread's executor, should be those defined in
HeartbeatContext
threadId
- the thread identifier, normally, it is empty, but if a heartbeat
executor is started in multiple threads, this can be used to distinguish them, the heartbeat
thread's name is a combination of executorName and threadIdexecutor
- identifies the heartbeat thread executor; an instance of a class that
implements the HeartbeatExecutor interfaceintervalSupplier
- Sleep time between different heartbeat supplierconf
- Alluxio configurationuserState
- the user state for this heartbeat threadclock
- the clock used to compute the current timepublic HeartbeatThread(String executorName, HeartbeatExecutor executor, java.util.function.Supplier<SleepIntervalSupplier> intervalSupplier, AlluxioConfiguration conf, UserState userState)
HeartbeatThread(String, String, HeartbeatExecutor, Supplier, AlluxioConfiguration,
UserState, Clock)
where threadId is null.executorName
- the executor name that is one of those defined in HeartbeatContext
executor
- the heartbeat executorintervalSupplier
- the interval between heartbeats supplierconf
- the Alluxio configurationuserState
- the user state for this heartbeat threadpublic HeartbeatThread(String executorName, HeartbeatExecutor executor, java.util.function.Supplier<SleepIntervalSupplier> intervalSupplier, AlluxioConfiguration conf, UserState userState, java.time.Clock clock)
HeartbeatThread(String, String, HeartbeatExecutor, Supplier, AlluxioConfiguration,
UserState, Clock)
where threadId is null.executorName
- the executor name that is one of those defined in HeartbeatContext
executor
- the heartbeat executorintervalSupplier
- the interval between heartbeats supplierconf
- the Alluxio configurationuserState
- the user state for this heartbeat threadclock
- the clock used to compute the current timepublic static String generateThreadName(String executorName, String threadId)
executorName
- the executor name defined in HeartbeatContext
threadId
- the thread identifierpublic HeartbeatThread.Status getStatus()
Copyright © 2023. All Rights Reserved.