Documentation ¶
Index ¶
- func CalculatePrelude(snaps []types.Snapshot, toSnapshotId string) (types.Prelude, error)
- func ConsumePrelude(r io.Reader) (types.Prelude, error)
- func EncodePrelude(prelude types.Prelude) ([]byte, error)
- func GetAllKeysForDir(query types.ListFileRequest) (results []types.ListFileItem, err error)
- func GetKeysForDirLimit(query types.ListFileRequest) (results types.ListFileResponse, err error)
- func TransferPollResultFromTransferRequest(transferRequestId string, transferRequest types.TransferRequest, nodeId string, ...) types.TransferPollResult
- type FSM
- type FSMStateDump
- type FsConfig
- type FsMachine
- func (f *FsMachine) DumpState() *FSMStateDump
- func (f *FsMachine) GetCurrentState() string
- func (f *FsMachine) GetMetadata(nodeID string) map[string]string
- func (f *FsMachine) GetSnapshots(nodeID string) []*types.Snapshot
- func (f *FsMachine) GetStatus() string
- func (f *FsMachine) ID() string
- func (f *FsMachine) ListLocalSnapshots() []*types.Snapshot
- func (f *FsMachine) ListMetadata() map[string]map[string]string
- func (f *FsMachine) ListSnapshots() map[string][]*types.Snapshot
- func (f *FsMachine) Mount() (response *types.Event)
- func (f *FsMachine) Mounted() bool
- func (f *FsMachine) PublishNewSnaps(server string, payload interface{}) error
- func (f *FsMachine) PushCompleted(success bool)
- func (f *FsMachine) ReadFile(destination *types.OutputFile)
- func (f *FsMachine) Run()
- func (f *FsMachine) SetMetadata(nodeID string, meta map[string]string)
- func (f *FsMachine) SetSnapshots(nodeID string, snapshots []*types.Snapshot)
- func (f *FsMachine) StatFile(source *types.OutputFile)
- func (f *FsMachine) Submit(event *types.Event, requestID string) (reply chan *types.Event, err error)
- func (f *FsMachine) TransitionSubscribe(channel string, ch chan interface{})
- func (f *FsMachine) TransitionUnsubscribe(channel string, ch chan interface{})
- func (f *FsMachine) Unmount() (response *types.Event)
- func (f *FsMachine) WriteFile(source *types.InputFile)
- type NoCommonSnapshots
- type NoFromSnaps
- type StateFn
- type StateManager
- type ToSnapsAhead
- type ToSnapsDiverged
- type ToSnapsUpToDate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculatePrelude ¶
func GetAllKeysForDir ¶
func GetAllKeysForDir(query types.ListFileRequest) (results []types.ListFileItem, err error)
get a recursive list of all file keys we do this so we can pick the correct page of results based on the limit and page query params for a recursive request
func GetKeysForDirLimit ¶
func GetKeysForDirLimit(query types.ListFileRequest) (results types.ListFileResponse, err error)
GetKeysForDirLimit - recurse it creating s3 style keys for all the files in it (aka relative paths from that directory) send back a map of keys -> file sizes, and the whole directory's size
func TransferPollResultFromTransferRequest ¶
func TransferPollResultFromTransferRequest( transferRequestId string, transferRequest types.TransferRequest, nodeId string, index, total int, status string, ) types.TransferPollResult
Types ¶
type FSM ¶
type FSM interface { ID() string Run() GetStatus() string GetCurrentState() string Mounted() bool Mount() (response *types.Event) Unmount() (response *types.Event) // TODO: review the call, maybe it's possible to internalize behaviour PushCompleted(success bool) // TODO: review the call, maybe it's possible to internalize behaviour PublishNewSnaps(server string, payload interface{}) error // TODO: review the call, maybe it's possible to internalize behaviour TransitionSubscribe(channel string, ch chan interface{}) TransitionUnsubscribe(channel string, ch chan interface{}) // metadata API GetMetadata(nodeID string) map[string]string ListMetadata() map[string]map[string]string SetMetadata(nodeID string, meta map[string]string) GetSnapshots(nodeID string) []*types.Snapshot ListSnapshots() map[string][]*types.Snapshot SetSnapshots(nodeID string, snapshots []*types.Snapshot) // Local snapshots from ZFS ListLocalSnapshots() []*types.Snapshot Submit(event *types.Event, requestID string) (reply chan *types.Event, err error) // WriteFile - reads the supplied Contents io.Reader and writes into the volume, // response will be sent to a provided Response channel WriteFile(source *types.InputFile) // ReadFile - reads a file from the volume into the supplied Contents io.Writer, // response will be sent to a provided Response channel ReadFile(destination *types.OutputFile) // StatFile - reads type and size of a file, // response will be sent to a provided Response channel StatFile(destination *types.OutputFile) // DumpState is used for diagnostics DumpState() *FSMStateDump }
type FSMStateDump ¶
type FsConfig ¶
type FsConfig struct { Config config.Config FilesystemID string StateManager StateManager Registry registry.Registry UserManager user.UserManager RegistryStore store.RegistryStore FilesystemStore store.FilesystemStore ServerStore store.ServerStore ContainerClient container.Client LocalReceiveProgress observer.Observer NewSnapsOnMaster observer.Observer DeathObserver observer.Observer FilesystemMetadataTimeout int64 // zfs executable path ZFSPath string // zpool executable path ZPoolPath string // Previously known as main.MOUNT_ZFS MountZFS string // PoolName is a required PoolName string }
FsConfig used to configure individual fsm
type FsMachine ¶
type FsMachine struct {
// contains filtered or unexported fields
}
a "filesystem machine" or "filesystem state machine"
func NewFilesystemMachine ¶
NewFilesystemMachine - core functions used by files ending `state` which I couldn't think of a good place for.
func (*FsMachine) DumpState ¶
func (f *FsMachine) DumpState() *FSMStateDump
DumpState - dumps internal FsMachine state TODO: make copies instead of returning actual pointers
func (*FsMachine) GetCurrentState ¶
func (*FsMachine) ListLocalSnapshots ¶
func (*FsMachine) PublishNewSnaps ¶
func (*FsMachine) PushCompleted ¶
func (*FsMachine) ReadFile ¶
func (f *FsMachine) ReadFile(destination *types.OutputFile)
ReadFile - reads a file from the volume into the supplied Contents io.Writer, response will be sent to a provided Response channel
func (*FsMachine) SetMetadata ¶
func (*FsMachine) SetSnapshots ¶
func (*FsMachine) StatFile ¶
func (f *FsMachine) StatFile(source *types.OutputFile)
func (*FsMachine) Submit ¶
func (f *FsMachine) Submit(event *types.Event, requestID string) (reply chan *types.Event, err error)
Submit - submits event to a filesystem, returning the event stream for convenience so the caller can listen for a response
func (*FsMachine) TransitionSubscribe ¶
func (*FsMachine) TransitionUnsubscribe ¶
type NoCommonSnapshots ¶
func (*NoCommonSnapshots) Error ¶
func (e *NoCommonSnapshots) Error() string
type NoFromSnaps ¶
type NoFromSnaps struct{}
func (*NoFromSnaps) Error ¶
func (e *NoFromSnaps) Error() string
type StateManager ¶
type StateManager interface { InitFilesystemMachine(filesystemId string) (FSM, error) GetFilesystemMachine(filesystemId string) (FSM, error) // ActivateFilesystem(filesystemId string) error AlignMountStateWithMasters(filesystemId string) error ActivateClone(topLevelFilesystemId, originFilesystemId, originSnapshotId, newCloneFilesystemId, newBranchName string) (string, error) DeleteFilesystem(filesystemId string) error DeleteFilesystemFromMap(filesystemId string) // current node ID NodeID() string UpdateSnapshotsFromKnownState(server, filesystem string, snapshots []*types.Snapshot) error SnapshotsFor(server string, filesystemId string) ([]types.Snapshot, error) SnapshotsForCurrentMaster(filesystemId string) ([]types.Snapshot, error) AddressesForServer(server string) []string RegisterNewFork(originFilesystemId, originSnapshotId, forkNamespace, forkName, forkFilesystemId string) error UpdateInterclusterTransfer(transferRequestId string, pollResult types.TransferPollResult) // TODO: move under a separate interface for Etcd related things MarkFilesystemAsLiveInEtcd(topLevelFilesystemId string) error }
type ToSnapsAhead ¶
type ToSnapsAhead struct {
// contains filtered or unexported fields
}
func (*ToSnapsAhead) Error ¶
func (e *ToSnapsAhead) Error() string
type ToSnapsDiverged ¶
type ToSnapsDiverged struct {
// contains filtered or unexported fields
}
func (*ToSnapsDiverged) Error ¶
func (e *ToSnapsDiverged) Error() string
type ToSnapsUpToDate ¶
type ToSnapsUpToDate struct{}
func (*ToSnapsUpToDate) Error ¶
func (e *ToSnapsUpToDate) Error() string
Source Files ¶
- communications.go
- fsm.go
- fsm_active.go
- fsm_active_file_io.go
- fsm_backoff.go
- fsm_diff.go
- fsm_discovering.go
- fsm_failed.go
- fsm_handoff.go
- fsm_inactive.go
- fsm_metadata.go
- fsm_missing.go
- fsm_pull_initiator.go
- fsm_pull_peer.go
- fsm_push_initiator.go
- fsm_push_peer.go
- fsm_receiving.go
- fsm_s3_pull_initiator.go
- fsm_s3_push_initiator.go
- metadata.go
- mount.go
- prelude.go
- s3.go
- snapshotlogic.go
- transfers.go
- types.go
- units.go