0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-02-07 18:09:45 +00:00
nextcloud_server/lib/public/DB/QueryBuilder/Sharded/IShardMapper.php
Robin Appelman 62f8b6517f
feat: implement distributing partitioned queries over multiple shards
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-28 10:21:19 +02:00

25 lines
524 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Robin Appelman <robin@icewind.nl>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCP\DB\QueryBuilder\Sharded;
/**
* Implementation of logic of mapping shard keys to shards.
* @since 30.0.0
*/
interface IShardMapper {
/**
* Get the shard number for a given shard key and total shard count
*
* @param int $key
* @param int $count
* @return int
* @since 30.0.0
*/
public function getShardForKey(int $key, int $count): int;
}