Returns quota limit value otherwise throws {@link UnknownQuotaLimitException}.
430515
private long getQuota(CacheKey key) throws UnknownQuotaLimitException
   {
      Long size = (Long)cache.withFlags(Flag.FORCE_WRITE_LOCK).get(key);

      if (size == null)
      {
         throw new UnknownQuotaLimitException("Quota was not set early");
      }

      return size;
   }
604210
static int getPoaThreadPoolMax() {
        if (!thread_pool_max_done) {
            final String str = System.getProperty("jacorb.poa.thread_pool_max");
            int value;
            try {
                value = Integer.parseInt(str);
                if (value > 0) {
                    thread_pool_max = value;
                }
            } catch (final NumberFormatException e) {
            }
            thread_pool_max_done = true;
        }
        return thread_pool_max;
    }
1340577
private String replaceAndAppendLimit(String parsedQuery)
    {
        StringBuilder builder = new StringBuilder(parsedQuery);
        onLimit(builder);
        parsedQuery = builder.toString();
        return parsedQuery;
    }
333373
def quota(ip=None):
    """"""
    # TODO: Add arbitrary user defined IP check
    url = 'http://www.random.org/quota/?format=plain'
    data = urlopen(url)
    credit = int(data.read().strip())
    if data.code == 200:
        return credit
    else:
        return "ERROR: Server responded with code %s" % data.code
158406
public function setQuota(): int
    {
        $this->quota = (int) floor(
            ($this->validBallots /
                ($this->election->getWinnersCount() + 1)
            ) // p. 47 (1)
            + 1); // p. 47 (2)

        $this->logger->info(sprintf('Quota set at %d based on %d winners and %d valid ballots', $this->quota, $this->election->getWinnersCount(), $this->validBallots));

        return $this->quota;
    }
1177790
public T getMax() {
    if (StringUtils.isEmpty(getInputElement().getMax())) {
      return null;
    }
    try {
      return this.numberParser.parse(getInputElement().getMax());
    } catch (final ParseException e) {
      return null;
    }
  }
691144
protected function parseRequest()
    {
        if (request()->limit) {
            if (request()->limit <= 0) {
                throw new InvalidLimitException();
            }
            else if (request()->limit > config("api.maxLimit")) {
                throw new MaxLimitException();
            }
            else {
                $this->limit = request()->limit;
            }
        }
        else {
            $this->limit = config("api.defaultLimit");
        }

        if (request()->offset) {
            $this->offset = request()->offset;
        }
        else {
            $this->offset = 0;
        }

        $this->extractFields();
        $this->extractFilters();
        $this->extractOrdering();
        $this->loadTableName();

        $this->attributes = request()->all();

        return $this;
    }
512436
@Override
    public void registerLimit(final long limit) {

        if (queues.size() > 0) {
            if (unlimited.get(currentQueue())
                         .get())
                limits.get(currentQueue())
                      .set(0);

            limits.get(currentQueue())
                  .addAndGet(limit);
            unlimited.get(currentQueue())
                     .set(false);

            queues.stream()
                  .forEach(this::closeQueueIfFinishedStateless);

        }
    }
1215702
private boolean nextWithoutLimit() throws SQLException {
		if (maxRows > 0 && rowsFetched >= maxRows) {
			System.out.println("Reach max rows " + maxRows);
			return false;
		}

		if ((recordItr == null || !recordItr.hasNext()) && !emptyResultSet) {
			TSFetchResultsReq req = new TSFetchResultsReq(sql, fetchSize);

			try {
				TSFetchResultsResp resp = client.fetchResults(req);
				Utils.verifySuccess(resp.getStatus());
				if (!resp.hasResultSet) {
					emptyResultSet = true;
				} else {
					TSQueryDataSet tsQueryDataSet = resp.getQueryDataSet();
					List<RowRecord> records = Utils.convertRowRecords(tsQueryDataSet);
					recordItr = records.iterator();
				}
			} catch (TException e) {
				throw new SQLException("Cannot fetch result from server, because of network connection");
			}

		}
		if (emptyResultSet) {
			return false;
		}
		record = recordItr.next();
		// if(record.getDeltaObjectType() != null &&
		// record.getDeltaObjectType().equals(AGGREGATION_STR)){
		// if(columnInfo.containsKey(TIMESTAMP_STR)){
		// columnInfo.remove(TIMESTAMP_STR);
		// }
		// }

		rowsFetched++;
        // maxRows is a constraint that exists in parallel with the LIMIT&SLIMIT constraints,
        // so rowsFetched will increase whenever the row is fetched,
        // regardless of whether the row satisfies the LIMIT&SLIMIT constraints or not.

		return true;
	}
1339847
public SearchOptions setLimit(int limit) {
    if (limit <= 0) {
      this.limit = MAX_LIMIT;
    } else {
      this.limit = Math.min(limit, MAX_LIMIT);
    }
    return this;
  }
1209859
async def service(self, limit=None, quota: Optional[Quota] = None) -> int:
        
        if self.listener:
            await self._serviceStack(self.age, quota)
        else:
            logger.info("{} is stopped".format(self))

        r = len(self.rxMsgs)
        if r > 0:
            pracLimit = limit if limit else sys.maxsize
            return self.processReceived(pracLimit)
        return 0
1244447
@Override
	public String getLimitClause(final long limit, final long offset) {
		StringBuilder builder = new StringBuilder();
		if (limit > 0) {
			builder.append("LIMIT ").append(limit).append(" ");
		}
		if (offset > 0) {
			builder.append("OFFSET ").append(offset);
		}
		if (builder.length() > 0) {
			builder.append(System.lineSeparator());
		}
		return builder.toString();
	}
976974
Constraint getLimitConstraint() {
        Constraint result = null;
        for (Constraint constraint : getConstraints()) {
            if (constraint.getConstraintType() == Constraint.LIMIT) {
                // We're assuming only one LIMIT constraint at the moment
                result = constraint;
                break;
            }
        }
        return result;
    }
125635
private function getLimit(?int $limit = null): ?int
    {
        if (is_int($limit) && $limit >= 0) {
            return $limit;
        }

        return null;
    }
273633
public long getRepositoryDataSizeDirectly() throws QuotaManagerException
   {
      long size = 0;
      for (WorkspaceQuotaManager wQuotaManager : wsQuotaManagers.values())
      {
         size += wQuotaManager.getWorkspaceDataSizeDirectly();
      }

      return size;
   }
287492
def get_quota(self):
		''
		du, ds = op.itemgetter('used_bytes', 'max_bytes')((yield self()))
		defer.returnValue((ds - du, ds))
1091747
public R setLimit(int limit) {
        mQueryMap.put(LIMIT, String.valueOf(limit));
        return (R) this;
    }