| // Copyright 2020 The LUCI Authors. |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| syntax = "proto3"; |
| |
| package luci.server.tq.internal; |
| |
| option go_package = "go.chromium.org/luci/server/tq/internal/tqpb"; |
| |
| // SweepTask is used to distribute sweeping work items and options when doing |
| // distributed sweeps. |
| // |
| // All fields are required. |
| message SweepTask { |
| // DB is an identifier of the database used for reminders. |
| // |
| // It must be registered in the process that does the sweeping. |
| string db = 1; |
| |
| // Partition specifies the range of keys to scan as [Low..High). |
| // |
| // It is a string of the form "<hex-low>_<hex-high>". |
| string partition = 2; |
| |
| // Identifies a registered Lessor implementation to grab leases through. |
| string lessor_id = 3; |
| |
| // Identifier of a lease section ID to grab leases on sub-partitions through. |
| string lease_section_id = 4; |
| |
| // Total number of shards used when this task was generated. |
| // |
| // Used FYI only in logs. |
| int32 shard_count = 5; |
| |
| // Shard number in the range of [0 .. Shards). |
| // |
| // Used FYI only in logs. |
| int32 shard_index = 6; |
| |
| // Level counts recursion level for monitoring/debugging purposes. |
| // |
| // The root sweeper triggers tasks at level=0. If there is a big backlog, |
| // level=0 task will offload some work to level=1 tasks. level > 1 should not |
| // normally happen and indicates either a bug or a very overloaded system. |
| // |
| // level > 2 won't be executed at all. |
| int32 level = 7; |
| |
| // Length of the reminder keys in the partition. |
| // |
| // Used to figure out the upper bound of the scan. Usually 16. |
| int32 key_space_bytes = 8; |
| |
| // Caps maximum number of reminders to process. |
| // |
| // Usually in hundreds. |
| int32 tasks_per_scan = 9; |
| |
| // Caps the number of follow-up scans. |
| // |
| // Usually 16. |
| int32 secondary_scan_shards = 10; |
| } |