1 | import {IncomingShuffleState} from './IncomingShuffleState';
|
2 | import {OutgoingShuffleState} from './OutgoingShuffleState';
|
3 | import {AsyncExecService, Logger} from 'cyclon.p2p-common';
|
4 | import {CyclonNode, CyclonNodePointer} from 'cyclon.p2p';
|
5 |
|
6 | export class ShuffleStateFactory{
|
7 |
|
8 | constructor(private readonly logger: Logger,
|
9 | private readonly asyncExecService: AsyncExecService) {
|
10 | }
|
11 |
|
12 | |
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | createOutgoingShuffleState(localNode: CyclonNode, destinationNodePointer: CyclonNodePointer, shuffleSet: CyclonNodePointer[]) {
|
21 | return new OutgoingShuffleState(localNode, destinationNodePointer, shuffleSet, this.asyncExecService, this.logger);
|
22 | }
|
23 |
|
24 | |
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | createIncomingShuffleState(localNode: CyclonNode, sourcePointer: CyclonNodePointer) {
|
32 | return new IncomingShuffleState(localNode, sourcePointer, this.asyncExecService, this.logger);
|
33 | }
|
34 | }
|