Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Items []ConfigItem `json:"items"` Port int `json:"port"` CopyRange int `json:"copy_range"` Salt string `json:"salt"` Folder string `json:"folder"` }
spread 1 2 3 4 1 -> 2 3 2 -> 3 4 3 -> 4 1 4 -> 1 2
to scale up, 1) add cluster 5 2) add 5 to config file of 4 3) restart 4, during restarting 1 2 3 5 will be keep active 4) change config 3, restart 3, during restart 1 2 4 5 will be active 5) change config 2, restart 2, during restart 1 3 4 5 will be active 6) do the rest, config and restart one by one
to scale down change config 3 dup, from 4 1 to 4 2, restart change config 4 dup, from 1 2 to 2 3, restart stop 1 do the rest, config and restart one by one
func (*Config) GetLocalConfig ¶
func (config *Config) GetLocalConfig() (*LocalConfig, error)
run at app start time, loop through
type ConfigItem ¶
for example c1 host: 192.168.0.12 islocal: true
type LocalConfig ¶
type LocalConfig struct { Self ConfigItem Dup []ConfigItem }
local config dup must exclude self for a forward request, send forward request to dup
type MemTable ¶
type Request ¶
type Request struct { IsRemote bool Timestamp int64 SecureHash []byte Bucket string Key string Value interface{} MRQuery []byte }