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 11package io .javaoperatorsdk .operator .processing ;
22
33import 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 .*;
105
116class EventBuffer {
127
@@ -22,7 +17,7 @@ public void addEvent(String uid, Event event) {
2217 Objects .requireNonNull (uid , "uid" );
2318 Objects .requireNonNull (event , "event" );
2419
25- List <Event > crEvents = events .computeIfAbsent (uid , (id ) -> new ArrayList <>(1 ));
20+ List <Event > crEvents = events .computeIfAbsent (uid , (id ) -> new LinkedList <>());
2621 crEvents .add (event );
2722 }
2823
@@ -31,8 +26,7 @@ public boolean newEventsExists(String resourceId) {
3126 }
3227
3328 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 <>());
3630 crEvents .addAll (0 , oldEvents );
3731 }
3832
You can’t perform that action at this time.
0 commit comments