/** * Translate {@link Vertex} values using the given {@link TranslateFunction}. * * @param vertices input vertices * @param translator implements conversion from {@code OLD} to {@code NEW} * @param <K> vertex ID type * @param <OLD> old vertex value type * @param <NEW> new vertex value type * @return translated vertices */ public static <K, OLD, NEW> DataSet<Vertex<K, NEW>> translateVertexValues(DataSet<Vertex<K, OLD>> vertices, TranslateFunction<OLD, NEW> translator) { return translateVertexValues(vertices, translator, PARALLELISM_DEFAULT); }
@Override public Graph<K, NEW, EV> runInternal(Graph<K, OLD, EV> input) throws Exception { DataSet<Vertex<K, NEW>> translatedVertices = translateVertexValues(input.getVertices(), translator, parallelism); return Graph.fromDataSet(translatedVertices, input.getEdges(), input.getContext()); } }
/** * Translate {@link Vertex} values using the given {@link TranslateFunction}. * * @param vertices input vertices * @param translator implements conversion from {@code OLD} to {@code NEW} * @param <K> vertex ID type * @param <OLD> old vertex value type * @param <NEW> new vertex value type * @return translated vertices */ public static <K, OLD, NEW> DataSet<Vertex<K, NEW>> translateVertexValues(DataSet<Vertex<K, OLD>> vertices, TranslateFunction<OLD, NEW> translator) { return translateVertexValues(vertices, translator, PARALLELISM_DEFAULT); }
/** * Translate {@link Vertex} values using the given {@link TranslateFunction}. * * @param vertices input vertices * @param translator implements conversion from {@code OLD} to {@code NEW} * @param <K> vertex ID type * @param <OLD> old vertex value type * @param <NEW> new vertex value type * @return translated vertices */ public static <K, OLD, NEW> DataSet<Vertex<K, NEW>> translateVertexValues(DataSet<Vertex<K, OLD>> vertices, TranslateFunction<OLD, NEW> translator) { return translateVertexValues(vertices, translator, PARALLELISM_DEFAULT); }
/** * Translate {@link Vertex} values using the given {@link TranslateFunction}. * * @param vertices input vertices * @param translator implements conversion from {@code OLD} to {@code NEW} * @param <K> vertex ID type * @param <OLD> old vertex value type * @param <NEW> new vertex value type * @return translated vertices */ public static <K, OLD, NEW> DataSet<Vertex<K, NEW>> translateVertexValues(DataSet<Vertex<K, OLD>> vertices, TranslateFunction<OLD, NEW> translator) { return translateVertexValues(vertices, translator, PARALLELISM_DEFAULT); }
@Override public Graph<K, NEW, EV> runInternal(Graph<K, OLD, EV> input) throws Exception { DataSet<Vertex<K, NEW>> translatedVertices = translateVertexValues(input.getVertices(), translator, parallelism); return Graph.fromDataSet(translatedVertices, input.getEdges(), input.getContext()); } }
@Override public Graph<K, NEW, EV> runInternal(Graph<K, OLD, EV> input) throws Exception { DataSet<Vertex<K, NEW>> translatedVertices = translateVertexValues(input.getVertices(), translator, parallelism); return Graph.fromDataSet(translatedVertices, input.getEdges(), input.getContext()); } }
@Override public Graph<K, NEW, EV> runInternal(Graph<K, OLD, EV> input) throws Exception { DataSet<Vertex<K, NEW>> translatedVertices = translateVertexValues(input.getVertices(), translator, parallelism); return Graph.fromDataSet(translatedVertices, input.getEdges(), input.getContext()); } }