bokilib

package
v0.0.0-...-2521f96 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const IntentLogTag uint64 = 1

Variables

View Source
var DBClient = dynamodb.New(sess)
View Source
var T = int64(60)
View Source
var TYPE = "BELDI"

Functions

func AbortTxn

func AbortTxn(env *Env)

func AssertConditionFailure

func AssertConditionFailure(err error)

func AssignedSyncInvoke

func AssignedSyncInvoke(env *Env, callee string, input interface{}, preInvokeLog *IntentLogEntry) (interface{}, string)

func AsyncInvoke

func AsyncInvoke(env *Env, callee string, input interface{}) string

func BeginTxn

func BeginTxn(env *Env)

func BuildProjection

func BuildProjection(names []string) expression.ProjectionBuilder

func CHECK

func CHECK(err error)

func CheckLogDataField

func CheckLogDataField(intentLog *IntentLogEntry, field string, expected string)

func CommitTxn

func CommitTxn(env *Env)

func CondWrite

func CondWrite(env *Env, tablename string, key string,
	update map[expression.NameBuilder]expression.OperandBuilder,
	cond expression.ConditionBuilder)

func CreateBaselineTable

func CreateBaselineTable(lambdaId string)

func CreateCollectorTable

func CreateCollectorTable(lambdaId string)

func CreateFuncHandlerFactory

func CreateFuncHandlerFactory(f func(env *Env) interface{}) types.FuncHandlerFactory

func CreateLambdaTables

func CreateLambdaTables(lambdaId string)

func CreateLogTable

func CreateLogTable(lambdaId string)

func CreateMainTable

func CreateMainTable(lambdaId string)

func CreateTxnTables

func CreateTxnTables(lambdaId string)

func DeleteLambdaTables

func DeleteLambdaTables(lambdaId string)

func DeleteTable

func DeleteTable(tablename string)

func IntentStepStreamTag

func IntentStepStreamTag(instanceId string) uint64

func LibAppendLog

func LibAppendLog(env *Env, tag uint64, data interface{}) uint64

func LibRead

func LibRead(tablename string, key aws.JSONValue, projection []string) aws.JSONValue

func LibScan

func LibScan(tablename string, projection []string) []aws.JSONValue

func LibScanWithLast

func LibScanWithLast(tablename string, projection []string, last map[string]*dynamodb.AttributeValue) []aws.JSONValue

func LibWrite

func LibWrite(tablename string, key aws.JSONValue,
	update map[expression.NameBuilder]expression.OperandBuilder)

func Lock

func Lock(env *Env, tablename string, key string) bool

func LockStreamTag

func LockStreamTag(lockId string) uint64

func LogStepResult

func LogStepResult(env *Env, instanceId string, stepNumber int32, data aws.JSONValue)

func Populate

func Populate(tablename string, key string, value interface{}, baseline bool)

func Read

func Read(env *Env, tablename string, key string) interface{}

func Scan

func Scan(env *Env, tablename string) interface{}

func SyncInvoke

func SyncInvoke(env *Env, callee string, input interface{}) (interface{}, string)

func TPLAbort

func TPLAbort(env *Env)

func TPLCommit

func TPLCommit(env *Env)

func TPLRead

func TPLRead(env *Env, tablename string, key string) (bool, interface{})

func TPLWrite

func TPLWrite(env *Env, tablename string, key string, value aws.JSONValue) bool

func TransactionStreamTag

func TransactionStreamTag(lambdaId string, txnId string) uint64

func Unlock

func Unlock(env *Env, tablename string, key string)

func WaitUntilActive

func WaitUntilActive(tablename string) bool

func WaitUntilAllActive

func WaitUntilAllActive(tablenames []string) bool

func WaitUntilAllDeleted

func WaitUntilAllDeleted(tablenames []string)

func WaitUntilDeleted

func WaitUntilDeleted(tablename string)

func Write

func Write(env *Env, tablename string, key string, update map[expression.NameBuilder]expression.OperandBuilder)

func WriteHead

func WriteHead(tablename string, key string)

func WriteNRows

func WriteNRows(tablename string, key string, n int)

func WriteTail

func WriteTail(tablename string, key string, row string)

Types

type Env

