public abstract class ScopeFormat extends Object
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).
Modifier and Type | Field and Description |
---|---|
static String |
SCOPE_HOST |
static String |
SCOPE_INHERIT_PARENT
If the scope format starts with this character, then the parent components scope format will
be used as a prefix.
|
static String |
SCOPE_JOB_ID |
static String |
SCOPE_JOB_NAME |
static String |
SCOPE_OPERATOR_ID |
static String |
SCOPE_OPERATOR_NAME |
static String |
SCOPE_SEPARATOR |
static String |
SCOPE_TASK_ATTEMPT_ID |
static String |
SCOPE_TASK_ATTEMPT_NUM |
static String |
SCOPE_TASK_NAME |
static String |
SCOPE_TASK_SUBTASK_INDEX |
static String |
SCOPE_TASK_VERTEX_ID |
static String |
SCOPE_TASKMANAGER_ID |
Modifier | Constructor and Description |
---|---|
protected |
ScopeFormat(String format,
ScopeFormat parent,
String[] variables) |
Modifier and Type | Method and Description |
---|---|
protected static HashMap<String,Integer> |
arrayToMap(String[] array) |
static String |
asVariable(String scope)
Formats the given string to resemble a scope variable.
|
protected String[] |
bindVariables(String[] template,
String[] values) |
static String |
concat(CharacterFilter filter,
Character delimiter,
String... components)
Concatenates the given component names separated by the delimiter character.
|
protected String[] |
copyTemplate() |
String |
format() |
String |
toString() |
protected static String |
valueOrNull(Object value) |
public static final String SCOPE_INHERIT_PARENT
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.
public static final String SCOPE_SEPARATOR
public static final String SCOPE_HOST
public static final String SCOPE_TASKMANAGER_ID
public static final String SCOPE_JOB_ID
public static final String SCOPE_JOB_NAME
public static final String SCOPE_TASK_VERTEX_ID
public static final String SCOPE_TASK_NAME
public static final String SCOPE_TASK_ATTEMPT_ID
public static final String SCOPE_TASK_ATTEMPT_NUM
public static final String SCOPE_TASK_SUBTASK_INDEX
public static final String SCOPE_OPERATOR_ID
public static final String SCOPE_OPERATOR_NAME
protected ScopeFormat(String format, ScopeFormat parent, String[] variables)
public String format()
protected final String[] copyTemplate()
public static String asVariable(String scope)
scope
- The string to formatpublic static String concat(CharacterFilter filter, Character delimiter, String... components)
filter
- Character filter to be applied to the component namesdelimiter
- Delimiter to separate component namescomponents
- Array of component namesCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.