- Ayan Datta
- Suyash Sethia
- Krishna Singh
- Create
- File and Folder
Client Side (Aditya)
- Create a connection with the NM
- Prompt the user for an action
- CREATE <file_path>
- Send Create Request with file / Folder Path
- recieve response from NM
- CREATE <file_path>
Overall Implementations :
- Create and Update content of files & folders within the NFS.
- Reading a file.
- Deleting a file / Folder.
- Listing all files / folders from a folder.
- Getting additional information.
- Clients [50]
- Directory Mounting
- Reading, Writing, and Retrieving Information about Files
- Creating and Deleting Files and Folders
- Copying Files/Directories Between Storage Servers
- Other features
- Multiple Clients
NM Side (Ayan )
- Recieve Create Request from Client
- For create file, send CREATE request to SS
- If successfull CREATE_BACKUP request to two other SS
- send response 200 to client
SS Side (Suyash)
Initialisation
-
Get ssid from commandline
-
Check if root folder of ssid exists
- if not then create
- if exists get list of all paths
-
send register request with all paths, ssid, addresses
-
start nm_handler thread and client_handler_thread
-
Recieve CREATE request from NM
-
Create file in correct Path inside Root
-
Send response 200 to NM if successfull
-
else send response 500 to NM if unsuccessfull
SS
- SS_Root_0
- Files / Folders
- SS_Root_1
- Files / Folders
- Include requests.h from Common folder
- Use
send_<request_type>_request
function
- Include requests.h from Common folder
- Create a Request object for receiving request
- Use
receive_request
function - Use
request_type
attribute to discriminate request type and get the corresponding request_content
- Include responses.h from Common folder
- Use
send_response
function
- Include responses.h from Common folder
- Use
receive_response
function with pointer to a character.
- Every request is proceeded by a header
-
Request/Response Type - 1 byte (char)
-
Payload Length - 8 bytes (uint64_t)
-
After the request, payload follows, whose length is defined by the header.
Eg Create a.txt ->
Header(type='C', length=5) Payload("a.txt")
- Include Headers from Common for functions for sending and receiving commands