Initializes limiter costs and boundaries

@param float $creditsPerNanosecond
@param float $maxBalance
551778
public function initialize(float $creditsPerNanosecond, float $maxBalance)
    {
        $this->creditsPerNanosecond = $creditsPerNanosecond;
        $this->maxBalance = $maxBalance;
    }
358968
private void deleteCheckFringeBalance(
                                         DeleteStack   stack,
                                         GBSNode       endp,
                                         int           endIndex,
                                         int           maxBal)
    {

        int           fDepth = 0;      /* Fringe balance depth                  */

        fDepth = 0;
        if (endp.leftChild() == null)
        {
            fDepth = 1;                /* Last node counts as one               */
            for (int j = endIndex; j > 0; j--)
            {
                GBSNode q = stack.node(j);
                if (q.leftChild() == null)/* Have not found end yet               */
                    fDepth++;
                else                     /* Found the top of the fringe           */
                    break;
            }
        }

        int t0_depth = tZeroDepth();
        int t = t0_depth;
        if (t < 1)
            t = 1;

        if ( (stack.maxDepth() >= t) &&/* Deep enough for a t0 and              */
             (endp.population() == (endp.width()-1))  )/* Last node was full   */
        {
            /* Check for a possible t0 tree          */
            int j = 1;
            if ((kFactor() % 3) == 0)
                j = 2;
            if (fDepth == j)
            {
                _xno++;
                GBSDeleteFringe.singleInstance().balance(
                                                        tZeroDepth(), stack);
            }
        }
        else                          /* Not a t0 fringe                       */
        {
            /* Check for empty node                  */
            if (endp.population() != 0)
                endp.adjustMedian();
            else
            {
                _xno++;
                GBSNode p = stack.node(endIndex);
                if (p.leftChild() == endp)
                    p.setLeftChild(null);
                else
                    p.setRightChild(null);
            }
        }
    }
181727
private boolean isAddToLoadBalancerSuspended(AutoScalingGroup asg) {
        List<SuspendedProcess> suspendedProcesses = asg.getSuspendedProcesses();
        for (SuspendedProcess process : suspendedProcesses) {
            if (PROP_ADD_TO_LOAD_BALANCER.equals(process.getProcessName())) {
                return true;
            }
        }
        return false;
    }
867273
@Nonnull
  public CacheControlBuilder setSharedMaxAgeSeconds (@Nonnegative final long nSeconds)
  {
    ValueEnforcer.isGE0 (nSeconds, "Seconds");
    m_aSharedMaxAgeSeconds = Long.valueOf (nSeconds);
    return this;
  }
659273
function TransactionBuilder (network, maximumFeeRate) {
  this.prevTxMap = {}
  this.network = network || networks.bitcoin

  // WARNING: This is __NOT__ to be relied on, its just another potential safety mechanism (safety in-depth)
  this.maximumFeeRate = maximumFeeRate || 2500

  this.inputs = []
  this.tx = new Transaction(this.network)
}
899233
public synchronized boolean acquireRebalancingPermit(int nodeId) {
        boolean added = rebalancePermits.add(nodeId);
        logger.info("Acquiring rebalancing permit for node id " + nodeId + ", returned: " + added);

        return added;
    }
778667
public static void beforeCompletion(TransactionImpl tran, int syncLevel) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "beforeCompletion", new Object[] { tran, syncLevel });

        if (syncLevel >= 0) {
            final ArrayList syncs = _syncLevels.get(syncLevel);

            if (syncs != null) {
                final int localID = (int) tran.getLocalTID();
                final byte[] globalID = tran.getTID();
                final int numSyncs = syncs.size();

                for (int s = 0; s < numSyncs; s++) {
                    ((SynchronizationCallback) syncs.get(s)).beforeCompletion(localID, globalID);
                    // exception here means rollback
                }
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "beforeCompletion");
    }
797486
public void setConcurrencyLimit(int maxConcurrency)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(this, tc, "setConcurrencyLimit", Integer.valueOf(maxConcurrency));

    boolean resumeConsumers = false;
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
      SibTr.debug(tc, "maxActiveMessagePrepareWriteLock.lock(): " + maxActiveMessagePrepareLock);
    
    // Fully lock down the active message counting
    maxActiveMessagePrepareWriteLock.lock();
    
    try
    {
      synchronized(maxActiveMessageLock)
      {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
          SibTr.debug(tc, "Inital active Messages: current: " + currentActiveMessages +
                            ", prepared: " + preparedActiveMessages +
                            ", maximum: " + maxActiveMessages +
                            " (suspended: " + consumerSetSuspended + ")");
        
        // A value of zero indicates no maximum
        if(maxConcurrency == 0)
        {
          maxActiveMessages = Integer.MAX_VALUE;
          resumeThreshold = Integer.MAX_VALUE;
        }
        else
        {
          maxActiveMessages = maxConcurrency;
          
          // Set the resumeThreshold to 80% of this value.
          float res = (maxActiveMessages * 8);
          res = Math.round(res / 10);
          this.resumeThreshold = (int) res;
        }
        
        // Check that changing the limit doesn't change our current
        // suspend state
        if(currentActiveMessages > maxActiveMessages)
          consumerSetSuspended = true;
        else if(consumerSetSuspended && (currentActiveMessages < resumeThreshold))
        {
          consumerSetSuspended = false;
          resumeConsumers = true;
        }
      } // synchronized
    }
    finally
    {
      maxActiveMessagePrepareWriteLock.unlock();

      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        SibTr.debug(tc, "maxActiveMessagePrepareWriteLock.unlock(): " + maxActiveMessagePrepareLock);
    }
    
    // We may have caused the set to be resumed - wakeup any suspended
    // members of the set.
    if(resumeConsumers)
      resumeConsumers();
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(this, tc, "setConcurrencyLimit");    
  }
