/
protocolSummary.txt
66 lines (56 loc) · 2.77 KB
/
protocolSummary.txt
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
List of messages
[...] denotes an indeterminable length string
Producer = Client
=================================================
Master to Consumer
- a IP~PORT : accumulator IP and Port so consumers know where to pass messages
- k NUMK : k for KNN algorithm
- l IP~PORT : current leader formatted as IP~PORT, need to connect to leader
- b [IP~PORT ...] : updated backup masters list each backup formatted as IP~PORT
- t [featureVector ...]: sends a training feature vector with its ID to consumer
- n : reject the connection since numConsumers == maxConsumers
- p ID [featureVector] : feature vector to be processed
Master to Producer
- l IP~PORT : current leader formatted as IP~PORT, need to connect to leader
- b [IP~PORT ...] : updated backup masters list each backup formatted as IP~PORT
- e ID [feature vector] : echo back feature vector with ID
- q ID CATEGORY : category of query
- c : could not get query
- r .... e: full results ends with a getline of "e"
Master to Master
- s PORT : request to be added as a backup with server socket port PORT
- l IP~PORT : current leader formatted as IP~PORT, need to connect to leader
- b [IP~PORT ...] : updated backup masters list each backup formatted as IP~PORT
Master to accumulator:
- n : already connected to accumulator
- l IP~PORT : current leader formatted as IP~PORT, need to connect to leader
- m [IP~PORT ...] : backup string for masters
- t MAXCONSUMERS K(for top k) : tells accumulator how many consumers and k
==================================================
Consumer to Master
- c : identifying message to master upon connection to master serversocket
Consumer to accumulator
- c : identification
- a ID [CATEGORY ...] : for a feature vectors, batched for k
===================================================
Producer to Master
- p : serves as identifying message
- r [feature vector]: request to send vector with consumers
- q ID : query master to get category for given ID
- g : query all, get entire file
====================================================
accumulator to consumer
- y : accepted connection
- n : rejected connection
accumulator to master
- a PORT: identifying message
- d ID CATEGORY : done with aggregating: here's the given id's category
accumulator to accumulator
- b [IP~PORT ...] : updated backup accumulators list each backup formatted as IP~PORT
- s PORT : request to be added as a backup with server socket port PORT
- h IP~PORT : current lead accumulator to connect to
possible disconnection protocol:
if consumer disconnects master can tell the client to resends a vector with a certain ID to the replacement consumer
if master disconnects then we do what you suggested using a queue
if accumulator disconnects master can do the same as if a consumer disconnects
tell the client to resend an entire vectorto all consumers