@SuppressWarnings("rawtypes")
	public static String getCustomJobName(String className, JobContext job,
                                  Class<? extends Mapper> mapper,
                                  Class<? extends Reducer> reducer) {
    StringBuilder name = new StringBuilder(100);
    String customJobName = job.getJobName();
    if (customJobName == null || customJobName.trim().isEmpty()) {
      name.append(className);
    } else {
      name.append(customJobName);
    }
    name.append('-').append(mapper.getSimpleName());
    if (reducer != null) {
    	name.append('-').append(reducer.getSimpleName());
    }
    return name.toString();
  }
Beispiel #2
0
 private static String toJsonString(final Class<?> clazz, final Object value) {
   return toJsonString(clazz.getSimpleName(), value);
 }