提交 e5f74f04 编写于 作者: W wizardforcel

2019-02-23 22:57:01

上级 ee163ab3
...@@ -50,11 +50,13 @@ val data: DataSet[(Int, String, Double)] = // [...] data.map { ...@@ -50,11 +50,13 @@ val data: DataSet[(Int, String, Double)] = // [...] data.map {
#### DataSet API #### DataSet API
| 方法 | 原生 | DEMO | ---
| --- | --- | --- |
| **mapWith** | **map(DataSet)** |
<figure class="highlight"> 方法:`mapWith`
原生:`map(DataSet)`
DEMO:
``` ```
data.mapWith { data.mapWith {
...@@ -62,12 +64,15 @@ data.mapWith { ...@@ -62,12 +64,15 @@ data.mapWith {
} }
``` ```
</figure>
|
| **mapPartitionWith** | **mapPartition(DataSet)** |
<figure class="highlight"> ---
方法:`mapPartitionWith`
原生:`mapPartition(DataSet)`
DEMO:
``` ```
data.mapPartitionWith { data.mapPartitionWith {
...@@ -75,12 +80,15 @@ data.mapPartitionWith { ...@@ -75,12 +80,15 @@ data.mapPartitionWith {
} }
``` ```
</figure>
|
| **flatMapWith** | **flatMap(DataSet)** |
<figure class="highlight"> ---
方法:`flatMapWith`
原生:`flatMap(DataSet)`
DEMO:
``` ```
data.flatMapWith { data.flatMapWith {
...@@ -88,12 +96,15 @@ data.flatMapWith { ...@@ -88,12 +96,15 @@ data.flatMapWith {
} }
``` ```
</figure>
|
| **filterWith** | **filter(DataSet)** |
<figure class="highlight"> ---
方法:`filterWith`
原生:`filter(DataSet)`
DEMO:
``` ```
data.filterWith { data.filterWith {
...@@ -101,12 +112,15 @@ data.filterWith { ...@@ -101,12 +112,15 @@ data.filterWith {
} }
``` ```
</figure>
|
| **reduceWith** | **reduce(DataSet,GroupedDataSet)** |
<figure class="highlight"> ---
方法:`reduceWith`
原生:`reduce(DataSet,GroupedDataSet)`
DEMO:
``` ```
data.reduceWith { data.reduceWith {
...@@ -114,12 +128,15 @@ data.reduceWith { ...@@ -114,12 +128,15 @@ data.reduceWith {
} }
``` ```
</figure>
|
| **reduceGroupWith** | **reduceGroup(GroupedDataSet)** |
<figure class="highlight"> ---
方法:`reduceGroupWith`
原生:`reduceGroup(GroupedDataSet)`
DEMO:
``` ```
data.reduceGroupWith { data.reduceGroupWith {
...@@ -127,12 +144,15 @@ data.reduceGroupWith { ...@@ -127,12 +144,15 @@ data.reduceGroupWith {
} }
``` ```
</figure>
|
| **groupingBy** | **groupBy(DataSet)** |
<figure class="highlight"> ---
方法:`groupingBy`
原生:`groupBy(DataSet)`
DEMO:
``` ```
data.groupingBy { data.groupingBy {
...@@ -140,12 +160,15 @@ data.groupingBy { ...@@ -140,12 +160,15 @@ data.groupingBy {
} }
``` ```
</figure>
|
| **sortGroupWith** | **sortGroup(GroupedDataSet)** |
<figure class="highlight"> ---
方法:`sortGroupWith`
原生:`sortGroup(GroupedDataSet)`
DEMO:
``` ```
grouped.sortGroupWith(Order.ASCENDING) { grouped.sortGroupWith(Order.ASCENDING) {
...@@ -153,12 +176,15 @@ grouped.sortGroupWith(Order.ASCENDING) { ...@@ -153,12 +176,15 @@ grouped.sortGroupWith(Order.ASCENDING) {
} }
``` ```
</figure>
|
| **combineGroupWith** | **combineGroup(GroupedDataSet)** |
<figure class="highlight"> ---
方法:`combineGroupWith`
原生:`combineGroup(GroupedDataSet)`
DEMO:
``` ```
grouped.combineGroupWith { grouped.combineGroupWith {
...@@ -166,12 +192,15 @@ grouped.combineGroupWith { ...@@ -166,12 +192,15 @@ grouped.combineGroupWith {
} }
``` ```
</figure>
|
| **projecting** | **apply(JoinDataSet,CrossDataSet)** |
<figure class="highlight"> ---
方法:`projecting`
原生:`apply(JoinDataSet,CrossDataSet)`
DEMO:
``` ```
data1.join(data2). data1.join(data2).
...@@ -186,12 +215,15 @@ data1.cross(data2).projecting { ...@@ -186,12 +215,15 @@ data1.cross(data2).projecting {
} }
``` ```
</figure>
|
| **projecting** | **apply(CoGroupDataSet)** |
<figure class="highlight"> ---
方法:`projecting`
原生:`apply(CoGroupDataSet)`
DEMO:
``` ```
data1.coGroup(data2). data1.coGroup(data2).
...@@ -203,17 +235,18 @@ data1.coGroup(data2). ...@@ -203,17 +235,18 @@ data1.coGroup(data2).
} }
``` ```
</figure>
|
#### DataStream API #### DataStream API
| 方法 | 原生 | DEMO | ---
| --- | --- | --- |
| **mapWith** | **map(DataStream)** | 方法:`mapWith`
原生:`map(DataStream)`
<figure class="highlight"> DEMO:
``` ```
data.mapWith { data.mapWith {
...@@ -221,12 +254,15 @@ data.mapWith { ...@@ -221,12 +254,15 @@ data.mapWith {
} }
``` ```
</figure>
|
| **mapPartitionWith** | **mapPartition(DataStream)** |
<figure class="highlight"> ---
方法:`mapPartitionWith`
原生:`mapPartition(DataStream)`
DEMO:
``` ```
data.mapPartitionWith { data.mapPartitionWith {
...@@ -234,12 +270,15 @@ data.mapPartitionWith { ...@@ -234,12 +270,15 @@ data.mapPartitionWith {
} }
``` ```
</figure>
|
| **flatMapWith** | **flatMap(DataStream)** |
<figure class="highlight"> ---
方法:`flatMapWith`
原生:`flatMap(DataStream)`
DEMO:
``` ```
data.flatMapWith { data.flatMapWith {
...@@ -247,12 +286,15 @@ data.flatMapWith { ...@@ -247,12 +286,15 @@ data.flatMapWith {
} }
``` ```
</figure>
|
| **filterWith** | **filter(DataStream)** |
<figure class="highlight"> ---
方法:`filterWith`
原生:`filter(DataStream)`
DEMO:
``` ```
data.filterWith { data.filterWith {
...@@ -260,12 +302,15 @@ data.filterWith { ...@@ -260,12 +302,15 @@ data.filterWith {
} }
``` ```
</figure>
|
| **keyingBy** | **keyBy(DataStream)** |
<figure class="highlight"> ---
方法:`keyingBy`
原生:`keyBy(DataStream)`
DEMO:
``` ```
data.keyingBy { data.keyingBy {
...@@ -273,12 +318,15 @@ data.keyingBy { ...@@ -273,12 +318,15 @@ data.keyingBy {
} }
``` ```
</figure>
|
| **mapWith** | **map(ConnectedDataStream)** |
<figure class="highlight"> ---
方法:`mapWith`
原生:`map(ConnectedDataStream)`
DEMO:
``` ```
data.mapWith( data.mapWith(
...@@ -287,12 +335,15 @@ data.mapWith( ...@@ -287,12 +335,15 @@ data.mapWith(
) )
``` ```
</figure>
|
| **flatMapWith** | **flatMap(ConnectedDataStream)** |
<figure class="highlight"> ---
方法:`flatMapWith`
原生:`flatMap(ConnectedDataStream)`
DEMO:
``` ```
data.flatMapWith( data.flatMapWith(
...@@ -301,12 +352,15 @@ data.flatMapWith( ...@@ -301,12 +352,15 @@ data.flatMapWith(
) )
``` ```
</figure>
|
| **keyingBy** | **keyBy(ConnectedDataStream)** |
<figure class="highlight"> ---
方法:`keyingBy`
原生:`keyBy(ConnectedDataStream)`
DEMO:
``` ```
data.keyingBy( data.keyingBy(
...@@ -315,12 +369,15 @@ data.keyingBy( ...@@ -315,12 +369,15 @@ data.keyingBy(
) )
``` ```
</figure>
|
| **reduceWith** | **reduce(KeyedStream,WindowedStream)** |
<figure class="highlight"> ---
方法:`reduceWith`
原生:`reduce(KeyedStream,WindowedStream)`
DEMO:
``` ```
data.reduceWith { data.reduceWith {
...@@ -328,12 +385,15 @@ data.reduceWith { ...@@ -328,12 +385,15 @@ data.reduceWith {
} }
``` ```
</figure>
|
| **foldWith** | **fold(KeyedStream,WindowedStream)** |
<figure class="highlight"> ---
方法:`foldWith`
原生:`fold(KeyedStream,WindowedStream)`
DEMO:
``` ```
data.foldWith(User(bought = 0)) { data.foldWith(User(bought = 0)) {
...@@ -341,12 +401,15 @@ data.foldWith(User(bought = 0)) { ...@@ -341,12 +401,15 @@ data.foldWith(User(bought = 0)) {
} }
``` ```
</figure>
|
| **applyWith** | **apply(WindowedStream)** |
<figure class="highlight"> ---
方法:`applyWith`
原生:`apply(WindowedStream)`
DEMO:
``` ```
data.applyWith(0)( data.applyWith(0)(
...@@ -354,12 +417,15 @@ data.applyWith(0)( ...@@ -354,12 +417,15 @@ data.applyWith(0)(
windowFunction = case (k, w, sum) => // [...] ) windowFunction = case (k, w, sum) => // [...] )
``` ```
</figure>
|
| **projecting** | **apply(JoinedStream)** |
<figure class="highlight"> ---
方法:`projecting`
原生:`apply(JoinedStream)`
DEMO:
``` ```
data1.join(data2). data1.join(data2).
...@@ -370,9 +436,8 @@ data1.join(data2). ...@@ -370,9 +436,8 @@ data1.join(data2).
} }
``` ```
</figure>
|
有关每种方法的语义的更多信息,请参阅 [DataSet](https://flink.sojb.cn/dev/batch/index.html)[DataStream](https://flink.sojb.cn/dev/datastream_api.html) API文档。 有关每种方法的语义的更多信息,请参阅 [DataSet](https://flink.sojb.cn/dev/batch/index.html)[DataStream](https://flink.sojb.cn/dev/datastream_api.html) API文档。
......
...@@ -98,53 +98,78 @@ val env = StreamExecutionEnvironment.getExecutionEnvironment() ...@@ -98,53 +98,78 @@ val env = StreamExecutionEnvironment.getExecutionEnvironment()
可以通过设置更多参数和/或默认值`conf/flink-conf.yaml`(参见完整指南的[配置](https://flink.sojb.cn/ops/config.html)): 可以通过设置更多参数和/或默认值`conf/flink-conf.yaml`(参见完整指南的[配置](https://flink.sojb.cn/ops/config.html)):
| 键 | 默认 | 描述 |
| --- | --- | --- |
|
##### state.backend ---
| (none) | 状态后台用于存储和检查点状态。 | 键:`state.backend`
|
##### state.backend.async 默认值:`(none)`
| true | 选择状态后台是否应在可能和可配置的情况下使用异步SNAPSHOT方法。某些状态后台可能不支持异步SNAPSHOT,或者仅支持异步SNAPSHOT,并忽略此选项。 | 描述:状态后台用于存储和检查点状态。
|
##### state.backend.fs.memory-threshold ---
| 1024 | 状态数据文件的最小大小。小于该值的所有状态块都内联存储在根检查点元数据文件中。 | 键:`state.backend.async`
|
##### state.backend.incremental 默认值:`true`
| false | 如果可能,选择状态后台是否应创建增量检查点。对于增量检查点,仅存储来自先前检查点的差异,而不是完整的检查点状态。某些状态后台可能不支持增量检查点并忽略此选项。 | 描述:选择状态后台是否应在可能和可配置的情况下使用异步SNAPSHOT方法。某些状态后台可能不支持异步SNAPSHOT,或者仅支持异步SNAPSHOT,并忽略此选项。
|
##### state.backend.local-recovery ---
| false | | 键:`state.backend.fs.memory-threshold`
|
##### state.checkpoints.dir 默认值:`1024`
| (none) | 用于在Flink支持的文件系统中存储检查点的数据文件和元数据的默认目录。必须可以从所有参与的进程/节点(即所有TaskManagers和JobManagers)访问存储路径。 | 描述:状态数据文件的最小大小。小于该值的所有状态块都内联存储在根检查点元数据文件中。
|
##### state.checkpoints.num-retained ---
| 1 | 要retained的已完成检查点的最大数量。 | 键:`state.backend.incremental`
|
##### state.savepoints.dir 默认值:`false`
| (none) | 保存点的默认目录。由将后台写入文件系统的状态后台(MemoryStateBackend,FsStateBackend,RocksDBStateBackend)使用。 | 描述:如果可能,选择状态后台是否应创建增量检查点。对于增量检查点,仅存储来自先前检查点的差异,而不是完整的检查点状态。某些状态后台可能不支持增量检查点并忽略此选项。
|
##### taskmanager.state.local.root - dirs ---
| (none) | | 键:`state.backend.local-recovery`
默认值:`false`
描述:无
---
键:`state.checkpoints.dir`
默认值:`(none)`
描述:用于在Flink支持的文件系统中存储检查点的数据文件和元数据的默认目录。必须可以从所有参与的进程/节点(即所有TaskManagers和JobManagers)访问存储路径。
---
键:`state.checkpoints.num-retained`
默认值:`1`
描述:要retained的已完成检查点的最大数量。
---
键:`state.savepoints.dir`
默认值:`(none)`
描述:保存点的默认目录。由将后台写入文件系统的状态后台(MemoryStateBackend,FsStateBackend,RocksDBStateBackend)使用。
---
键:`taskmanager.state.local.root - dirs`
默认值:`(none)`
描述:无
## 选择状态后台 ## 选择状态后台
......
此差异已折叠。
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
`Graph`用于组装API和顶级算法的逻辑块可在Gelly中作为`org.apache.flink.graph.asm`包中的图形算法访问。这些算法通过配置参数提供优化和调整,并且在使用类似配置处理相同输入时可以提供隐式运行时重用。 `Graph`用于组装API和顶级算法的逻辑块可在Gelly中作为`org.apache.flink.graph.asm`包中的图形算法访问。这些算法通过配置参数提供优化和调整,并且在使用类似配置处理相同输入时可以提供隐式运行时重用。
| 算法 | 描述 | ---
| --- | --- |
| degree.annotate.directed。 算法:`degree.annotate.directed。VertexInDegree`
**VertexInDegree** | 使用in-degree 注释有[向图的](#graph-representation)顶点。
描述:使用in-degree 注释有[向图的](#graph-representation)顶点。
<figure class="highlight">
``` ```
DataSet<Vertex<K, LongValue>> inDegree = graph DataSet<Vertex<K, LongValue>> inDegree = graph
...@@ -20,7 +20,6 @@ DataSet<Vertex<K, LongValue>> inDegree = graph ...@@ -20,7 +20,6 @@ DataSet<Vertex<K, LongValue>> inDegree = graph
.setIncludeZeroDegreeVertices(true)); .setIncludeZeroDegreeVertices(true));
``` ```
</figure>
可选配置: 可选配置:
...@@ -28,11 +27,12 @@ DataSet<Vertex<K, LongValue>> inDegree = graph ...@@ -28,11 +27,12 @@ DataSet<Vertex<K, LongValue>> inDegree = graph
* **setParallelism**:覆盖 算子并行度 * **setParallelism**:覆盖 算子并行度
| ---
| degree.annotate.directed。
**VertexOutDegree** | 使用out-degree 注释有[向图的](#graph-representation)顶点。 算法:`degree.annotate.directed。VertexOutDegree`
描述:使用out-degree 注释有[向图的](#graph-representation)顶点。
<figure class="highlight">
``` ```
DataSet<Vertex<K, LongValue>> outDegree = graph DataSet<Vertex<K, LongValue>> outDegree = graph
...@@ -40,7 +40,6 @@ DataSet<Vertex<K, LongValue>> outDegree = graph ...@@ -40,7 +40,6 @@ DataSet<Vertex<K, LongValue>> outDegree = graph
.setIncludeZeroDegreeVertices(true)); .setIncludeZeroDegreeVertices(true));
``` ```
</figure>
可选配置: 可选配置:
...@@ -48,11 +47,12 @@ DataSet<Vertex<K, LongValue>> outDegree = graph ...@@ -48,11 +47,12 @@ DataSet<Vertex<K, LongValue>> outDegree = graph
* **setParallelism**:覆盖 算子并行度 * **setParallelism**:覆盖 算子并行度
| ---
| degree.annotate.directed。
**VertexDegrees** | 使用degree,out-degree和in-degree 注释有[向图的](#graph-representation)顶点。 算法:`degree.annotate.directed。VertexDegrees`
描述:使用degree,out-degree和in-degree 注释有[向图的](#graph-representation)顶点。
<figure class="highlight">
``` ```
DataSet<Vertex<K, Tuple2<LongValue, LongValue>>> degrees = graph DataSet<Vertex<K, Tuple2<LongValue, LongValue>>> degrees = graph
...@@ -60,7 +60,6 @@ DataSet<Vertex<K, Tuple2<LongValue, LongValue>>> degrees = gra ...@@ -60,7 +60,6 @@ DataSet<Vertex<K, Tuple2<LongValue, LongValue>>> degrees = gra
.setIncludeZeroDegreeVertices(true)); .setIncludeZeroDegreeVertices(true));
``` ```
</figure>
可选配置: 可选配置:
...@@ -68,62 +67,63 @@ DataSet<Vertex<K, Tuple2<LongValue, LongValue>>> degrees = gra ...@@ -68,62 +67,63 @@ DataSet<Vertex<K, Tuple2<LongValue, LongValue>>> degrees = gra
* **setParallelism**:覆盖 算子并行度 * **setParallelism**:覆盖 算子并行度
| ---
| degree.annotate.directed。
**EdgeSourceDegrees** | 使用源ID的度,出度和度数来标注有[向图的](#graph-representation)边。 算法:`degree.annotate.directed。EdgeSourceDegrees`
描述:使用源ID的度,出度和度数来标注有[向图的](#graph-representation)边。
<figure class="highlight">
``` ```
DataSet<Edge<K, Tuple2<EV, Degrees>>> sourceDegrees = graph DataSet<Edge<K, Tuple2<EV, Degrees>>> sourceDegrees = graph
.run(new EdgeSourceDegrees()); .run(new EdgeSourceDegrees());
``` ```
</figure>
可选配置: 可选配置:
* **setParallelism**:覆盖 算子并行度 * **setParallelism**:覆盖 算子并行度
| ---
| degree.annotate.directed。
**EdgeTargetDegrees** | 使用目标ID的度,出度和度数来标注有[向图的](#graph-representation)边。 算法:`degree.annotate.directed。EdgeTargetDegrees`
描述:使用目标ID的度,出度和度数来标注有[向图的](#graph-representation)边。
<figure class="highlight">
``` ```
DataSet<Edge<K, Tuple2<EV, Degrees>>> targetDegrees = graph DataSet<Edge<K, Tuple2<EV, Degrees>>> targetDegrees = graph
.run(new EdgeTargetDegrees(); .run(new EdgeTargetDegrees();
``` ```
</figure>
可选配置: 可选配置:
* **setParallelism**:覆盖 算子并行度 * **setParallelism**:覆盖 算子并行度
| ---
| degree.annotate.directed。
**EdgeDegreesPair** | 使用源顶点和目标顶点的度,出度和度数来标注有[向图](#graph-representation)的边。 算法:`degree.annotate.directed。EdgeDegreesPair`
描述:使用源顶点和目标顶点的度,出度和度数来标注有[向图](#graph-representation)的边。
<figure class="highlight">
``` ```
DataSet<Edge<K, Tuple2<EV, Degrees>>> degrees = graph DataSet<Edge<K, Tuple2<EV, Degrees>>> degrees = graph
.run(new EdgeDegreesPair()); .run(new EdgeDegreesPair());
``` ```
</figure>
可选配置: 可选配置:
* **setParallelism**:覆盖 算子并行度 * **setParallelism**:覆盖 算子并行度
| ---
| degree.annotate.undirected。
**VertexDegree** | 用度数注释[无向图的](#graph-representation)顶点。 算法:`degree.annotate.undirected。VertexDegree`
描述:用度数注释[无向图的](#graph-representation)顶点。
<figure class="highlight">
``` ```
DataSet<Vertex<K, LongValue>> degree = graph DataSet<Vertex<K, LongValue>> degree = graph
...@@ -132,7 +132,6 @@ DataSet<Vertex<K, LongValue>> degree = graph ...@@ -132,7 +132,6 @@ DataSet<Vertex<K, LongValue>> degree = graph
.setReduceOnTargetId(true)); .setReduceOnTargetId(true));
``` ```
</figure>
可选配置: 可选配置:
...@@ -142,11 +141,12 @@ DataSet<Vertex<K, LongValue>> degree = graph ...@@ -142,11 +141,12 @@ DataSet<Vertex<K, LongValue>> degree = graph
* **setReduceOnTargetId**:可以从边缘源ID或目标ID计算度数。默认情况下,会计算源ID。如果输入边缘列表按目标ID排序,则Reduce目标ID可以优化算法。 * **setReduceOnTargetId**:可以从边缘源ID或目标ID计算度数。默认情况下,会计算源ID。如果输入边缘列表按目标ID排序,则Reduce目标ID可以优化算法。
| ---
| degree.annotate.undirected。
**EdgeSourceDegree** | 使用源ID的度数注释[无向图的](#graph-representation)边。 算法:`degree.annotate.undirected。EdgeSourceDegree`
描述:使用源ID的度数注释[无向图的](#graph-representation)边。
<figure class="highlight">
``` ```
DataSet<Edge<K, Tuple2<EV, LongValue>>> sourceDegree = graph DataSet<Edge<K, Tuple2<EV, LongValue>>> sourceDegree = graph
...@@ -154,7 +154,6 @@ DataSet<Edge<K, Tuple2<EV, LongValue>>> sourceDegree = graph ...@@ -154,7 +154,6 @@ DataSet<Edge<K, Tuple2<EV, LongValue>>> sourceDegree = graph
.setReduceOnTargetId(true)); .setReduceOnTargetId(true));
``` ```
</figure>
可选配置: 可选配置:
...@@ -162,11 +161,12 @@ DataSet<Edge<K, Tuple2<EV, LongValue>>> sourceDegree = graph ...@@ -162,11 +161,12 @@ DataSet<Edge<K, Tuple2<EV, LongValue>>> sourceDegree = graph
* **setReduceOnTargetId**:可以从边缘源ID或目标ID计算度数。默认情况下,会计算源ID。如果输入边缘列表按目标ID排序,则Reduce目标ID可以优化算法。 * **setReduceOnTargetId**:可以从边缘源ID或目标ID计算度数。默认情况下,会计算源ID。如果输入边缘列表按目标ID排序,则Reduce目标ID可以优化算法。
| ---
| degree.annotate.undirected。
**EdgeTargetDegree** | 使用目标ID的度数注释[无向图的](#graph-representation)边。 算法:`degree.annotate.undirected。EdgeTargetDegree`
描述:使用目标ID的度数注释[无向图的](#graph-representation)边。
<figure class="highlight">
``` ```
DataSet<Edge<K, Tuple2<EV, LongValue>>> targetDegree = graph DataSet<Edge<K, Tuple2<EV, LongValue>>> targetDegree = graph
...@@ -174,7 +174,6 @@ DataSet<Edge<K, Tuple2<EV, LongValue>>> targetDegree = graph ...@@ -174,7 +174,6 @@ DataSet<Edge<K, Tuple2<EV, LongValue>>> targetDegree = graph
.setReduceOnSourceId(true)); .setReduceOnSourceId(true));
``` ```
</figure>
可选配置: 可选配置:
...@@ -182,11 +181,12 @@ DataSet<Edge<K, Tuple2<EV, LongValue>>> targetDegree = graph ...@@ -182,11 +181,12 @@ DataSet<Edge<K, Tuple2<EV, LongValue>>> targetDegree = graph
* **setReduceOnSourceId**:可以从边缘源ID或目标ID计算度。默认情况下,计算目标ID。如果输入边缘列表按源ID排序,则Reduce源ID可以优化算法。 * **setReduceOnSourceId**:可以从边缘源ID或目标ID计算度。默认情况下,计算目标ID。如果输入边缘列表按源ID排序,则Reduce源ID可以优化算法。
| ---
| degree.annotate.undirected。
**EdgeDegreePair** | 使用源顶点和目标顶点的度数注释[无向图](#graph-representation)的边。 算法:`degree.annotate.undirected。EdgeDegreePair`
描述:使用源顶点和目标顶点的度数注释[无向图](#graph-representation)的边。
<figure class="highlight">
``` ```
DataSet<Edge<K, Tuple3<EV, LongValue, LongValue>>> pairDegree = graph DataSet<Edge<K, Tuple3<EV, LongValue, LongValue>>> pairDegree = graph
...@@ -194,7 +194,6 @@ DataSet<Edge<K, Tuple3<EV, LongValue, LongValue>>> pairDegree ...@@ -194,7 +194,6 @@ DataSet<Edge<K, Tuple3<EV, LongValue, LongValue>>> pairDegree
.setReduceOnTargetId(true)); .setReduceOnTargetId(true));
``` ```
</figure>
可选配置: 可选配置:
...@@ -202,11 +201,12 @@ DataSet<Edge<K, Tuple3<EV, LongValue, LongValue>>> pairDegree ...@@ -202,11 +201,12 @@ DataSet<Edge<K, Tuple3<EV, LongValue, LongValue>>> pairDegree
* **setReduceOnTargetId**:可以从边缘源ID或目标ID计算度数。默认情况下,会计算源ID。如果输入边缘列表按目标ID排序,则Reduce目标ID可以优化算法。 * **setReduceOnTargetId**:可以从边缘源ID或目标ID计算度数。默认情况下,会计算源ID。如果输入边缘列表按目标ID排序,则Reduce目标ID可以优化算法。
| ---
| degree.filter.undirected。
**MaximumDegree** | 按最大程度Filter[无向图](#graph-representation) 算法:`degree.filter.undirected。MaximumDegree`
描述:按最大程度Filter[无向图](#graph-representation)
<figure class="highlight">
``` ```
Graph<K, VV, EV> filteredGraph = graph Graph<K, VV, EV> filteredGraph = graph
...@@ -215,7 +215,6 @@ Graph<K, VV, EV> filteredGraph = graph ...@@ -215,7 +215,6 @@ Graph<K, VV, EV> filteredGraph = graph
.setReduceOnTargetId(true)); .setReduceOnTargetId(true));
``` ```
</figure>
可选配置: 可选配置:
...@@ -225,49 +224,49 @@ Graph<K, VV, EV> filteredGraph = graph ...@@ -225,49 +224,49 @@ Graph<K, VV, EV> filteredGraph = graph
* **setReduceOnTargetId**:可以从边缘源ID或目标ID计算度数。默认情况下,会计算源ID。如果输入边缘列表按目标ID排序,则Reduce目标ID可以优化算法。 * **setReduceOnTargetId**:可以从边缘源ID或目标ID计算度数。默认情况下,会计算源ID。如果输入边缘列表按目标ID排序,则Reduce目标ID可以优化算法。
| ---
| simple.directed。
**简化** | 从有[向图中](#graph-representation)删除自循环和重复边。 算法:`simple.directed。简化`
描述:从有[向图中](#graph-representation)删除自循环和重复边。
<figure class="highlight">
``` ```
graph.run(new Simplify()); graph.run(new Simplify());
``` ```
</figure>
可选配置: 可选配置:
* **setParallelism**:覆盖 算子并行度 * **setParallelism**:覆盖 算子并行度
| ---
| simple.undirected。
**简化** | 添加对称边并[从无向图中](#graph-representation)移除自循环和复制边。 算法:`simple.undirected。简化`
描述:添加对称边并[从无向图中](#graph-representation)移除自循环和复制边。
<figure class="highlight">
``` ```
graph.run(new Simplify()); graph.run(new Simplify());
``` ```
</figure>
可选配置: 可选配置:
* **setParallelism**:覆盖 算子并行度 * **setParallelism**:覆盖 算子并行度
| ---
| 翻译。
**TranslateGraphIds** | 使用给定的转换顶点和边ID `TranslateFunction` 算法:`翻译。TranslateGraphIds`
描述:使用给定的转换顶点和边ID `TranslateFunction`
<figure class="highlight">
``` ```
graph.run(new TranslateGraphIds(new LongValueToStringValue())); graph.run(new TranslateGraphIds(new LongValueToStringValue()));
``` ```
</figure>
所需配置: 所需配置:
...@@ -277,17 +276,17 @@ graph.run(new TranslateGraphIds(new LongValueToStringValue())); ...@@ -277,17 +276,17 @@ graph.run(new TranslateGraphIds(new LongValueToStringValue()));
* **setParallelism**:覆盖 算子并行度 * **setParallelism**:覆盖 算子并行度
| ---
| 翻译。
**TranslateVertexValues** | 使用给定的转换顶点值`TranslateFunction` 算法:`翻译。TranslateVertexValues`
描述:使用给定的转换顶点值`TranslateFunction`
<figure class="highlight">
``` ```
graph.run(new TranslateVertexValues(new LongValueAddOffset(vertexCount))); graph.run(new TranslateVertexValues(new LongValueAddOffset(vertexCount)));
``` ```
</figure>
所需配置: 所需配置:
...@@ -297,17 +296,17 @@ graph.run(new TranslateVertexValues(new LongValueAddOffset(vertexCount))); ...@@ -297,17 +296,17 @@ graph.run(new TranslateVertexValues(new LongValueAddOffset(vertexCount)));
* **setParallelism**:覆盖 算子并行度 * **setParallelism**:覆盖 算子并行度
| ---
| 翻译。
**TranslateEdgeValues** | 使用给定的转换边缘值`TranslateFunction` 算法:`翻译。TranslateEdgeValues`
描述:使用给定的转换边缘值`TranslateFunction`
<figure class="highlight">
``` ```
graph.run(new TranslateEdgeValues(new Nullify())); graph.run(new TranslateEdgeValues(new Nullify()));
``` ```
</figure>
所需配置: 所需配置:
...@@ -317,5 +316,4 @@ graph.run(new TranslateEdgeValues(new Nullify())); ...@@ -317,5 +316,4 @@ graph.run(new TranslateEdgeValues(new Nullify()));
* **setParallelism**:覆盖 算子并行度 * **setParallelism**:覆盖 算子并行度
|
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册