cm

package
v0.0.0-...-e04e7a0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GcStart = time.Now()
View Source
var HttpBatchLimit = 1

TODO: Move those to arguments of the cache manager

View Source
var HttpQueue = make(chan interface{}, cm.QueueSize)
View Source
var HttpTimeoutDuration = time.Microsecond * 500
View Source
var LogStart = time.Now()
View Source
var ToEvict = CallsAndCallers{Dict: make(map[cm.ServiceName]map[cm.CallArgs]struct{})}
View Source
var ToEvictSize = 1000
View Source
var UserCacheSize = 80

Functions

func HttpSender

func HttpSender(cfg *Config)

func Process

func Process(cfg *Config, state *State)

func ReadCacheManagerAddressFile

func ReadCacheManagerAddressFile(cmAddsFile string) (map[cm.ServiceName]string, cm.ServiceName)

ReadCacheManagerAddressFile returns a tuple of 1. a map from service name to cache manager address 2. the service name this cache manager is responsible for

func Serve0mq

func Serve0mq(cfg *Config)

func Serve0mq2

func Serve0mq2(cfg *Config)

func ServeHttp

func ServeHttp(cfg *Config)

Types

type CallsAndCallers

type CallsAndCallers struct {
	Dict map[cm.ServiceName]map[cm.CallArgs]struct{}
}

type Config

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

func InitConfig

func InitConfig(httpP int, cmAddsFile string, printTimeFreq int) *Config

func (*Config) Close

func (cfg *Config) Close()

func (*Config) GetCacheManagerAddress

func (cfg *Config) GetCacheManagerAddress(name cm.ServiceName) string

func (*Config) GetNeighbors

func (cfg *Config) GetNeighbors() []string

type HistoryItem

type HistoryItem interface {
	IsCallArgSet() bool
	IsWriteKey() bool
	IsInvCall() bool
}

TODO: Maybe it makes sense to have both writes and callargs sets!

type HttpBufferElement

type HttpBufferElement struct {
	InvSet  cm.CallArgSet
	SaveMap map[cm.CallArgs]cm.ReturnVal
}

type HttpSendBuffer

type HttpSendBuffer struct {
	Callers map[cm.ServiceName]HttpBufferElement
}

type HttpSendInvalidateCallRequest

type HttpSendInvalidateCallRequest struct {
	InvSet map[cm.ServiceName]map[cm.CallArgs]struct{}
}

type HttpSendSaveCallsRequest

type HttpSendSaveCallsRequest struct {
	Request cm.SaveCallsRequest
	Caller  cm.ServiceName
}

type ProfileState

type ProfileState struct {
	Counter       int
	Time          time.Time
	PrintTimeFreq int
}

type State

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

func NewState

func NewState() *State

func (*State) Init

func (state *State) Init()

func (*State) String

func (state *State) String() string

Just for debugging

Jump to

Keyboard shortcuts

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