throw new IllegalArgumentException(
"Distance measure is empty. " +
"It should be specified from Hadoop configuration"
);
}
DistanceMeasure measure;
try {
Class<?> clazz = Class.forName(className);
Object obj = clazz.newInstance();
measure = (DistanceMeasure) obj;
} catch (ClassNotFoundException e) {
throw new IOException(e);
} catch (InstantiationException e) {
throw new IOException(e);
} catch (IllegalAccessException e) {
throw new IOException(e);
}
// Configure distance measure
measure.configure(conf);
return measure;
}