make taskId=0 and streamId empty and metricName remain the string after `.`.
10921
public static String task2MergeCompName(String old) {
        String[] parts = old.split(DELIM);
        if (parts.length >= 7) {
            parts[0] = MetaType.COMPONENT.getV() + parts[0].charAt(1);
            parts[parts.length - 3] = EMPTY;
            parts[parts.length - 4] = "0";

            String metricName = getMergeMetricName(parts[parts.length - 1]);
            parts[parts.length - 1] = metricName;
        }
        return concat(parts);
    }
1305836
private static String getPathForWorker(Protos.TaskID taskID) {
		checkNotNull(taskID, "taskID");
		return String.format("/%s", taskID.getValue());
	}
1076881
def write_metrics(baseName, values):
    
    m = open(baseName  + '_metrics.txt', 'w')
    for key in values:
        m.write(key + '=' + str(values[key]) + "\n")
    m.flush()
    m.close()
690132
function cancelTask(proc, taskId) {
  const taskProcs = proc.tasks[taskId];
  delete proc.tasks[taskId];

  for (const execId in taskProcs) {
    const taskCall = taskProcs[execId];
    if (taskCall && taskCall.cancel) {
      taskCall.cancel();
    }
  }
}
635802
public void skipTaskFromWorkflow(String workflowId, String taskReferenceName) {
        Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "workflow id cannot be blank");
        Preconditions.checkArgument(StringUtils.isNotBlank(taskReferenceName), "Task reference name cannot be blank");
        stub.skipTaskFromWorkflow(WorkflowServicePb.SkipTaskRequest.newBuilder()
                .setWorkflowId(workflowId)
                .setTaskReferenceName(taskReferenceName)
                .build()
        );
    }
665266
public void setStreamName(String streamName) {
    Validator.validate(!Validator.isBlank(streamName), "streamName cannot be blank");
    this.streamName = streamName.trim();
  }
178403
def play_empty(self):
        """"""
        if self.vclient:
            if self.streamer:
                self.streamer.volume = 0
            self.vclient.play_audio("\n".encode(), encode=False)
148239
def de_blank(val):
    """"""
    ret = list(val)
    if type(val) == list:
        for idx, item in enumerate(val):
            if item.strip() == '':
                ret.remove(item)
            else:
                ret[idx] = item.strip()
    return ret
684214
def emptyElement(self, name, attrs):
        """"""
        attr = ' '.join('%s=%s' % (n, quoteattr(scientificformat(v)))
                        for n, v in sorted(attrs.items()))
        self._write('<%s %s/>' % (name, attr))
983065
protected void setMetric(String metric) {
        requireArgument(metric != null && !metric.isEmpty(), "Metric name cannot be null or empty.");
        _metric = metric;
    }
482283
public static int getAttemptId(Configuration conf)
      throws IllegalArgumentException {
    if (conf == null) {
      throw new NullPointerException("Conf is null");
    }

    String taskId = conf.get("mapred.task.id");
    if (taskId == null) {
      throw new IllegalArgumentException(
          "Configuration does not contain the property mapred.task.id");
    }

    String[] parts = taskId.split("_");
    if (parts.length != 6 ||
        !parts[0].equals("attempt") ||
        (!"m".equals(parts[3]) && !"r".equals(parts[3]))) {
      throw new IllegalArgumentException(
          "TaskAttemptId string : " + taskId + " is not properly formed");
    }

    return Integer.parseInt(parts[5]);
  }
693749
private static String getForkMetricsName(TaskMetrics taskMetrics, State state, int index) {
    return taskMetrics.getName() + "." + getForkMetricsId(state, index);
  }
1129216
public void resetCallbacksForInProgressTasks(String workflowId) {
        Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "workflow id cannot be blank");
        stub.resetWorkflowCallbacks(WorkflowServicePb.ResetWorkflowCallbacksRequest.newBuilder()
                .setWorkflowId(workflowId)
                .build()
        );
    }
84841
public String getUserName(TaskAttemptID taskId) {
    TaskInProgress tip = tasks.get(taskId);
    if (tip != null) {
      return tip.getJobConf().getUser();
    }
    return null;
  }
1051894
public void setStringIfNotEmpty(@NotNull final String key, @Nullable final String value) {
        if (null != value && !value.isEmpty()) {
            setString(key, value);
        }
    }
250513
private void checkAttempt(TaskAttemptID attemptId) throws IOException {
    if (!attemptId.equals(currentAttemptId)) {
      throw new IOException("Attempt " + attemptId
          + " does not match current attempt " + currentAttemptId);
    }
  }
723791
public void remove(String id) {
		final Lock writeLock = lock.writeLock();
		try {
			writeLock.lock();
			final int index = ids.indexOf(id);
			if (index > -1) {
				tasks.remove(index);
				patterns.remove(index);
				ids.remove(index);
				size--;
			}
		} finally {
			writeLock.unlock();
		}
	}