Class ScopeFormat
java.lang.Object
org.apache.flink.runtime.metrics.scope.ScopeFormat
- Direct Known Subclasses:
JobManagerJobScopeFormat,JobManagerOperatorScopeFormat,JobManagerScopeFormat,OperatorScopeFormat,TaskManagerJobScopeFormat,TaskManagerScopeFormat,TaskScopeFormat
This class represents the format after which the "scope" (or namespace) of the various component
metric groups is built. Component metric groups are for example "TaskManager", "Task", or
"Operator".
User defined scope formats allow users to include or exclude certain identifiers from the scope. The scope for metrics belonging to the "Task" group could for example include the task attempt number (more fine grained identification), or exclude it (continuity of the namespace across failure and recovery).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringIf the scope format starts with this character, then the parent components scope format will be used as a prefix.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedScopeFormat(String format, ScopeFormat parent, String[] variables) -
Method Summary
Modifier and TypeMethodDescriptionarrayToMap(String[] array) static StringasVariable(String scope) Formats the given string to resemble a scope variable.protected final String[]bindVariables(String[] template, String[] values) static StringConcatenates the given component names separated by the delimiter character.protected final String[]format()toString()protected static StringvalueOrNull(Object value)
-
Field Details
-
SCOPE_INHERIT_PARENT
If the scope format starts with this character, then the parent components scope format will be used as a prefix.For example, if the TaskManager's job format is
"*.<job_name>", and the TaskManager format is"<host>", then the job's metrics will have"<host>.<job_name>"as their scope.- See Also:
-
SCOPE_SEPARATOR
- See Also:
-
SCOPE_HOST
-
SCOPE_TASKMANAGER_ID
-
SCOPE_JOB_ID
-
SCOPE_JOB_NAME
-
SCOPE_TASK_VERTEX_ID
-
SCOPE_TASK_NAME
-
SCOPE_TASK_ATTEMPT_ID
-
SCOPE_TASK_ATTEMPT_NUM
-
SCOPE_TASK_SUBTASK_INDEX
-
SCOPE_OPERATOR_ID
-
SCOPE_OPERATOR_NAME
-
-
Constructor Details
-
ScopeFormat
-
-
Method Details
-
format
-
copyTemplate
-
bindVariables
-
toString
-
asVariable
Formats the given string to resemble a scope variable.- Parameters:
scope- The string to format- Returns:
- The formatted string
-
concat
public static String concat(org.apache.flink.metrics.CharacterFilter filter, Character delimiter, String... components) Concatenates the given component names separated by the delimiter character. Additionally the character filter is applied to all component names.- Parameters:
filter- Character filter to be applied to the component namesdelimiter- Delimiter to separate component namescomponents- Array of component names- Returns:
- The concatenated component name
-
valueOrNull
-
arrayToMap
-