Adjust the bytesDownloaded property of the specified torrent by the passed amount.
 Adjustment should be an integer. It is added to the current bytesDownloaded amount.
16654
def adjustBytesDownloaded(infoHash, adjustment)
      torrentData = @torrentData[infoHash]
      if ! torrentData
        @logger.warn "Asked to adjust uploaded bytes for a non-existent torrent #{QuartzTorrent.bytesToHex(infoHash)}"
        return
      end
      
      runInReactorThread do
        torrentData.bytesDownloaded += adjustment
        torrentData.bytesDownloadedDataOnly += adjustment
      end
    end
287920
def handleCheckExistingResult(torrentData, pieceManagerResult)
      if pieceManagerResult.successful?
        existingBitfield = pieceManagerResult.data
        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}: We already have #{existingBitfield.countSet}/#{existingBitfield.length} pieces." 

        info = torrentData.info
       
        torrentData.blockState = BlockState.new(info, existingBitfield)

        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}: Starting torrent. Information:"
        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}:   piece length:     #{info.pieceLen}"
        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}:   number of pieces: #{info.pieces.size}"
        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}:   total length      #{info.dataLength}"

        startDownload torrentData
      else
        @logger.info "#{QuartzTorrent.bytesToHex(torrentData.infoHash)}: Checking existing pieces of torrent failed: #{pieceManagerResult.error}"
        torrentData.state = :error
      end
    end
1000667
public ReceiptTemplateBuilder addAdjustment(String name, BigDecimal amount) {
		Adjustment adjustment = new Adjustment(name, amount);
		return this.addAdjustment(adjustment);
	}
692318
public void accumulate(AverageData data,
                           Object value) {
        if (value != null) {
            data.count++;
            data.total = data.total.add( (BigDecimal) value );
        }
    }
710800
public void setAdjustment(String name, String amount)
    {
        HashMap<String, String> adjustment = new HashMap<String, String>();
        adjustment.put("name", name);
        adjustment.put("amount", amount);
        this.adjustments.add(adjustment);
    }
464974
private static void numericAdjustment(MethodVisitor mVisitor, String javaType) {
        adjustmentsMapper.getOrDefault(javaType, XsdAsmAttributes::doubleAdjustment).accept(mVisitor);
    }
1203971
def setFrozen(torrent, value)
      torrentData = torrent
      if ! torrent.is_a?(TorrentData)
        torrentData = @torrentData[torrent]
        if ! torrentData
          @logger.warn "Asked to freeze a non-existent torrent #{QuartzTorrent.bytesToHex(torrent)}"
          return
        end
      end

      if value
        # Disconnect from all peers so we won't reply to any messages.
        torrentData.peers.all.each do |peer|
          if peer.state != :disconnected
            # Close socket 
            withPeersIo(peer, "when removing torrent") do |io|
              setPeerDisconnected(peer)
              close(io)
            end
          end
          torrentData.peers.delete peer
        end
      else
        # Get our list of peers and start connecting right away
        # Non-recurring and immediate timer
        torrentData.managePeersTimer =
          @reactor.scheduleTimer(@managePeersPeriod, [:manage_peers, torrentData.infoHash], false, true)
      end
    end
26029
@Override
  public void update(final long value) {
    count.incrementAndGet();
    int index = (int) (value / binWidth);
    if (index >= numBins) {
      index = numBins - 1;
    }
    values.incrementAndGet(index);
  }
1200814
private void applyHorizontalLimit()
    {
        if (mover.getX() < limitLeft && limitLeft != Integer.MIN_VALUE)
        {
            mover.teleportX(limitLeft);
        }
        else if (mover.getX() > limitRight && limitRight != Integer.MAX_VALUE)
        {
            mover.teleportX(limitRight);
        }
    }
244810
def set(self, start, stop, length=None, units='bytes'):
        """"""
        assert is_byte_range_valid(start, stop, length), \
            'Bad range provided'
        self._units = units
        self._start = start
        self._stop = stop
        self._length = length
        if self.on_update is not None:
            self.on_update(self)
1081759
@GuardedBy("evictionLock")
  void determineAdjustment() {
    if (frequencySketch().isNotInitialized()) {
      setPreviousSampleHitRate(0.0);
      setMissesInSample(0);
      setHitsInSample(0);
      return;
    }

    int requestCount = hitsInSample() + missesInSample();
    if (requestCount < frequencySketch().sampleSize) {
      return;
    }

    double hitRate = (double) hitsInSample() / requestCount;
    double hitRateChange = hitRate - previousSampleHitRate();
    double amount = (hitRateChange >= 0) ? stepSize() : -stepSize();
    double nextStepSize = (Math.abs(hitRateChange) >= HILL_CLIMBER_RESTART_THRESHOLD)
        ? HILL_CLIMBER_STEP_PERCENT * maximum() * (amount >= 0 ? 1 : -1)
        : HILL_CLIMBER_STEP_DECAY_RATE * amount;
    setPreviousSampleHitRate(hitRate);
    setAdjustment((long) amount);
    setStepSize(nextStepSize);
    setMissesInSample(0);
    setHitsInSample(0);
  }
843635
public void setParamsWithProperty(BitSet nonNullSet) {
        for (int i = 0; i < 32; ++i) {
            setParamWithProperty(i, nonNullSet.get(i));
        }
    }
841974
int grabFlowControlBytes(int bytesToGrab) {
        if(bytesToGrab <= 0) {
            return 0;
        }
        int min;
        synchronized (flowControlLock) {
            min = (int) Math.min(bytesToGrab, sendWindowSize);
            if (bytesToGrab > FLOW_CONTROL_MIN_WINDOW && min <= FLOW_CONTROL_MIN_WINDOW) {
                //this can cause problems with padding, so we just return 0
                return 0;
            }
            min = Math.min(sendMaxFrameSize, min);
            sendWindowSize -= min;
        }
        return min;
    }
185179
public final void setValue(final int value)
	{
		expUnitAdjustment = 0;
		try {
			data = toDpt(dimensionlessCounter, value);
		}
		catch (final KNXFormatException e) {
			logger.error("{} {} coding {} (value {}) should alway have correct format", dpt.getID(),
					dpt.getDescription(), binary(dimensionlessCounter), value, e);
		}
	}
777540
public SettingsPack uploadRateLimit(int value) {
        sp.set_int(settings_pack.int_types.upload_rate_limit.swigValue(), value);
        return this;
    }
1183954
def add_torrent(file, type = :url, options = {})
      arguments = set_arguments_from_options(options)

      case type
        when :url
          file = URI.encode(file) if URI.decode(file) == file
          arguments.filename = file
        when :file
          arguments.metainfo = Base64.encode64(File.read(file))
        else
          raise ArgumentError.new('type has to be :url or :file.')
      end

      response = rpc('torrent-add', arguments)
      id = get_id_from_response(response)

      log_message = 'torrent-add result: ' + response.result
      log_message << ' (id ' + id.to_s + ')' if id
      @log.debug(log_message)

      if id && options[:seed_ratio_limit]
        set_torrent(id, {
          'seedRatioLimit' => options[:seed_ratio_limit].to_f,
          'seedRatioMode' => 1
        })
      end

      response
    end
980413
def add_adaptive_int(self, n):
        
        if n >= Message.big_int:
            self.packet.write(max_byte)
            self.add_string(util.deflate_long(n))
        else:
            self.packet.write(struct.pack(">I", n))
        return self