-
-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d139926
commit 5b5f1e7
Showing
6 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
tags: | ||
- DeveloperApi | ||
--- | ||
|
||
# PartitionEvaluator | ||
|
||
`PartitionEvaluator[T, U]` is an [abstraction](#contract) of [partition evaluators](#implementations) that can [compute (_evaluate_) one or more RDD partitions](#eval). | ||
|
||
## Contract | ||
|
||
### Evaluate Partitions { #eval } | ||
|
||
```scala | ||
eval( | ||
partitionIndex: Int, | ||
inputs: Iterator[T]*): Iterator[U] | ||
``` | ||
|
||
Used when: | ||
|
||
* `MapPartitionsWithEvaluatorRDD` is requested to [compute a partition](rdd/MapPartitionsWithEvaluatorRDD.md#compute) | ||
* `ZippedPartitionsWithEvaluatorRDD` is requested to [compute a partition](rdd/ZippedPartitionsWithEvaluatorRDD.md#compute) | ||
|
||
## Implementations | ||
|
||
!!! note | ||
No built-in implementations available in Spark Core (but [Spark SQL]({{ book.spark_sql }})). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
tags: | ||
- DeveloperApi | ||
--- | ||
|
||
# PartitionEvaluatorFactory | ||
|
||
`PartitionEvaluatorFactory[T, U]` is an [abstraction](#contract) of [PartitionEvaluator factories](#implementations). | ||
|
||
`PartitionEvaluatorFactory` is a `Serializable` ([Java]({{ java.api }}/java/io/Serializable.html)). | ||
|
||
## Contract | ||
|
||
### Creating PartitionEvaluator { #createEvaluator } | ||
|
||
```scala | ||
createEvaluator(): PartitionEvaluator[T, U] | ||
``` | ||
|
||
Creates a [PartitionEvaluator](PartitionEvaluator.md) | ||
|
||
Used when: | ||
|
||
* `MapPartitionsWithEvaluatorRDD` is requested to [compute a partition](rdd/MapPartitionsWithEvaluatorRDD.md#compute) | ||
* `ZippedPartitionsWithEvaluatorRDD` is requested to [compute a partition](rdd/ZippedPartitionsWithEvaluatorRDD.md#compute) | ||
|
||
## Implementations | ||
|
||
!!! note | ||
No built-in implementations available in Spark Core (but [Spark SQL]({{ book.spark_sql }})). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# MapPartitionsWithEvaluatorRDD | ||
|
||
`MapPartitionsWithEvaluatorRDD` is an [RDD](RDD.md). | ||
|
||
## Creating Instance | ||
|
||
`MapPartitionsWithEvaluatorRDD` takes the following to be created: | ||
|
||
* <span id="prev"> Previous [RDD](RDD.md) | ||
* <span id="evaluatorFactory"> [PartitionEvaluatorFactory](../PartitionEvaluatorFactory.md) | ||
|
||
`MapPartitionsWithEvaluatorRDD` is created when: | ||
|
||
* [RDD.mapPartitionsWithEvaluator](RDD.md#mapPartitionsWithEvaluator) operator is used | ||
* [RDDBarrier.mapPartitionsWithEvaluator](../barrier-execution-mode/RDDBarrier.md#mapPartitionsWithEvaluator) operator is used | ||
|
||
## Computing Partition { #compute } | ||
|
||
??? note "RDD" | ||
|
||
```scala | ||
compute( | ||
split: Partition, | ||
context: TaskContext): Iterator[U] | ||
``` | ||
|
||
`compute` is part of the [RDD](RDD.md#compute) abstraction. | ||
|
||
`compute` requests the [PartitionEvaluatorFactory](#evaluatorFactory) to [create a PartitionEvaluator](../PartitionEvaluatorFactory.md#createEvaluator). | ||
|
||
`compute` requests the [first parent RDD](RDD.md#firstParent) to [iterator](RDD.md#iterator). | ||
|
||
In the end, `compute` requests the [PartitionEvaluator](../PartitionEvaluator.md) to [evaluate the partition](../PartitionEvaluator.md#eval). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# ZippedPartitionsWithEvaluatorRDD | ||
|
||
`ZippedPartitionsWithEvaluatorRDD` is...FIXME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters