@ThreadSafe public class MetricsHeartbeatContext extends Object
addHeartbeat(ClientContext, MasterInquireClient)
with the necessary arguments.
For each separate set of connection details, a new instance of this class is created. As
FileSystemContexts are closed, they remove themselves from the internal metrics heartbeat.
When a context reaches 0 tracked contexts it will automatically close and remove itself from
the internal MASTER_METRICS_HEARTBEAT map.
When the final FileSystemContext closes and removes its heartbeat from metrics it will also
shutdown and close the executor service until a new FileSystemContext
is created.Modifier and Type | Method and Description |
---|---|
static void |
addHeartbeat(ClientContext ctx,
MasterInquireClient inquireClient)
Sets up a new metrics heartbeat with the given client information.
|
static void |
removeHeartbeat(ClientContext ctx)
Removes an application from the metrics heartbeat.
|
public static void addHeartbeat(ClientContext ctx, MasterInquireClient inquireClient)
ctx
- The application's client contextinquireClient
- the master inquire client used to connect to the masterpublic static void removeHeartbeat(ClientContext ctx)
ctx
- The client context used to register the heartbeatCopyright © 2023. All Rights Reserved.