Example usage for com.google.common.collect EvictingQueue create

List of usage examples for com.google.common.collect EvictingQueue create

Introduction

In this page you can find the example usage for com.google.common.collect EvictingQueue create.

Prototype

public static <E> EvictingQueue<E> create(int maxSize) 

Source Link

Document

Creates and returns a new evicting queue that will hold up to maxSize elements.

Usage

From source file:net.tradelib.functors.Max.java

public Max(int length) {
    this.length = length;
    this.count = 0;
    this.eq = EvictingQueue.create(this.length);
}

From source file:net.tradelib.functors.Min.java

public Min(int length) {
    this.length = length;
    this.count = 0;
    this.eq = EvictingQueue.create(this.length);
}

From source file:net.tradelib.functors.Sma.java

public Sma(int n) {
    this.count = 0;
    this.n = n;//from www  .j av  a2 s.  c  o m
    this.dn = n;
    this.mean = 0.0;
    this.cq = EvictingQueue.create(this.n);
}

From source file:middleware.LiveTransactionStatistic.java

public LiveTransactionStatistic() {
    examples = EvictingQueue.create(MAX_EXAMPLE_LIMIT);
}

From source file:net.tradelib.functors.StdDev.java

public StdDev(int n) {
    this.mean = 0.0;
    this.var = 0.0;
    this.count = 0;
    this.n = n;//from w ww  .j  a v a 2 s  .  c  o m
    this.dn = n;
    this.eq = EvictingQueue.create(this.n);
}

From source file:fr.norad.jmxzabbix.core.JmxToZabbixDaemon.java

@Override
public void run() {
    EvictingQueue<ZabbixRequest> queue = EvictingQueue.create(config.getInMemoryMaxQueueSize());
    while (!interruptFlag) {
        try {//from  w  w w  .j  a v  a 2s  .c o m
            Thread.sleep(config.getPushIntervalSecond() * 1000);
            if (isNullOrEmpty(config.getZabbix().getHost())) {
                continue;
            }
            ZabbixRequest metrics = new JmxMetrics(config.getJmx(), config.getServerName()).getMetrics();
            if (metrics != null) {
                queue.add(metrics);
            }
            new ZabbixClient(config.getZabbix()).send(queue);
        } catch (Exception e) {
            e.printStackTrace(System.err);
        }
    }

}

From source file:com.facebook.buck.intellij.plugin.ws.buckevents.BuckEventsQueue.java

public BuckEventsQueue(BuckEventsConsumerFactory factory) {
    mFactory = factory;
    mLowPri = EvictingQueue.create(maxLowPriSize);
}

From source file:com.anathema_roguelike.main.ui.messages.MessageBuffer.java

public MessageBuffer(int width, int height) {
    this.width = width;
    this.height = height;

    this.queue = EvictingQueue.create(maxSize);
}

From source file:com.boundlessgeo.geoserver.util.RecentObjectCache.java

public RecentObjectCache(final int size) {
    cache = CacheBuilder.newBuilder().build(new CacheLoader<Class<?>, EvictingQueue<Ref>>() {
        @Override//from   w  ww.  j  ava  2s .co m
        public EvictingQueue<Ref> load(Class<?> key) throws Exception {
            return EvictingQueue.create(size);
        }
    });
}

From source file:com.facebook.presto.connector.jmx.JmxHistoricalData.java

public JmxHistoricalData(int maxEntries, Set<String> tableNames) {
    tables = tableNames.stream().map(String::toLowerCase).collect(toSet());
    for (String tableName : tables) {
        tableData.put(tableName, EvictingQueue.create(maxEntries));
    }/*ww w. j ava  2 s  . c  o m*/
}