Documentation ¶
Overview ¶
Copyright 2021 Matrix Origin
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.
Index ¶
- Constants
- Variables
- func MakeVersionFile(dir, name string, version uint64) string
- func NewBaseStore(dir, name string, cfg *StoreCfg) (*baseStore, error)
- func OpenRotateFile(dir, name string, mu *sync.RWMutex, rotateChecker RotateChecker, ...) (*rotateFile, error)
- func ParseVersion(name, prefix, suffix string) (n int, ok bool)
- type File
- type FileAppender
- type FileReader
- type History
- type HistoryFactory
- type MaxSizeRotateChecker
- type ReplayObserver
- type RotateChecker
- type Store
- type StoreCfg
- type VFile
- type VFileAddress
- type VFileUncommitInfo
Constants ¶
View Source
const (
DefaultRotateCheckerMaxSize = int(mpool.MB) * 64
)
Variables ¶
View Source
var ( DefaultMaxBatchSize = 500 DefaultMaxSyncSize = 10 DefaultMaxCommitSize = 10 DefaultBatchPerSync = 100 DefaultSyncDuration = time.Millisecond * 2 FlushEntry entry.Entry )
View Source
var ( ErrGroupNotExist = moerr.NewInternalErrorNoCtx("group not existed") ErrLsnNotExist = moerr.NewInternalErrorNoCtx("lsn not existed") ErrVFileVersionTimeOut = moerr.NewInternalErrorNoCtx("get vfile version timeout") ErrLsnCheckpointed = moerr.NewInternalErrorNoCtx("lsn has been checkpointed") )
View Source
var ( ErrVFileGroupNotExist = moerr.NewInternalErrorNoCtx("vfile: group not existed") ErrVFileLsnNotExist = moerr.NewInternalErrorNoCtx("vfile: lsn not existed") ErrVFileOffsetTimeOut = moerr.NewInternalErrorNoCtx("get vfile offset timeout") ErrReadMetaFailed = moerr.NewInternalErrorNoCtx("read meta failed") )
View Source
var ( DefaultHistoryFactory = func() History { return newHistory(nil) } )
View Source
var (
ErrHistoryEntryNotFound = moerr.NewInternalErrorNoCtx("tae: history not found")
)
View Source
var Metasize = 2
Functions ¶
func MakeVersionFile ¶
func NewBaseStore ¶
func OpenRotateFile ¶
func OpenRotateFile(dir, name string, mu *sync.RWMutex, rotateChecker RotateChecker, historyFactory HistoryFactory, observer ReplayObserver) (*rotateFile, error)
func ParseVersion ¶
Types ¶
type FileAppender ¶
type FileReader ¶
type FileReader any
type HistoryFactory ¶
type HistoryFactory func() History
type MaxSizeRotateChecker ¶
type MaxSizeRotateChecker struct {
MaxSize int
}
func NewMaxSizeRotateChecker ¶
func NewMaxSizeRotateChecker(size int) *MaxSizeRotateChecker
func (*MaxSizeRotateChecker) PrepareAppend ¶
func (c *MaxSizeRotateChecker) PrepareAppend(vfile VFile, delta int) (needRot bool, err error)
type ReplayObserver ¶
type ReplayObserver interface {
// contains filtered or unexported methods
}
type StoreCfg ¶
type StoreCfg struct { RotateChecker RotateChecker HistoryFactory HistoryFactory }
type VFileAddress ¶
type VFileUncommitInfo ¶
type VFileUncommitInfo struct { Index *roaring64.Bitmap Addr *VFileAddress }
Click to show internal directories.
Click to hide internal directories.