1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
package org.apache.giraph.block_app.framework.piece.global_comm.internal; |
19 | |
|
20 | |
import org.apache.giraph.block_app.framework.api.BlockMasterApi; |
21 | |
import org.apache.giraph.block_app.framework.api.CreateReducersApi; |
22 | |
import org.apache.giraph.block_app.framework.piece.global_comm.ReducerHandle; |
23 | |
import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration; |
24 | |
import org.apache.giraph.reducers.ReduceOperation; |
25 | |
import org.apache.hadoop.io.Writable; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
public class CreateReducersApiWrapper implements CreateReducersApi { |
32 | |
private final BlockMasterApi masterApi; |
33 | |
private final ReducersForPieceHandler reducersApi; |
34 | |
|
35 | |
public CreateReducersApiWrapper( |
36 | 0 | BlockMasterApi masterApi, ReducersForPieceHandler reducersApi) { |
37 | 0 | this.masterApi = masterApi; |
38 | 0 | this.reducersApi = reducersApi; |
39 | 0 | } |
40 | |
|
41 | |
@Override |
42 | |
public <S, R extends Writable> ReducerHandle<S, R> createLocalReducer( |
43 | |
ReduceOperation<S, R> reduceOp) { |
44 | 0 | return reducersApi.createLocalReducer( |
45 | 0 | masterApi, reduceOp, reduceOp.createInitialValue()); |
46 | |
} |
47 | |
|
48 | |
@Override |
49 | |
public <S, R extends Writable> ReducerHandle<S, R> createLocalReducer( |
50 | |
ReduceOperation<S, R> reduceOp, R globalInitialValue) { |
51 | 0 | return reducersApi.createLocalReducer( |
52 | |
masterApi, reduceOp, globalInitialValue); |
53 | |
} |
54 | |
|
55 | |
@Override |
56 | |
public <S, R extends Writable> ReducerHandle<S, R> createGlobalReducer( |
57 | |
ReduceOperation<S, R> reduceOp) { |
58 | 0 | return reducersApi.createGlobalReducer( |
59 | 0 | masterApi, reduceOp, reduceOp.createInitialValue()); |
60 | |
} |
61 | |
|
62 | |
@Override |
63 | |
public <S, R extends Writable> ReducerHandle<S, R> createGlobalReducer( |
64 | |
ReduceOperation<S, R> reduceOp, R globalInitialValue) { |
65 | 0 | return reducersApi.createGlobalReducer( |
66 | |
masterApi, reduceOp, globalInitialValue); |
67 | |
} |
68 | |
|
69 | |
@Override |
70 | |
public ImmutableClassesGiraphConfiguration<?, ?, ?> getConf() { |
71 | 0 | return masterApi.getConf(); |
72 | |
} |
73 | |
} |