public class JCQueue extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
static interface |
JCQueue.Consumer |
static interface |
JCQueue.ExitCondition |
Constructor and Description |
---|
JCQueue(String queueName,
String metricNamePrefix,
int size,
int overflowLimit,
int producerBatchSz,
IWaitStrategy backPressureWaitStrategy,
String topologyId,
String componentId,
List<Integer> taskIds,
int port,
StormMetricRegistry metricRegistry) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
consume(JCQueue.Consumer consumer)
Non blocking.
|
int |
consume(JCQueue.Consumer consumer,
JCQueue.ExitCondition exitCond)
Non blocking.
|
void |
flush()
if(batchSz>1) : Blocking call.
|
int |
getOverflowCount() |
int |
getQueuedCount() |
double |
getQueueLoad() |
String |
getQueueName() |
boolean |
isEmptyOverflow() |
void |
publish(Object obj)
Blocking call.
|
void |
recordMsgDrop() |
int |
size() |
boolean |
tryFlush()
if(batchSz>1) : Non-Blocking call.
|
boolean |
tryPublish(Object obj)
Non-blocking call, returns false if full.
|
boolean |
tryPublishDirect(Object obj)
Non-blocking call.
|
boolean |
tryPublishToOverflow(Object obj)
Un-batched write to overflowQ.
|
public JCQueue(String queueName, String metricNamePrefix, int size, int overflowLimit, int producerBatchSz, IWaitStrategy backPressureWaitStrategy, String topologyId, String componentId, List<Integer> taskIds, int port, StormMetricRegistry metricRegistry)
public String getQueueName()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public int consume(JCQueue.Consumer consumer)
public int consume(JCQueue.Consumer consumer, JCQueue.ExitCondition exitCond)
public int size()
public double getQueueLoad()
public void publish(Object obj) throws InterruptedException
InterruptedException
public boolean tryPublish(Object obj)
public boolean tryPublishDirect(Object obj)
public boolean tryPublishToOverflow(Object obj)
public void recordMsgDrop()
public boolean isEmptyOverflow()
public int getOverflowCount()
public int getQueuedCount()
public void flush() throws InterruptedException
InterruptedException
public boolean tryFlush()
Copyright © 2023 The Apache Software Foundation. All rights reserved.