File tree Expand file tree Collapse file tree 3 files changed +22
-9
lines changed
ccl/changefeedccl/resolvedspan Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -437,8 +437,8 @@ type maybeTablePartitionedFrontier interface {
437
437
// Frontiers returns an iterator over the table ID and sub-frontiers
438
438
// being tracked by the frontier. If the frontier is not tracking
439
439
// on a per-table basis, the iterator will return a single frontier
440
- // with an ID of 0 .
441
- Frontiers () iter.Seq2 [descpb.ID , span.Frontier ]
440
+ // with descpb.InvalidID .
441
+ Frontiers () iter.Seq2 [descpb.ID , span.ReadOnlyFrontier ]
442
442
}
443
443
444
444
var _ maybeTablePartitionedFrontier = (* span.MultiFrontier [descpb.ID ])(nil )
@@ -456,9 +456,9 @@ type notTablePartitionedFrontier struct {
456
456
var _ maybeTablePartitionedFrontier = notTablePartitionedFrontier {}
457
457
458
458
// Frontiers implements maybeTablePartitionedFrontier.
459
- func (f notTablePartitionedFrontier ) Frontiers () iter.Seq2 [descpb.ID , span.Frontier ] {
460
- return func (yield func (descpb.ID , span.Frontier ) bool ) {
461
- yield (0 , f .spanFrontier )
459
+ func (f notTablePartitionedFrontier ) Frontiers () iter.Seq2 [descpb.ID , span.ReadOnlyFrontier ] {
460
+ return func (yield func (descpb.ID , span.ReadOnlyFrontier ) bool ) {
461
+ yield (descpb . InvalidID , f .spanFrontier )
462
462
}
463
463
}
464
464
Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ type frontier interface {
176
176
InBackfill (jobspb.ResolvedSpan ) bool
177
177
AtBoundary () (bool , jobspb.ResolvedSpan_BoundaryType , hlc.Timestamp )
178
178
All () iter.Seq [jobspb.ResolvedSpan ]
179
- Frontiers () iter.Seq2 [descpb.ID , span.Frontier ]
179
+ Frontiers () iter.Seq2 [descpb.ID , span.ReadOnlyFrontier ]
180
180
}
181
181
182
182
func testBackfillSpan (
Original file line number Diff line number Diff line change @@ -241,9 +241,22 @@ func (f *MultiFrontier[P]) String() string {
241
241
return buf .String ()
242
242
}
243
243
244
- // Frontiers returns an iterator over the sub-frontiers.
245
- func (f * MultiFrontier [P ]) Frontiers () iter.Seq2 [P , Frontier ] {
246
- return func (yield func (P , Frontier ) bool ) {
244
+ // ReadOnlyFrontier is a subset of Frontier with only the methods
245
+ // that are read-only.
246
+ type ReadOnlyFrontier interface {
247
+ Frontier () hlc.Timestamp
248
+ PeekFrontierSpan () roachpb.Span
249
+ Entries () iter.Seq2 [roachpb.Span , hlc.Timestamp ]
250
+ SpanEntries (span roachpb.Span ) iter.Seq2 [roachpb.Span , hlc.Timestamp ]
251
+ Len () int
252
+ String () string
253
+ }
254
+
255
+ var _ ReadOnlyFrontier = Frontier (nil )
256
+
257
+ // Frontiers returns an iterator over the sub-frontiers (with read-only access).
258
+ func (f * MultiFrontier [P ]) Frontiers () iter.Seq2 [P , ReadOnlyFrontier ] {
259
+ return func (yield func (P , ReadOnlyFrontier ) bool ) {
247
260
f .mu .Lock ()
248
261
defer f .mu .Unlock ()
249
262
You can’t perform that action at this time.
0 commit comments