-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDesign Decision.txt
More file actions
116 lines (95 loc) · 3.23 KB
/
Copy pathDesign Decision.txt
File metadata and controls
116 lines (95 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
Command reference: "start": "nodemon server.js --exec babel-node --presets es2015,stage-2",
=========
THEORY:
=========
---------------
REPLICATION:
---------------
1. DROPBOX model, where all files are present everywhere.
2. Download file on run-time (on demand)
---------------
DESIGN DECISIONS:
---------------
1. Latest Time Stamp would be considered.
2. Following Dropbox Model for replication.
3. Every message will be broadcasted along with the relevant receivers addresses.
The relevant receivers will handle the message the rest will just ignore it.
4. No two files will have the same name and path.
5. Each node will broadcast its file table if the file table is updated.
6. Any file or Directory that is marked deleted will not be added to the global file table.
7. Any file or directory that is deleted will not be fetched.
=========
PROTOCOLS:
=========
DOWN_FILE : (File ID, Source Node ID, Dest Node ID) : Downloads a specific file from a node
REQ_FILE_TABLE : (Source Node ID, Dest Node ID) : Happens on connection. Receives File Table from the given Node
FORCE_UPDATE : (Source Node ID, Dest Node ID) : Force the given node to do a "REQ_FILE_TABLE"
SEND_FILE_TABLE : (SourceNode ID, Dest Node ID) : Sends the File Table to the given Node.
UPLOAD_FILE : (FILE, Source Node ID, Dest Node ID) : Sends File to the given node.
UPDATE_LOCAL_FILE_TABLE: Update the local files in the local file table.
UPDATE_LOCAL_FILE: Update a single local file in the local file table.
USR_MSG: Each node can broadcast a custom message.
BRDCST_FILE_TBL: Broadcasts its global file table to the rest of the nodes.
UPDATE_FILE_TBL: Compares the received file table with the own GOBAL file table and updates the changes.
SYNC_FS: Compares the Gobal File Table with Local Filesystem and fetches the files that are not available locally.
=========
PAGE TABLE:
=========
GLOBAL:
---------------
F_ID:
F_NAME:
TIME_STAMP:
NODE_LIST:
DIRECTORY:
---------------
LOCAL:
---------------
F_ID :
F_NAME :
FS_DWNLD_TIME :
---------------
=========
LOCAL:
=========
Functions:
---------------
Comparing File Table
Monitoring current structure
---------------
Variables:
=========
Parser
=========
1. ls
2. mkdir
3. pwd
4. cd
5. touch
=========
General Rules
=========
1. Add IP to NODELIST if ROW exist, but IP does not exist in Nodelist
2. Don't add row to F_TABLE, if my_addr is present in DELETED BY.
3. Add DELETED BY:
1. IF ROW EXIST, and DELETED is false
2. IF ROW DOES NOT EXIST.
------------------------
FILE_DECISION
------------------------
1 - TIME_STAMP for a file will be same across all GFT.
2 - Each File would have the latest modified date.
3 - Whenever a file is modified it will reset the nodelist.
The process is as follows:
Source:
1 - Modify the file
2 - Update the modification Date
3 - Reset the NODE_LIST
4 - Broadcast the FILE_TABLE
Node:
1 - Compare the modified date.
2 - If it has the older file row then do the following:
a. Delete the local file physically and from the file table row.
b. Request file from source using the received nodelist of the received filetable.
c. On Successful replication of file append the nodelist with your ip and add it to file table
4.Add actualDelete after FileTable is completely updated in one Diffie round.