wqx081 / egfs

Automatically exported from code.google.com/p/egfs
0 stars 0 forks source link

Write 规格(Specification)与时序图(Sequence) #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
http://www.websequencediagrams.com/
=================================================

Client->MetadataServer: {open, FileName, Mode}
activate MetadataServer
note right of MetadataServer: getFileHandle
MetadataServer->Client: {ok,FileID} | {error,Reason}
deactivate MetadataServer
loop write_chunks
Client->MetadataServer: {allocatechunk,FileID}
activate MetadataServer
note right of MetadataServer: allocateChunk
MetadataServer->Client: {ok, ChunkID, NodeList} | {error,Reason}
deactivate MetadataServer
Client->DataServer: {writechunk, FileID, ChunkID, NodeList}
activate DataServer
note right of DataServer: writeChunk
DataServer->Client: {ok,State} | {error,Reason}
Client->DataServer: gen_tcp:connect
Client->DataServer: gen_tcp:send
Client->DataServer: {tcp, Socket, Binary}
Client->DataServer: {tcp_closed, Socket}
DataServer->MetadataServer: {flush, FileID, ChunkID, ChunkUsedSize, NodeList}
activate MetadataServer
note right of MetadataServer: registerChunk
MetadataServer->DataServer: {ok, State} | {error,Reason}
deactivate MetadataServer
DataServer->Client: {finish, State}
deactivate DataServer
end
Client->MetadataServer: {close, FileName}

Original issue reported on code.google.com by huangxia...@gmail.com on 16 Dec 2008 at 7:32

GoogleCodeExporter commented 8 years ago
关闭的时候,应该传递{close, FileID}, 而不是{close, FileName}
=================================================

Client->MetadataServer: {open, FileName, Mode}
activate MetadataServer
note right of MetadataServer: getFileHandle
MetadataServer->Client: {ok,FileID} | {error,Reason}
deactivate MetadataServer
loop write_chunks
Client->MetadataServer: {allocatechunk,FileID}
activate MetadataServer
note right of MetadataServer: allocateChunk
MetadataServer->Client: {ok, ChunkID, NodeList} | {error,Reason}
deactivate MetadataServer
Client->DataServer: {writechunk, FileID, ChunkID, NodeList}
activate DataServer
note right of DataServer: writeChunk
DataServer->Client: {ok,State} | {error,Reason}
Client->DataServer: gen_tcp:connect
Client->DataServer: gen_tcp:send
Client->DataServer: {tcp, Socket, Binary}
Client->DataServer: {tcp_closed, Socket}
DataServer->MetadataServer: {flush, FileID, ChunkID, ChunkUsedSize, NodeList}
activate MetadataServer
note right of MetadataServer: registerChunk
MetadataServer->DataServer: {ok, State} | {error,Reason}
deactivate MetadataServer
DataServer->Client: {finish, State}
deactivate DataServer
end
Client->MetadataServer: {close, FileID}

Original comment by LTsong...@gmail.com on 16 Dec 2008 at 1:34

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Quote from xushiweizh:
-------------------------
依据 GFS 的 
Paper,其写操作如下(注意:GFS中Client一次只写一个Chunk。如�
��写操作涉及多
个
Chunk,这个写操作会被分开来做。这一点我们可以展开来讨论
。因为这样的话数据会可能出现被
分割的情
况。除非GFS根本不支持write,而只有 pwrite 和 append 
两种操作)
-------------------------
1.我同意一次只写一个Chunk的做法,在此前提下,一个Block可��
�成为一个LocatedBlock结构。
其大概应该记录的信息,有Offset,BlockSize(考虑到Append操作��
�取信息和续写),其它的还
没细想。等睡醒再说,^_^
2.另外考虑到一个block在之前的写操作中可能是未填满的,需�
��计算一个更小的block数据包,
先填充满未满的block。这样对后续block的加速应该可行。
3.关于write之后通知的问题,刚才翻了一下代码,hadoop中的做�
��是有notify的,在
DataNode.java中,但是只通知,而不等待master返回。

Original comment by krzyc...@gmail.com on 23 Dec 2008 at 4:08