Documentation ¶
Overview ¶
Package fidias is a generated protocol buffer package.
It is generated from these files:
rpc.proto
It has these top-level messages:
KeyLocation KeyValuePair FileVersion PathRPC
Index ¶
- Constants
- Variables
- func RegisterFidiasRPCServer(s *grpc.Server, srv FidiasRPCServer)
- type Config
- type DHT
- type FSM
- type Fetcher
- type FetcherTransport
- type Fidias
- func (fids *Fidias) FileSystem() *FileSystem
- func (fidias *Fidias) Leaving(local, pred, succ *chord.Vnode)
- func (fidias *Fidias) NewPredecessor(local, newPred, oldPred *chord.Vnode)
- func (fidias *Fidias) PredecessorLeaving(local, remote *chord.Vnode)
- func (fids *Fidias) Register(ring *hexaring.Ring)
- func (fidias *Fidias) Shutdown()
- func (fidias *Fidias) Status() *Status
- func (fidias *Fidias) SuccessorLeaving(local, remote *chord.Vnode)
- type FidiasRPCClient
- type FidiasRPCServer
- type FidiasRPC_RelocateBlocksRPCClient
- type FidiasRPC_RelocateBlocksRPCServer
- type FidiasRPC_RelocateRPCClient
- type FidiasRPC_RelocateRPCServer
- type File
- type FileSystem
- func (fs *FileSystem) Create(name string) (*File, error)
- func (fs *FileSystem) GetVersions(name string) (*VersionedFile, error)
- func (fs *FileSystem) Mkdir(name string) error
- func (fs *FileSystem) Open(name string) (*File, error)
- func (fs *FileSystem) RegisterDHT(dht DHT)
- func (fs *FileSystem) RegisterTransport(remote FileSystemTransport)
- func (fs *FileSystem) Stat(name string) (os.FileInfo, error)
- type FileSystemFSM
- type FileSystemTransport
- type FileVersion
- func (*FileVersion) Descriptor() ([]byte, []int)
- func (m *FileVersion) GetAlias() string
- func (m *FileVersion) GetID() []byte
- func (ver *FileVersion) MarshalJSON() ([]byte, error)
- func (*FileVersion) ProtoMessage()
- func (m *FileVersion) Reset()
- func (m *FileVersion) String() string
- func (ver *FileVersion) Text() string
- type Healer
- type Hexalog
- func (hexlog *Hexalog) GetEntry(key, id []byte) (entry *hexatype.Entry, meta *ReMeta, err error)
- func (hexlog *Hexalog) Heal(key []byte, opts *hexatype.RequestOptions) error
- func (hexlog *Hexalog) Leader(key []byte, locs hexaring.LocationSet) (*hexalog.KeyLeader, error)
- func (hexlog *Hexalog) MinVotes() int
- func (hexlog *Hexalog) NewEntry(key []byte) (*hexatype.Entry, *hexatype.RequestOptions, error)
- func (hexlog *Hexalog) NewEntryFrom(entry *hexatype.Entry) (*hexatype.Entry, *hexatype.RequestOptions, error)
- func (hexlog *Hexalog) ProposeEntry(entry *hexatype.Entry, opts *hexatype.RequestOptions) (err error)
- func (hexlog *Hexalog) RegisterDHT(dht DHT)
- type InMemKeyValueFSM
- type InMemVersionedFileFSM
- type KeyLocation
- type KeyValueFSM
- type KeyValuePair
- func (*KeyValuePair) Descriptor() ([]byte, []int)
- func (m *KeyValuePair) GetEntry() *hexatype.Entry
- func (m *KeyValuePair) GetKey() []byte
- func (m *KeyValuePair) GetValue() []byte
- func (kvp KeyValuePair) MarshalJSON() ([]byte, error)
- func (*KeyValuePair) ProtoMessage()
- func (m *KeyValuePair) Reset()
- func (m *KeyValuePair) String() string
- type KeyValueStore
- type KeyValueTransport
- type Keyvs
- func (kv *Keyvs) GetKey(key []byte) (kvp *KeyValuePair, opt *hexatype.RequestOptions, err error)
- func (kv *Keyvs) RegisterDHT(dht DHT)
- func (kv *Keyvs) RegisterTransport(remote KeyValueTransport)
- func (kv *Keyvs) RemoveKey(basekey []byte) (*hexatype.Entry, *hexatype.RequestOptions, error)
- func (kv *Keyvs) SetKey(basekey, val []byte) (*hexatype.Entry, *hexatype.RequestOptions, error)
- type LocalStore
- type NetTransport
- func (trans *NetTransport) GetKey(ctx context.Context, host string, key []byte) (*KeyValuePair, error)
- func (trans *NetTransport) GetKeyRPC(ctx context.Context, in *KeyValuePair) (*KeyValuePair, error)
- func (trans *NetTransport) GetPath(ctx context.Context, host string, name string) (*VersionedFile, error)
- func (trans *NetTransport) GetPathRPC(ctx context.Context, in *PathRPC) (*PathRPC, error)
- func (trans *NetTransport) GetRelocateBlocksStream(local, remote *chord.Vnode) (*RelocateBlocksStream, error)
- func (trans *NetTransport) GetRelocateStream(local, remote *chord.Vnode) (*RelocateStream, error)
- func (trans *NetTransport) Register(fetLogCh, fetBlkCh chan<- *relocateReq)
- func (trans *NetTransport) RelocateBlocksRPC(stream FidiasRPC_RelocateBlocksRPCServer) error
- func (trans *NetTransport) RelocateRPC(stream FidiasRPC_RelocateRPCServer) error
- func (trans *NetTransport) Shutdown()
- type PathRPC
- type ReMeta
- type RelocateBlocksStream
- type RelocateStream
- type Relocator
- type RelocatorTransport
- type RingDevice
- func (dev *RingDevice) Close() error
- func (dev *RingDevice) GetBlock(id []byte) (block.Block, error)
- func (dev *RingDevice) Hasher() hexatype.Hasher
- func (dev *RingDevice) RegisterDHT(dht DHT)
- func (dev *RingDevice) RemoveBlock(id []byte) error
- func (dev *RingDevice) SetBlock(blk block.Block) ([]byte, error)
- type Status
- type VersionedFile
- func (f *VersionedFile) AddVersion(version *FileVersion) error
- func (f *VersionedFile) GetVersion(alias string) (*FileVersion, error)
- func (f *VersionedFile) MarshalBinary() ([]byte, error)
- func (f *VersionedFile) MarshalJSON() ([]byte, error)
- func (f *VersionedFile) String() string
- func (f *VersionedFile) UnmarshalBinary(b []byte) error
- func (f *VersionedFile) UpdateVersion(alias string, id []byte) error
- func (f *VersionedFile) Version() *FileVersion
- type VersionedFileStore
Constants ¶
const ( // OpSet is the op to set a ke-value pair OpSet byte = iota + 1 // OpDel is the op to delete a key-value pair OpDel )
const ( // OpFsSet is used to set a path in the fsm OpFsSet byte = iota + 10 // OpFsDel is used to delete a path from the fsm OpFsDel )
Variables ¶
var ( // ErrVersionNotFound is used when a file version is not found ErrVersionNotFound = errors.New("version not found") // ErrVersionExists is used when a new version being created has // the same name as an already existing one ErrVersionExists = errors.New("version exists") )
Functions ¶
func RegisterFidiasRPCServer ¶
func RegisterFidiasRPCServer(s *grpc.Server, srv FidiasRPCServer)
Types ¶
type Config ¶
type Config struct { Version string // This is internally set Ring *chord.Config Hexalog *hexalog.Config RelocateBufSize int // Relocate request buffer size RetryInterval time.Duration // interval to wait before retrying a proposal //StableThreshold time.Duration // Threshold after ring event to consider we are stable KeyValueNamespace string FileSystemNamespace string // Web UI directory UIDir string }
Config hold the guac config along with the underlying log and ring config
func DefaultConfig ¶
DefaultConfig returns a default sane config setting the hostname on the log and ring configs
type FSM ¶ added in v0.1.4
type FSM struct {
// contains filtered or unexported fields
}
FSM is a hexalog FSM for an in-memory key-value store. It implements the FSM interface and provides a get function to retrieve keys as all write are handled by the FSM
func (*FSM) Apply ¶ added in v0.1.4
Apply applies the given entry to the FSM. entryID is the hash id of the entry. The first byte in entry.Data contains the operation to be performed followed by the actual value.
func (*FSM) GetKey ¶ added in v0.1.4
func (fsm *FSM) GetKey(key []byte) (*KeyValuePair, error)
GetKey gets a value for the key. It reads it directly from the stored log entry
type Fetcher ¶ added in v0.1.4
type Fetcher struct {
// contains filtered or unexported fields
}
Fetcher manages fetching block and log entries from the network
func NewFetcher ¶ added in v0.1.4
func NewFetcher(idx hexalog.IndexStore, ent hexalog.EntryStore, replicas, bufSize int, hasher hexatype.Hasher) *Fetcher
NewFetcher inits a Fetcher with the given options.
func (*Fetcher) RegisterBlockTransport ¶ added in v0.1.4
RegisterBlockTransport registers a transport for block fetching
func (*Fetcher) RegisterDHT ¶ added in v0.1.4
RegisterDHT registers the DHT to the fetcher and starts the fetch loop. This must be called after the transport and healer interfaces have been registered.
func (*Fetcher) RegisterHealer ¶ added in v0.1.4
RegisterHealer registers the log healer to the fetcher to submit heal requests
func (*Fetcher) RegisterTransport ¶ added in v0.1.4
func (fet *Fetcher) RegisterTransport(trans FetcherTransport)
RegisterTransport registers a transport for log fetching
type FetcherTransport ¶ added in v0.1.4
type FetcherTransport interface {
FetchKeylog(host string, entry *hexatype.Entry, opts *hexatype.RequestOptions) (*hexalog.FutureEntry, error)
}
FetcherTransport implements a tranport interface to fetch all entries from a given entry down
type Fidias ¶
type Fidias struct {
// contains filtered or unexported fields
}
Fidias is the core that manages all operations for a node. It primary manages rebalancing, replication, and appropriately deals with cluster churn.
func New ¶
func New(conf *Config, hexlog *Hexalog, fsm *FSM, relocator *Relocator, fetcher *Fetcher, keyvs *Keyvs, dev *RingDevice, trans *NetTransport) *Fidias
New instantiates a new instance of Fidias based on the given config and stores along with a grpc server instance to register the network transports
func (*Fidias) FileSystem ¶ added in v0.1.4
func (fids *Fidias) FileSystem() *FileSystem
FileSystem returns the fidias file-system
func (*Fidias) Leaving ¶
func (fidias *Fidias) Leaving(local, pred, succ *chord.Vnode)
Leaving is called by the Ring when this node willingly leaves. This is only triggered if an explicit leave is issued
func (*Fidias) NewPredecessor ¶
func (fidias *Fidias) NewPredecessor(local, newPred, oldPred *chord.Vnode)
NewPredecessor is called when a local vnode finds a new predecessor. This causes a rebalance of keys. All key hashes less than the new predecessor are transferred to the new predecessor.
func (*Fidias) PredecessorLeaving ¶
func (fidias *Fidias) PredecessorLeaving(local, remote *chord.Vnode)
PredecessorLeaving is only triggered if an explicit leave is issued
func (*Fidias) Register ¶
Register registers the chord ring to fidias. This is due to the fact that guac and the ring depend on each other and the ring may not be intialized yet. Only upon ring registration, the rebalancing is started.
func (*Fidias) Shutdown ¶
func (fidias *Fidias) Shutdown()
Shutdown is called but a chord node is shutdown
func (*Fidias) SuccessorLeaving ¶
func (fidias *Fidias) SuccessorLeaving(local, remote *chord.Vnode)
SuccessorLeaving is only triggered if an explicit leave is issued
type FidiasRPCClient ¶
type FidiasRPCClient interface { // Get key-value pair from remote GetKeyRPC(ctx context.Context, in *KeyValuePair, opts ...grpc.CallOption) (*KeyValuePair, error) // Get versioned path from remote GetPathRPC(ctx context.Context, in *PathRPC, opts ...grpc.CallOption) (*PathRPC, error) // Send key-location id pairs RelocateRPC(ctx context.Context, opts ...grpc.CallOption) (FidiasRPC_RelocateRPCClient, error) // Send block id and journal value RelocateBlocksRPC(ctx context.Context, opts ...grpc.CallOption) (FidiasRPC_RelocateBlocksRPCClient, error) }
func NewFidiasRPCClient ¶
func NewFidiasRPCClient(cc *grpc.ClientConn) FidiasRPCClient
type FidiasRPCServer ¶
type FidiasRPCServer interface { // Get key-value pair from remote GetKeyRPC(context.Context, *KeyValuePair) (*KeyValuePair, error) // Get versioned path from remote GetPathRPC(context.Context, *PathRPC) (*PathRPC, error) // Send key-location id pairs RelocateRPC(FidiasRPC_RelocateRPCServer) error // Send block id and journal value RelocateBlocksRPC(FidiasRPC_RelocateBlocksRPCServer) error }
type FidiasRPC_RelocateBlocksRPCClient ¶ added in v0.1.4
type FidiasRPC_RelocateBlocksRPCClient interface { Send(*KeyLocation) error Recv() (*KeyLocation, error) grpc.ClientStream }
type FidiasRPC_RelocateBlocksRPCServer ¶ added in v0.1.4
type FidiasRPC_RelocateBlocksRPCServer interface { Send(*KeyLocation) error Recv() (*KeyLocation, error) grpc.ServerStream }
type FidiasRPC_RelocateRPCClient ¶ added in v0.1.2
type FidiasRPC_RelocateRPCClient interface { Send(*KeyLocation) error Recv() (*KeyLocation, error) grpc.ClientStream }
type FidiasRPC_RelocateRPCServer ¶ added in v0.1.2
type FidiasRPC_RelocateRPCServer interface { Send(*KeyLocation) error Recv() (*KeyLocation, error) grpc.ServerStream }
type File ¶ added in v0.1.4
type File struct { *filesystem.BloxFile // contains filtered or unexported fields }
File is a fidias file representing a standard OS file type interface. It contains methods to perform native go file type operations
func (*File) Close ¶ added in v0.1.4
Close closes the underlying BloxFile and updates hexalog with the new hash entries
func (*File) Versions ¶ added in v0.1.5
func (file *File) Versions() *VersionedFile
Versions returns the underlying VersionedFile instance
type FileSystem ¶ added in v0.1.4
type FileSystem struct {
// contains filtered or unexported fields
}
FileSystem represents a fidias filesystem
func NewFileSystem ¶ added in v0.1.4
func NewFileSystem(host, namespace string, dev *RingDevice, hexlog *Hexalog, verfs VersionedFileStore) *FileSystem
NewFileSystem inits a new FileSystem instance. There can be as many instances needed. namespace is used to prefix all keys.
func (*FileSystem) Create ¶ added in v0.1.4
func (fs *FileSystem) Create(name string) (*File, error)
Create creates a new file
func (*FileSystem) GetVersions ¶ added in v0.1.5
func (fs *FileSystem) GetVersions(name string) (*VersionedFile, error)
GetVersions gets the VersionedFile associated to the provided file name.
func (*FileSystem) Mkdir ¶ added in v0.1.5
func (fs *FileSystem) Mkdir(name string) error
Mkdir creates a new directory by submitting a log entry
func (*FileSystem) Open ¶ added in v0.1.4
func (fs *FileSystem) Open(name string) (*File, error)
Open opens the active version of the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY.
func (*FileSystem) RegisterDHT ¶ added in v0.1.4
func (fs *FileSystem) RegisterDHT(dht DHT)
RegisterDHT registers the DHT for lookups
func (*FileSystem) RegisterTransport ¶ added in v0.1.4
func (fs *FileSystem) RegisterTransport(remote FileSystemTransport)
RegisterTransport registers a network transport for the filesystem used to get remote paths
type FileSystemFSM ¶ added in v0.1.4
type FileSystemFSM interface { // Get a VersionedFile by name Get(name string) (*VersionedFile, error) // ApplySet is called when an entry needs to be applied. It is called // with the entry and the extracted value from the entry. It should // use the value bytes as the data payload ApplySet(entryID []byte, entry *hexatype.Entry, value []byte) error // ApplyDelete is called when a delete entry to needs to be applied // It should remove the key and all versions given by the entry key ApplyDelete(entry *hexatype.Entry) error }
FileSystemFSM implements an FSM to manage a versioned file-system. It is responsible for applying log entries to provide a VersionedFile file-system view.
type FileSystemTransport ¶ added in v0.1.4
type FileVersion ¶ added in v0.1.4
type FileVersion struct { Alias string `protobuf:"bytes,1,opt,name=Alias" json:"Alias,omitempty"` ID []byte `protobuf:"bytes,2,opt,name=ID,proto3" json:"ID,omitempty"` }
func (*FileVersion) Descriptor ¶ added in v0.1.4
func (*FileVersion) Descriptor() ([]byte, []int)
func (*FileVersion) GetAlias ¶ added in v0.1.4
func (m *FileVersion) GetAlias() string
func (*FileVersion) GetID ¶ added in v0.1.4
func (m *FileVersion) GetID() []byte
func (*FileVersion) MarshalJSON ¶ added in v0.1.5
func (ver *FileVersion) MarshalJSON() ([]byte, error)
MarshalJSON marshals a file version accounting for hash ids
func (*FileVersion) ProtoMessage ¶ added in v0.1.4
func (*FileVersion) ProtoMessage()
func (*FileVersion) Reset ¶ added in v0.1.4
func (m *FileVersion) Reset()
func (*FileVersion) String ¶ added in v0.1.4
func (m *FileVersion) String() string
func (*FileVersion) Text ¶ added in v0.1.4
func (ver *FileVersion) Text() string
Text returns the text string representation of the file version
type Healer ¶ added in v0.1.4
type Healer interface {
Heal(key []byte, opts *hexatype.RequestOptions) error
}
Healer implements an interface to submit heal requests for a given key.
type Hexalog ¶ added in v0.1.4
type Hexalog struct {
// contains filtered or unexported fields
}
Hexalog is a ring/cluster aware Hexalog.
func NewHexalog ¶ added in v0.1.4
func NewHexalog(conf *Config, logstore *hexalog.LogStore, stable hexalog.StableStore, f *FSM, remote *hexalog.NetTransport) (*Hexalog, error)
NewHexalog inits a new fidias hexalog instance attached to the ring. Remote must be registered to grpc before init'ing hexalog
func (*Hexalog) GetEntry ¶ added in v0.1.4
GetEntry tries to get an entry from the ring. It gets the replica locations and queries upto the max allowed successors for each location.
func (*Hexalog) Heal ¶ added in v0.1.4
func (hexlog *Hexalog) Heal(key []byte, opts *hexatype.RequestOptions) error
Heal submits a heal request for the given key to the local note. It consults the supplied PeerSet in order to perform the heal.
func (*Hexalog) Leader ¶ added in v0.1.4
Leader returns the leader of the given location set from the underlying log.
func (*Hexalog) MinVotes ¶ added in v0.1.4
MinVotes returns the minimum number of required votes for a proposal and commit
func (*Hexalog) NewEntry ¶ added in v0.1.4
NewEntry returns a new Entry for the given key from Hexalog. It returns an error if the node is not part of the location set or a lookup error occurs
func (*Hexalog) NewEntryFrom ¶ added in v0.1.4
func (hexlog *Hexalog) NewEntryFrom(entry *hexatype.Entry) (*hexatype.Entry, *hexatype.RequestOptions, error)
NewEntryFrom creates a new entry based on the given entry. It uses the given height and previous hash of the entry to determine the values for the new entry. This is essentially a compare and set
func (*Hexalog) ProposeEntry ¶ added in v0.1.4
func (hexlog *Hexalog) ProposeEntry(entry *hexatype.Entry, opts *hexatype.RequestOptions) (err error)
ProposeEntry finds locations for the entry and proposes it to those locations. It retries the specified number of times before returning. It returns a ballot that can be waited on for the entry to be applied or an error
func (*Hexalog) RegisterDHT ¶ added in v0.1.4
RegisterDHT registers the DHT to hexalog
type InMemKeyValueFSM ¶
type InMemKeyValueFSM struct {
// contains filtered or unexported fields
}
func NewInMemKeyValueFSM ¶
func NewInMemKeyValueFSM(prefix string) *InMemKeyValueFSM
func (*InMemKeyValueFSM) ApplyDelete ¶ added in v0.1.4
func (fsm *InMemKeyValueFSM) ApplyDelete(entry *hexatype.Entry) error
func (*InMemKeyValueFSM) Get ¶
func (fsm *InMemKeyValueFSM) Get(key []byte) (*KeyValuePair, error)
type InMemVersionedFileFSM ¶ added in v0.1.4
type InMemVersionedFileFSM struct {
// contains filtered or unexported fields
}
InMemVersionedFileFSM is a VersionedFile FSM
func NewInMemVersionedFileFSM ¶ added in v0.1.4
func NewInMemVersionedFileFSM(prefix string) *InMemVersionedFileFSM
NewInMemVersionedFileFSM inits a new in-memory VersionedFile fsm. It takes a prefix that must be present in hexalog used to trim the received entry key to obtain the file path.
func (*InMemVersionedFileFSM) ApplyDelete ¶ added in v0.1.4
func (store *InMemVersionedFileFSM) ApplyDelete(entry *hexatype.Entry) error
ApplyDelete applies a delete fsm operation for VersionedFiles. This is not to be directly used or called. It is called by the managing parent fsm when a fs delete operation entry is received.
func (*InMemVersionedFileFSM) ApplySet ¶ added in v0.1.4
func (store *InMemVersionedFileFSM) ApplySet(entryID []byte, entry *hexatype.Entry, value []byte) error
ApplySet applies a set fsm operation for VersionedFiles. This is not to be directly used or called. It is called by the managing parent fsm when a fs set operation entry is received by the managing parent fsm.
func (*InMemVersionedFileFSM) Get ¶ added in v0.1.4
func (store *InMemVersionedFileFSM) Get(name string) (*VersionedFile, error)
Get returns the VersionedFile by the given name
type KeyLocation ¶ added in v0.1.2
type KeyLocation struct { // Actual key Key []byte `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` // Location id or last entry or id Marker []byte `protobuf:"bytes,2,opt,name=Marker,proto3" json:"Marker,omitempty"` // Total known height of the key Height uint32 `protobuf:"varint,3,opt,name=Height" json:"Height,omitempty"` }
func (*KeyLocation) Descriptor ¶ added in v0.1.2
func (*KeyLocation) Descriptor() ([]byte, []int)
func (*KeyLocation) GetHeight ¶ added in v0.1.2
func (m *KeyLocation) GetHeight() uint32
func (*KeyLocation) GetKey ¶ added in v0.1.2
func (m *KeyLocation) GetKey() []byte
func (*KeyLocation) GetMarker ¶ added in v0.1.2
func (m *KeyLocation) GetMarker() []byte
func (*KeyLocation) ProtoMessage ¶ added in v0.1.2
func (*KeyLocation) ProtoMessage()
func (*KeyLocation) Reset ¶ added in v0.1.2
func (m *KeyLocation) Reset()
func (*KeyLocation) String ¶ added in v0.1.2
func (m *KeyLocation) String() string
type KeyValueFSM ¶
type KeyValueFSM interface { // Get a key Get(key []byte) (*KeyValuePair, error) // Apply a set operation entry with value containing the data ApplySet(entryID []byte, entry *hexatype.Entry, value []byte) error // Apply a delete entry ApplyDelete(entry *hexatype.Entry) error }
KeyValueFSM is an FSM for a key value store. Aside from fsm functions, it also contains read-only key-value functions needed.
type KeyValuePair ¶
type KeyValuePair struct { Key []byte `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=Value,proto3" json:"Value,omitempty"` Entry *hexatype.Entry `protobuf:"bytes,3,opt,name=Entry" json:"Entry,omitempty"` }
func (*KeyValuePair) Descriptor ¶
func (*KeyValuePair) Descriptor() ([]byte, []int)
func (*KeyValuePair) GetEntry ¶
func (m *KeyValuePair) GetEntry() *hexatype.Entry
func (*KeyValuePair) GetKey ¶
func (m *KeyValuePair) GetKey() []byte
func (*KeyValuePair) GetValue ¶
func (m *KeyValuePair) GetValue() []byte
func (KeyValuePair) MarshalJSON ¶ added in v0.1.4
func (kvp KeyValuePair) MarshalJSON() ([]byte, error)
MarshalJSON is a custom marshaller to handle the entry key
func (*KeyValuePair) ProtoMessage ¶
func (*KeyValuePair) ProtoMessage()
func (*KeyValuePair) Reset ¶
func (m *KeyValuePair) Reset()
func (*KeyValuePair) String ¶
func (m *KeyValuePair) String() string
type KeyValueStore ¶
type KeyValueStore interface {
GetKey(key []byte) (*KeyValuePair, error)
}
KeyValueStore implements a key value storage interface. It is used by the network transport
type KeyValueTransport ¶ added in v0.1.4
type KeyValueTransport interface {
GetKey(ctx context.Context, host string, key []byte) (*KeyValuePair, error)
}
KeyValueTransport implements a transport for key-value operations
type Keyvs ¶ added in v0.1.4
type Keyvs struct {
// contains filtered or unexported fields
}
Keyvs is a key-value interface that relies on Hexalog and Hexaring to provide functions to perform CRUD like operations on keys
func NewKeyvs ¶ added in v0.1.4
func NewKeyvs(namespace string, hexlog *Hexalog, kvs KeyValueStore) *Keyvs
NewKeyvs inits a new instance of Keyvs. It takes the hexalog for write ops, key-value store and network transport for read ops. namespace is used to prefix all keys.
func (*Keyvs) GetKey ¶ added in v0.1.4
func (kv *Keyvs) GetKey(key []byte) (kvp *KeyValuePair, opt *hexatype.RequestOptions, err error)
GetKey requests a key from the nodes in the key peerset concurrently and returns the first non-errored result. If the key is not found in any of the locations, a ErrKeyNotFound is returned
func (*Keyvs) RegisterDHT ¶ added in v0.1.4
RegisterDHT registers the ring to the keyvalue store
func (*Keyvs) RegisterTransport ¶ added in v0.1.4
func (kv *Keyvs) RegisterTransport(remote KeyValueTransport)
RegisterTransport registers the remote transport to use.
type LocalStore ¶ added in v0.1.4
type LocalStore interface { KeyValueStore VersionedFileStore }
LocalStore implements all local calls needed by the network transport
type NetTransport ¶
type NetTransport struct {
// contains filtered or unexported fields
}
NetTransport implements a network transport needed for fidias
func NewNetTransport ¶ added in v0.1.2
func NewNetTransport(localStore LocalStore, idx hexalog.IndexStore, journal device.Journal, reapInterval, maxIdle time.Duration, replicas int, hasher hexatype.Hasher) *NetTransport
NewNetTransport instantiates a new network transport using the given key-value store.
func (*NetTransport) GetKey ¶
func (trans *NetTransport) GetKey(ctx context.Context, host string, key []byte) (*KeyValuePair, error)
GetKey retrieves a key from a remote host
func (*NetTransport) GetKeyRPC ¶
func (trans *NetTransport) GetKeyRPC(ctx context.Context, in *KeyValuePair) (*KeyValuePair, error)
GetKeyRPC serves a GetKey request
func (*NetTransport) GetPath ¶ added in v0.1.4
func (trans *NetTransport) GetPath(ctx context.Context, host string, name string) (*VersionedFile, error)
func (*NetTransport) GetPathRPC ¶ added in v0.1.4
GetPathRPC serves a GetPath request
func (*NetTransport) GetRelocateBlocksStream ¶ added in v0.1.4
func (trans *NetTransport) GetRelocateBlocksStream(local, remote *chord.Vnode) (*RelocateBlocksStream, error)
GetRelocateBlocksStream gets a stream to send relocation keys
func (*NetTransport) GetRelocateStream ¶ added in v0.1.2
func (trans *NetTransport) GetRelocateStream(local, remote *chord.Vnode) (*RelocateStream, error)
GetRelocateStream gets a stream to send relocation keys
func (*NetTransport) Register ¶ added in v0.1.2
func (trans *NetTransport) Register(fetLogCh, fetBlkCh chan<- *relocateReq)
Register registers a write channel used for submitting reloc. requests for keylogs and blocks.
func (*NetTransport) RelocateBlocksRPC ¶ added in v0.1.4
func (trans *NetTransport) RelocateBlocksRPC(stream FidiasRPC_RelocateBlocksRPCServer) error
RelocateBlocksRPC serves a GetRelocateStream request stream. It initiates the process to start taking over the sent keys.
func (*NetTransport) RelocateRPC ¶ added in v0.1.2
func (trans *NetTransport) RelocateRPC(stream FidiasRPC_RelocateRPCServer) error
RelocateRPC serves a GetRelocateStream request stream. It initiates the process to start taking over the sent keys.
func (*NetTransport) Shutdown ¶
func (trans *NetTransport) Shutdown()
Shutdown signals the transport to be shutdown. After shutdown no new connections can be
type PathRPC ¶ added in v0.1.4
type PathRPC struct { Name string `protobuf:"bytes,1,opt,name=Name" json:"Name,omitempty"` Versions []*FileVersion `protobuf:"bytes,2,rep,name=Versions" json:"Versions,omitempty"` Entry *hexatype.Entry `protobuf:"bytes,3,opt,name=Entry" json:"Entry,omitempty"` }
func (*PathRPC) Descriptor ¶ added in v0.1.4
func (*PathRPC) GetVersions ¶ added in v0.1.4
func (m *PathRPC) GetVersions() []*FileVersion
func (*PathRPC) ProtoMessage ¶ added in v0.1.4
func (*PathRPC) ProtoMessage()
type ReMeta ¶
type ReMeta struct { Vnode *chord.Vnode // vnode processing the request or response PeerSet hexaring.LocationSet // set of peers involved }
ReMeta contains metadata associated to a request or response
type RelocateBlocksStream ¶ added in v0.1.4
type RelocateBlocksStream struct { FidiasRPC_RelocateBlocksRPCClient // grp stream client // contains filtered or unexported fields }
type RelocateStream ¶ added in v0.1.2
type RelocateStream struct { FidiasRPC_RelocateRPCClient // grp stream client // contains filtered or unexported fields }
RelocateStream is a stream to handle relocating of keys between nodes.
type Relocator ¶ added in v0.1.2
type Relocator struct {
// contains filtered or unexported fields
}
Relocator is responsible for moving data as needed when the underlying cluster topology changes
func NewRelocator ¶ added in v0.1.2
NewRelocator instantiates a new Relocator
func (*Relocator) RegisterBlockJournal ¶ added in v0.1.4
RegisterBlockJournal registers a block journal to the relocator to be used to determine which blocks need to be relocated.
func (*Relocator) RegisterKeylogIndex ¶ added in v0.1.4
func (reb *Relocator) RegisterKeylogIndex(idx hexalog.IndexStore)
RegisterKeylogIndex register an index store of keylogs to the relocator to be used to determine the keys that need to be relocated
func (*Relocator) RegisterTransport ¶ added in v0.1.4
func (reb *Relocator) RegisterTransport(trans RelocatorTransport)
RegisterTransport registers the transport to be used for relocation
type RelocatorTransport ¶ added in v0.1.2
type RelocatorTransport interface { GetRelocateStream(local, remote *chord.Vnode) (*RelocateStream, error) GetRelocateBlocksStream(local, remote *chord.Vnode) (*RelocateBlocksStream, error) }
RelocatorTransport implements a transport needed by the key rebalancing engine
type RingDevice ¶ added in v0.1.4
type RingDevice struct {
// contains filtered or unexported fields
}
RingDevice implements the blox.BlockDevice interface backed by hexaring to distribute blocks into the cluster. The filesystem uses this as its underlying device.
func NewRingDevice ¶ added in v0.1.4
NewRingDevice inits a new RingDevice that implements a BlockDevice with the given replica count, hash function and blox transport.
func (*RingDevice) Close ¶ added in v0.1.4
func (dev *RingDevice) Close() error
Close shutdowns the underlying network transport
func (*RingDevice) GetBlock ¶ added in v0.1.4
func (dev *RingDevice) GetBlock(id []byte) (block.Block, error)
GetBlock gets a block from the device
func (*RingDevice) Hasher ¶ added in v0.1.4
func (dev *RingDevice) Hasher() hexatype.Hasher
Hasher returns the hash function generator for hash ids for the device
func (*RingDevice) RegisterDHT ¶ added in v0.1.4
func (dev *RingDevice) RegisterDHT(dht DHT)
RegisterDHT registers the DHT ring device. This device is only usable once a call to register has been made.
func (*RingDevice) RemoveBlock ¶ added in v0.1.4
func (dev *RingDevice) RemoveBlock(id []byte) error
RemoveBlock submits a request to remove a block on the device and all replicas
type Status ¶ added in v0.1.2
type Status struct { Version string Hash hexatype.HashAlgorithm DHT *chord.Status }
Status contains status information of a node.
type VersionedFile ¶ added in v0.1.4
type VersionedFile struct {
// contains filtered or unexported fields
}
VersionedFile contains all known versions for a given file and the hexalog entry associated with the view instance
func NewVersionedFile ¶ added in v0.1.4
func NewVersionedFile(name string) *VersionedFile
NewVersionedFile instantiates a new VersionedFile with the given name
func (*VersionedFile) AddVersion ¶ added in v0.1.4
func (f *VersionedFile) AddVersion(version *FileVersion) error
AddVersion adds a new version of the file. It returns an ErrVersionExists if the alias for the given version already exists.
func (*VersionedFile) GetVersion ¶ added in v0.1.4
func (f *VersionedFile) GetVersion(alias string) (*FileVersion, error)
GetVersion gets a version by the given alias.
func (*VersionedFile) MarshalBinary ¶ added in v0.1.4
func (f *VersionedFile) MarshalBinary() ([]byte, error)
MarshalBinary marshals the version into a byte slice. It does not include the key and entry
func (*VersionedFile) MarshalJSON ¶ added in v0.1.5
func (f *VersionedFile) MarshalJSON() ([]byte, error)
MarshalJSON marshals the VersionedFile as json with the wanted private fields
func (*VersionedFile) String ¶ added in v0.1.4
func (f *VersionedFile) String() string
func (*VersionedFile) UnmarshalBinary ¶ added in v0.1.4
func (f *VersionedFile) UnmarshalBinary(b []byte) error
UnmarshalBinary unmarshal the byte slice into Versioned. It will not include the key and entry
func (*VersionedFile) UpdateVersion ¶ added in v0.1.4
func (f *VersionedFile) UpdateVersion(alias string, id []byte) error
UpdateVersion updates a version by the alias. It returns an ErrVersionNotFound if the alias is not found,
func (*VersionedFile) Version ¶ added in v0.1.4
func (f *VersionedFile) Version() *FileVersion
Version returns the active version
type VersionedFileStore ¶ added in v0.1.4
type VersionedFileStore interface {
GetPath(name string) (*VersionedFile, error)
}
VersionedFileStore implements a storage mechanism for versioned file paths. Each file path may point many versions containing an alias and id