## Class ScatterGatherIteration<K,VV,Message,EV>

• java.lang.Object
• Type Parameters:
`K` - The type of the vertex key (the vertex identifier).
`VV` - The type of the vertex value (the state of the vertex).
`Message` - The type of the message sent between vertices along the edges.
`EV` - The type of the values that are associated with the edges.
All Implemented Interfaces:
CustomUnaryOperation<Vertex<K,VV>,Vertex<K,VV>>

```public class ScatterGatherIteration<K,VV,Message,EV>
extends Object
implements CustomUnaryOperation<Vertex<K,VV>,Vertex<K,VV>>```
This class represents iterative graph computations, programmed in a scatter-gather perspective. It is a special case of Bulk Synchronous Parallel computation.

Scatter-Gather algorithms operate on graphs, which are defined through vertices and edges. The algorithms send messages along the edges and update the state of vertices based on the old state and the incoming messages. All vertices have an initial state. The computation terminates once no vertex updates its state any more. Additionally, a maximum number of iterations (supersteps) may be specified.

The computation is here represented by two functions:

• The `GatherFunction` receives incoming messages and may updates the state for the vertex. If a state is updated, messages are sent from this vertex. Initially, all vertices are considered updated.
• The `ScatterFunction` takes the new vertex state and sends messages along the outgoing edges of the vertex. The outgoing edges may optionally have an associated value, such as a weight.

Scatter-Gather graph iterations are are run by calling `Graph.runScatterGatherIteration(ScatterFunction, GatherFunction, int)`.

• ### Method Summary

All Methods
Modifier and Type Method and Description
`void` `configure(ScatterGatherConfiguration parameters)`
Configures this scatter-gather iteration with the provided parameters.
`DataSet<Vertex<K,VV>>` `createResult()`
Creates the operator that represents this scatter-gather graph computation.
`ScatterGatherConfiguration` `getIterationConfiguration()`
`void` `setInput(DataSet<Vertex<K,VV>> inputData)`
Sets the input data set for this operator.
`static <K,VV,Message,EV>ScatterGatherIteration<K,VV,Message,EV>` ```withEdges(DataSet<Edge<K,EV>> edgesWithValue, ScatterFunction<K,VV,Message,EV> sf, GatherFunction<K,VV,Message> gf, int maximumNumberOfIterations)```
Creates a new scatter-gather iteration operator for graphs where the edges are associated with a value (such as a weight or distance).
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Method Detail

• #### setInput

`public void setInput(DataSet<Vertex<K,VV>> inputData)`
Sets the input data set for this operator. In the case of this operator this input data set represents the set of vertices with their initial state.
Specified by:
`setInput` in interface `CustomUnaryOperation<Vertex<K,VV>,Vertex<K,VV>>`
Parameters:
`inputData` - The input data set, which in the case of this operator represents the set of vertices with their initial state.
`CustomUnaryOperation.setInput(org.apache.flink.api.java.DataSet)`
• #### createResult

`public DataSet<Vertex<K,VV>> createResult()`
Creates the operator that represents this scatter-gather graph computation.
Specified by:
`createResult` in interface `CustomUnaryOperation<Vertex<K,VV>,Vertex<K,VV>>`
Returns:
The operator that represents this scatter-gather graph computation.
• #### withEdges

```public static <K,VV,Message,EV> ScatterGatherIteration<K,VV,Message,EV> withEdges(DataSet<Edge<K,EV>> edgesWithValue,
ScatterFunction<K,VV,Message,EV> sf,
GatherFunction<K,VV,Message> gf,
int maximumNumberOfIterations)```
Creates a new scatter-gather iteration operator for graphs where the edges are associated with a value (such as a weight or distance).
Type Parameters:
`K` - The type of the vertex key (the vertex identifier).
`VV` - The type of the vertex value (the state of the vertex).
`Message` - The type of the message sent between vertices along the edges.
`EV` - The type of the values that are associated with the edges.
Parameters:
`edgesWithValue` - The data set containing edges.
`sf` - The function that turns changed vertex states into messages along the edges.
`gf` - The function that updates the state of the vertices from the incoming messages.
Returns:
An in stance of the scatter-gather graph computation operator.
• #### configure

`public void configure(ScatterGatherConfiguration parameters)`
Configures this scatter-gather iteration with the provided parameters.
Parameters:
`parameters` - the configuration parameters
• #### getIterationConfiguration

`public ScatterGatherConfiguration getIterationConfiguration()`
Returns:
the configuration parameters of this scatter-gather iteration
{"ft_lang_label":"__label__en","ft_lang_prob":0.6982683,"math_prob":0.7127621,"size":3430,"snap":"2021-43-2021-49","text_gpt3_token_len":749,"char_repetition_ratio":0.16520724,"word_repetition_ratio":0.2200957,"special_character_ratio":0.18746355,"punctuation_ratio":0.15068494,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9771897,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-12-02T10:08:17Z\",\"WARC-Record-ID\":\"<urn:uuid:d3a4472d-eac1-4727-8186-d0425a419beb>\",\"Content-Length\":\"26250\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:191afa10-9259-4f70-b7ed-627e5d56b0a2>\",\"WARC-Concurrent-To\":\"<urn:uuid:5d4c78c2-bc71-4bf0-9af0-855f561b1835>\",\"WARC-IP-Address\":\"95.217.38.54\",\"WARC-Target-URI\":\"https://nightlies.apache.org/flink/flink-docs-release-1.7/api/java/org/apache/flink/graph/spargel/ScatterGatherIteration.html\",\"WARC-Payload-Digest\":\"sha1:VRYAIXNHIC563EOJI2MTRPXBP7OEQARG\",\"WARC-Block-Digest\":\"sha1:TP6B3VH4QC62FPMRYS5XY5YFDWAEAVR7\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-49/CC-MAIN-2021-49_segments_1637964361253.38_warc_CC-MAIN-20211202084644-20211202114644-00375.warc.gz\"}"}