Skip to content

Commit

Permalink
[ledger-api-test-tool] - add participant deduplication feature descri…
Browse files Browse the repository at this point in the history
…ptor [kvl-1218] (#12213)
  • Loading branch information
nicu-da authored Dec 21, 2021
1 parent f847767 commit 9102b09
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ message UserManagementFeature {}

message CommandDeduplicationFeatures {
DeduplicationPeriodSupport deduplication_period_support = 1;
ParticipantDeduplicationSupport participant_deduplication_support = 2;
}

message DeduplicationPeriodSupport {
Expand All @@ -80,3 +81,8 @@ message DeduplicationPeriodSupport {
OffsetSupport offset_support = 1;
DurationSupport duration_support = 2;
}
enum ParticipantDeduplicationSupport {
PARTICIPANT_DEDUPLICATION_NOT_SUPPORTED = 0;
PARTICIPANT_DEDUPLICATION_PARALLEL_ONLY = 1;
PARTICIPANT_DEDUPLICATION_SUPPORTED = 2;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.daml.ledger.api.health.HealthChecks
import com.daml.ledger.api.v1.version_service.{
CommandDeduplicationFeatures,
DeduplicationPeriodSupport,
ParticipantDeduplicationSupport,
}
import com.daml.ledger.participant.state.index.impl.inmemory.InMemoryUserManagementStore
import com.daml.ledger.participant.state.v2.WritePackagesService
Expand Down Expand Up @@ -206,7 +207,8 @@ final class Runner[T <: ReadWriteService, Extra](
durationSupport =
DeduplicationPeriodSupport.DurationSupport.DURATION_NATIVE_SUPPORT,
)
)
),
ParticipantDeduplicationSupport.PARTICIPANT_DEDUPLICATION_NOT_SUPPORTED,
),
).acquire()
} yield {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.daml.ledger.api.health.HealthChecks
import com.daml.ledger.api.v1.version_service.{
CommandDeduplicationFeatures,
DeduplicationPeriodSupport,
ParticipantDeduplicationSupport,
}
import com.daml.ledger.participant.state.index.impl.inmemory.InMemoryUserManagementStore
import com.daml.ledger.participant.state.v2.metrics.TimedWriteService
Expand Down Expand Up @@ -430,7 +431,8 @@ final class SandboxServer(
offsetSupport = DeduplicationPeriodSupport.OffsetSupport.OFFSET_NOT_SUPPORTED,
durationSupport = DeduplicationPeriodSupport.DurationSupport.DURATION_NATIVE_SUPPORT,
)
)
),
ParticipantDeduplicationSupport.PARTICIPANT_DEDUPLICATION_SUPPORTED,
),
)(materializer, executionSequencerFactory, loggingContext)
.map(_.withServices(List(resetService)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import com.daml.ledger.api.health.HealthChecks
import com.daml.ledger.api.v1.version_service.{
CommandDeduplicationFeatures,
DeduplicationPeriodSupport,
ParticipantDeduplicationSupport,
}
import com.daml.ledger.offset.Offset
import com.daml.ledger.participant.state.index.impl.inmemory.InMemoryUserManagementStore
Expand Down Expand Up @@ -252,7 +253,8 @@ object SandboxOnXRunner {
DeduplicationPeriodSupport.OffsetSupport.OFFSET_NOT_SUPPORTED,
DeduplicationPeriodSupport.DurationSupport.DURATION_NATIVE_SUPPORT,
)
)
),
ParticipantDeduplicationSupport.PARTICIPANT_DEDUPLICATION_NOT_SUPPORTED,
),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import com.daml.ledger.api.health.HealthChecks
import com.daml.ledger.api.v1.version_service.{
CommandDeduplicationFeatures,
DeduplicationPeriodSupport,
ParticipantDeduplicationSupport,
}
import com.daml.ledger.configuration.LedgerId
import com.daml.ledger.on.sql.Database.InvalidDatabaseException
Expand Down Expand Up @@ -324,7 +325,8 @@ class Runner(config: SandboxConfig) extends ResourceOwner[Port] {
durationSupport =
DeduplicationPeriodSupport.DurationSupport.DURATION_NATIVE_SUPPORT,
)
)
),
ParticipantDeduplicationSupport.PARTICIPANT_DEDUPLICATION_SUPPORTED,
),
)
_ = apiServerServicesClosed.completeWith(apiServer.servicesClosed())
Expand Down

0 comments on commit 9102b09

Please sign in to comment.