func (lta *LocalTSOAllocator) SetTSO(tso uint64) error {
	return lta.timestampOracle.resetUserTimestamp(lta.leadership, tso, false)
}
SetTSO sets the physical part with given TSO.
package tso
import (
	"context"
	"fmt"
	"sync/atomic"
	"time"
	"github.com/pingcap/kvproto/pkg/pdpb"
	"github.com/pingcap/log"
	"github.com/tikv/pd/pkg/errs"
	"github.com/tikv/pd/pkg/tsoutil"
	"github.com/tikv/pd/pkg/typeutil"
	"github.com/tikv/pd/server/election"
	"go.etcd.io/etcd/clientv3"
	"go.uber.org/zap"
)
type LocalTSOAllocator struct {
	allocatorManager *AllocatorManager
	leadership      *election.Leadership
	timestampOracle *timestampOracle
	rootPath        string
	allocatorLeader atomic.Value  
}
func NewLocalTSOAllocator(
	am *AllocatorManager,
	leadership *election.Leadership,
	dcLocation string,
) Allocator {
	return &LocalTSOAllocator{
		allocatorManager: am,
		leadership:       leadership,
		timestampOracle: &timestampOracle{
			client:                 leadership.GetClient(),
			rootPath:               leadership.GetLeaderKey(),
			saveInterval:           am.saveInterval,
			updatePhysicalInterval: am.updatePhysicalInterval,
			maxResetTSGap:          am.maxResetTSGap,
			dcLocation:             dcLocation,
			tsoMux:                 &tsoObject{},
		},
		rootPath: leadership.GetLeaderKey(),
	}
}
func (lta *LocalTSOAllocator) GetDCLocation() string {
	return lta.timestampOracle.dcLocation
}
func (lta *LocalTSOAllocator) Initialize(suffix int) error {
	tsoAllocatorRole.WithLabelValues(lta.timestampOracle.dcLocation).Set(1)
	lta.timestampOracle.suffix = suffix
	return lta.timestampOracle.SyncTimestamp(lta.leadership)
}
func (lta *LocalTSOAllocator) IsInitialize() bool {
	return lta.timestampOracle.isInitialized()
}
func (lta *LocalTSOAllocator) UpdateTSO() error {
	return lta.timestampOracle.UpdateTimestamp(lta.leadership)
}