Search in sources :

Example 1 with JCQueue

use of org.apache.storm.utils.JCQueue in project storm by apache.

the class JCQueuePerfTest method producerFwdConsumer.

private static void producerFwdConsumer(int prodBatchSz) {
    WaitStrategyPark ws = new WaitStrategyPark(100);
    StormMetricRegistry registry = new StormMetricRegistry();
    JCQueue q1 = new JCQueue("q1", "q1", 1024, 0, prodBatchSz, ws, "test", "test", Collections.singletonList(1000), 1000, registry);
    JCQueue q2 = new JCQueue("q2", "q2", 1024, 0, prodBatchSz, ws, "test", "test", Collections.singletonList(1000), 1000, registry);
    final Producer prod = new Producer(q1);
    final Forwarder fwd = new Forwarder(q1, q2);
    final Consumer cons = new Consumer(q2);
    runAllThds(prod, fwd, cons);
}
Also used : JCQueue(org.apache.storm.utils.JCQueue) WaitStrategyPark(org.apache.storm.policy.WaitStrategyPark) StormMetricRegistry(org.apache.storm.metrics2.StormMetricRegistry)

Example 2 with JCQueue

use of org.apache.storm.utils.JCQueue in project storm by apache.

the class JCQueuePerfTest method oneProducer1Consumer.

private static void oneProducer1Consumer(int prodBatchSz) {
    JCQueue q1 = new JCQueue("q1", "q1", 50_000, 0, prodBatchSz, new WaitStrategyPark(100), "test", "test", Collections.singletonList(1000), 1000, new StormMetricRegistry());
    final Producer prod1 = new Producer(q1);
    final Consumer cons1 = new Consumer(q1);
    runAllThds(prod1, cons1);
}
Also used : JCQueue(org.apache.storm.utils.JCQueue) WaitStrategyPark(org.apache.storm.policy.WaitStrategyPark) StormMetricRegistry(org.apache.storm.metrics2.StormMetricRegistry)

Example 3 with JCQueue

use of org.apache.storm.utils.JCQueue in project storm by apache.

the class JCQueuePerfTest method twoProducer1Consumer.

private static void twoProducer1Consumer(int prodBatchSz) {
    JCQueue q1 = new JCQueue("q1", "q1", 50_000, 0, prodBatchSz, new WaitStrategyPark(100), "test", "test", Collections.singletonList(1000), 1000, new StormMetricRegistry());
    final Producer prod1 = new Producer(q1);
    final Producer prod2 = new Producer(q1);
    final Consumer cons1 = new Consumer(q1);
    runAllThds(prod1, prod2, cons1);
}
Also used : JCQueue(org.apache.storm.utils.JCQueue) WaitStrategyPark(org.apache.storm.policy.WaitStrategyPark) StormMetricRegistry(org.apache.storm.metrics2.StormMetricRegistry)

Example 4 with JCQueue

use of org.apache.storm.utils.JCQueue in project storm by apache.

the class JCQueuePerfTest method ackingProducerSimulation.

private static void ackingProducerSimulation() {
    WaitStrategyPark ws = new WaitStrategyPark(100);
    StormMetricRegistry registry = new StormMetricRegistry();
    JCQueue spoutQ = new JCQueue("spoutQ", "spoutQ", 1024, 0, 100, ws, "test", "test", Collections.singletonList(1000), 1000, registry);
    JCQueue ackQ = new JCQueue("ackQ", "ackQ", 1024, 0, 100, ws, "test", "test", Collections.singletonList(1000), 1000, registry);
    final AckingProducer ackingProducer = new AckingProducer(spoutQ, ackQ);
    final Acker acker = new Acker(ackQ, spoutQ);
    runAllThds(ackingProducer, acker);
}
Also used : JCQueue(org.apache.storm.utils.JCQueue) WaitStrategyPark(org.apache.storm.policy.WaitStrategyPark) StormMetricRegistry(org.apache.storm.metrics2.StormMetricRegistry)

Example 5 with JCQueue

use of org.apache.storm.utils.JCQueue in project storm by apache.

the class JCQueuePerfTest method threeProducer1Consumer.

private static void threeProducer1Consumer(int prodBatchSz) {
    JCQueue q1 = new JCQueue("q1", "q1", 50_000, 0, prodBatchSz, new WaitStrategyPark(100), "test", "test", Collections.singletonList(1000), 1000, new StormMetricRegistry());
    final Producer prod1 = new Producer(q1);
    final Producer prod2 = new Producer(q1);
    final Producer prod3 = new Producer(q1);
    final Consumer cons1 = new Consumer(q1);
    runAllThds(prod1, prod2, prod3, cons1);
}
Also used : JCQueue(org.apache.storm.utils.JCQueue) WaitStrategyPark(org.apache.storm.policy.WaitStrategyPark) StormMetricRegistry(org.apache.storm.metrics2.StormMetricRegistry)

Aggregations

JCQueue (org.apache.storm.utils.JCQueue)16 StormMetricRegistry (org.apache.storm.metrics2.StormMetricRegistry)13 WaitStrategyPark (org.apache.storm.policy.WaitStrategyPark)7 BackpressureState (org.apache.storm.daemon.worker.BackPressureTracker.BackpressureState)6 BackPressureStatus (org.apache.storm.messaging.netty.BackPressureStatus)6 Test (org.junit.Test)6 HashMap (java.util.HashMap)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 WorkerState (org.apache.storm.daemon.worker.WorkerState)1 WorkerTransfer (org.apache.storm.daemon.worker.WorkerTransfer)1 StormTopology (org.apache.storm.generated.StormTopology)1 IWaitStrategy (org.apache.storm.policy.IWaitStrategy)1 GeneralTopologyContext (org.apache.storm.task.GeneralTopologyContext)1 WorkerTopologyContext (org.apache.storm.task.WorkerTopologyContext)1 AddressedTuple (org.apache.storm.tuple.AddressedTuple)1 Before (org.junit.Before)1