feat: add engineVersion option to projection create#389
Conversation
Exposes the V2 projection engine introduced in KurrentDB. Setting engineVersion(2) on CreateProjectionOptions selects V2; 0 (default) or 1 selects V1. The option is pinned at create time and cannot be changed via update.
Review Summary by QodoAdd engineVersion option to projection create for V2 engine support
WalkthroughsDescription• Adds engineVersion option to projection creation API • Exposes V2 projection engine with partition-based parallel processing • Engine version pinned at create time, cannot be changed via update • V2 has limitations: no result streams, no bi-state projections, rejects trackEmittedStreams Diagramflowchart LR
A["CreateProjectionOptions"] -->|"engineVersion int"| B["CreateProjection"]
B -->|"setEngineVersion"| C["CreateReq.Options"]
C -->|"engine_version field 5"| D["gRPC Server"]
D -->|"0/1=V1, 2=V2"| E["Projection Engine"]
File Changes1. src/main/java/io/kurrent/dbclient/CreateProjectionOptions.java
|
Code Review by Qodo
1. Missing engineVersion validation
|
Summary
engineVersion(int)toCreateProjectionOptions, exposing the V2 projection engine introduced in KurrentDBengine_versionfield (5) toCreateReq.Optionsin the client proto so the value is sent to the serverCreateProjectionso it lands on the gRPCCreateReq.OptionsV2 selection:
engineVersion(2)selects V2.0(default) or1selects V1. The engine version is pinned at create time and cannot be changed viaupdate.V2 has limitations vs V1 (documented on the option's javadoc):
outputState()live updates — poll state instead)$initShared) are not supportedtrackEmittedStreams=trueis rejected by the serverCloses DEV-1657.
Test plan
setEngineVersion(int)onCreateReq.Options.BuilderengineVersion(2), verify it runs as V2