44import com .github .nexmark .flink .generator .GeneratorConfig ;
55import com .github .nexmark .flink .generator .NexmarkGenerator ;
66import com .spbsu .flamestream .core .data .PayloadDataItem ;
7- import com .spbsu .flamestream .core .data .meta .EdgeId ;
87import com .spbsu .flamestream .core .data .meta .GlobalTime ;
98import com .spbsu .flamestream .core .data .meta .Meta ;
109import com .spbsu .flamestream .runtime .FlameRuntime ;
2019
2120public class GeneratorFrontType implements FlameRuntime .FrontType <GeneratorFrontType .Front , Void > {
2221 private final NexmarkConfiguration nexmarkConfiguration ;
23- private final Map <EdgeId , Integer > edgePartition ;
22+ private final Map <String , Integer > nodePartition ;
2423 private final long baseTime ;
2524 private final long maxEvents ;
2625
2726 public GeneratorFrontType (
2827 NexmarkConfiguration nexmarkConfiguration ,
29- Map <EdgeId , Integer > edgePartition ,
28+ Map <String , Integer > nodePartition ,
3029 long baseTime ,
3130 long maxEvents
3231 ) {
3332 this .nexmarkConfiguration = nexmarkConfiguration ;
34- this .edgePartition = edgePartition ;
33+ this .nodePartition = nodePartition ;
3534 this .baseTime = baseTime ;
3635 this .maxEvents = maxEvents ;
3736 }
@@ -57,7 +56,7 @@ public static class Front implements com.spbsu.flamestream.runtime.edge.Front {
5756 public Front (EdgeContext edgeContext , GeneratorFrontType type ) {
5857 this .edgeContext = edgeContext ;
5958 this .type = type ;
60- partition = type .edgePartition .get (edgeContext .edgeId ());
59+ partition = type .nodePartition .get (edgeContext .edgeId (). nodeId ());
6160 }
6261
6362 @ Override
@@ -73,7 +72,7 @@ public void onStart(Consumer<Object> consumer, GlobalTime from) {
7372 1 ,
7473 type .maxEvents ,
7574 1
76- ).split (type .edgePartition .size ()).get (partition );
75+ ).split (type .nodePartition .size ()).get (partition );
7776 final var executor =
7877 Executors .newSingleThreadExecutor (runnable -> new Thread (runnable , edgeContext .edgeId ().toString ()));
7978 executor .submit (() -> {
0 commit comments