Documentation ¶
Index ¶
- Constants
- Variables
- func GetBodyDeadline(size int64) time.Time
- func GetBodyTimeout(size int64) time.Duration
- func GetDeadline(d time.Duration) time.Time
- func GetHeaderDeadline() time.Time
- func GetHeaderTimeout() time.Duration
- type BackupLocator
- type Contextable
- type InputEvent
- type Meta
- type OutputError
- type ShortMeta
- type Status
Constants ¶
View Source
const ( // FLAG_ENABLE_WARMUP Enable warmup. FLAG_ENABLE_WARMUP = 0x0001 // FLAG_ENABLE_REPLICA Enable replication. FLAG_ENABLE_REPLICA = 0x0010 // FLAG_WARMUP_REPLICA Replication will be triggered on warming up. FLAG_WARMUP_REPLICA = 0x0020 // FLAG_ENABLE_PERSISTENT Enable persist. FLAG_ENABLE_PERSISTENT = 0x0100 // FLAG_DISABLE_RECOVERY Disable recovery on reclaimation. FLAG_DISABLE_RECOVERY = 0x0200 // FLAG_BACKING_ONLY Disable recovery for main repository FLAG_BACKING_ONLY = 0x1000 // FLAG_DISABLE_WAIT_FOR_COS Disable waiting for COS on PUT chunks. FLAG_DISABLE_WAIT_FOR_COS = 0x2000 // PONG_FOR_DATA Pong for data link PONG_FOR_DATA = int64(0x0000) // PONG_FOR_CTRL Pong for ctrl link PONG_FOR_CTRL = int64(0x0001) // PONG_ON_INVOKING Pong issued on invoking PONG_ON_INVOKING = int64(0x0010) // PONG_RECOVERY Pong with parallel recovery requested PONG_RECOVERY = int64(0x0020) // PONG_RECLAIMED Pong with claiming the node has experienced reclaimation (backing mode only). PONG_RECLAIMED = int64(0x0040) // PONG_WITH_PAYLOAD Pong with piggyback payload. PONG_WITH_PAYLOAD = int64(0x0080) // PONG_RECONCILE Pong with reconcile meta included. PONG_RECONCILE = int64(0x0100) CMD_TEST = "test" CMD_ACK = "ack" // Control command CMD_GET = "get" // Redis and Lambda command CMD_GET_CHUNK = "get chunk" // Client command CMD_SET = "set" // Redis and Lambda command CMD_SET_CHUNK = "set chunk" // Client command CMD_PERSISTED = "persisted" // Control command CMD_PERSIST_FAILED = "persist failed" // Control command CMD_RECOVER = "recover" // Control command CMD_DEL = "del" // Control command CMD_WARMUP = "warmup" // Control command CMD_PING = "ping" // Control command CMD_PONG = "pong" // Control command CMD_RECOVERED = "recovered" // Control command CMD_INITMIGRATE = "initMigrate" // Control command CMD_MIGRATE = "migrate" // Control command CMD_MHELLO = "mhello" // Control command CMD_DATA = "data" // Control command CMD_BYE = "bye" // Control command REQUEST_GET_OPTIONAL = 0x0001 // Flag response is optional. There is a compete fallback will eventually fulfill the request. REQUEST_GET_OPTION_BUFFER = 0x0002 // Flag the chunk should be put in buffer area. // TIP_BACKUP_KEY Backup ID. TIP_BACKUP_KEY = "bak" // TIP_BACKUP_TOTAL Total backups available. TIP_BACKUP_TOTAL = "baks" // TIP_DELEGATE_KEY Delegate ID. TIP_DELEGATE_KEY = "dele" // TIP_DELEGATE_TOTAL Total delegates available. TIP_DELEGATE_TOTAL = "deles" // TIP_SERVING_KEY Key should be recovered as the first one. TIP_SERVING_KEY = "key" // TIP_MAX_CHUNK Max chunk size can be backed up. TIP_MAX_CHUNK = "max" )
Variables ¶
Functions ¶
func GetBodyDeadline ¶
func GetBodyTimeout ¶
func GetHeaderDeadline ¶
func GetHeaderTimeout ¶
Types ¶
type BackupLocator ¶
type BackupLocator struct {
// contains filtered or unexported fields
}
Backups for a instace. If not specified, all operation are not thread safe.
func (*BackupLocator) LocateByHash ¶
func (b *BackupLocator) LocateByHash(hash uint64) (int, int, bool)
func (*BackupLocator) Reset ¶
func (b *BackupLocator) Reset(num int)
type Contextable ¶
type Contextable struct {
// contains filtered or unexported fields
}
func (*Contextable) Context ¶
func (r *Contextable) Context() context.Context
Context returns the context
func (*Contextable) SetContext ¶
func (r *Contextable) SetContext(ctx context.Context)
SetContext sets the context
type InputEvent ¶
type InputEvent struct { Sid string `json:"sid"` // Session id to ensure invoking once only. Cmd string `json:"cmd"` // Invocation type, can be "ping", "warmup". Id uint64 `json:"id"` // Node id Proxy string `json:"proxy"` // Address of proxy . ProxyAddr net.Addr // Address of proxy, for simulation. Addr string `json:"addr"` // Address of P2P relay. Prefix string `json:"prefix"` // Experiment id reserved for evaluation. Log int `json:"log"` // Log level - debug or not. Flags uint64 `json:"flags"` // Feature flags Backups int `json:"baks"` // Number of configured recovery nodes Status Status `json:"status"` // Lineage info }
InputEvent Input for the Lambda
func (*InputEvent) IsBackingOnly ¶
func (i *InputEvent) IsBackingOnly() bool
func (*InputEvent) IsPersistencyEnabled ¶
func (i *InputEvent) IsPersistencyEnabled() bool
func (*InputEvent) IsRecoveryEnabled ¶
func (i *InputEvent) IsRecoveryEnabled() bool
func (*InputEvent) IsReplicaEnabled ¶
func (i *InputEvent) IsReplicaEnabled() bool
func (*InputEvent) IsWaitForCOSDisabled ¶
func (i *InputEvent) IsWaitForCOSDisabled() bool
type Meta ¶
type Meta struct { // Lambda ID Id uint64 `json:"id"` // Sequence of the last confirmed log. Logs store by sequence. Term uint64 `json:"term"` // Total transmission size for restoring all confirmed logs. Updates uint64 `json:"updates"` // Rank for lambda to decide if a fast recovery is required. DiffRank float64 `json:"diffrank"` // Hash of the last confirmed log. Hash string `json:"hash"` // Sequence of snapshot. SnapshotTerm uint64 `json:"snapshot"` // Total transmission size for restoring all confirmed logs from start to SnapShotSeq. SnapshotUpdates uint64 `json:"snapshotupdates"` // Total size of snapshot for transmission. SnapshotSize uint64 `json:"snapshotsize"` // Tips offer the lambda clues of how to recovery data. It is in http query format. Tip string `json:"tip"` }
type OutputError ¶
func (*OutputError) String ¶
func (e *OutputError) String() string
type ShortMeta ¶
type ShortMeta struct { // Lambda ID Id uint64 `json:"id"` // Sequence of the last confirmed log. Logs store by sequence. Term uint64 `json:"term"` // Total transmission size for restoring all confirmed logs. Updates uint64 `json:"updates"` // Rank for lambda to decide if a fast recovery is required. DiffRank float64 `json:"diffrank"` // Hash of the last confirmed log. Hash string `json:"hash"` }
Click to show internal directories.
Click to hide internal directories.