Example usage for org.apache.commons.collections4.queue CircularFifoQueue CircularFifoQueue

List of usage examples for org.apache.commons.collections4.queue CircularFifoQueue CircularFifoQueue

Introduction

In this page you can find the example usage for org.apache.commons.collections4.queue CircularFifoQueue CircularFifoQueue.

Prototype

public CircularFifoQueue(final Collection<? extends E> coll) 

Source Link

Document

Constructor that creates a queue from the specified collection.

Usage

From source file:com.sborny.wordcountexample.AverageBolt.java

void addToQueue(String loc, Integer conc) {
    if (!averages.containsKey(loc)) {
        Queue<Integer> q = new CircularFifoQueue<>(SIZEQUEUE);
        averages.put(loc, (CircularFifoQueue<Integer>) q);
    }/*  w  w w .jav  a  2  s .  c  o m*/
    averages.get(loc).add(conc);
}

From source file:edu.iu.grnoc.flowspace_firewall.RateTracker.java

public RateTracker(int size, int rate) {
    myRate = rate;
    myFifo = new CircularFifoQueue<Date>(size);
}

From source file:ch.vorburger.exec.RollingLogOutputStream.java

@SuppressWarnings("unchecked")
RollingLogOutputStream(int maxLines) {
    ringBuffer = new CircularFifoQueue(maxLines);
}

From source file:by.zuyeu.deyestracker.core.video.capture.CameraFrameCapture.java

public CameraFrameCapture() throws DEyesTrackerException {
    OpenCVLibraryLoader.loadCoreIfNeed();
    frames = new CircularFifoQueue<>(DEFAULT_FRAMES_COUNT);
    capture = new VideoCapture(DEFAULT_DEVICE);
    isCanceled = false;//from  w  w w .  j av a 2 s .  c o m
}

From source file:at.ac.tuwien.dsg.cloud.utilities.messaging.lightweight.rabbitMq.RabbitMqConsumer.java

public RabbitMqConsumer(ReceivingChannel channel) {
    this.messageListeners = new HashMap<>();
    this.threadPool = Executors.newFixedThreadPool(1);
    this.channel = channel;
    this.messageFifo = new CircularFifoQueue<>(100);
}

From source file:actor4j.core.DefaultActorThread.java

public DefaultActorThread(ActorSystemImpl system) {
    super(system);

    directiveQueue = new MpscArrayQueue<>(system.getQueueSize());
    priorityQueue = new PriorityBlockingQueue<>(system.getQueueSize());
    serverQueueL2 = new MpscArrayQueue<>(system.getQueueSize());
    serverQueueL1 = new ArrayDeque<>(system.getBufferQueueSize());
    outerQueueL2 = new MpscArrayQueue<>(system.getQueueSize());
    outerQueueL1 = new ArrayDeque<>(system.getBufferQueueSize());
    innerQueue = new CircularFifoQueue<>(system.getQueueSize());

    newMessage = new AtomicBoolean(true);
}

From source file:actor4j.core.XActorThread.java

public XActorThread(ActorSystemImpl system) {
    super(system);

    directiveQueue = new MpscArrayQueue<>(system.getQueueSize());
    priorityQueue = new PriorityBlockingQueue<>(system.getQueueSize());
    serverQueueL2 = new MpscArrayQueue<>(system.getQueueSize());
    serverQueueL1 = new ArrayDeque<>(system.getBufferQueueSize());
    outerQueueL2B = new MpscLinkedQueue8<>();
    outerQueueL2A = new MpscArrayQueue<>(system.getQueueSize());
    outerQueueL1 = new ArrayDeque<>(system.getBufferQueueSize());
    innerQueueL2 = new LinkedList<>();
    innerQueueL1 = new CircularFifoQueue<>(system.getQueueSize());

    antiFloodingEnabled = new AtomicBoolean(false);

    newMessage = new AtomicBoolean(true);
}

From source file:com.jfastnet.MessageLog.java

public MessageLog(Config config, MessageLogProcessor.ProcessorConfig processorConfig) {
    this.config = config;
    this.processorConfig = processorConfig;
    received = new CircularFifoQueue<>(processorConfig.receivedMessagesLimit);
    sent = new CircularFifoQueue<>(processorConfig.sentMessagesLimit);
    sentMap = new LRUMap<>(processorConfig.sentMessagesMapLimit);
}

From source file:bzh.terrevirtuelle.navisu.instruments.gps.plotter.impl.controller.GpsPlotterController.java

public void init() {
    sentenceQueue = new CircularFifoQueue<>(6);
    wwd = GeoWorldWindViewImpl.getWW();/*from   w  w  w . j a v  a  2  s  .c o m*/
    gpsLayer = layersManagerServices.getInstance(GROUP, name);
    properties = new Properties();
    try {
        properties.load(new FileInputStream(PROPERTIES_FILE_NAME));
    } catch (IOException ex) {
        Logger.getLogger(AisRadarController.class.getName()).log(Level.SEVERE, null, ex);
    }
    addPanelController();
    addListeners();
    ownerShip = ShipController.createOwnerShip(properties);
    createTarget();
    subscribe();
}

From source file:com.room5.server.spring_boot.jmx.JMXServerStatistics.java

@PostConstruct
private void init() {
    //sanity check properties
    if (statCount < 1) {
        throw new IllegalArgumentException(
                "The property specifying the number of rolling metrics (statistics.interval.count) must be greater than zero; value supplied: "
                        + statCount);//  ww  w  .ja v  a  2 s.c o m
    }
    if (statIntervalDuration < 1) {
        throw new IllegalArgumentException(
                "The property specifying the rolling metrics interval duration (statistics.interval.duration.minutes) must be greater than zero; value supplied: "
                        + statIntervalDuration);
    }

    //initialize stats rolling queue
    rollingStats = new CircularFifoQueue<RollingStatistics>(statCount);

    //convert minute intervals to seconds
    intervalClock = new IntervalClock(statIntervalDuration * 60);
}