rm

package
v0.0.0-...-1fef4f5 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DBKEYS_SPLIT_CHAR = ","
)

Functions

This section is empty.

Types

type AbstractResourceManager

type AbstractResourceManager struct {
	RpcClient     *rpc_client.RpcRemoteClient
	ResourceCache map[string]model.IResource
}

func NewAbstractResourceManager

func NewAbstractResourceManager(client *rpc_client.RpcRemoteClient) AbstractResourceManager

func (AbstractResourceManager) BranchRegister

func (resourceManager AbstractResourceManager) BranchRegister(branchType meta.BranchType, resourceID string,
	clientID string, xid string, applicationData []byte, lockKeys string) (int64, error)

func (AbstractResourceManager) BranchReport

func (resourceManager AbstractResourceManager) BranchReport(branchType meta.BranchType, xid string, branchID int64,
	status meta.BranchStatus, applicationData []byte) error

func (AbstractResourceManager) GetManagedResources

func (resourceManager AbstractResourceManager) GetManagedResources() map[string]model.IResource

func (AbstractResourceManager) LockQuery

func (resourceManager AbstractResourceManager) LockQuery(ctx *context.RootContext, branchType meta.BranchType, resourceID string, xid string,
	lockKeys string) (bool, error)

func (AbstractResourceManager) RegisterResource

func (resourceManager AbstractResourceManager) RegisterResource(resource model.IResource)

func (AbstractResourceManager) UnregisterResource

func (resourceManager AbstractResourceManager) UnregisterResource(resource model.IResource)

type ResourceManager

type ResourceManager interface {
	ResourceManagerInbound
	ResourceManagerOutbound

	// Register a Resource to be managed by Resource Manager.
	RegisterResource(resource model.IResource)

	// Unregister a Resource from the Resource Manager.
	UnregisterResource(resource model.IResource)

	// Get all resources managed by this manager.
	GetManagedResources() map[string]model.IResource

	// Get the BranchType.
	GetBranchType() meta.BranchType
}

type ResourceManagerInbound

type ResourceManagerInbound interface {
	// Commit a branch transaction.
	BranchCommit(branchType meta.BranchType, xid string, branchID int64, resourceID string, applicationData []byte) (meta.BranchStatus, error)

	// Rollback a branch transaction.
	BranchRollback(branchType meta.BranchType, xid string, branchID int64, resourceID string, applicationData []byte) (meta.BranchStatus, error)
}

type ResourceManagerOutbound

type ResourceManagerOutbound interface {
	// Branch register long.
	BranchRegister(branchType meta.BranchType, resourceID string, clientID string, xid string, applicationData []byte, lockKeys string) (int64, error)

	// Branch report.
	BranchReport(branchType meta.BranchType, xid string, branchID int64, status meta.BranchStatus, applicationData []byte) error

	// Lock query boolean.
	LockQuery(branchType meta.BranchType, resourceID string, xid string, lockKeys string) (bool, error)
}

Jump to

Keyboard shortcuts

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