Class JobManagerMetricGroup
- java.lang.Object
-
- org.apache.flink.runtime.metrics.groups.AbstractMetricGroup<P>
-
- org.apache.flink.runtime.metrics.groups.ComponentMetricGroup<JobManagerMetricGroup>
-
- org.apache.flink.runtime.metrics.groups.JobManagerMetricGroup
-
- All Implemented Interfaces:
org.apache.flink.metrics.MetricGroup
,LocallyCleanableResource
- Direct Known Subclasses:
UnregisteredMetricGroups.UnregisteredJobManagerMetricGroup
public class JobManagerMetricGroup extends ComponentMetricGroup<JobManagerMetricGroup> implements LocallyCleanableResource
SpecialMetricGroup
representing a JobManager.Contains extra logic for adding jobs with tasks, and removing jobs when they do not contain tasks any more
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.runtime.metrics.groups.AbstractMetricGroup
AbstractMetricGroup.ChildType
-
-
Field Summary
-
Fields inherited from class org.apache.flink.runtime.metrics.groups.AbstractMetricGroup
LOG, parent, queryServiceScopeInfo, registry, variables
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JobManagerJobMetricGroup
addJob(org.apache.flink.api.common.JobID jobId, String jobName)
static JobManagerMetricGroup
createJobManagerMetricGroup(MetricRegistry metricRegistry, String hostname)
protected QueryScopeInfo.JobManagerQueryScopeInfo
createQueryServiceMetricInfo(org.apache.flink.metrics.CharacterFilter filter)
Creates the metric query service scope for this group.protected String
getGroupName(org.apache.flink.metrics.CharacterFilter filter)
Returns the name for this group, meaning what kind of entity it represents, for example "taskmanager".String
hostname()
CompletableFuture<Void>
localCleanupAsync(org.apache.flink.api.common.JobID jobId, Executor ignoredExecutor)
localCleanupAsync
is expected to be called from the main thread.int
numRegisteredJobMetricGroups()
protected void
putVariables(Map<String,String> variables)
Enters all variables specific to thisAbstractMetricGroup
and their associated values into the map.protected Iterable<? extends ComponentMetricGroup>
subComponents()
Gets all component metric groups that are contained in this component metric group.-
Methods inherited from class org.apache.flink.runtime.metrics.groups.ComponentMetricGroup
close
-
Methods inherited from class org.apache.flink.runtime.metrics.groups.AbstractMetricGroup
addGroup, addGroup, addMetric, addSpan, counter, counter, createChildGroup, createLogicalScope, gauge, getAllVariables, getAllVariables, getLogicalScope, getLogicalScope, getMetricIdentifier, getMetricIdentifier, getMetricIdentifier, getQueryServiceMetricInfo, getScopeComponents, histogram, isClosed, meter
-
-
-
-
Method Detail
-
createJobManagerMetricGroup
public static JobManagerMetricGroup createJobManagerMetricGroup(MetricRegistry metricRegistry, String hostname)
-
hostname
public String hostname()
-
createQueryServiceMetricInfo
protected QueryScopeInfo.JobManagerQueryScopeInfo createQueryServiceMetricInfo(org.apache.flink.metrics.CharacterFilter filter)
Description copied from class:AbstractMetricGroup
Creates the metric query service scope for this group.- Specified by:
createQueryServiceMetricInfo
in classAbstractMetricGroup<JobManagerMetricGroup>
- Parameters:
filter
- character filter- Returns:
- query service scope
-
addJob
public JobManagerJobMetricGroup addJob(org.apache.flink.api.common.JobID jobId, String jobName)
-
localCleanupAsync
public CompletableFuture<Void> localCleanupAsync(org.apache.flink.api.common.JobID jobId, Executor ignoredExecutor)
Description copied from interface:LocallyCleanableResource
localCleanupAsync
is expected to be called from the main thread. Heavy IO tasks should be outsourced into the passedcleanupExecutor
. Thread-safety must be ensured.- Specified by:
localCleanupAsync
in interfaceLocallyCleanableResource
- Parameters:
jobId
- TheJobID
of the job for which the local data should be cleaned up.ignoredExecutor
- The fallback executor for IO-heavy operations.- Returns:
- The cleanup result future.
-
numRegisteredJobMetricGroups
public int numRegisteredJobMetricGroups()
-
putVariables
protected void putVariables(Map<String,String> variables)
Description copied from class:AbstractMetricGroup
Enters all variables specific to thisAbstractMetricGroup
and their associated values into the map.- Overrides:
putVariables
in classAbstractMetricGroup<JobManagerMetricGroup>
- Parameters:
variables
- map to enter variables and their values into
-
subComponents
protected Iterable<? extends ComponentMetricGroup> subComponents()
Description copied from class:ComponentMetricGroup
Gets all component metric groups that are contained in this component metric group.- Specified by:
subComponents
in classComponentMetricGroup<JobManagerMetricGroup>
- Returns:
- All component metric groups that are contained in this component metric group.
-
getGroupName
protected String getGroupName(org.apache.flink.metrics.CharacterFilter filter)
Description copied from class:AbstractMetricGroup
Returns the name for this group, meaning what kind of entity it represents, for example "taskmanager".- Specified by:
getGroupName
in classAbstractMetricGroup<JobManagerMetricGroup>
- Parameters:
filter
- character filter which is applied to the name- Returns:
- logical name for this group
-
-