コード例 #1
0
  @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();
  }
コード例 #2
0
ファイル: JsonUtil.java プロジェクト: aixuebo/had2.6.0
 private static String toJsonString(final Class<?> clazz, final Object value) {
   return toJsonString(clazz.getSimpleName(), value);
 }