Package xbird.util.primitive

Examples of xbird.util.primitive.MutableLong


        int scanned = 0, zipf = 0;
        long base = 0L;

        long mills1 = System.currentTimeMillis();
        long ops = 0L;
        final MutableLong miss = new MutableLong(0L);
        int iocontention = 0;

        final int start = thrdnum * round;
        final int limit = start + round - 1;
        for(int nth = start, i = 0; !_stop; nth = (nth < limit) ? nth + 1 : start, i++) {
            final long key;
            if(scanning || scanLength != 0 && (i == scanLength && rand.nextDouble() < percent)) {
                if(++scanCount <= scanLength) {
                    if(!scanning) {
                        base = dist[nth];
                    }
                    key = base + scanCount;
                    scanning = true;
                    scanned++;
                } else {
                    key = dist[nth];
                    scanCount = 0;
                    scanning = false;
                    i = 0;
                    zipf++;
                }
            } else {
                key = dist[nth];
                zipf++;
            }
            ICacheEntry<Long, byte[]> entry = cache.fixEntryLazySync2(pager, key, key, miss);
            // application logic here.
            entry.unpin();
            ops++;
        }

        long mills2 = System.currentTimeMillis();
        stat.mills = mills2 - mills1;
        stat.ops = ops;
        stat.miss = miss.getValue();
        stat.iocontention = iocontention;

        if(showstdout) {
            System.out.println("[" + Thread.currentThread().getName() + "] scanned: " + scanned
                    + ", zipf: " + zipf);
View Full Code Here


    }

    public ThreadLocalCounter(final long initVal) {
        this.counter = new ThreadLocal<MutableLong>() {
            protected MutableLong initialValue() {
                return new MutableLong(initVal);
            }
        };
    }
View Full Code Here

TOP

Related Classes of xbird.util.primitive.MutableLong

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.