@@ -15,13 +15,13 @@ public class SchedulerAssignment {
15
15
/**
16
16
* assignment detail, a mapping from executor to <code>WorkerSlot</code>
17
17
*/
18
- Map <ExecutorDetails , WorkerSlot > executorToSlots ;
18
+ Map <ExecutorDetails , WorkerSlot > executorToSlot ;
19
19
20
20
public SchedulerAssignment (String topologyId , Map <ExecutorDetails , WorkerSlot > executorToSlots ) {
21
21
this .topologyId = topologyId ;
22
- this .executorToSlots = new HashMap <ExecutorDetails , WorkerSlot >(0 );
22
+ this .executorToSlot = new HashMap <ExecutorDetails , WorkerSlot >(0 );
23
23
if (executorToSlots != null ) {
24
- this .executorToSlots .putAll (executorToSlots );
24
+ this .executorToSlot .putAll (executorToSlots );
25
25
}
26
26
}
27
27
@@ -32,7 +32,7 @@ public SchedulerAssignment(String topologyId, Map<ExecutorDetails, WorkerSlot> e
32
32
*/
33
33
public void assign (WorkerSlot slot , Collection <ExecutorDetails > executors ) {
34
34
for (ExecutorDetails executor : executors ) {
35
- this .executorToSlots .put (executor , slot );
35
+ this .executorToSlot .put (executor , slot );
36
36
}
37
37
}
38
38
@@ -42,16 +42,16 @@ public void assign(WorkerSlot slot, Collection<ExecutorDetails> executors) {
42
42
*/
43
43
public void removeSlot (WorkerSlot slot ) {
44
44
List <ExecutorDetails > executors = new ArrayList <ExecutorDetails >();
45
- for (ExecutorDetails executor : this .executorToSlots .keySet ()) {
46
- WorkerSlot ws = this .executorToSlots .get (executor );
45
+ for (ExecutorDetails executor : this .executorToSlot .keySet ()) {
46
+ WorkerSlot ws = this .executorToSlot .get (executor );
47
47
if (ws .equals (slot )) {
48
48
executors .add (executor );
49
49
}
50
50
}
51
51
52
52
// remove
53
53
for (ExecutorDetails executor : executors ) {
54
- this .executorToSlots .remove (executor );
54
+ this .executorToSlot .remove (executor );
55
55
}
56
56
}
57
57
@@ -61,7 +61,7 @@ public void removeSlot(WorkerSlot slot) {
61
61
* @return
62
62
*/
63
63
public boolean isSlotOccupied (WorkerSlot slot ) {
64
- Collection <WorkerSlot > slots = this .executorToSlots .values ();
64
+ Collection <WorkerSlot > slots = this .executorToSlot .values ();
65
65
for (WorkerSlot slot1 : slots ) {
66
66
if (slot1 .equals (slot )) {
67
67
return true ;
@@ -75,15 +75,15 @@ public String getTopologyId() {
75
75
return this .topologyId ;
76
76
}
77
77
78
- public Map <ExecutorDetails , WorkerSlot > getExecutorToSlots () {
79
- return this .executorToSlots ;
78
+ public Map <ExecutorDetails , WorkerSlot > getExecutorToSlot () {
79
+ return this .executorToSlot ;
80
80
}
81
81
82
82
/**
83
83
* Return the executors covered by this assignments
84
84
* @return
85
85
*/
86
86
public Set <ExecutorDetails > getExecutors () {
87
- return this .executorToSlots .keySet ();
87
+ return this .executorToSlot .keySet ();
88
88
}
89
89
}
0 commit comments