51834
function handleRatelimit(?int $limit, ?int $remaining, ?float $resetTime) {
        if($limit === null && $remaining === null && $resetTime === null) {
            $this->remaining++; // there is no ratelimit...
            return;
        }
        
        $this->limit = $limit ?? $this->limit;
        $this->remaining = $remaining ?? $this->remaining;
        $this->resetTime = $resetTime ?? $this->resetTime;
        
        if($this->remaining === 0 && $this->resetTime > \microtime(true)) {
            $this->api->client->emit('debug', 'Endpoint "'.$this->endpoint.'" ratelimit encountered, continueing in '.($this->resetTime - \microtime(true)).' seconds');
        }
    }
1323296
public function limit( $new_limit ) {
		$this->limit = $new_limit;
		if ( false === starts_with( $new_limit . '', ':' ) ) {
			$this->limit = (int) $new_limit;
		}
	}
1087768
@SuppressWarnings("unchecked")
  public T withMaxDuration(Duration maxDuration) {
    Assert.notNull(maxDuration, "maxDuration");
    this.maxDuration = maxDuration;
    return (T) this;
  }
215002
public static function setMaximumCachedFiles($newLimit)
    {
        self::$maximumCachedFiles = $newLimit;
        if (count(self::$parsedFiles) > $newLimit) {
            self::$parsedFiles = array_slice(self::$parsedFiles, 0, $newLimit);
        }
    }
1279483
public function setAmountMax(float $amountMax): self
    {
        $this->amountMax = (int) ($amountMax * self::FACTOR_AMOUNT_MAX);
        return $this;
    }
324808
@Override
    protected void initializeLoadBalancer(String loadBalancingPolicyName)
    {
        if (loadBalancingPolicyName != null)
        {
            switch (LoadBalancer.getValue(loadBalancingPolicyName))
            {
            case ROUNDROBIN:
                loadBalancingPolicy = new RoundRobinBalancingPolicy();
                break;
            case LEASTACTIVE:
                loadBalancingPolicy = new ThriftLeastActiveBalancingPolcy();
                break;
            default:
                loadBalancingPolicy = new RoundRobinBalancingPolicy();
                break;
            }
        }
        loadBalancingPolicy = new RoundRobinBalancingPolicy();
    }
475675
public void setCosts(Costs nodeCosts) {
		// the plan enumeration logic works as for regular two-input-operators, which is important
		// because of the branch handling logic. it does pick redistributing network channels
		// between the sink and the sink joiner, because sinks joiner has a different DOP than the sink.
		// we discard any cost and simply use the sum of the costs from the two children.
		
		Costs totalCosts = getInput1().getSource().getCumulativeCosts().clone();
		totalCosts.addCosts(getInput2().getSource().getCumulativeCosts());
		super.setCosts(totalCosts);
	}
710554
public void setMax (BigDecimal max) {
		if (min.compareTo(max) > 0) throw new IllegalArgumentException("min can't be > max");

		this.max = max;

		if (current.compareTo(max) > 0) {
			current = max.setScale(scale, BigDecimal.ROUND_HALF_UP);
			spinner.notifyValueChanged(spinner.isProgrammaticChangeEvents());
		}
	}
1334339
public function setupRecurringPayments(string $currencyCode, string $paymentProviderId, float $replenishAmount, float $recurringAmount): BalanceInterface
    {
        $response = $this->client->post(
            $this->getBaseEndpointUri()->withPath("{$this->getBaseEndpointUri()->getPath()}/recurring-setup")->withQuery(http_build_query(['supportedCurrencyId' => $currencyCode])),
            (string) json_encode((object) [
                'providerId' => $paymentProviderId,
                'isRecurring' => 'true',
                'replenishAmount' => $replenishAmount,
                'recurringAmount' => $recurringAmount,
            ])
        );

        return $this->entitySerializer->deserialize(
            (string) $response->getBody(),
            $this->getEntityClass(),
            'json'
        );
    }