public RCFileColumn(Config columnConfig, Configuration conf) {
this.conf = conf;
Configs configs = new Configs();
this.inputField = configs.getInt(columnConfig, "inputField");
if (inputField < 0) {
throw new MorphlineCompilationException(
"Invalid column inputField specified: " + inputField, columnConfig);
}
this.outputField = configs.getString(columnConfig, "outputField");
String writableClassString = configs.getString(columnConfig, "writableClass");
if (writableClassString == null || writableClassString.isEmpty()) {
throw new MorphlineCompilationException(
"No writableClass specified for column " + outputField, columnConfig);
}
try {
Class clazz = Class.forName(writableClassString);
if (!Writable.class.isAssignableFrom(clazz)) {
throw new MorphlineCompilationException("writableClass provided "
+ writableClassString + " for column " + outputField
+ " does not implement " + Writable.class.getName(), columnConfig);
}
this.writableClass = clazz;
} catch (ClassNotFoundException e) {
throw new MorphlineCompilationException("Could not load class "
+ writableClassString + " definition", columnConfig, e);
}
configs.validateArguments(columnConfig);
}