@Override public void map(final Vertex vertex, final MapEmitter<NullObject, Integer> emitter) { emitter.emit(1); assertEquals(1, WORKER_START.size()); assertTrue(WORKER_START.contains(Stage.MAP)); }
@Override public void map(final Vertex vertex, final MapEmitter<Integer, Integer> emitter) { emitter.emit(vertex.<String>value("name").length(), vertex.<String>value("name").length()); }
@Override public void map(final Vertex vertex, final MapEmitter<Integer, Integer> emitter) { emitter.emit(vertex.<String>value("name").length(), vertex.<String>value("name").length()); }
@Override public void safeMap(final Vertex vertex, final MapEmitter<Serializable, Long> emitter) { if (vertex.property((String) persistentProperties.get(CLUSTER_LABEL)).isPresent()) { emitter.emit(vertex.value((String) persistentProperties.get(CLUSTER_LABEL)), 1L); } else { emitter.emit(NullObject.instance(), 0L); } }
@Override public void safeMap(final Vertex vertex, final MapEmitter<Serializable, Set<ConceptId>> emitter) { if (vertex.property((String) persistentProperties.get(CLUSTER_LABEL)).isPresent()) { String clusterPropertyKey = (String) persistentProperties.get(CLUSTER_LABEL); String clusterId = vertex.value(clusterPropertyKey); ConceptId conceptId = ConceptId.of(vertex.value(Schema.VertexProperty.ID.name())); Set<ConceptId> cluster = Collections.singleton(conceptId); emitter.emit(clusterId, cluster); } else { emitter.emit(NullObject.instance(), Collections.emptySet()); } }
/** * A default method that assumes the key is {@link org.apache.tinkerpop.gremlin.process.computer.MapReduce.NullObject}. * * @param value the value to emit. */ public default void emit(final V value) { this.emit((K) MapReduce.NullObject.instance(), value); } }
@Override public void safeMap(final Vertex vertex, final MapEmitter<Serializable, Set<ConceptId>> emitter) { if (vertex.property((String) persistentProperties.get(DegreeVertexProgram.DEGREE)).isPresent() && vertexHasSelectedTypeId(vertex, selectedTypes)) { String degreePropertyKey = (String) persistentProperties.get(DegreeVertexProgram.DEGREE); Long centralityCount = vertex.value(degreePropertyKey); ConceptId conceptId = ConceptId.of(vertex.value(Schema.VertexProperty.ID.name())); emitter.emit(centralityCount, Collections.singleton(conceptId)); } else { emitter.emit(NullObject.instance(), Collections.emptySet()); } }
@Override public void safeMap(final Vertex vertex, final MapEmitter<Serializable, Number> emitter) { Number value = resourceIsValid(vertex) ? resourceValue(vertex) : maxValue(); emitter.emit(NullObject.instance(), value); }
@Override public void map(final Vertex vertex, final MapEmitter<NullObject, Integer> emitter) { emitter.emit(1); switch (this.state) { case VertexProgramM.SOFTWARE_ONLY: {
@Override public void map(final Vertex vertex, final MapEmitter<Integer, Integer> emitter) { vertex.<Integer>property("age").ifPresent(age -> emitter.emit(age, age)); }
@Override public void map(final Vertex vertex, final MapEmitter<Serializable, Long> emitter) { final Property<Serializable> cluster = vertex.property(PeerPressureVertexProgram.CLUSTER); if (cluster.isPresent()) { emitter.emit(cluster.value(), 1l); } }
/** * A default method that assumes the key is {@link org.apache.tinkerpop.gremlin.process.computer.MapReduce.NullObject}. * * @param value the value to emit. */ public default void emit(final V value) { this.emit((K) MapReduce.NullObject.instance(), value); } }
@Override public void map(final Vertex vertex, final MapEmitter<NullObject, Serializable> emitter) { final Property<Serializable> cluster = vertex.property(PeerPressureVertexProgram.CLUSTER); if (cluster.isPresent()) { emitter.emit(NullObject.instance(), cluster.value()); } }
@Override public void map(final Vertex vertex, final MapEmitter<Object, Double> emitter) { final Property pageRank = vertex.property(PageRankVertexProgram.PAGE_RANK); if (pageRank.isPresent()) { emitter.emit(vertex.id(), (Double) pageRank.value()); } }
@Override public void map(Vertex vertex, MapEmitter<Long, Integer> emitter) { emitter.emit((Long)vertex.id(),vertex.value(DegreeCounter.DEGREE)); }
@Override public void map(final Vertex vertex, final MapEmitter<Object, Long> emitter) { final Property distance = vertex.property(ShortestDistanceVertexProgram.DISTANCE); if (distance.isPresent()) { emitter.emit(vertex.id(), (Long) distance.value()); } }
@Override public void map(final Vertex vertex, final MapEmitter<Object, Double> emitter) { final Property pageRank = vertex.property(PageRankVertexProgram.PAGE_RANK); if (pageRank.isPresent()) { emitter.emit(vertex.id(), (Double) pageRank.value()); } }
@Override public void map(Vertex vertex, MapEmitter<Long, Integer> emitter) { emitter.emit((Long)vertex.id(),vertex.value(DegreeCounter.DEGREE)); }
@Override public void map(final Vertex vertex, final MapEmitter<Object, Double> emitter) { final Property pageRank = vertex.property(PageRankVertexProgram.PAGE_RANK); if (pageRank.isPresent()) { emitter.emit(vertex.id(), (Double) pageRank.value()); } }
@Override public void map(final Vertex vertex, final MapEmitter<Object, Long> emitter) { final Property distance = vertex.property(ShortestDistanceVertexProgram.DISTANCE); if (distance.isPresent()) { emitter.emit(vertex.id(), (Long) distance.value()); } }