forked from apache/beam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EvaluationResult.java
62 lines (56 loc) · 2.18 KB
/
EvaluationResult.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* Copyright (c) 2014, Cloudera, Inc. All Rights Reserved.
*
* Cloudera, Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"). You may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for
* the specific language governing permissions and limitations under the
* License.
*/
package org.apache.beam.runners.spark;
import com.google.cloud.dataflow.sdk.PipelineResult;
import com.google.cloud.dataflow.sdk.values.PCollection;
import com.google.cloud.dataflow.sdk.values.PValue;
/**
* Interface for retrieving the result(s) of running a pipeline. Allows us to translate between
* {@code PObject<T>}s or {@code PCollection<T>}s and Ts or collections of Ts.
*/
public interface EvaluationResult extends PipelineResult {
/**
* Retrieves an iterable of results associated with the PCollection passed in.
*
* @param pcollection Collection we wish to translate.
* @param <T> Type of elements contained in collection.
* @return Natively types result associated with collection.
*/
<T> Iterable<T> get(PCollection<T> pcollection);
/**
* Retrieve an object of Type T associated with the PValue passed in.
*
* @param pval PValue to retrieve associated data for.
* @param <T> Type of object to return.
* @return Native object.
*/
<T> T get(PValue pval);
/**
* Retrieves the final value of the aggregator.
*
* @param aggName name of aggregator.
* @param resultType Class of final result of aggregation.
* @param <T> Type of final result of aggregation.
* @return Result of aggregation associated with specified name.
*/
<T> T getAggregatorValue(String aggName, Class<T> resultType);
/**
* Releases any runtime resources, including distributed-execution contexts currently held by
* this EvaluationResult; once close() has been called,
* {@link EvaluationResult#get(PCollection)} might
* not work for subsequent calls.
*/
void close();
}