Documentation ¶
Index ¶
- Constants
- Variables
- type ClusteredBigCache
- func (node *ClusteredBigCache) Delete(key string) error
- func (node *ClusteredBigCache) Get(key string, timeout time.Duration) ([]byte, error)
- func (node *ClusteredBigCache) Put(key string, data []byte, duration time.Duration) error
- func (node *ClusteredBigCache) ShutDown()
- func (node *ClusteredBigCache) Start() error
- func (node *ClusteredBigCache) Statistics() string
- type ClusteredBigCacheConfig
Constants ¶
View Source
const ( REPLICATION_MODE_FULL_REPLICATE byte = iota REPLICATION_MODE_SHARD )
Constants used to specify various conditions and state within the system
View Source
const CHAN_SIZE = 1024 * 64
CHAN_SIZE for all defined channels
Variables ¶
View Source
var ( ErrNotEnoughReplica = errors.New("not enough replica") ErrNotFound = errors.New("data not found") ErrTimedOut = errors.New("not found as a result of timing out") ErrNotStarted = errors.New("node not started, call Start()") )
Global errors that can be returned to callers
Functions ¶
This section is empty.
Types ¶
type ClusteredBigCache ¶
type ClusteredBigCache struct {
// contains filtered or unexported fields
}
ClusteredBigCache definition
func New ¶
func New(config *ClusteredBigCacheConfig, logger utils.AppLogger) *ClusteredBigCache
New creates a new local node
func NewPassiveClient ¶
func NewPassiveClient(id string, serverEndpoint string, localPort, pingInterval, pingTimeout int, pingFailureThreashold int32, logger utils.AppLogger) *ClusteredBigCache
NewPassiveClient creates a new local node that does not store any data locally
func (*ClusteredBigCache) Delete ¶
func (node *ClusteredBigCache) Delete(key string) error
Delete removes a key from the cluster
func (*ClusteredBigCache) ShutDown ¶
func (node *ClusteredBigCache) ShutDown()
ShutDown shuts this Cluster and all terminate all connections to remoteNodes
func (*ClusteredBigCache) Start ¶
func (node *ClusteredBigCache) Start() error
Start this Cluster running
func (*ClusteredBigCache) Statistics ¶
func (node *ClusteredBigCache) Statistics() string
Statistics returns the cache stats
type ClusteredBigCacheConfig ¶
type ClusteredBigCacheConfig struct { Id string `json:"id"` Join bool `json:"join"` JoinIp string `json:"join_ip"` LocalAddresses []string `json:"local_addresses"` LocalPort int `json:"local_port"` BindAll bool `json:"bind_all"` ConnectRetries int `json:"connect_retries"` TerminateOnListenerExit bool `json:"terminate_on_listener_exit"` ReplicationMode byte `json:"replication_mode"` ReplicationFactor int `json:"replication_factor"` WriteAck bool `json:"write_ack"` DebugMode bool `json:"debug_mode"` DebugPort int `json:"debug_port"` ReconnectOnDisconnect bool `json:"reconnect_on_disconnect"` PingFailureThreshHold int32 `json:"ping_failure_thresh_hold"` PingInterval int `json:"ping_interval"` PingTimeout int `json:"ping_timeout"` ShardSize int `json:"shard_size"` }
ClusteredBigCacheConfig is configuration for the cache
func DefaultClusterConfig ¶
func DefaultClusterConfig() *ClusteredBigCacheConfig
DefaultClusterConfig creates a new default configuration
Click to show internal directories.
Click to hide internal directories.