Documentation ¶
Index ¶
- Constants
- func NewDataID(handle gfs.ChunkHandle) gfs.DataBufferID
- type ChunkServer
- func (cs *ChunkServer) PrintSelf(no1 gfs.Nouse, no2 *gfs.Nouse) error
- func (cs *ChunkServer) RPCAppendChunk(args gfs.AppendChunkArg, reply *gfs.AppendChunkReply) error
- func (cs *ChunkServer) RPCApplyCopy(args gfs.ApplyCopyArg, reply *gfs.ApplyCopyReply) error
- func (cs *ChunkServer) RPCApplyMutation(args gfs.ApplyMutationArg, reply *gfs.ApplyMutationReply) error
- func (cs *ChunkServer) RPCCheckVersion(args gfs.CheckVersionArg, reply *gfs.CheckVersionReply) error
- func (cs *ChunkServer) RPCCreateChunk(args gfs.CreateChunkArg, reply *gfs.CreateChunkReply) error
- func (cs *ChunkServer) RPCForwardData(args gfs.ForwardDataArg, reply *gfs.ForwardDataReply) error
- func (cs *ChunkServer) RPCReadChunk(args gfs.ReadChunkArg, reply *gfs.ReadChunkReply) error
- func (cs *ChunkServer) RPCReportSelf(args gfs.ReportSelfArg, reply *gfs.ReportSelfReply) error
- func (cs *ChunkServer) RPCSendCopy(args gfs.SendCopyArg, reply *gfs.SendCopyReply) error
- func (cs *ChunkServer) RPCWriteChunk(args gfs.WriteChunkArg, reply *gfs.WriteChunkReply) error
- func (cs *ChunkServer) Shutdown()
- type Mutation
Constants ¶
const ( MetaFileName = "gfs-server.meta" FilePerm = 0755 )
Variables ¶
This section is empty.
Functions ¶
func NewDataID ¶
func NewDataID(handle gfs.ChunkHandle) gfs.DataBufferID
allocate a new DataID for given handle
Types ¶
type ChunkServer ¶
type ChunkServer struct {
// contains filtered or unexported fields
}
ChunkServer struct
func NewAndServe ¶
func NewAndServe(addr, masterAddr gfs.ServerAddress, rootDir string) *ChunkServer
NewAndServe starts a chunkserver and return the pointer to it.
func (*ChunkServer) RPCAppendChunk ¶
func (cs *ChunkServer) RPCAppendChunk(args gfs.AppendChunkArg, reply *gfs.AppendChunkReply) error
RPCAppendChunk is called by client to apply atomic record append. The length of data should be within 1/4 chunk size. If the chunk size after appending the data will excceed the limit, pad current chunk and ask the client to retry on the next chunk.
func (*ChunkServer) RPCApplyCopy ¶
func (cs *ChunkServer) RPCApplyCopy(args gfs.ApplyCopyArg, reply *gfs.ApplyCopyReply) error
RPCSendCCopy is called by another replica rewrite the local version to given copy data
func (*ChunkServer) RPCApplyMutation ¶
func (cs *ChunkServer) RPCApplyMutation(args gfs.ApplyMutationArg, reply *gfs.ApplyMutationReply) error
RPCApplyWriteChunk is called by primary to apply mutations
func (*ChunkServer) RPCCheckVersion ¶
func (cs *ChunkServer) RPCCheckVersion(args gfs.CheckVersionArg, reply *gfs.CheckVersionReply) error
RPCCheckVersion is called by master to check version ande detect stale chunk
func (*ChunkServer) RPCCreateChunk ¶
func (cs *ChunkServer) RPCCreateChunk(args gfs.CreateChunkArg, reply *gfs.CreateChunkReply) error
RPCCreateChunk is called by master to create a new chunk given the chunk handle.
func (*ChunkServer) RPCForwardData ¶
func (cs *ChunkServer) RPCForwardData(args gfs.ForwardDataArg, reply *gfs.ForwardDataReply) error
RPCForwardData is called by client or another replica who sends data to the current memory buffer.
func (*ChunkServer) RPCReadChunk ¶
func (cs *ChunkServer) RPCReadChunk(args gfs.ReadChunkArg, reply *gfs.ReadChunkReply) error
RPCReadChunk is called by client, read chunk data and return
func (*ChunkServer) RPCReportSelf ¶
func (cs *ChunkServer) RPCReportSelf(args gfs.ReportSelfArg, reply *gfs.ReportSelfReply) error
RPCReportSelf reports all chunks the server holds
func (*ChunkServer) RPCSendCopy ¶
func (cs *ChunkServer) RPCSendCopy(args gfs.SendCopyArg, reply *gfs.SendCopyReply) error
RPCSendCCopy is called by master, send the whole copy to given address
func (*ChunkServer) RPCWriteChunk ¶
func (cs *ChunkServer) RPCWriteChunk(args gfs.WriteChunkArg, reply *gfs.WriteChunkReply) error
RPCWriteChunk is called by client applies chunk write to itself (primary) and asks secondaries to do the same.
func (*ChunkServer) Shutdown ¶
func (cs *ChunkServer) Shutdown()
Shutdown shuts the chunkserver down func (cs *ChunkServer) Shutdown(args gfs.Nouse, reply *gfs.Nouse) error {