Examples of throttle()


Examples of org.apache.hadoop.util.DataTransferThrottler.throttle()

    long bytesToSend = TOTAL_BYTES;
    long start = Util.now();
    DataTransferThrottler throttler = new DataTransferThrottler(bandwidthPerSec);
    long totalBytes = 0L;
    long bytesSent = 1024*512L; // 0.5MB
    throttler.throttle(bytesSent);
    bytesToSend -= bytesSent;
    bytesSent = 1024*768L; // 0.75MB
    throttler.throttle(bytesSent);
    bytesToSend -= bytesSent;
    try {
View Full Code Here

Examples of org.apache.hadoop.util.DataTransferThrottler.throttle()

    long totalBytes = 0L;
    long bytesSent = 1024*512L; // 0.5MB
    throttler.throttle(bytesSent);
    bytesToSend -= bytesSent;
    bytesSent = 1024*768L; // 0.75MB
    throttler.throttle(bytesSent);
    bytesToSend -= bytesSent;
    try {
      Thread.sleep(1000);
    } catch (InterruptedException ignored) {}
    throttler.throttle(bytesToSend);
View Full Code Here

Examples of org.apache.hadoop.util.DataTransferThrottler.throttle()

    throttler.throttle(bytesSent);
    bytesToSend -= bytesSent;
    try {
      Thread.sleep(1000);
    } catch (InterruptedException ignored) {}
    throttler.throttle(bytesToSend);
    long end = Util.now();
    assertTrue(totalBytes*1000/(end-start)<=bandwidthPerSec);
  }
 
  public void testBlockReplacement() throws IOException {
View Full Code Here

Examples of org.voltdb.client.exampleutils.IRateLimiter.throttle()

            while (endTime > System.currentTimeMillis())
            {
                doBenchmark(procedure, poolSize, rand, wait);

                // Use the limiter to throttle client activity
                limiter.throttle();
            }

            // We're done - stop the performance statistics display task
            timer.cancel();
View Full Code Here

Examples of org.voltdb.client.exampleutils.IRateLimiter.throttle()

                    Con.executeAsync(new DeleteCallback(false, cycle),
                                     "Delete", cycle);
                }
                cycle++;
                // Use the limiter to throttle client activity
                limiter.throttle();
            }

// --------------------------------------------------------------------------------------------------------

            Con.close();
View Full Code Here

Examples of org.voltdb.client.exampleutils.IRateLimiter.throttle()

                , (long)rand.nextInt(poolSize)
                , wait
                );

                // Use the limiter to throttle client activity
                limiter.throttle();
            }

// ---------------------------------------------------------------------------------------------------------------------------------------------------

            // We're done - stop the performance statistics display task
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.