nextcloud/lib/private/DB/QueryBuilder/Sharded/RoundRobinShardMapper.php
Ferdinand Thiessen e0ba4d71b6
chore: add missing Override attribute to OC
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-04-28 21:29:27 +02:00

21 lines
458 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Robin Appelman <robin@icewind.nl>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\DB\QueryBuilder\Sharded;
use OCP\DB\QueryBuilder\Sharded\IShardMapper;
/**
* Map string key to an int-range by hashing the key
*/
class RoundRobinShardMapper implements IShardMapper {
#[\Override]
public function getShardForKey(int $key, int $count): int {
return $key % $count;
}
}