File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 1
1
package io .javaoperatorsdk .operator .processing ;
2
2
3
3
import io .javaoperatorsdk .operator .processing .event .Event ;
4
- import java .util .ArrayList ;
5
- import java .util .Collections ;
6
- import java .util .HashMap ;
7
- import java .util .List ;
8
- import java .util .Map ;
9
- import java .util .Objects ;
4
+ import java .util .*;
10
5
11
6
class EventBuffer {
12
7
@@ -22,7 +17,7 @@ public void addEvent(String uid, Event event) {
22
17
Objects .requireNonNull (uid , "uid" );
23
18
Objects .requireNonNull (event , "event" );
24
19
25
- List <Event > crEvents = events .computeIfAbsent (uid , (id ) -> new ArrayList <>(1 ));
20
+ List <Event > crEvents = events .computeIfAbsent (uid , (id ) -> new LinkedList <>());
26
21
crEvents .add (event );
27
22
}
28
23
@@ -31,8 +26,7 @@ public boolean newEventsExists(String resourceId) {
31
26
}
32
27
33
28
public void putBackEvents (String resourceUid , List <Event > oldEvents ) {
34
- List <Event > crEvents =
35
- events .computeIfAbsent (resourceUid , (id ) -> new ArrayList <>(oldEvents .size ()));
29
+ List <Event > crEvents = events .computeIfAbsent (resourceUid , (id ) -> new LinkedList <>());
36
30
crEvents .addAll (0 , oldEvents );
37
31
}
38
32
You can’t perform that action at this time.
0 commit comments