public Map<String, String> getAllVariables() { if (variables == null) { Map<String, String> tmpVariables = new HashMap<>(); putVariables(tmpVariables); if (parent != null) { // not true for Job-/TaskManagerMetricGroup tmpVariables.putAll(parent.getAllVariables()); } variables = tmpVariables; } return variables; }
public Map<String, String> getAllVariables() { if (variables == null) { // avoid synchronization for common case synchronized (this) { if (variables == null) { Map<String, String> tmpVariables = new HashMap<>(); putVariables(tmpVariables); if (parent != null) { // not true for Job-/TaskManagerMetricGroup tmpVariables.putAll(parent.getAllVariables()); } variables = tmpVariables; } } } return variables; }
public Map<String, String> getAllVariables() { if (variables == null) { // avoid synchronization for common case synchronized (this) { if (variables == null) { Map<String, String> tmpVariables = new HashMap<>(); putVariables(tmpVariables); if (parent != null) { // not true for Job-/TaskManagerMetricGroup tmpVariables.putAll(parent.getAllVariables()); } variables = tmpVariables; } } } return variables; }