Package java.util

Examples of java.util.Random


    private static void runBenchmarkWithZipfDistributionLockForGCLOCK(int thrdnum, Status stat, ILock lock, Segments pager, ConcurrentPluggableCache<Long, byte[]> cache, int capacity, int round, double percent, int scanLength, long[] dist) {
        boolean scanning = false;
        long scanCount = 0L;

        final Random rand = new Random(129);

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

        long mills1 = System.currentTimeMillis();
        long ops = 0L;
        long miss = 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;
View Full Code Here


    private static void runBenchmarkWithZipfDistributionSync(int thrdnum, Status stat, Segments pager, ConcurrentPluggableCache<Long, byte[]> cache, int capacity, int round, double percent, int scanLength, long[] dist) {
        boolean scanning = false;
        long scanCount = 0L;

        final Random rand = new Random();

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

        long mills1 = System.currentTimeMillis();
        long ops = 0L;
        long miss = 0L;

        final int limit = round - 1;
        for(int nth = 0, i = 0; !_stop; nth = (nth >= limit) ? 0 : nth + 1, i++) {
            final long key;
            final int distnth = nth * thrdnum;
            if(scanning || scanLength != 0 && (i == scanLength && rand.nextDouble() < percent)) {
                if(++scanCount <= scanLength) {
                    if(!scanning) {
                        base = dist[distnth];
                    }
                    key = base + scanCount;
View Full Code Here

    private static void runBenchmarkWithZipfDistributionReadWriteLock(ReadWriteLock rwlock, int thrdnum, Status stat, Segments pager, ConcurrentPluggableCache<Long, byte[]> cache, int capacity, int round, double percent, int scanLength, long[] dist) {
        boolean scanning = false;
        long scanCount = 0L;

        final Random rand = new Random(129);

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

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

        final Lock readLock = rwlock.readLock();
        final Lock writeLock = rwlock.writeLock();

        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;
View Full Code Here

    private static void runBenchmarkWithZipfDistributionReadWriteLockForGCLOCK(ReadWriteLock rwlock, int thrdnum, Status stat, Segments pager, ConcurrentPluggableCache<Long, byte[]> cache, int capacity, int round, double percent, int scanLength, long[] dist) {
        boolean scanning = false;
        long scanCount = 0L;

        final Random rand = new Random(129);

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

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

        final Lock readLock = rwlock.readLock();
        final Lock writeLock = rwlock.writeLock();

        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;
View Full Code Here

    public ZipfGenerator(double skew) {
        if(skew <= 1d) {
            throw new IllegalArgumentException("skew should be greater than 1.0f");
        }
        this.random = new Random();
        this.skew_d = skew;
    }
View Full Code Here

    private static void runBenchmarkWithZipfDistributionLock(int thrdnum, Status stat, ILock lock, Segments pager, ConcurrentPluggableCache<Long, byte[]> cache, int capacity, int round, double percent, int scanLength, long[] dist) {
        boolean scanning = false;
        long scanCount = 0L;

        final Random rand = new Random(129);

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

        long mills1 = System.currentTimeMillis();
        long ops = 0L;
        long miss = 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;
View Full Code Here

    private static void runBenchmarkWithZipfDistributionLazySync(int thrdnum, Status stat, ILock lock, Segments pager, ConcurrentPluggableCache<Long, byte[]> cache, int capacity, int round, double percent, int scanLength, long[] dist) {
        boolean scanning = false;
        long scanCount = 0L;

        final Random rand = new Random(129);

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

        long mills1 = System.currentTimeMillis();
        long ops = 0L;
        long miss = 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;
View Full Code Here

    private static void runBenchmarkWithZipfDistributionLazySync2(int thrdnum, Status stat, ILock lock, Segments pager, ConcurrentPluggableCache<Long, byte[]> cache, int capacity, int round, double percent, int scanLength, long[] dist) {
        boolean scanning = false;
        long scanCount = 0L;

        final Random rand = new Random(129);

        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;
View Full Code Here

    private static void runBenchmarkWithZipfDistributionLockForGCLOCK(int thrdnum, Status stat, ILock lock, Segments pager, ConcurrentPluggableCache<Long, byte[]> cache, int capacity, int round, double percent, int scanLength, long[] dist) {
        boolean scanning = false;
        long scanCount = 0L;

        final Random rand = new Random(129);

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

        long mills1 = System.currentTimeMillis();
        long ops = 0L;
        long miss = 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;
View Full Code Here

    private static void runBenchmarkWithZipfDistributionLock(Status stat, ILock lock, FixedSegments pager, ConcurrentPluggableCache<Long, byte[]> cache, int capacity, int round, double percent, int scanLength, long[] dist) {
        boolean scanning = false;
        long scanCount = 0L;

        final Random rand = new Random();

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

        long mills1 = System.currentTimeMillis();
        long ops = 0L;
        long miss = 0L;

        long totalExecInterval = 0L, totalDurationHold = 0L;
        long prelock = System.currentTimeMillis();

        final int limit = round - 1;
        for(int nth = 0, i = 0; !_stop; nth = (nth >= limit) ? 0 : nth + 1, i++) {
            final long key;
            if(scanning || scanLength != 0 && (i == scanLength && rand.nextDouble() < percent)) {
                if(++scanCount <= scanLength) {
                    if(!scanning) {
                        base = dist[nth];
                    }
                    key = base + scanCount;
View Full Code Here

TOP

Related Classes of java.util.Random

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.