public class

ClusterEventBlockingQueue

extends Object
java.lang.Object
   ↳ org.apache.helix.controller.stages.ClusterEventBlockingQueue

Class Overview

A blocking queue of ClusterEvent objects to be used by the controller pipeline. This prevents multiple events of the same type from flooding the controller and preventing progress from being made. This queue has no capacity. This class is meant to be a limited implementation of the BlockingQueue interface.

Summary

Public Constructors
ClusterEventBlockingQueue()
Instantiate the queue
Public Methods
synchronized void clear()
Remove all events from the queue
boolean isEmpty()
Check if the queue is empty
synchronized ClusterEvent peek()
Get at the head of the queue without removing it
synchronized void put(ClusterEvent event)
Add a single event to the queue, overwriting events with the same name
int size()
Get the queue size
synchronized ClusterEvent take()
Remove an element from the front of the queue, blocking if none is available.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ClusterEventBlockingQueue ()

Instantiate the queue

Public Methods

public synchronized void clear ()

Remove all events from the queue

public boolean isEmpty ()

Check if the queue is empty

Returns
  • true if events are not present, false otherwise

public synchronized ClusterEvent peek ()

Get at the head of the queue without removing it

Returns
  • ClusterEvent at the front of the queue, or null if none available

public synchronized void put (ClusterEvent event)

Add a single event to the queue, overwriting events with the same name

Parameters
event ClusterEvent event to add

public int size ()

Get the queue size

Returns
  • integer size of the queue

public synchronized ClusterEvent take ()

Remove an element from the front of the queue, blocking if none is available. This method will return the most recent event seen with the oldest enqueued event name.

Returns
  • ClusterEvent at the front of the queue
Throws
InterruptedException if the wait for elements was interrupted