public JCQueue(String queueName, int size, int overflowLimit, int producerBatchSz, IWaitStrategy backPressureWaitStrategy,
String topologyId, String componentId, Integer taskId, int port) {
this.queueName = queueName;
this.overflowLimit = overflowLimit;
this.recvQueue = new MpscArrayQueue<>(size);
this.overflowQ = new MpscUnboundedArrayQueue<>(size);
this.metrics = new JCQueue.QueueMetrics();
this.jcMetrics = StormMetricRegistry.jcMetrics(queueName, topologyId, componentId, taskId, port);
this.producerBatchSz = Math.max(1, Math.min(producerBatchSz, size / 2));
this.backPressureWaitStrategy = backPressureWaitStrategy;
if (!METRICS_REPORTER_EXECUTOR.isShutdown()) {
METRICS_REPORTER_EXECUTOR.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
jcMetrics.set(metrics);
}
}, 15, 15, TimeUnit.SECONDS);
}
}