github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/cdc/redo/reader/blackhole_reader.go (about)

     1  // Copyright 2021 PingCAP, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // See the License for the specific language governing permissions and
    12  // limitations under the License.
    13  
    14  package reader
    15  
    16  import (
    17  	"context"
    18  
    19  	"github.com/pingcap/tiflow/cdc/model"
    20  )
    21  
    22  // BlackHoleReader is a blockHole storage which implements LogReader interface
    23  type BlackHoleReader struct{}
    24  
    25  // newBlackHoleReader creates a new BlackHoleReader
    26  func newBlackHoleReader() *BlackHoleReader {
    27  	return &BlackHoleReader{}
    28  }
    29  
    30  // Run implements LogReader.Run
    31  func (br *BlackHoleReader) Run(ctx context.Context) error {
    32  	return nil
    33  }
    34  
    35  // ReadNextRow implements LogReader.ReadNextRow
    36  func (br *BlackHoleReader) ReadNextRow(ctx context.Context) (*model.RowChangedEvent, error) {
    37  	return nil, nil
    38  }
    39  
    40  // ReadNextDDL implements LogReader.ReadNextDDL
    41  func (br *BlackHoleReader) ReadNextDDL(ctx context.Context) (*model.DDLEvent, error) {
    42  	return nil, nil
    43  }
    44  
    45  // ReadMeta implements LogReader.ReadMeta
    46  func (br *BlackHoleReader) ReadMeta(ctx context.Context) (checkpointTs, resolvedTs uint64, err error) {
    47  	return 0, 1, nil
    48  }
    49  
    50  // Close implement the Close interface
    51  func (br *BlackHoleReader) Close() error {
    52  	return nil
    53  }