/** * Read types from a {@link Configuration}. * First tries to read them directly from the configuration options. * If that doesn't work, tries to infer from {@link TypesHolder}. * * @param conf Configuration * @param <IX> vertex id * @param <VX> vertex value * @param <EX> edge value * @return GiraphTypes */ public static <IX extends WritableComparable, VX extends Writable, EX extends Writable> GiraphTypes<IX, VX, EX> readFrom( Configuration conf) { GiraphTypes<IX, VX, EX> types = new GiraphTypes<IX, VX, EX>(); types.readDirect(conf); if (!types.hasData()) { Class<? extends TypesHolder> klass = getTypesHolderClass(conf); if (klass != null) { types.inferFrom(klass); } } return types; }