private static void initHiveReadersWriters(Configuration conf,
JythonJob jythonJob, PythonInterpreter interpreter) {
if (!userTypeIsJavaPrimitiveWritable(jythonJob.getVertex_id())) {
checkTypeWithHive(jythonJob.getVertex_id(), GraphType.VERTEX_ID);
LanguageAndType idReader = processUserType(
jythonJob.getVertex_id().getHive_reader(), interpreter);
checkImplements(idReader, JythonHiveReader.class, interpreter);
checkArgument(idReader.getLanguage() == Language.JYTHON);
GiraphHiveConstants.VERTEX_ID_READER_JYTHON_NAME.set(conf,
idReader.getJythonClassName());
LanguageAndType idWriter = processUserType(
jythonJob.getVertex_id().getHive_writer(), interpreter);
checkImplements(idWriter, JythonHiveWriter.class, interpreter);
checkArgument(idWriter.getLanguage() == Language.JYTHON);
GiraphHiveConstants.VERTEX_ID_WRITER_JYTHON_NAME.set(conf,
idWriter.getJythonClassName());
}
if (hasVertexInputs(jythonJob) &&
!userTypeIsJavaPrimitiveWritable(jythonJob.getVertex_value())) {
checkTypeWithHive(jythonJob.getVertex_value(), GraphType.VERTEX_VALUE);
LanguageAndType valueReader = processUserType(
jythonJob.getVertex_value().getHive_reader(), interpreter);
checkImplements(valueReader, JythonHiveReader.class, interpreter);
checkArgument(valueReader.getLanguage() == Language.JYTHON);
VERTEX_VALUE_READER_JYTHON_NAME.set(conf,
valueReader.getJythonClassName());
LanguageAndType valueWriter = processUserType(
jythonJob.getVertex_value().getHive_writer(), interpreter);
checkImplements(valueWriter, JythonHiveWriter.class, interpreter);
checkArgument(valueWriter.getLanguage() == Language.JYTHON);
VERTEX_VALUE_WRITER_JYTHON_NAME.set(conf,
valueWriter.getJythonClassName());
}
if (hasEdgeInputs(jythonJob) &&
!userTypeIsJavaPrimitiveWritable(jythonJob.getEdge_value())) {
checkNotNull(jythonJob.getEdge_value().getHive_reader(),
"edge_value.hive_reader cannot be null");
LanguageAndType edgeReader = processUserType(
jythonJob.getEdge_value().getHive_reader(), interpreter);
checkImplements(edgeReader, JythonHiveReader.class, interpreter);
checkArgument(edgeReader.getLanguage() == Language.JYTHON);
GiraphHiveConstants.EDGE_VALUE_READER_JYTHON_NAME.set(conf,
edgeReader.getJythonClassName());
}
}