-
Notifications
You must be signed in to change notification settings - Fork 199
/
PruningResult.scala
33 lines (26 loc) · 1.45 KB
/
PruningResult.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package com.daml.ledger.participant.state.v2
import com.google.rpc.Status
sealed trait PruningResult extends Product with Serializable
object PruningResult {
/** Pruning has been performed. Commits the ledger api server to prune at the same offset as passed to the
* WriteService.
*/
case object ParticipantPruned extends PruningResult
/** Pruning was not performed. Indicates to ledger api server not to proceed with pruning either.
*
* @param grpcStatus grpcStatus to return as a reason according to the GRPC guidelines
* (https://grpc.github.io/grpc/core/md_doc_statuscodes.html). Examples specific to pruning:
*
* OUT_OF_RANGE: If the specified offset cannot be pruned at, but will eventually be possible to
* prune at without user intervention.
*
* FAILED_PRECONDITION: If the specified offset cannot be pruned at, and enabling pruning at the
* offset requires user intervention (such as submitting a command via the submission service).
*
* INTERNAL: If a severe error has been encountered, particularly indicating that pruning has only
* been partially applied.
*/
final case class NotPruned(grpcStatus: Status) extends PruningResult
}