Class ScopeFormat
- java.lang.Object
-
- org.apache.flink.runtime.metrics.scope.ScopeFormat
-
- Direct Known Subclasses:
JobManagerJobScopeFormat,JobManagerOperatorScopeFormat,JobManagerScopeFormat,OperatorScopeFormat,TaskManagerJobScopeFormat,TaskManagerScopeFormat,TaskScopeFormat
public abstract class ScopeFormat extends Object
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
Fields Modifier and Type Field Description static StringSCOPE_HOSTstatic StringSCOPE_INHERIT_PARENTIf the scope format starts with this character, then the parent components scope format will be used as a prefix.static StringSCOPE_JOB_IDstatic StringSCOPE_JOB_NAMEstatic StringSCOPE_OPERATOR_IDstatic StringSCOPE_OPERATOR_NAMEstatic StringSCOPE_SEPARATORstatic StringSCOPE_TASK_ATTEMPT_IDstatic StringSCOPE_TASK_ATTEMPT_NUMstatic StringSCOPE_TASK_NAMEstatic StringSCOPE_TASK_SUBTASK_INDEXstatic StringSCOPE_TASK_VERTEX_IDstatic StringSCOPE_TASKMANAGER_ID
-
Constructor Summary
Constructors Modifier Constructor Description protectedScopeFormat(String format, ScopeFormat parent, String[] variables)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static HashMap<String,Integer>arrayToMap(String[] array)static StringasVariable(String scope)Formats the given string to resemble a scope variable.protected String[]bindVariables(String[] template, String[] values)static Stringconcat(org.apache.flink.metrics.CharacterFilter filter, Character delimiter, String... components)Concatenates the given component names separated by the delimiter character.protected String[]copyTemplate()Stringformat()StringtoString()protected static StringvalueOrNull(Object value)
-
-
-
Field Detail
-
SCOPE_INHERIT_PARENT
public static final String 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:
- Constant Field Values
-
SCOPE_SEPARATOR
public static final String SCOPE_SEPARATOR
- See Also:
- Constant Field Values
-
SCOPE_HOST
public static final String SCOPE_HOST
-
SCOPE_TASKMANAGER_ID
public static final String SCOPE_TASKMANAGER_ID
-
SCOPE_JOB_ID
public static final String SCOPE_JOB_ID
-
SCOPE_JOB_NAME
public static final String SCOPE_JOB_NAME
-
SCOPE_TASK_VERTEX_ID
public static final String SCOPE_TASK_VERTEX_ID
-
SCOPE_TASK_NAME
public static final String SCOPE_TASK_NAME
-
SCOPE_TASK_ATTEMPT_ID
public static final String SCOPE_TASK_ATTEMPT_ID
-
SCOPE_TASK_ATTEMPT_NUM
public static final String SCOPE_TASK_ATTEMPT_NUM
-
SCOPE_TASK_SUBTASK_INDEX
public static final String SCOPE_TASK_SUBTASK_INDEX
-
SCOPE_OPERATOR_ID
public static final String SCOPE_OPERATOR_ID
-
SCOPE_OPERATOR_NAME
public static final String SCOPE_OPERATOR_NAME
-
-
Constructor Detail
-
ScopeFormat
protected ScopeFormat(String format, ScopeFormat parent, String[] variables)
-
-
Method Detail
-
format
public String format()
-
copyTemplate
protected final String[] copyTemplate()
-
asVariable
public static String asVariable(String scope)
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
-
-