@@ -46,46 +46,39 @@ public class DispatchablePlanMetadata implements Serializable {
46
46
// --------------------------------------------------------------------------
47
47
// Fields extracted with {@link DispatchablePlanVisitor}
48
48
// --------------------------------------------------------------------------
49
- // info from TableNode
50
- private final List <String > _scannedTables ;
49
+
50
+ // Info from TableNode
51
+ private final List <String > _scannedTables = new ArrayList <>();
51
52
private Map <String , String > _tableOptions ;
52
- // info from MailboxSendNode - whether a stage is pre-partitioned by the same way the sending exchange desires
53
+
54
+ // Info from MailboxSendNode - whether a stage is pre-partitioned by the same way the sending exchange desires
53
55
private boolean _isPrePartitioned ;
54
- // info from PlanNode that requires singleton (e.g. SortNode/AggregateNode)
56
+
57
+ // Info from PlanNode that requires singleton (e.g. SortNode/AggregateNode)
55
58
private boolean _requiresSingletonInstance ;
56
59
57
60
// TODO: Change the following maps to lists
58
61
59
62
// --------------------------------------------------------------------------
60
63
// Fields extracted with {@link PinotDispatchPlanner}
61
64
// --------------------------------------------------------------------------
62
- // used for assigning server/worker nodes.
63
- private Map <Integer , QueryServerInstance > _workerIdToServerInstanceMap ;
64
65
65
- // used for table scan stage - we use ServerInstance instead of VirtualServer
66
- // here because all virtual servers that share a server instance will have the
67
- // same segments on them
66
+ // The following fields are calculated in {@link WorkerManager}
67
+ // Available for both leaf and intermediate stage
68
+ private Map <Integer , QueryServerInstance > _workerIdToServerInstanceMap ;
69
+ private String _partitionFunction ;
70
+ // Available for leaf stage only
71
+ // Map from workerId -> {tableType -> segments}
68
72
private Map <Integer , Map <String , List <String >>> _workerIdToSegmentsMap ;
69
-
70
- // used for build mailboxes between workers.
71
- // workerId -> {planFragmentId -> mailbox list}
72
- private final Map <Integer , Map <Integer , MailboxInfos >> _workerIdToMailboxesMap ;
73
-
74
- // used for tracking unavailable segments from routing table, then assemble missing segments exception.
75
- private final Map <String , Set <String >> _tableToUnavailableSegmentsMap ;
76
-
77
- // time boundary info
73
+ // Map from tableType -> segments, available when 'is_replicated' hint is set to true
74
+ private Map <String , List <String >> _replicatedSegments ;
78
75
private TimeBoundaryInfo _timeBoundaryInfo ;
76
+ private int _partitionParallelism = 1 ;
77
+ private final Map <String , Set <String >> _tableToUnavailableSegmentsMap = new HashMap <>();
79
78
80
- // physical partition info
81
- private String _partitionFunction ;
82
- private int _partitionParallelism ;
83
-
84
- public DispatchablePlanMetadata () {
85
- _scannedTables = new ArrayList <>();
86
- _workerIdToMailboxesMap = new HashMap <>();
87
- _tableToUnavailableSegmentsMap = new HashMap <>();
88
- }
79
+ // Calculated in {@link MailboxAssignmentVisitor}
80
+ // Map from workerId -> {planFragmentId -> mailboxes}
81
+ private final Map <Integer , Map <Integer , MailboxInfos >> _workerIdToMailboxesMap = new HashMap <>();
89
82
90
83
public List <String > getScannedTables () {
91
84
return _scannedTables ;
@@ -125,6 +118,15 @@ public void setWorkerIdToSegmentsMap(Map<Integer, Map<String, List<String>>> wor
125
118
_workerIdToSegmentsMap = workerIdToSegmentsMap ;
126
119
}
127
120
121
+ @ Nullable
122
+ public Map <String , List <String >> getReplicatedSegments () {
123
+ return _replicatedSegments ;
124
+ }
125
+
126
+ public void setReplicatedSegments (Map <String , List <String >> replicatedSegments ) {
127
+ _replicatedSegments = replicatedSegments ;
128
+ }
129
+
128
130
public Map <Integer , Map <Integer , MailboxInfos >> getWorkerIdToMailboxesMap () {
129
131
return _workerIdToMailboxesMap ;
130
132
}
0 commit comments