config

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REMOTE Mode = "remote"
	LOCAL  Mode = "local"

	MEMORY DataStoreType = "memory"

	// DEFAULT sets the concurrent optimization level to 0, which means that
	// when a write conflict occurs, one transaction will success
	DEFAULT int = 0

	// PARALLELIZE_ON_UPDATE sets the concurrent optimization level to 1, which
	// means there is NO guarantee that any transaction will success when a write
	// conflict happens in a single datastore
	PARALLELIZE_ON_UPDATE int = 1

	// PARALLELIZE_ON_PREPARE sets the concurrent optimization level to 2, which
	// means there is NO guarantee that any transaction will success when a write
	// conflict happens in different datastores
	PARALLELIZE_ON_PREPARE int = 2

	// AsyncLevelZero means no async commit
	AsyncLevelZero int = 0

	// AsyncLevelOne means async delete the TSR after return
	AsyncLevelOne int = 1

	// AsyncLevelTwo means async ds.Commit() and delete the TSR after return
	AsyncLevelTwo int = 2

	Pessimistic  ReadStrategy = "pessimistic"
	AssumeCommit ReadStrategy = "commit"
	AssumeAbort  ReadStrategy = "abort"
)

Variables

View Source
var Config = config{
	LeaseTime:                   1000 * time.Millisecond,
	MaxRecordLength:             2,
	IdGenerator:                 generator.NewUUIDGenerator(),
	Serializer:                  serializer.NewJSONSerializer(),
	LogLevel:                    zapcore.InfoLevel,
	ConcurrentOptimizationLevel: DEFAULT,
	AsyncLevel:                  AsyncLevelZero,
	MaxOutstandingRequest:       5,
	ReadStrategy:                Pessimistic,
}
View Source
var Debug = debug{
	DebugMode:             false,
	CherryGarciaMode:      false,
	HTTPAdditionalLatency: 0,
	ConnAdditionalLatency: 0,
}

Functions

This section is empty.

Types

type DataStoreType

type DataStoreType string

type Mode

type Mode string

type ReadStrategy

type ReadStrategy string

type State

type State int
const (
	EMPTY     State = 0
	STARTED   State = 1
	PREPARED  State = 2
	COMMITTED State = 3
	ABORTED   State = 4
)

func (State) MarshalBinary

func (s State) MarshalBinary() (data []byte, err error)

func (State) UnmarshalBinary

func (s State) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL