backtype.storm.utils
Class DisruptorQueue

java.lang.Object
  extended by backtype.storm.utils.DisruptorQueue
All Implemented Interfaces:
IStatefulObject

public class DisruptorQueue
extends Object
implements IStatefulObject

A single consumer queue that uses the LMAX Disruptor. They key to the performance is the ability to catch up to the producer by processing tuples in batches.


Nested Class Summary
static class DisruptorQueue.ObjectEventFactory
           
 
Constructor Summary
DisruptorQueue(String queueName, com.lmax.disruptor.ClaimStrategy claim, com.lmax.disruptor.WaitStrategy wait)
           
 
Method Summary
 long capacity()
           
 void consumeBatch(com.lmax.disruptor.EventHandler<Object> handler)
           
 void consumeBatchWhenAvailable(com.lmax.disruptor.EventHandler<Object> handler)
           
 void consumerStarted()
           
 String getName()
           
 Object getState()
           
 void haltWithInterrupt()
           
 float pctFull()
           
 long population()
           
 void publish(Object obj)
           
 void publish(Object obj, boolean block)
           
 long readPos()
           
 void tryPublish(Object obj)
           
 long writePos()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisruptorQueue

public DisruptorQueue(String queueName,
                      com.lmax.disruptor.ClaimStrategy claim,
                      com.lmax.disruptor.WaitStrategy wait)
Method Detail

getName

public String getName()

consumeBatch

public void consumeBatch(com.lmax.disruptor.EventHandler<Object> handler)

haltWithInterrupt

public void haltWithInterrupt()

consumeBatchWhenAvailable

public void consumeBatchWhenAvailable(com.lmax.disruptor.EventHandler<Object> handler)

publish

public void publish(Object obj)

tryPublish

public void tryPublish(Object obj)
                throws com.lmax.disruptor.InsufficientCapacityException
Throws:
com.lmax.disruptor.InsufficientCapacityException

publish

public void publish(Object obj,
                    boolean block)
             throws com.lmax.disruptor.InsufficientCapacityException
Throws:
com.lmax.disruptor.InsufficientCapacityException

consumerStarted

public void consumerStarted()

population

public long population()

capacity

public long capacity()

writePos

public long writePos()

readPos

public long readPos()

pctFull

public float pctFull()

getState

public Object getState()
Specified by:
getState in interface IStatefulObject


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.