storage

package
v2.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const LockSplit = "^^^"

Variables

This section is empty.

Functions

func CollectBranchSessionRowLocks

func CollectBranchSessionRowLocks(branchSession *apis.BranchSession) []*apis.RowLock

func CollectRowLocks

func CollectRowLocks(lockKey string, resourceID string, xid string) []*apis.RowLock

Types

type Driver

type Driver interface {
	SessionManager
	LockManager
}

type LockManager

type LockManager interface {
	// AcquireLock Acquire lock boolean.
	AcquireLock(rowLocks []*apis.RowLock) bool

	// ReleaseLock Unlock boolean.
	ReleaseLock(rowLocks []*apis.RowLock) bool

	// IsLockable Is lockable boolean.
	IsLockable(xid string, resourceID string, lockKey string) bool
}

type SessionManager

type SessionManager interface {
	// Add global session.
	AddGlobalSession(session *apis.GlobalSession) error

	// Find global session.
	FindGlobalSession(xid string) *apis.GlobalSession

	// Find global sessions list.
	FindGlobalSessions(statuses []apis.GlobalSession_GlobalStatus) []*apis.GlobalSession

	// Find global sessions list with addressing identities
	FindGlobalSessionsWithAddressingIdentities(statuses []apis.GlobalSession_GlobalStatus, addressingIdentities []string) []*apis.GlobalSession

	// All sessions collection.
	AllSessions() []*apis.GlobalSession

	// Update global session status.
	UpdateGlobalSessionStatus(session *apis.GlobalSession, status apis.GlobalSession_GlobalStatus) error

	// Inactive global session.
	InactiveGlobalSession(session *apis.GlobalSession) error

	// Remove global session.
	RemoveGlobalSession(session *apis.GlobalSession) error

	// Add branch session.
	AddBranchSession(globalSession *apis.GlobalSession, session *apis.BranchSession) error

	// Find branch session.
	FindBranchSessions(xid string) []*apis.BranchSession

	// Find branch session.
	FindBatchBranchSessions(xids []string) []*apis.BranchSession

	// Update branch session status.
	UpdateBranchSessionStatus(session *apis.BranchSession, status apis.BranchSession_BranchStatus) error

	// Remove branch session.
	RemoveBranchSession(globalSession *apis.GlobalSession, session *apis.BranchSession) error
}

SessionManager stored the globalTransactions and branchTransactions.

Directories

Path Synopsis
driver

Jump to

Keyboard shortcuts

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