backtype.storm.utils
Class DisruptorQueue
java.lang.Object
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.
|
Constructor Summary |
DisruptorQueue(String queueName,
com.lmax.disruptor.ClaimStrategy claim,
com.lmax.disruptor.WaitStrategy wait)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DisruptorQueue
public DisruptorQueue(String queueName,
com.lmax.disruptor.ClaimStrategy claim,
com.lmax.disruptor.WaitStrategy wait)
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.