@Override public void loadState(final Graph graph, final Configuration configuration) { maxDepth = configuration.getInt(MAX_DEPTH); seed = configuration.getLong(SEED); weightProperty = configuration.getString(WEIGHT_PROPERTY, "distance"); incidentMessageScope = MessageScope.Local.of(__::inE, (msg, edge) -> msg + edge.<Integer>value(weightProperty)); log.debug("Loaded maxDepth={}", maxDepth); }
@Override public void loadState(final Graph graph, final Configuration configuration) { maxDepth = configuration.getInt(MAX_DEPTH); seed = configuration.getLong(SEED); weightProperty = configuration.getString(WEIGHT_PROPERTY, "distance"); incidentMessageScope = MessageScope.Local.of(__::inE, (msg, edge) -> msg + edge.<Integer>value(weightProperty)); log.debug("Loaded maxDepth={}", maxDepth); }
private BulkLoaderVertexProgram() { messageScope = MessageScope.Local.of(__::inE); elementComputeKeys = new HashSet<>(); }
@Override public void loadState(final Graph graph, final Configuration config) { configuration = new BaseConfiguration(); if (config != null) { ConfigurationUtils.copy(config, configuration); } if (configuration.containsKey(EDGE_TRAVERSAL)) { this.edgeTraversal = PureTraversal.loadState(configuration, EDGE_TRAVERSAL, graph); this.scope = MessageScope.Local.of(() -> this.edgeTraversal.get().clone()); } scopes = new HashSet<>(Collections.singletonList(scope)); this.property = configuration.getString(PROPERTY, COMPONENT); this.haltedTraversers = TraversalVertexProgram.loadHaltedTraversers(configuration); this.haltedTraversersIndex = new IndexedTraverserSet<>(v -> v); for (final Traverser.Admin<Vertex> traverser : this.haltedTraversers) { this.haltedTraversersIndex.add(traverser.split()); } }
@Override public void loadState(final Graph graph, final Configuration configuration) { if (configuration.containsKey(INITIAL_RANK_TRAVERSAL)) this.initialRankTraversal = PureTraversal.loadState(configuration, INITIAL_RANK_TRAVERSAL, graph); if (configuration.containsKey(EDGE_TRAVERSAL)) { this.edgeTraversal = PureTraversal.loadState(configuration, EDGE_TRAVERSAL, graph); this.incidentMessageScope = MessageScope.Local.of(() -> this.edgeTraversal.get().clone()); this.countMessageScope = MessageScope.Local.of(new MessageScope.Local.ReverseTraversalSupplier(this.incidentMessageScope)); } this.alpha = configuration.getDouble(ALPHA, this.alpha); this.epsilon = configuration.getDouble(EPSILON, this.epsilon); this.maxIterations = configuration.getInt(MAX_ITERATIONS, 20); this.property = configuration.getString(PROPERTY, PAGE_RANK); this.vertexComputeKeys = new HashSet<>(Arrays.asList( VertexComputeKey.of(this.property, false), VertexComputeKey.of(EDGE_COUNT, true))); this.memoryComputeKeys = new HashSet<>(Arrays.asList( MemoryComputeKey.of(TELEPORTATION_ENERGY, Operator.sum, true, true), MemoryComputeKey.of(VERTEX_COUNT, Operator.sum, true, true), MemoryComputeKey.of(CONVERGENCE_ERROR, Operator.sum, false, true))); }
private BulkLoaderVertexProgram() { messageScope = MessageScope.Local.of(__::inE); elementComputeKeys = new HashSet<>(); }
@Override public void loadState(final Graph graph, final Configuration configuration) { if (configuration.containsKey(INITIAL_VOTE_STRENGTH_TRAVERSAL)) this.initialVoteStrengthTraversal = PureTraversal.loadState(configuration, INITIAL_VOTE_STRENGTH_TRAVERSAL, graph); if (configuration.containsKey(EDGE_TRAVERSAL)) { this.edgeTraversal = PureTraversal.loadState(configuration, EDGE_TRAVERSAL, graph); this.voteScope = MessageScope.Local.of(() -> this.edgeTraversal.get().clone()); this.countScope = MessageScope.Local.of(new MessageScope.Local.ReverseTraversalSupplier(this.voteScope)); } this.property = configuration.getString(PROPERTY, CLUSTER); this.maxIterations = configuration.getInt(MAX_ITERATIONS, 30); this.distributeVote = configuration.getBoolean(DISTRIBUTE_VOTE, false); }
@Override public void loadState(final Graph graph, final Configuration configuration) { if (configuration.containsKey(INITIAL_RANK_TRAVERSAL)) this.initialRankTraversal = PureTraversal.loadState(configuration, INITIAL_RANK_TRAVERSAL, graph); if (configuration.containsKey(EDGE_TRAVERSAL)) { this.edgeTraversal = PureTraversal.loadState(configuration, EDGE_TRAVERSAL, graph); this.incidentMessageScope = MessageScope.Local.of(() -> this.edgeTraversal.get().clone()); this.countMessageScope = MessageScope.Local.of(new MessageScope.Local.ReverseTraversalSupplier(this.incidentMessageScope)); } this.alpha = configuration.getDouble(ALPHA, this.alpha); this.epsilon = configuration.getDouble(EPSILON, this.epsilon); this.maxIterations = configuration.getInt(MAX_ITERATIONS, 20); this.property = configuration.getString(PROPERTY, PAGE_RANK); this.vertexComputeKeys = new HashSet<>(Arrays.asList( VertexComputeKey.of(this.property, false), VertexComputeKey.of(EDGE_COUNT, true))); this.memoryComputeKeys = new HashSet<>(Arrays.asList( MemoryComputeKey.of(TELEPORTATION_ENERGY, Operator.sum, true, true), MemoryComputeKey.of(VERTEX_COUNT, Operator.sum, true, true), MemoryComputeKey.of(CONVERGENCE_ERROR, Operator.sum, false, true))); }
@Override public void loadState(final Graph graph, final Configuration config) { configuration = new BaseConfiguration(); if (config != null) { ConfigurationUtils.copy(config, configuration); } if (configuration.containsKey(EDGE_TRAVERSAL)) { this.edgeTraversal = PureTraversal.loadState(configuration, EDGE_TRAVERSAL, graph); this.scope = MessageScope.Local.of(() -> this.edgeTraversal.get().clone()); } scopes = new HashSet<>(Collections.singletonList(scope)); this.property = configuration.getString(PROPERTY, COMPONENT); this.haltedTraversers = TraversalVertexProgram.loadHaltedTraversers(configuration); this.haltedTraversersIndex = new IndexedTraverserSet<>(v -> v); for (final Traverser.Admin<Vertex> traverser : this.haltedTraversers) { this.haltedTraversersIndex.add(traverser.split()); } }
@Override public void loadState(final Graph graph, final Configuration configuration) { if (configuration.containsKey(INITIAL_VOTE_STRENGTH_TRAVERSAL)) this.initialVoteStrengthTraversal = PureTraversal.loadState(configuration, INITIAL_VOTE_STRENGTH_TRAVERSAL, graph); if (configuration.containsKey(EDGE_TRAVERSAL)) { this.edgeTraversal = PureTraversal.loadState(configuration, EDGE_TRAVERSAL, graph); this.voteScope = MessageScope.Local.of(() -> this.edgeTraversal.get().clone()); this.countScope = MessageScope.Local.of(new MessageScope.Local.ReverseTraversalSupplier(this.voteScope)); } this.property = configuration.getString(PROPERTY, CLUSTER); this.maxIterations = configuration.getInt(MAX_ITERATIONS, 30); this.distributeVote = configuration.getBoolean(DISTRIBUTE_VOTE, false); }