Amita Eswar
TA- CS-656
Department of Electrical and Computer Engineering
New Jersey Institute of Technology
University Heights, Newark, NJ 07102, USA
Office Hours: Thursdays, 3.30 - 5.00 p.m
Room No.:4325(Internet Lab),GITC
E-mail: ae46@njit.edu
Announcements
|
Suggestions
|
PHASE 2- TEST CASES
|
FAQ's
Announcements
PHASE 2 TEST CASES POSTED
Office hours : Thursdays : 3.30-5.00 p.m
Suggestions
It is always better to have back-up of your codes either in the Afs or pc
For the log files, I'd suggest the use of log4j . This is an external jar which can be downloaded along with a properties file and incorporated in the build path Available as Apache log4j 1.2.15 (tar.gz). Please check
Apache log4j 1.2.15 (tar.gz)
It is not good programming practice to hard code the port number.
It is a good idea to double check on the code in Afs before submitting, also ensuring that the errors of phase 1 are not repeated.
Phase 2 Test Cases
Test Cases:
Test 1: Start peers 1, 3, 9, 7 (in this order) (15 points)
Result: 1)The log files must contain the structure of the ring in terms of predecessor and successor of each peer. 2)The ring evolves as follow: 1,1->3, 1->3->9, 1->3->7->9
Test 2: Peer 3 leaves the network (5 points)
Result: 1)The ring becomes 1->7->9.
Test 3: Assume (music=6) and (sport=9) (15 points)
Peer 1 executes: publish music f1.mp3 Peer 7 executes: publish sport f2.doc Result: 1)The logs should show that peer 7 becomes the manager for "music", and the associated data structure records that f1.mp3 is stored by peer 1. 2)Similarly, peer 9 becomes the manager for "sports", and the associated data structure records that f2.doc is stored by 7.
Test 4: Start peer 6 (10 points)
Result: 1)The ring becomes 1->6->7->9. Peer 6 becomes the manager for music (i.e., the data structure for music stored by peer 7 is moved to peer 6)
Test 5: Assume (docs=4) (10 points)
Peer 1 executes: publish docs f3.pdf Peer 9 executes: publish docs f4.doc Peer 9 executes: search docs Result: Peer 6 will manage "docs". After the two "publish" operations, the data structure for "docs" will have two entries (f3.pdf->peer 1) and (f4.doc->peer 9). "search" returns these two entries.
Test 6: Assume (10 points)
Peer 9 executes: retrieve f3.pdf 1 (note that retrieve takes one more parameter, the ID of the peer hosting the file) Result: f3.pdf is stored at peer 9. Peer 9 sends an update message to peer 6 to inform it that it cached a copy of f3.pdf.
Test 7: peer 6 leaves (10 points)
Result: the data structure associated with "docs" is moved to peer 1 (let's assume that if |ID-key| is the same for two nodes, we select the one with the lower ID). The data structure associated to music is moved to peer 7. The ring becomes: 1->7->9
Test 8: peer 9 leaves (15 points)
Result: 1)The data structure associated with "sport" is moved to peer 1. 2)f4.doc is moved to peer 1. 3)The data structure associated with docs (which is on peer 1) is updated to reflect this change (f4.doc->peer 1). 4)Also, the same data structure will remove peer 9 from the list of nodes that store f3.pdf.
Test 9: synchronization (10 points)
Result: the code will be inspected to check that synchronization is properly used when accessing shared data structures/variables.
FAQ's