type Env struct {
	LambdaId    string
	InstanceId  string
	StepNumber  int32
	Input       interface{}
	TxnId       string
	Instruction string
	Baseline    bool
	FaasCtx     context.Context
	FaasEnv     types.Environment
	Fsm         *IntentFsm

	// added for NubesPlus
	TypeName string
}

func PrepareEnv

func PrepareEnv(iw *InputWrapper, lambdaId string) *Env

type InputWrapper

type InputWrapper struct {
	CallerName  string      `mapstructure:"CallerName"`
	CallerId    string      `mapstructure:"CallerId"`
	CallerStep  int32       `mapstructure:"CallerStep"`
	InstanceId  string      `mapstructure:"InstanceId"`
	Input       interface{} `mapstructure:"Input"`
	TxnId       string      `mapstructure:"TxnId"`
	Instruction string      `mapstructure:"Instruction"`
	Async       bool        `mapstructure:"Async"`
}

func ParseInput

func ParseInput(raw interface{}) *InputWrapper

func (*InputWrapper) Deserialize

func (iw *InputWrapper) Deserialize(stream []byte)

func (*InputWrapper) Serialize

func (iw *InputWrapper) Serialize() []byte

type IntentFsm

type IntentFsm struct {
	// contains filtered or unexported fields
}

func NewIntentFsm

func NewIntentFsm(instanceId string) *IntentFsm

func (*IntentFsm) Catch

func (fsm *IntentFsm) Catch(env *Env)

func (*IntentFsm) GetPostStepLog

func (fsm *IntentFsm) GetPostStepLog(stepNumber int32) *IntentLogEntry

func (*IntentFsm) GetStepLog

func (fsm *IntentFsm) GetStepLog(stepNumber int32) *IntentLogEntry

type IntentLogEntry

type IntentLogEntry struct {
	SeqNum     uint64        `json:"-"`
	InstanceId string        `json:"instanceId"`
	StepNumber int32         `json:"step"`
	PostStep   bool          `json:"postStep"`
	Data       aws.JSONValue `json:"data"`
}

func FetchStepResultLog

func FetchStepResultLog(env *Env, stepNumber int32, catch bool) *IntentLogEntry

func ProposeInvoke

func ProposeInvoke(env *Env, callee string) *IntentLogEntry

func ProposeNextStep

func ProposeNextStep(env *Env, data aws.JSONValue) (bool, *IntentLogEntry)

type InvokeError

type InvokeError struct {
	ErrorMessage string           `json:"errorMessage"`
	ErrorType    string           `json:"errorType"`
	StackTrace   []StackTraceCall `json:"stackTrace"`
}

func (*InvokeError) Deserialize

func (ie *InvokeError) Deserialize(stream []byte)

type LockFsm

type LockFsm struct {
	// contains filtered or unexported fields
}

func (*LockFsm) Lock

func (fsm *LockFsm) Lock(env *Env, holder string) bool

func (*LockFsm) Unlock

func (fsm *LockFsm) Unlock(env *Env, holder string)

type LockLogEntry

type LockLogEntry struct {
	SeqNum     uint64 `json:"-"`
	LockId     string `json:"lockId"`
	StepNumber int32  `json:"step"`
	UnlockOp   bool   `json:"unlockOp"`
	Holder     string `json:"holder"`
}

type LogEntry

type LogEntry struct {
	SeqNum uint64
	Data   map[string]interface{}
}

type OutputWrapper

type OutputWrapper struct {
	Status string
	Output interface{}
}

func (*OutputWrapper) Deserialize

func (ow *OutputWrapper) Deserialize(stream []byte)

func (*OutputWrapper) Serialize

func (ow *OutputWrapper) Serialize() []byte

type StackTraceCall

type StackTraceCall struct {
	Label string `json:"label"`
	Line  int    `json:"line"`
	Path  string `json:"path"`
}

type TxnLogEntry

type TxnLogEntry struct {
	SeqNum   uint64        `json:"-"`
	LambdaId string        `json:"lambdaId"`
	TxnId    string        `json:"txnId"`
	Callee   string        `json:"callee"`
	WriteOp  aws.JSONValue `json:"write"`
}

Jump to

Keyboard shortcuts

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