Checks if there is a result on the bucket.  Before checking,
runs a non-blocking poll of the children for updated results.

@param string $bucket The bucket to check.
@return int Returns true if there is a result
351538
public function has_result($bucket = self::DEFAULT_BUCKET)
	{
		// check for additional results
		$this->post_results($bucket);

		return (!empty($this->results[$bucket]));
	}
465071
public function executeNone(string $query): int
  {
    $this->realQuery($query);

    $n = $this->mysqli->affected_rows;

    if ($this->mysqli->more_results()) $this->mysqli->next_result();

    return $n;
  }
139972
public function flush($bucket)
    {
        if (false === empty($_SESSION[self::ROOT_NODE][$bucket])) {
            $_SESSION[self::ROOT_NODE][$bucket] = [];
            return true;
        }

        return false;
    }
409285
public function children_running($bucket = self::DEFAULT_BUCKET, $show_pending = false)
	{
		// force reaping of children
		$this->signal_handler_sigchild(SIGCHLD);

		// return global count if bucket is default
		if ($bucket == self::DEFAULT_BUCKET)
		{
			return ($show_pending ? count($this->forked_children) : $this->forked_children_count);
		}

		// count within the specified bucket
		$count = 0;
		foreach ($this->forked_children as $child)
		{
			if ($show_pending)
			{
				if ($child['bucket'] == $bucket)
				{
					$count++;
				}
			}
			else if (($child['bucket'] == $bucket) && ($child['status'] != self::STOPPED))
			{
				$count++;
			}
		}

		return $count;
	}
538576
public function has($path)
    {
        $location = $this->applyPathPrefix($path);
        return $this->ossClient->doesObjectExist($this->bucket, $location);
    }
637555
public function doesBucketExist($bucket, $accept403 = true, array $params = [])
    {
        return $this->instance->doesBucketExist($bucket, $accept403, $params);
    }
492061
private function statusComparator($s1, $s2)
    {
        if (array_search($s1->getCode(), $this->statusOrder) === array_search($s2->getCode(), $this->statusOrder)) {
            return 0;
        }

        return (array_search($s1->getCode(), $this->statusOrder)
            < array_search($s2->getCode(), $this->statusOrder)) ? -1 : 1;
    }
1031454
public function hasBlock( $section )
	{
		$names	= array_keys( $this->blocks );
		$result	= array_search( $section, $names );
		$return	= is_int( $result );
		return $return;
	}
622250
public function max_work_per_child_set($value, $bucket = self::DEFAULT_BUCKET)
	{
		if ($this->child_single_work_item[$bucket])
		{
			$value = 1;
		}

		if ($value < 1)
		{
			$value = 0;
			$this->log(($bucket === self::DEFAULT_BUCKET ? 'default' : $bucket) . ' bucket max_work_per_child set to 0, bucket will be disabled', self::LOG_LEVEL_WARN);
		}

		$this->max_work_per_child[$bucket] = $value;
	}
62287
public function has($key)
    {
        $result = $this->get($key);

        //an empty EntityCollection means no related entities
        if ($result instanceof EntityCollection && count($result) === 0) {
            return false;
        }

        return $result ? true : false;
    }
121499
private function hasNotAllowedChildren(MethodNode $node)
    {
        $children = $node->findChildrenOfType('ScopeStatement');

        $allowedChildren = explode(
            $this->getStringProperty('delimiter'),
            $this->getStringProperty('allowedChildren')
        );

        /** @var AbstractNode $child */
        foreach ($children as $child) {
            if (true === in_array($child->getImage(), $allowedChildren) || true === $this->isChildOfTry($child)) {
                continue;
            }

            return true;
        }

        return false;
    }
1062681
protected function process_work_unit($bucket = self::DEFAULT_BUCKET)
	{
		$child_work_units = array_splice($this->work_units[$bucket], 0, $this->max_work_per_child[$bucket]);

		if ($this->child_persistent_mode[$bucket])
		{
			$data = isset($this->child_persistent_mode_data[$bucket]) ? $this->child_persistent_mode_data[$bucket] : null;
			$this->fork_work_unit($data, '', $bucket);
		}
		elseif (count($child_work_units) > 0)
		{
			if ($this->child_single_work_item[$bucket])
			{
				// break out identifier and unit
				$child_identifier = key($child_work_units);
				$child_work_unit = current($child_work_units);
				next($child_work_units);

				// strip preceeding 'id-' from the identifier
				if (strpos($child_identifier, 'id-') === 0)
				{
					$child_identifier = substr($child_identifier, 3);
				}

				// process work unit
				$this->fork_work_unit(array($child_work_unit, $child_identifier), $child_identifier, $bucket);
			}
			else
			{
				$this->fork_work_unit(array($child_work_units), '', $bucket);
			}
		}

		// Poll for results from children
		$this->post_results($bucket);
	}
689423
public function hasSort(string $field): bool
    {
        foreach ($this->sorts as $sort) {
            if ($field === $sort->getField()) {
                return true;
            }
        }

        return false;
    }
572850
def exists(self, bucket, label):
        ''''''
        fn = self._zf(bucket, label)
        try:
            self.z.getinfo(fn)
            return True
        except KeyError:
            return False
508987
public function prefetch($bucket, $key){
        $err = $this->bucketManager->prefetch($bucket, $key);
        if($err){
            return $this->error($err->message(), ['errorCode'=>$err->code()]);
        }
        return $this->success('操作成功');
    }
309152
public function count()
    {
        if ($this->_resultsCount === null) {
            $this->_resultsCount = $this->_performCount();
        }

        return $this->_resultsCount;
    }
553826
public function getNextSortValue(array $scope = []): int
    {
        $query = $this->_table->query();
        $scope = Hash::merge($this->getConfig('scope'), $scope);
        if (!empty($scope)) {
            $query->where($scope);
        }
        $query->select([
            'maxSort' => $query->func()->max($this->getConfig('sortField')),
        ]);
        $res = $query->enableHydration(false)->first();
        if (empty($res)) {
            return 1;
        }

        return ($res['maxSort'] + 1);
    }