func (s *Storage) GetRegionStorage() *RegionStorage {
	return s.regionStorage
}
GetRegionStorage gets the region storage.
package core
import (
	"context"
	"encoding/json"
	"fmt"
	"math"
	"path"
	"strconv"
	"strings"
	"sync"
	"sync/atomic"
	"time"
	"github.com/gogo/protobuf/proto"
	"github.com/pingcap/errors"
	"github.com/pingcap/kvproto/pkg/metapb"
	"github.com/pingcap/log"
	"github.com/tikv/pd/pkg/encryption"
	"github.com/tikv/pd/pkg/errs"
	"github.com/tikv/pd/server/encryptionkm"
	"github.com/tikv/pd/server/kv"
	"go.etcd.io/etcd/clientv3"
)
const (
	clusterPath                = "raft"
	configPath                 = "config"
	schedulePath               = "schedule"
	gcPath                     = "gc"
	rulesPath                  = "rules"
	ruleGroupPath              = "rule_group"
	regionLabelPath            = "region_label"
	replicationPath            = "replication_mode"
	componentPath              = "component"
	customScheduleConfigPath   = "scheduler_config"
	encryptionKeysPath         = "encryption_keys"
	gcWorkerServiceSafePointID = "gc_worker"
)
const (
	maxKVRangeLimit = 10000
	minKVRangeLimit = 100
)
type Storage struct {
	kv.Base
	regionStorage        *RegionStorage
	encryptionKeyManager *encryptionkm.KeyManager
	useRegionStorage     int32
	regionLoaded         int32
	mu                   sync.Mutex
}
type StorageOpt struct {
	regionStorage        *RegionStorage
	encryptionKeyManager *encryptionkm.KeyManager
}
type StorageOption func(*StorageOpt)
func WithRegionStorage(regionStorage *RegionStorage) StorageOption {
	return func(opt *StorageOpt) {
		opt.regionStorage = regionStorage
	}
}
func WithEncryptionKeyManager(encryptionKeyManager *encryptionkm.KeyManager) StorageOption {
	return func(opt *StorageOpt) {
		opt.encryptionKeyManager = encryptionKeyManager
	}
}
func NewStorage(base kv.Base, opts ...StorageOption) *Storage {
	options := &StorageOpt{}
	for _, opt := range opts {
		opt(options)
	}
	return &Storage{
		Base:                 base,
		regionStorage:        options.regionStorage,
		encryptionKeyManager: options.encryptionKeyManager,
	}
}