Documentation
¶
Index ¶
- type BlockNetTransport
- func (s *BlockNetTransport) GetBlockRPC(ctx context.Context, in *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
- func (s *BlockNetTransport) Register(ch chan *rpc.RelocateRPCData)
- func (s *BlockNetTransport) ReleaseBlockRPC(ctx context.Context, in *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
- func (s *BlockNetTransport) SetBlockRPC(ctx context.Context, in *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
- func (s *BlockNetTransport) TransferBlockRPC(ctx context.Context, in *rpc.RelocateRPCData) (*rpc.RelocateRPCData, error)
- type BlockNetTransportClient
- func (s *BlockNetTransportClient) GetBlock(loc *structs.Location, id []byte) (*structs.Block, error)
- func (s *BlockNetTransportClient) ReleaseBlock(loc *structs.Location, id []byte) error
- func (s *BlockNetTransportClient) SetBlock(loc *structs.Location, block *structs.Block) error
- func (s *BlockNetTransportClient) TransferBlock(id []byte, src, dst *structs.Location) error
- type BlockRing
- func (br *BlockRing) CommitEntry(tx *structs.LogEntryBlock, opts structs.RequestOptions) error
- func (br *BlockRing) EnableProximityShifting(enable bool)
- func (br *BlockRing) GetBlock(id []byte, opts ...structs.RequestOptions) (*structs.Location, *structs.Block, error)
- func (br *BlockRing) GetEntry(id []byte, opts structs.RequestOptions) (*structs.Location, *structs.LogEntryBlock, error)
- func (br *BlockRing) GetLogBlock(key []byte, opts structs.RequestOptions) (*structs.Location, *structs.LogBlock, error)
- func (br *BlockRing) GetRootBlock(id []byte, opts ...structs.RequestOptions) (*structs.Location, *structs.RootBlock, error)
- func (br *BlockRing) NewEntry(key []byte, opts structs.RequestOptions) (*structs.LogEntryBlock, *structs.Location, error)
- func (br *BlockRing) ProposeEntry(tx *structs.LogEntryBlock, opts structs.RequestOptions) error
- func (br *BlockRing) SetBlock(block *structs.Block, opts ...structs.RequestOptions) (*structs.Location, error)
- type BlockRingTransport
- func (t *BlockRingTransport) GetBlock(loc *structs.Location, id []byte) (*structs.Block, error)
- func (t *BlockRingTransport) ReleaseBlock(loc *structs.Location, id []byte) error
- func (t *BlockRingTransport) SetBlock(loc *structs.Location, block *structs.Block) error
- func (t *BlockRingTransport) TransferBlock(id []byte, src, dst *structs.Location) error
- type BlockTransport
- type ChordDelegate
- func (s *ChordDelegate) Leaving(local, pred, succ *chord.Vnode)
- func (s *ChordDelegate) NewPredecessor(local, remoteNew, remotePrev *chord.Vnode)
- func (s *ChordDelegate) PredecessorLeaving(local, remote *chord.Vnode)
- func (s *ChordDelegate) Register(ring *ChordRing, blockRing *BlockRing)
- func (s *ChordDelegate) Shutdown()
- func (s *ChordDelegate) SuccessorLeaving(local, remote *chord.Vnode)
- type ChordRing
- func (cr *ChordRing) Hostname() string
- func (cr *ChordRing) LocateReplicatedHash(hash []byte, n int) ([]*structs.Location, error)
- func (cr *ChordRing) LocateReplicatedKey(key []byte, n int) ([]*structs.Location, error)
- func (cr *ChordRing) LookupHash(hash []byte, n int) (*chord.Vnode, []*chord.Vnode, error)
- func (cr *ChordRing) LookupKey(key []byte, n int) ([]byte, *chord.Vnode, []*chord.Vnode, error)
- func (cr *ChordRing) NumSuccessors() int
- func (cr *ChordRing) Vnodes(host string) ([]*chord.Vnode, error)
- type Config
- type Locator
- type LogNetTransport
- func (t *LogNetTransport) CommitEntryRPC(ctx context.Context, req *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
- func (t *LogNetTransport) GetEntryRPC(ctx context.Context, req *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
- func (t *LogNetTransport) GetLogBlockRPC(ctx context.Context, req *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
- func (t *LogNetTransport) NewEntryRPC(ctx context.Context, req *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
- func (t *LogNetTransport) ProposeEntryRPC(ctx context.Context, req *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
- func (t *LogNetTransport) Register(ch chan *rpc.RelocateRPCData)
- func (t *LogNetTransport) ReleaseLogBlockRPC(ctx context.Context, req *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
- func (t *LogNetTransport) TransferLogBlockRPC(ctx context.Context, req *rpc.RelocateRPCData) (*rpc.RelocateRPCData, error)
- type LogNetTransportClient
- func (c *LogNetTransportClient) CommitEntry(loc *structs.Location, tx *structs.LogEntryBlock, opts structs.RequestOptions) error
- func (c *LogNetTransportClient) GetEntry(loc *structs.Location, id []byte, opts structs.RequestOptions) (*structs.LogEntryBlock, *structs.Location, error)
- func (c *LogNetTransportClient) GetLogBlock(loc *structs.Location, key []byte, opts structs.RequestOptions) (*structs.LogBlock, *structs.Location, error)
- func (c *LogNetTransportClient) NewEntry(loc *structs.Location, key []byte, opts structs.RequestOptions) (*structs.LogEntryBlock, *structs.Location, error)
- func (c *LogNetTransportClient) ProposeEntry(loc *structs.Location, tx *structs.LogEntryBlock, opts structs.RequestOptions) error
- func (c *LogNetTransportClient) TransferLogBlock(key []byte, src, dst *structs.Location) error
- type LogRingTransport
- func (lt *LogRingTransport) CommitEntry(loc *structs.Location, tx *structs.LogEntryBlock, opts structs.RequestOptions) error
- func (lt *LogRingTransport) GetEntry(loc *structs.Location, id []byte, opts structs.RequestOptions) (*structs.LogEntryBlock, *structs.Location, error)
- func (lt *LogRingTransport) GetLogBlock(loc *structs.Location, key []byte, opts structs.RequestOptions) (*structs.LogBlock, *structs.Location, error)
- func (lt *LogRingTransport) NewEntry(loc *structs.Location, key []byte, opts structs.RequestOptions) (*structs.LogEntryBlock, *structs.Location, error)
- func (lt *LogRingTransport) ProposeEntry(loc *structs.Location, tx *structs.LogEntryBlock, opts structs.RequestOptions) error
- func (lt *LogRingTransport) TransferLogBlock(key []byte, src, dst *structs.Location) error
- type LogTransport
- type LookupService
- func (ls *LookupService) LocateReplicatedHashRPC(ctx context.Context, req *rpc.LocateRequest) (*rpc.LocateResponse, error)
- func (ls *LookupService) LocateReplicatedKeyRPC(ctx context.Context, req *rpc.LocateRequest) (*rpc.LocateResponse, error)
- func (ls *LookupService) LookupHashRPC(ctx context.Context, req *rpc.LocateRequest) (*rpc.LocateResponse, error)
- func (ls *LookupService) LookupKeyRPC(ctx context.Context, req *rpc.LocateRequest) (*rpc.LocateResponse, error)
- func (ls *LookupService) NegotiateRPC(ctx context.Context, req *rpc.NegotiateRequest) (*rpc.NegotiateResponse, error)
- type LookupServiceClient
- func (ls *LookupServiceClient) LocateReplicatedHash(host string, hash []byte, r int) ([]*structs.Location, error)
- func (ls *LookupServiceClient) LocateReplicatedKey(host string, key []byte, r int) ([]*structs.Location, error)
- func (ls *LookupServiceClient) LookupHash(host string, hash []byte, n int) (*chord.Vnode, []*chord.Vnode, error)
- func (ls *LookupServiceClient) LookupKey(host string, key []byte, n int) ([]byte, *chord.Vnode, []*chord.Vnode, error)
- func (ls *LookupServiceClient) Negotiate(host string) (*rpc.NegotiateResponse, error)
- type NetTimeouts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockNetTransport ¶
type BlockNetTransport struct {
// contains filtered or unexported fields
}
func NewBlockNetTransport ¶
func NewBlockNetTransport(bs store.BlockStore) *BlockNetTransport
func (*BlockNetTransport) GetBlockRPC ¶
func (s *BlockNetTransport) GetBlockRPC(ctx context.Context, in *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
func (*BlockNetTransport) Register ¶
func (s *BlockNetTransport) Register(ch chan *rpc.RelocateRPCData)
Register registers a channel where incoming blocks are sent for processing.
func (*BlockNetTransport) ReleaseBlockRPC ¶
func (s *BlockNetTransport) ReleaseBlockRPC(ctx context.Context, in *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
func (*BlockNetTransport) SetBlockRPC ¶
func (s *BlockNetTransport) SetBlockRPC(ctx context.Context, in *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
func (*BlockNetTransport) TransferBlockRPC ¶
func (s *BlockNetTransport) TransferBlockRPC(ctx context.Context, in *rpc.RelocateRPCData) (*rpc.RelocateRPCData, error)
type BlockNetTransportClient ¶
type BlockNetTransportClient struct {
// contains filtered or unexported fields
}
func NewBlockNetTransportClient ¶
func NewBlockNetTransportClient(reapInterval, maxIdle int) *BlockNetTransportClient
func (*BlockNetTransportClient) ReleaseBlock ¶
func (s *BlockNetTransportClient) ReleaseBlock(loc *structs.Location, id []byte) error
func (*BlockNetTransportClient) TransferBlock ¶
func (s *BlockNetTransportClient) TransferBlock(id []byte, src, dst *structs.Location) error
TransferBlock submits a transfer request to the location for a Block by its id
type BlockRing ¶
type BlockRing struct {
// contains filtered or unexported fields
}
BlockRing is the core interface to perform operations around the ring.
func NewBlockRing ¶
func NewBlockRing(locator Locator, maxSuccessors int, blkTrans BlockTransport, logTrans LogTransport, ch chan<- *rpc.RelocateRPCData) *BlockRing
NewBlockRing instantiates an instance of BlockRing. If the channel is not nil, proximity shifting is automatically enabled.
func (*BlockRing) CommitEntry ¶
func (br *BlockRing) CommitEntry(tx *structs.LogEntryBlock, opts structs.RequestOptions) error
CommitEntry locates partipicating voters for the LogEntryBlock and asynchronously submits a commit request to each one participant, 1 per go-routine.
func (*BlockRing) EnableProximityShifting ¶
EnableProximityShifting enables or disables proximity shifting. Proximity shifing can only enabled if the input block channel is not nil.
func (*BlockRing) GetBlock ¶
func (br *BlockRing) GetBlock(id []byte, opts ...structs.RequestOptions) (*structs.Location, *structs.Block, error)
GetBlock lookups up the id hash then uses upto max successors to find the block.
func (*BlockRing) GetEntry ¶
func (br *BlockRing) GetEntry(id []byte, opts structs.RequestOptions) (*structs.Location, *structs.LogEntryBlock, error)
GetEntry gets a LogEntryBlock from the ring. It routes the id around the ring until an entry is found.
func (*BlockRing) GetLogBlock ¶
func (br *BlockRing) GetLogBlock(key []byte, opts structs.RequestOptions) (*structs.Location, *structs.LogBlock, error)
GetLogBlock gets the LogBlock by routing the key until it is found.
func (*BlockRing) GetRootBlock ¶
func (br *BlockRing) GetRootBlock(id []byte, opts ...structs.RequestOptions) (*structs.Location, *structs.RootBlock, error)
GetRootBlock gets a root block with the given id. It is a helper function that simply decodes a Block into a RootBlock
func (*BlockRing) NewEntry ¶
func (br *BlockRing) NewEntry(key []byte, opts structs.RequestOptions) (*structs.LogEntryBlock, *structs.Location, error)
NewEntry gets a new entry from the log.
func (*BlockRing) ProposeEntry ¶
func (br *BlockRing) ProposeEntry(tx *structs.LogEntryBlock, opts structs.RequestOptions) error
ProposeEntry locates participating voters for the LogEntryBlock and submits a propose request to each participant, 1 per go-routine
type BlockRingTransport ¶
type BlockRingTransport struct {
// contains filtered or unexported fields
}
BlockRingTransport allows to make block requests based on Location around the ring. It appropriately makes calls to the local or remote locations
func NewBlockRingTransport ¶
func NewBlockRingTransport(hostname string, local store.BlockStore, remote BlockTransport) *BlockRingTransport
func (*BlockRingTransport) ReleaseBlock ¶
func (t *BlockRingTransport) ReleaseBlock(loc *structs.Location, id []byte) error
func (*BlockRingTransport) TransferBlock ¶
func (t *BlockRingTransport) TransferBlock(id []byte, src, dst *structs.Location) error
type BlockTransport ¶
type BlockTransport interface {
GetBlock(loc *structs.Location, id []byte) (*structs.Block, error)
SetBlock(loc *structs.Location, block *structs.Block) error
TransferBlock(id []byte, src, dst *structs.Location) error
ReleaseBlock(loc *structs.Location, id []byte) error
}
BlockTransport implements the transport interface for the block store.
type ChordDelegate ¶
type ChordDelegate struct {
Store *BlockRingTransport
LogTrans *LogRingTransport
// Incoming candidate blocks to be locally stored i.e. taken over. These are either stored or
// forwarded based on location ID
InBlocks chan *rpc.RelocateRPCData
// contains filtered or unexported fields
}
ChordDelegate primarily handles the movement of data when nodes join and leave the ring.
func NewChordDelegate ¶
func NewChordDelegate(peerStore store.PeerStore, conf *Config) *ChordDelegate
NewChordDelegate instantiates a new ChordDelegate with the supplied PeerStore and config.
func (*ChordDelegate) Leaving ¶
func (s *ChordDelegate) Leaving(local, pred, succ *chord.Vnode)
Leaving is called when local node is leaving the ring
func (*ChordDelegate) NewPredecessor ¶
func (s *ChordDelegate) NewPredecessor(local, remoteNew, remotePrev *chord.Vnode)
NewPredecessor is called when a new predecessor is found
func (*ChordDelegate) PredecessorLeaving ¶
func (s *ChordDelegate) PredecessorLeaving(local, remote *chord.Vnode)
PredecessorLeaving is called when a predecessor leaves
func (*ChordDelegate) Register ¶
func (s *ChordDelegate) Register(ring *ChordRing, blockRing *BlockRing)
Register registers the chord ring to the delegate and starts processing incoming blocks
func (*ChordDelegate) Shutdown ¶
func (s *ChordDelegate) Shutdown()
Shutdown is called when the node is shutting down
func (*ChordDelegate) SuccessorLeaving ¶
func (s *ChordDelegate) SuccessorLeaving(local, remote *chord.Vnode)
SuccessorLeaving is called when a successor leaves
type ChordRing ¶
type ChordRing struct {
// contains filtered or unexported fields
}
ChordRing is a node part of the chord ring allowing to perform ring operations. This is used on peers participating in the ring.
func NewChordRing ¶
func NewChordRing(conf *Config, peerStore store.PeerStore, gserver *grpc.Server) (*ChordRing, error)
NewChordRing instantiates new ChordRing struct joining or creating a ring based on the configuration.
func (*ChordRing) LocateReplicatedHash ¶
LocateReplicatedHash returns vnodes where a key and n replicas are located.
func (*ChordRing) LocateReplicatedKey ¶
LocateReplicatedKey returns vnodes where a key and n replicas are located.
func (*ChordRing) LookupHash ¶
LookupHash returns the pred. vnode, n succesor vnodes
func (*ChordRing) NumSuccessors ¶
NumSuccessors returns the num of succesors per the config.
type Config ¶
type Config struct {
Chord *chord.Config // Chord configuration
BindAddr string // Bind address
AdvAddr string // Advertise address used by peers
Peers []string // Existing peers to join
RetryJoin bool // keep trying peers on failure
Timeouts *NetTimeouts // Network call timeouts
BlockBufferSize int // Input block buffer
RequiredVotes int // Votes required for consensus
}
Config holds the overall config
type Locator ¶
type Locator interface {
LookupHash(hash []byte, n int) (*chord.Vnode, []*chord.Vnode, error)
LookupKey(key []byte, n int) ([]byte, *chord.Vnode, []*chord.Vnode, error)
LocateReplicatedHash(hash []byte, n int) ([]*structs.Location, error)
LocateReplicatedKey(key []byte, n int) ([]*structs.Location, error)
}
Locator implements a location and lookup service
type LogNetTransport ¶
type LogNetTransport struct {
// contains filtered or unexported fields
}
LogNetTransport is the network transport for the consensus log.
func NewLogNetTransport ¶
func NewLogNetTransport(host string, txl *hexalog.HexaLog, bs hexalog.BlockStore) *LogNetTransport
NewLogNetTransport instantiates a new log network transport with the host, HexaLog and BlockStore
func (*LogNetTransport) CommitEntryRPC ¶
func (t *LogNetTransport) CommitEntryRPC(ctx context.Context, req *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
CommitEntryRPC serves a CommitEntry request
func (*LogNetTransport) GetEntryRPC ¶
func (t *LogNetTransport) GetEntryRPC(ctx context.Context, req *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
GetEntryRPC serves a GetEntry request.
func (*LogNetTransport) GetLogBlockRPC ¶
func (t *LogNetTransport) GetLogBlockRPC(ctx context.Context, req *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
GetLogBlockRPC serves a GetLogBlock request.
func (*LogNetTransport) NewEntryRPC ¶
func (t *LogNetTransport) NewEntryRPC(ctx context.Context, req *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
NewEntryRPC services a NewEntry request
func (*LogNetTransport) ProposeEntryRPC ¶
func (t *LogNetTransport) ProposeEntryRPC(ctx context.Context, req *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
ProposeEntryRPC serves a ProposeEntry request
func (*LogNetTransport) Register ¶
func (t *LogNetTransport) Register(ch chan *rpc.RelocateRPCData)
Register registers a channel where incoming blocks are sent for processing.
func (*LogNetTransport) ReleaseLogBlockRPC ¶
func (t *LogNetTransport) ReleaseLogBlockRPC(ctx context.Context, req *rpc.BlockRPCData) (*rpc.BlockRPCData, error)
func (*LogNetTransport) TransferLogBlockRPC ¶
func (t *LogNetTransport) TransferLogBlockRPC(ctx context.Context, req *rpc.RelocateRPCData) (*rpc.RelocateRPCData, error)
TransferLogBlockRPC submits a LogBlock transfer request to the local input block channel.
type LogNetTransportClient ¶
type LogNetTransportClient struct {
// contains filtered or unexported fields
}
func NewLogNetTransportClient ¶
func NewLogNetTransportClient(reapInterval, maxIdle int) *LogNetTransportClient
func (*LogNetTransportClient) CommitEntry ¶
func (c *LogNetTransportClient) CommitEntry(loc *structs.Location, tx *structs.LogEntryBlock, opts structs.RequestOptions) error
CommitEntry makes a CommitEntry request to the Location
func (*LogNetTransportClient) GetEntry ¶
func (c *LogNetTransportClient) GetEntry(loc *structs.Location, id []byte, opts structs.RequestOptions) (*structs.LogEntryBlock, *structs.Location, error)
GetEntry makes a GetEntry rpc call to the location with the id.
func (*LogNetTransportClient) GetLogBlock ¶
func (c *LogNetTransportClient) GetLogBlock(loc *structs.Location, key []byte, opts structs.RequestOptions) (*structs.LogBlock, *structs.Location, error)
GetLogBlock gets a LogBlock from the provided location.
func (*LogNetTransportClient) NewEntry ¶
func (c *LogNetTransportClient) NewEntry(loc *structs.Location, key []byte, opts structs.RequestOptions) (*structs.LogEntryBlock, *structs.Location, error)
NewEntry makes a new a entry request to Location for key
func (*LogNetTransportClient) ProposeEntry ¶
func (c *LogNetTransportClient) ProposeEntry(loc *structs.Location, tx *structs.LogEntryBlock, opts structs.RequestOptions) error
ProposeEntry makes an ProposeEntry rpc call to a location.
func (*LogNetTransportClient) TransferLogBlock ¶
func (c *LogNetTransportClient) TransferLogBlock(key []byte, src, dst *structs.Location) error
TransferLogBlock submits a transfer request to the location for a LogBlock by the key
type LogRingTransport ¶
type LogRingTransport struct {
// contains filtered or unexported fields
}
LogRingTransport is a transport to make log requests around the ring based on location.
func NewLogRingTransport ¶
func NewLogRingTransport(host string, txl *hexalog.HexaLog, bs hexalog.BlockStore, remote LogTransport) *LogRingTransport
NewLogRingTransport instantiates a new LogRingTransport to make location based calls around the ring
func (*LogRingTransport) CommitEntry ¶
func (lt *LogRingTransport) CommitEntry(loc *structs.Location, tx *structs.LogEntryBlock, opts structs.RequestOptions) error
CommitEntry commits the LogEntryBlock to the specified Location
func (*LogRingTransport) GetEntry ¶
func (lt *LogRingTransport) GetEntry(loc *structs.Location, id []byte, opts structs.RequestOptions) (*structs.LogEntryBlock, *structs.Location, error)
GetEntry gets a log entry from a location returning the entry and the location it was retreived from.
func (*LogRingTransport) GetLogBlock ¶
func (lt *LogRingTransport) GetLogBlock(loc *structs.Location, key []byte, opts structs.RequestOptions) (*structs.LogBlock, *structs.Location, error)
GetLogBlock retrieves a LogBlock from a local or remote Location
func (*LogRingTransport) NewEntry ¶
func (lt *LogRingTransport) NewEntry(loc *structs.Location, key []byte, opts structs.RequestOptions) (*structs.LogEntryBlock, *structs.Location, error)
NewEntry creates a new LogEntryBlock from the provided Location
func (*LogRingTransport) ProposeEntry ¶
func (lt *LogRingTransport) ProposeEntry(loc *structs.Location, tx *structs.LogEntryBlock, opts structs.RequestOptions) error
ProposeEntry proposes a LogEntryBlock to a local or remote Location
func (*LogRingTransport) TransferLogBlock ¶
func (lt *LogRingTransport) TransferLogBlock(key []byte, src, dst *structs.Location) error
TransferLogBlock makes a transfer request to the destination. It returns an error if a local transfer is initiated otherwise the remote transport error is returned.
type LogTransport ¶
type LogTransport interface {
GetEntry(loc *structs.Location, key []byte, opts structs.RequestOptions) (*structs.LogEntryBlock, *structs.Location, error)
NewEntry(loc *structs.Location, key []byte, opts structs.RequestOptions) (*structs.LogEntryBlock, *structs.Location, error)
ProposeEntry(loc *structs.Location, tx *structs.LogEntryBlock, opts structs.RequestOptions) error
CommitEntry(loc *structs.Location, tx *structs.LogEntryBlock, opts structs.RequestOptions) error
GetLogBlock(loc *structs.Location, key []byte, opts structs.RequestOptions) (*structs.LogBlock, *structs.Location, error)
TransferLogBlock(key []byte, src, dst *structs.Location) error
}
LogTransport implements a transport for the distributed log
type LookupService ¶
type LookupService struct {
// contains filtered or unexported fields
}
func NewLookupSerivce ¶
func NewLookupSerivce(ring *ChordRing, peerStore store.PeerStore) *LookupService
func (*LookupService) LocateReplicatedHashRPC ¶
func (ls *LookupService) LocateReplicatedHashRPC(ctx context.Context, req *rpc.LocateRequest) (*rpc.LocateResponse, error)
func (*LookupService) LocateReplicatedKeyRPC ¶
func (ls *LookupService) LocateReplicatedKeyRPC(ctx context.Context, req *rpc.LocateRequest) (*rpc.LocateResponse, error)
func (*LookupService) LookupHashRPC ¶
func (ls *LookupService) LookupHashRPC(ctx context.Context, req *rpc.LocateRequest) (*rpc.LocateResponse, error)
func (*LookupService) LookupKeyRPC ¶
func (ls *LookupService) LookupKeyRPC(ctx context.Context, req *rpc.LocateRequest) (*rpc.LocateResponse, error)
func (*LookupService) NegotiateRPC ¶
func (ls *LookupService) NegotiateRPC(ctx context.Context, req *rpc.NegotiateRequest) (*rpc.NegotiateResponse, error)
type LookupServiceClient ¶
type LookupServiceClient struct {
// contains filtered or unexported fields
}
func NewLookupServiceClient ¶
func NewLookupServiceClient(reapInterval, maxIdle int) *LookupServiceClient
func (*LookupServiceClient) LocateReplicatedHash ¶
func (*LookupServiceClient) LocateReplicatedKey ¶
func (ls *LookupServiceClient) LocateReplicatedKey(host string, key []byte, r int) ([]*structs.Location, error)
LocateReplicatedKey makes a LocateReplicatedKey RPC request to the host
func (*LookupServiceClient) LookupHash ¶
func (ls *LookupServiceClient) LookupHash(host string, hash []byte, n int) (*chord.Vnode, []*chord.Vnode, error)
LookupHash performs a hash lookup on the host
func (*LookupServiceClient) LookupKey ¶
func (ls *LookupServiceClient) LookupKey(host string, key []byte, n int) ([]byte, *chord.Vnode, []*chord.Vnode, error)
LookupKey performs a key lookup on the host
func (*LookupServiceClient) Negotiate ¶
func (ls *LookupServiceClient) Negotiate(host string) (*rpc.NegotiateResponse, error)
Negotiate negotiates various parameters from the network when a new Client is instantiated
type NetTimeouts ¶
NetTimeouts holds timeouts for rpc's
func DefaultNetTimeouts ¶
func DefaultNetTimeouts() *NetTimeouts
DefaultNetTimeouts initializes sane timeouts