Examples of TokenBucket


Examples of freenet.support.TokenBucket

    localSSKFetchTimeAverageBulk = new TrivialRunningAverage();

    chkSuccessRatesByLocation = new Histogram2(10, 1.0);

    requestOutputThrottle =
      new TokenBucket(Math.max(obwLimit*60, 32768*20), SECONDS.toNanos(1) / obwLimit, 0);
    requestInputThrottle =
      new TokenBucket(Math.max(ibwLimit*60, 32768*20), SECONDS.toNanos(1) / ibwLimit, 0);

    double nodeLoc=node.lm.getLocation();
    this.avgCacheCHKLocation   = new DecayingKeyspaceAverage(nodeLoc, 10000, throttleFS == null ? null : throttleFS.subset("AverageCacheCHKLocation"));
    this.avgStoreCHKLocation   = new DecayingKeyspaceAverage(nodeLoc, 10000, throttleFS == null ? null : throttleFS.subset("AverageStoreCHKLocation"));
    this.avgSlashdotCacheCHKLocation = new DecayingKeyspaceAverage(nodeLoc, 10000, throttleFS == null ? null : throttleFS.subset("AverageSlashdotCacheCHKLocation"));
View Full Code Here

Examples of freenet.support.TokenBucket

    int bucketSize = obwLimit/2;
    // Must have at least space for ONE PACKET.
    // FIXME: make compatible with alternate transports.
    bucketSize = Math.max(bucketSize, 2048);
    try {
    outputThrottle = new TokenBucket(bucketSize, SECONDS.toNanos(1) / obwLimit, obwLimit/2);
    } catch (IllegalArgumentException e) {
      throw new NodeInitException(NodeInitException.EXIT_BAD_BWLIMIT, e.getMessage());
    }

    nodeConfig.register("inputBandwidthLimit", "-1", sortOrder++, false, true, "Node.inBWLimit", "Node.inBWLimitLong"new IntCallback() {
View Full Code Here

Examples of org.apache.hadoop.mapred.GenWriterThread.TokenBucket

      super(conf, input, output, rtc);
      this.rtc = rtc;
      this.replication = (short)conf.getInt(REPLICATION_KEY, DEFAULT_REPLICATION_NUM);
      this.max_size = conf.getLong(FILE_SIZE_KEY, DEFAULT_FILE_SIZE) * 1024 * 1024;
      this.pread = conf.getFloat(READ_PERCENT_KEY, DEFAULT_READ_PERCENT);
      this.tb = new TokenBucket(rtc.data_rate);
      this.id = id;
      this.thread_name = rtc.task_name + "_" + id;
      this.running_type = init_type;
      if (running_type.equals(RUNNING_TYPE.PREPARE)) {
        this.file_prefix = rtc.cur_datanode + thread_name +  "_part";
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.