22
33import io .kubernetes .client .informer .ResourceEventHandler ;
44import io .kubernetes .client .informer .exception .BadNotificationException ;
5- import java .util .concurrent .ArrayBlockingQueue ;
65import java .util .concurrent .BlockingQueue ;
6+ import java .util .concurrent .LinkedBlockingQueue ;
77import org .joda .time .DateTime ;
88import org .slf4j .Logger ;
99import org .slf4j .LoggerFactory ;
1010
1111/**
1212 * ProcessorListener implements Runnable interface. It's supposed to run in background and actually
13- * executes its event handler on notification. Note that it allows 1000 pending notifications at
14- * maximum.
13+ * executes its event handler on notification.
1514 */
1615public class ProcessorListener <ApiType > implements Runnable {
1716
1817 private static final Logger log = LoggerFactory .getLogger (ProcessorListener .class );
1918
20- private static final int DEFAULT_QUEUE_CAPACITY = 1000 ;
21-
2219 // resyncPeriod is how frequently the listener wants a full resync from the shared informer. This
2320 // value may differ from requestedResyncPeriod if the shared informer adjusts it to align with the
2421 // informer's overall resync check period.
@@ -33,7 +30,7 @@ public ProcessorListener(ResourceEventHandler<ApiType> handler, long resyncPerio
3330 this .resyncPeriod = resyncPeriod ;
3431 this .handler = handler ;
3532
36- this .queue = new ArrayBlockingQueue <>(DEFAULT_QUEUE_CAPACITY );
33+ this .queue = new LinkedBlockingQueue <>();
3734
3835 determineNextResync (DateTime .now ());
3936 }
@@ -90,9 +87,7 @@ public void add(Notification<ApiType> obj) {
9087 if (obj == null ) {
9188 return ;
9289 }
93- if (!this .queue .offer (obj )) {
94- log .warn ("notification queue full!" );
95- }
90+ this .queue .add (obj );
9691 }
9792
9893 public void determineNextResync (DateTime now ) {
0 commit comments