Skip to content

Commit

Permalink
kvserver/rangefeed: rename setRangeIDEventSink to perRangeEventSink
Browse files Browse the repository at this point in the history
This patch renames `setRangeIDEventSink` to `perRangeEventSink` for clarity.

Epic: none
Release note: none
  • Loading branch information
wenyihu6 committed Jul 11, 2024
1 parent 1c013ae commit bf58d51
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/server/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1832,27 +1832,27 @@ func (n *Node) RangeLookup(
return resp, nil
}

// setRangeIDEventSink is an implementation of rangefeed.Stream which annotates
// perRangeEventSink is an implementation of rangefeed.Stream which annotates
// each response with rangeID and streamID. It is used by MuxRangeFeed.
type setRangeIDEventSink struct {
type perRangeEventSink struct {
ctx context.Context
rangeID roachpb.RangeID
streamID int64
wrapped *rangefeed.StreamMuxer
}

var _ kvpb.RangeFeedEventSink = (*setRangeIDEventSink)(nil)
var _ kvpb.RangeFeedEventSink = (*perRangeEventSink)(nil)

func (s *setRangeIDEventSink) Context() context.Context {
func (s *perRangeEventSink) Context() context.Context {
return s.ctx
}

// SendIsThreadSafe is a no-op declaration method. It is a contract that the
// Send method is thread-safe. Note that Send wraps rangefeed.StreamMuxer which
// declares its Send method to be thread-safe.
func (s *setRangeIDEventSink) SendIsThreadSafe() {}
func (s *perRangeEventSink) SendIsThreadSafe() {}

func (s *setRangeIDEventSink) Send(event *kvpb.RangeFeedEvent) error {
func (s *perRangeEventSink) Send(event *kvpb.RangeFeedEvent) error {
response := &kvpb.MuxRangeFeedEvent{
RangeFeedEvent: *event,
RangeID: s.rangeID,
Expand Down Expand Up @@ -1918,7 +1918,7 @@ func (n *Node) MuxRangeFeed(stream kvpb.Internal_MuxRangeFeedServer) error {
streamCtx = logtags.AddTag(streamCtx, "s", req.Replica.StoreID)
streamCtx = logtags.AddTag(streamCtx, "sid", req.StreamID)

streamSink := &setRangeIDEventSink{
streamSink := &perRangeEventSink{
ctx: streamCtx,
rangeID: req.RangeID,
streamID: req.StreamID,
Expand Down

0 comments on commit bf58d51

Please sign in to comment.