You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kv: extract KVBatch service from Internal service and remove api_drpc_hacky
This change removes the old manually-created `api_drpc_hacky.go` file and
uses the properly auto-generated `api_drpc.pb.go` now that the DRPC
compiler setup is working.
We also extract the `KVBatch` service from the `Internal` service, which
has largely been an ad-hoc collection of internal RPCs. This enables:
- Easier Maintenance: Smaller services are simpler to manage and update.
- Smoother DRPC Rollout: We can move to DRPC step-by-step with these
smaller services, rather than doing `Internal` all at once.
- Subsystems get client interfaces focused only on what they need.
We also refactor `batchStreamImpl` to directly call `RecvMsg` on the
provided stream, which is enabled by the change in codegen to include a
gRPC-compatible `RecvMsg`.
---
Some context on why we use `RecvMsg`: Commit 34e3abf optimized the
`BatchStream` implementation by changing how the `BatchRequest` and its
initial `Requests` slice capacity are allocated. `RecvMsg` allows the
caller to provide a pre-allocated `BatchRequest` instance. This pattern,
when used with a pre-allocated instance of a `BatchRequest` header and
first request together, helps reduce per-message allocations compared to a
`Recv()` method that might allocate a new message object on each call
0 commit comments