Documentation
¶
Index ¶
- Constants
- type ChunkHandle
- type ChunkServer
- type F2Hs
- type FileSystem
- type LocalRegistry
- func (lr *LocalRegistry) All() []ChunkServer
- func (lr LocalRegistry) Len() int
- func (lr LocalRegistry) Less(i, j int) bool
- func (lr *LocalRegistry) Next() *ChunkServer
- func (lr *LocalRegistry) Pop() interface{}
- func (lr *LocalRegistry) Push(x interface{})
- func (lr *LocalRegistry) Register(cs ChunkServer) error
- func (lr LocalRegistry) Swap(i, j int)
- type MasterServer
- type Registry
Constants ¶
View Source
const ( // ChunkSize is default 64MB ChunkSize uint64 = 1 << 26 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChunkHandle ¶
type ChunkHandle struct {
// contains filtered or unexported fields
}
ChunkHandle stores detail infomation about a chunk, including it's physical position in the DFS.
func NewChunkHandle ¶
func NewChunkHandle(filename string, chunkNum int) ChunkHandle
type ChunkServer ¶
type ChunkServer struct {
// contains filtered or unexported fields
}
func NewChunkServer ¶
func NewChunkServer(address string, port int, weight uint32) ChunkServer
func (ChunkServer) Compare ¶
func (cs ChunkServer) Compare(server ChunkServer) int
func (ChunkServer) GetIPAddress ¶
func (cs ChunkServer) GetIPAddress() string
type F2Hs ¶
type F2Hs map[string][]ChunkHandle
F2Hs holds <filename, chunk handles> pairs
type FileSystem ¶
type FileSystem interface { // Touch creates a new file. Touch(string) error // GetHandle finds a chunk handle based on filename and offset. GetHandle(string, uint64) (ChunkHandle, error) }
FileSystem manages all files stored in DFS.
type LocalRegistry ¶
type LocalRegistry []ChunkServer
LocalRegistry stores all chunk servers' infomation in master server's run time memory space.
func (*LocalRegistry) All ¶
func (lr *LocalRegistry) All() []ChunkServer
func (LocalRegistry) Len ¶
func (lr LocalRegistry) Len() int
func (LocalRegistry) Less ¶
func (lr LocalRegistry) Less(i, j int) bool
func (*LocalRegistry) Next ¶
func (lr *LocalRegistry) Next() *ChunkServer
func (*LocalRegistry) Pop ¶
func (lr *LocalRegistry) Pop() interface{}
func (*LocalRegistry) Push ¶
func (lr *LocalRegistry) Push(x interface{})
func (*LocalRegistry) Register ¶
func (lr *LocalRegistry) Register(cs ChunkServer) error
func (LocalRegistry) Swap ¶
func (lr LocalRegistry) Swap(i, j int)
type MasterServer ¶
type MasterServer struct { pb.UnimplementedMasterServer // contains filtered or unexported fields }
func (*MasterServer) Create ¶
func (s *MasterServer) Create(ctx context.Context, req *pb.CreateReq) (*pb.CreateResp, error)
func (*MasterServer) Discover ¶
func (s *MasterServer) Discover(stream pb.Master_DiscoverServer) error
func (*MasterServer) Register ¶
func (s *MasterServer) Register(ctx context.Context, req *pb.RegisterReq) (*pb.RegisterResp, error)
type Registry ¶
type Registry interface { Register(ChunkServer) error Next() *ChunkServer All() []ChunkServer }
Registry manages infomation about running chunk servers.
Click to show internal directories.
Click to hide internal directories.