Documentation ¶
Index ¶
- Constants
- Variables
- func GetClientMetadata() (*hank.ClientMetadata, error)
- func NewHankSmartClientOptions() *hankSmartClientOptions
- type ConnectionSet
- type Entry
- type EnvironmentValue
- type HankCacheResponse
- type HankSmartClient
- type HostConnection
- func (p *HostConnection) Disconnect() error
- func (p *HostConnection) Get(id iface.DomainID, key []byte, isLockHeld bool) (*hank.HankResponse, error)
- func (p *HostConnection) IsDisconnected() bool
- func (p *HostConnection) IsOffline() bool
- func (p *HostConnection) IsServing() bool
- func (p *HostConnection) Lock()
- func (p *HostConnection) OnDataChange(newVal interface{}, path string) (err error)
- func (p *HostConnection) TryImmediateLock() bool
- func (p *HostConnection) TryLockWithTimeout() bool
- func (p *HostConnection) Unlock()
- type HostConnectionPool
- type IndexedHostConnection
- type QueryFailedErr
- type RequestCounters
Constants ¶
View Source
const NO_HASH = -1
View Source
const NO_SEED = -1
View Source
const NumStatSamples = 3
View Source
const SampleSleepTime = time.Second
View Source
const StatInterval = time.Second * 30
Variables ¶
View Source
var AssignmentsRegex = regexp.MustCompile(fmt.Sprintf("hosts/[-0-9]+/%v", zk_coordinator.ASSIGNMENTS_PATH))
we don't want to rebuild each time an updating host updates a version of a partition. we'll catch it when it switches back to active.
View Source
var SkipRebuildPaths = []*regexp.Regexp{AssignmentsRegex}
Functions ¶
func GetClientMetadata ¶
func GetClientMetadata() (*hank.ClientMetadata, error)
func NewHankSmartClientOptions ¶
func NewHankSmartClientOptions() *hankSmartClientOptions
Types ¶
type ConnectionSet ¶
type ConnectionSet struct {
// contains filtered or unexported fields
}
type EnvironmentValue ¶
type HankCacheResponse ¶
type HankCacheResponse struct { *hank.HankResponse Cached bool }
type HankSmartClient ¶
type HankSmartClient struct {
// contains filtered or unexported fields
}
func New ¶
func New( coordinator iface.Coordinator, ringGroupName string, options *hankSmartClientOptions) (*HankSmartClient, error)
func (*HankSmartClient) Get ¶
func (p *HankSmartClient) Get(domainName string, key []byte) (*HankCacheResponse, error)
func (*HankSmartClient) OnChange ¶
func (p *HankSmartClient) OnChange(path string)
func (*HankSmartClient) Stop ¶
func (p *HankSmartClient) Stop()
type HostConnection ¶
type HostConnection struct {
// contains filtered or unexported fields
}
func NewHostConnection ¶
func (*HostConnection) Disconnect ¶
func (p *HostConnection) Disconnect() error
func (*HostConnection) Get ¶
func (p *HostConnection) Get(id iface.DomainID, key []byte, isLockHeld bool) (*hank.HankResponse, error)
func (*HostConnection) IsDisconnected ¶
func (p *HostConnection) IsDisconnected() bool
func (*HostConnection) IsOffline ¶
func (p *HostConnection) IsOffline() bool
func (*HostConnection) IsServing ¶
func (p *HostConnection) IsServing() bool
func (*HostConnection) Lock ¶
func (p *HostConnection) Lock()
func (*HostConnection) OnDataChange ¶
func (p *HostConnection) OnDataChange(newVal interface{}, path string) (err error)
func (*HostConnection) TryImmediateLock ¶
func (p *HostConnection) TryImmediateLock() bool
func (*HostConnection) TryLockWithTimeout ¶
func (p *HostConnection) TryLockWithTimeout() bool
func (*HostConnection) Unlock ¶
func (p *HostConnection) Unlock()
type HostConnectionPool ¶
type HostConnectionPool struct {
// contains filtered or unexported fields
}
func CreateHostConnectionPool ¶
func CreateHostConnectionPool(connections []*HostConnection, hostShuffleSeed int64, preferredHosts []string) (*HostConnectionPool, error)
func NewHostConnectionPool ¶
func NewHostConnectionPool(connectionsByHost map[string][]*HostConnection, hostShuffleSeed int64, preferredHosts []string) (*HostConnectionPool, error)
func (*HostConnectionPool) Get ¶
func (p *HostConnectionPool) Get(domain iface.Domain, key []byte, maxNumTries int32, keyHash int32) (*hank.HankResponse, error)
func (*HostConnectionPool) GetConnectionLoad ¶
func (p *HostConnectionPool) GetConnectionLoad() (numConnections int64, numLockedConnections int64)
func (*HostConnectionPool) GetConnections ¶
func (p *HostConnectionPool) GetConnections() []*HostConnection
type IndexedHostConnection ¶
type IndexedHostConnection struct {
// contains filtered or unexported fields
}
type QueryFailedErr ¶
type QueryFailedErr struct {
Msg string
}
QueryFailedErr is a classification of errors that are returned when a query is attempted on a Hank server but the query fails.
func (*QueryFailedErr) Error ¶
func (e *QueryFailedErr) Error() string
type RequestCounters ¶
type RequestCounters struct {
// contains filtered or unexported fields
}
func NewRequestCounters ¶
func NewRequestCounters() *RequestCounters
Click to show internal directories.
Click to hide internal directories.