Documentation
¶
Index ¶
- Constants
- Variables
- func CheckUsage(options *CommandlineOptions)
- func GetIP() (string, error)
- func GetLogger(prefix string) logger.ILogger
- func GetPrivateIp() (string, error)
- func IsClientsideFirstDOptimization() bool
- func IsLocalCacheEnabled() bool
- func IsPrivateIp(ip net.IP) bool
- func IsWarmupWithFixedInterval() bool
- func SetLoggerLevel(level int)
- type CommandlineOptions
- func (o *CommandlineOptions) GetClusterType() string
- func (o *CommandlineOptions) GetInstanceCapacity() uint64
- func (o *CommandlineOptions) GetInstanceChunkThreshold() int
- func (o *CommandlineOptions) GetInvoker() string
- func (o *CommandlineOptions) GetLambdaLogLevel() int
- func (o *CommandlineOptions) GetLambdaPrefix() string
- func (o *CommandlineOptions) GetNumFunctions() int
- type RequestCoordinator
- func (c *RequestCoordinator) Clear(reqId string)
- func (c *RequestCoordinator) Len() int
- func (c *RequestCoordinator) Load(reqId string) interface{}
- func (c *RequestCoordinator) Register(reqId string, cmd string, d int, p int, meta interface{}) *RequestCounter
- func (c *RequestCoordinator) RegisterControl(reqId string, ctrl *types.Control)
- type RequestCounter
- func (c *RequestCounter) AddFlushed(chunk int) uint64
- func (c *RequestCounter) AddReturned(chunk int) (uint64, bool)
- func (c *RequestCounter) AddSucceeded(chunk int, recovered bool) (uint64, bool)
- func (c *RequestCounter) Close()
- func (c *RequestCounter) IsAllFlushed(status ...uint64) bool
- func (c *RequestCounter) IsAllReturned(status ...uint64) bool
- func (c *RequestCounter) IsFulfilled(status ...uint64) bool
- func (c *RequestCounter) IsLate(status ...uint64) bool
- func (c *RequestCounter) Load() *RequestCounter
- func (c *RequestCounter) MarkReturnd(id *types.Id) (uint64, bool)
- func (c *RequestCounter) Recovered() uint64
- func (c *RequestCounter) Release()
- func (c *RequestCounter) ReleaseIfAllReturned(status ...uint64) bool
- func (c *RequestCounter) Returned() uint64
- func (c *RequestCounter) Status() uint64
- func (c *RequestCounter) String() string
- func (c *RequestCounter) Succeeded() uint64
Constants ¶
const ( REQCNT_STATUS_RETURNED uint64 = 0x0000000000000001 REQCNT_STATUS_SUCCEED uint64 = 0x0000000000010000 REQCNT_STATUS_RECOVERED uint64 = 0x0000000100000000 REQCNT_STATUS_FLUSHED uint64 = 0x0001000000000000 REQCNT_MASK_RETURNED uint64 = 0x000000000000FFFF REQCNT_MASK_SUCCEED uint64 = 0x00000000FFFF0000 REQCNT_MASK_RECOVERED uint64 = 0x0000FFFF00000000 REQCNT_MASK_FLUSHED uint64 = 0xFFFF000000000000 REQCNT_BITS_RETURNED uint64 = 0 REQCNT_BITS_SUCCEED uint64 = 16 REQCNT_BITS_RECOVERED uint64 = 32 REQCNT_BITS_FLUSHED uint64 = 48 )
const (
InvokerLocal = "local"
)
Variables ¶
var ( // Clients = make([]chan interface{}, 1024*1024) Options CommandlineOptions DataCollected sync.WaitGroup Log logger.ILogger ReqCoordinator = NewRequestCoordinator(1024) Migrator types.MigrationScheduler BasePort = 6378 LambdaServePorts = 1 BaseMigratorPort = 6400 ServerIp string LambdaFlags uint64 )
var (
ErrPrivateIPNotFound = errors.New("can not identify private ip")
)
Functions ¶
func CheckUsage ¶
func CheckUsage(options *CommandlineOptions)
func GetPrivateIp ¶
func IsClientsideFirstDOptimization ¶
func IsClientsideFirstDOptimization() bool
func IsLocalCacheEnabled ¶
func IsLocalCacheEnabled() bool
func IsPrivateIp ¶
func IsWarmupWithFixedInterval ¶
func IsWarmupWithFixedInterval() bool
func SetLoggerLevel ¶
func SetLoggerLevel(level int)
Types ¶
type CommandlineOptions ¶
type CommandlineOptions struct {
Pid string
Debug bool
Prefix string
PublicIP string
D int
P int
NoDashboard bool
NoColor bool
LogPath string
LogFile string
Evaluation bool
NumBackups int
NoFirstD bool
// Profiling
CpuProfile string
MemProfile string
// contains filtered or unexported fields
}
func (*CommandlineOptions) GetClusterType ¶
func (o *CommandlineOptions) GetClusterType() string
func (*CommandlineOptions) GetInstanceCapacity ¶
func (o *CommandlineOptions) GetInstanceCapacity() uint64
func (*CommandlineOptions) GetInstanceChunkThreshold ¶
func (o *CommandlineOptions) GetInstanceChunkThreshold() int
func (*CommandlineOptions) GetInvoker ¶
func (o *CommandlineOptions) GetInvoker() string
func (*CommandlineOptions) GetLambdaLogLevel ¶
func (o *CommandlineOptions) GetLambdaLogLevel() int
func (*CommandlineOptions) GetLambdaPrefix ¶
func (o *CommandlineOptions) GetLambdaPrefix() string
func (*CommandlineOptions) GetNumFunctions ¶
func (o *CommandlineOptions) GetNumFunctions() int
type RequestCoordinator ¶
type RequestCoordinator struct {
// contains filtered or unexported fields
}
func NewRequestCoordinator ¶
func NewRequestCoordinator(size int) *RequestCoordinator
func (*RequestCoordinator) Clear ¶
func (c *RequestCoordinator) Clear(reqId string)
func (*RequestCoordinator) Len ¶
func (c *RequestCoordinator) Len() int
func (*RequestCoordinator) Load ¶
func (c *RequestCoordinator) Load(reqId string) interface{}
Load returns the RequestCounter that associated with the specified request id. It returns interface{} to be compatible with customized types. If a RequestCounter is returned, it calls Load() of the RequestCounter to ensure the reference count is correct.
func (*RequestCoordinator) Register ¶
func (c *RequestCoordinator) Register(reqId string, cmd string, d int, p int, meta interface{}) *RequestCounter
func (*RequestCoordinator) RegisterControl ¶
func (c *RequestCoordinator) RegisterControl(reqId string, ctrl *types.Control)
type RequestCounter ¶
type RequestCounter struct {
Cmd string
DataShards int
ParityShards int
Meta interface{}
Requests []*types.Request
// contains filtered or unexported fields
}
Counter for returned requests.
func (*RequestCounter) AddFlushed ¶
func (c *RequestCounter) AddFlushed(chunk int) uint64
AddFlushed sets specified chunk of the object request as successfully flushed to client.
func (*RequestCounter) AddReturned ¶
func (c *RequestCounter) AddReturned(chunk int) (uint64, bool)
AddReturned sets specified chunk of the object request as returned but failed. Returns the updated status of the request and if the chunk request has been fulfilled already.
func (*RequestCounter) AddSucceeded ¶
func (c *RequestCounter) AddSucceeded(chunk int, recovered bool) (uint64, bool)
AddSucceeded sets specified chunk of the object request as succeeded. If the chunk is recovered from backing store, it will be marked as recovered. Returns the updated status of the request and if the chunk request has been fulfilled already.
func (*RequestCounter) Close ¶
func (c *RequestCounter) Close()
func (*RequestCounter) IsAllFlushed ¶
func (c *RequestCounter) IsAllFlushed(status ...uint64) bool
func (*RequestCounter) IsAllReturned ¶
func (c *RequestCounter) IsAllReturned(status ...uint64) bool
func (*RequestCounter) IsFulfilled ¶
func (c *RequestCounter) IsFulfilled(status ...uint64) bool
func (*RequestCounter) IsLate ¶
func (c *RequestCounter) IsLate(status ...uint64) bool
IsLate returns true if the request is late and should be called after successfully got head of response but before flushing the stream.
func (*RequestCounter) Load ¶
func (c *RequestCounter) Load() *RequestCounter
func (*RequestCounter) MarkReturnd ¶
func (c *RequestCounter) MarkReturnd(id *types.Id) (uint64, bool)
func (*RequestCounter) Recovered ¶
func (c *RequestCounter) Recovered() uint64
func (*RequestCounter) Release ¶
func (c *RequestCounter) Release()
func (*RequestCounter) ReleaseIfAllReturned ¶
func (c *RequestCounter) ReleaseIfAllReturned(status ...uint64) bool
func (*RequestCounter) Returned ¶
func (c *RequestCounter) Returned() uint64
func (*RequestCounter) Status ¶
func (c *RequestCounter) Status() uint64
func (*RequestCounter) String ¶
func (c *RequestCounter) String() string
func (*RequestCounter) Succeeded ¶
func (c *RequestCounter) Succeeded() uint64