// Copyright 2024 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//	http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package tidbworker

import (
	"context"

	"github.com/pingcap/kvproto/pkg/keyspacepb"
	"github.com/pingcap/tidb/pkg/sessionctx"
)

// NoopManager implements Manager with no-op stubs. Embed it in a test struct
// and override only the methods your test needs.
type NoopManager struct{}

// Role returns an empty string.
func (NoopManager) Role() string { return "" }

// Meta returns nil.
func (NoopManager) Meta() *keyspacepb.KeyspaceMeta { return nil }

// InitializeGC is a no-op.
func (NoopManager) InitializeGC(_ context.Context, _ sessionctx.Context) error { return nil }

// RegisterGC is a no-op.
func (NoopManager) RegisterGC(_ context.Context, _ uint64) error { return nil }

// RecycleGC is a no-op.
func (NoopManager) RecycleGC(_ context.Context, _ uint64) error { return nil }

// InitializeGCV2 is a no-op.
func (NoopManager) InitializeGCV2(_ context.Context) error { return nil }

// AbortGCV2 is a no-op.
func (NoopManager) AbortGCV2(_ context.Context) error { return nil }

// RegisterGCV2 is a no-op.
func (NoopManager) RegisterGCV2(_ context.Context, _ uint64, _ int64) error { return nil }

// RecycleGCV2 is a no-op.
func (NoopManager) RecycleGCV2(_ context.Context, _ uint64) error { return nil }

// UpdateGCLifeTime is a no-op.
func (NoopManager) UpdateGCLifeTime(_ context.Context, _ int64) error { return nil }

// GetBgTaskConfig returns zero values.
func (NoopManager) GetBgTaskConfig(_ context.Context, _ string) (int, bool, error) {
	return 0, false, nil
}

// RegisterBgTask is a no-op.
func (NoopManager) RegisterBgTask(_ context.Context, _, _ string, _, _ int64, _ string) error {
	return nil
}

// RecycleBgTask is a no-op.
func (NoopManager) RecycleBgTask(_ context.Context, _, _ string, _, _ int64) error { return nil }

// UpdateBgTaskExecID is a no-op.
func (NoopManager) UpdateBgTaskExecID(_ context.Context, _ int64, _ []int64, _ []string) error {
	return nil
}

// RegisterRemoteQuery is a no-op.
func (NoopManager) RegisterRemoteQuery(_ context.Context, _, _ string) error { return nil }

// RegisterTTLTask is a no-op.
func (NoopManager) RegisterTTLTask(_ context.Context, _ int64, _ bool) error { return nil }

// DeleteTTLTableInfo is a no-op.
func (NoopManager) DeleteTTLTableInfo(_ context.Context, _ int64) error { return nil }

// RecycleTTLTask is a no-op.
func (NoopManager) RecycleTTLTask(_ context.Context, _ uint64) error { return nil }

// UpdateTTLJobEnable is a no-op.
func (NoopManager) UpdateTTLJobEnable(_ context.Context, _ bool) error { return nil }

// RegisterAutoAnalyze is a no-op.
func (NoopManager) RegisterAutoAnalyze(_ context.Context, _ uint64) error { return nil }

// RecycleAutoAnalyze is a no-op.
func (NoopManager) RecycleAutoAnalyze(_ context.Context, _ uint64) error { return nil }
