org.apache.oozie.event
Class MemoryEventQueue

java.lang.Object
  extended by org.apache.oozie.event.MemoryEventQueue
All Implemented Interfaces:
EventQueue

public class MemoryEventQueue
extends Object
implements EventQueue

An implementation of the EventQueue, defining a memory-based data structure holding the events


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.oozie.event.EventQueue
EventQueue.EventQueueElement
 
Constructor Summary
MemoryEventQueue()
           
 
Method Summary
 void add(org.apache.oozie.client.event.Event e)
          Add event to queue
 void clear()
          Clear the events queue
 int getBatchSize()
          Get the batch size used during polling events
 void init(org.apache.hadoop.conf.Configuration conf)
          Initialize the event queue
 boolean isEmpty()
          Find out if queue is empty
 org.apache.oozie.client.event.Event peek()
          Read topmost event from queue but do not pop from it
 org.apache.oozie.client.event.Event poll()
          Fetch single event from queue
 List<org.apache.oozie.client.event.Event> pollBatch()
          Fetch events from queue in batch
 int size()
          Get current queue size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryEventQueue

public MemoryEventQueue()
Method Detail

init

public void init(org.apache.hadoop.conf.Configuration conf)
Description copied from interface: EventQueue
Initialize the event queue

Specified by:
init in interface EventQueue

getBatchSize

public int getBatchSize()
Description copied from interface: EventQueue
Get the batch size used during polling events

Specified by:
getBatchSize in interface EventQueue
Returns:
batchSize

add

public void add(org.apache.oozie.client.event.Event e)
Description copied from interface: EventQueue
Add event to queue

Specified by:
add in interface EventQueue

pollBatch

public List<org.apache.oozie.client.event.Event> pollBatch()
Description copied from interface: EventQueue
Fetch events from queue in batch

Specified by:
pollBatch in interface EventQueue
Returns:
events set

poll

public org.apache.oozie.client.event.Event poll()
Description copied from interface: EventQueue
Fetch single event from queue

Specified by:
poll in interface EventQueue
Returns:
event

isEmpty

public boolean isEmpty()
Description copied from interface: EventQueue
Find out if queue is empty

Specified by:
isEmpty in interface EventQueue
Returns:
boolean

size

public int size()
Description copied from interface: EventQueue
Get current queue size

Specified by:
size in interface EventQueue
Returns:
size

peek

public org.apache.oozie.client.event.Event peek()
Description copied from interface: EventQueue
Read topmost event from queue but do not pop from it

Specified by:
peek in interface EventQueue
Returns:
event

clear

public void clear()
Description copied from interface: EventQueue
Clear the events queue

Specified by:
clear in interface EventQueue


Copyright © 2013 Apache Software Foundation. All Rights Reserved.