go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/server/dsmapper/internal/tasks/tasks.proto (about)

     1  // Copyright 2018 The LUCI Authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  syntax = "proto3";
    16  
    17  package luci.server.dsmapper.internal.tasks;
    18  
    19  option go_package = "go.chromium.org/luci/server/dsmapper/internal/tasks";
    20  
    21  
    22  // SplitAndLaunch task splits the key range into shards and kicks off processing
    23  // of each individual shard.
    24  //
    25  // Enqueued transactionally when creating a new mapping job.
    26  message SplitAndLaunch {
    27    int64 job_id = 1;
    28  }
    29  
    30  
    31  // FanOutShards enqueues a bunch of ProcessShard named tasks (one per shard).
    32  //
    33  // Enqueued transactionally by SplitAndLaunch after it has constructed shards.
    34  message FanOutShards {
    35    int64 job_id = 1;
    36  }
    37  
    38  
    39  // ProcessShard sequentially reads the entities belonging to a key range
    40  // assigned to a shard and applies the mapper to them.
    41  //
    42  // Upon reaching 1 min mark, relaunches itself, increasing task_num. Thus
    43  // ProcessShard is actually a chain of tasks that runs as long as needed to
    44  // completely process the shard.
    45  message ProcessShard {
    46    int64 job_id = 1;
    47    int64 shard_id = 2;
    48    int64 task_num = 3;
    49  }
    50  
    51  
    52  // RequestJobStateUpdate is transactionally emitted by ProcessShard when shard's
    53  // state changes.
    54  //
    55  // It eventually (with some throttling) causes UpdateJobState to be emitted,
    56  // which updates the job state based on states of the shards.
    57  message RequestJobStateUpdate {
    58    int64 job_id = 1;
    59    int64 shard_id = 2; // mostly FYI
    60  }
    61  
    62  
    63  // UpdateJobState is emitted after one or more shards have changed their state.
    64  //
    65  // It recalculates the job's state based on state of all its shards. Throttled
    66  // to 0.5 QPS.
    67  message UpdateJobState {
    68    int64 job_id = 1;
    69  }