master

package
v0.0.0-...-180b4dd Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetaFileName = "gfs-master.meta"
	FilePerm     = 0755
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Master

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

Master Server struct

func NewAndServe

func NewAndServe(address gfs.ServerAddress, serverRoot string) *Master

NewAndServe starts a master and returns the pointer to it.

func (*Master) RPCCreateFile

func (m *Master) RPCCreateFile(args gfs.CreateFileArg, reply *gfs.CreateFileReply) error

RPCCreateFile is called by client to create a new file

func (*Master) RPCDeleteFile

func (m *Master) RPCDeleteFile(args gfs.DeleteFileArg, reply *gfs.DeleteFileReply) error

RPCDelete is called by client to delete a file

func (*Master) RPCExtendLease

func (m *Master) RPCExtendLease(args gfs.ExtendLeaseArg, reply *gfs.ExtendLeaseReply) error

RPCExtendLease extends the lease of chunk if the lessee is nobody or requester.

func (*Master) RPCGetChunkHandle

func (m *Master) RPCGetChunkHandle(args gfs.GetChunkHandleArg, reply *gfs.GetChunkHandleReply) error

RPCGetChunkHandle returns the chunk handle of (path, index). If the requested index is bigger than the number of chunks of this path by one, create one.

func (*Master) RPCGetFileInfo

func (m *Master) RPCGetFileInfo(args gfs.GetFileInfoArg, reply *gfs.GetFileInfoReply) error

RPCGetFileInfo is called by client to get file information

func (*Master) RPCGetPrimaryAndSecondaries

func (m *Master) RPCGetPrimaryAndSecondaries(args gfs.GetPrimaryAndSecondariesArg, reply *gfs.GetPrimaryAndSecondariesReply) error

RPCGetPrimaryAndSecondaries returns lease holder and secondaries of a chunk. If no one holds the lease currently, grant one. Master will communicate with all replicas holder to check version, if stale replica is detected, add it to garbage collection

func (*Master) RPCGetReplicas

func (m *Master) RPCGetReplicas(args gfs.GetReplicasArg, reply *gfs.GetReplicasReply) error

RPCGetReplicas is called by client to find all chunkserver that holds the chunk.

func (*Master) RPCHeartbeat

func (m *Master) RPCHeartbeat(args gfs.HeartbeatArg, reply *gfs.HeartbeatReply) error

RPCHeartbeat is called by chunkserver to let the master know that a chunkserver is alive

func (*Master) RPCList

func (m *Master) RPCList(args gfs.ListArg, reply *gfs.ListReply) error

RPCList is called by client to list all files in specific directory

func (*Master) RPCMkdir

func (m *Master) RPCMkdir(args gfs.MkdirArg, reply *gfs.MkdirReply) error

RPCMkdir is called by client to make a new directory

func (*Master) RPCRenameFile

func (m *Master) RPCRenameFile(args gfs.RenameFileArg, reply *gfs.RenameFileReply) error

RPCRename is called by client to rename a file

func (*Master) Shutdown

func (m *Master) Shutdown()

Shutdown shuts down master

type PersistentBlock

type PersistentBlock struct {
	NamespaceTree []serialTreeNode
	ChunkInfo     []serialChunkInfo
}

Jump to

Keyboard shortcuts

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