hank_client

package
v0.0.0-...-78fbe0a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2019 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

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 Entry

type Entry struct {
	// contains filtered or unexported fields
}

type EnvironmentValue

type EnvironmentValue struct {
	Key   string
	Value string
}

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 NewHostConnection(
	host iface.Host,
	tryLockTimeoutMs int32,
	establishConnectionTimeoutMs int32,
	establishConnectionRetries int32,
	queryTimeoutMs int32,
	bulkQueryTimeoutMs int32,
) (*HostConnection, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL