Skip to main content
. 2021 Apr 26;23(5):532. doi: 10.3390/e23050532
Algorithm 1. Registration of Candidate for Server Placement of a Certain Service
1 Input:
2 v an input service
3 N the set of edge nodes
4 C the set of clients using the service v
5
6 C set as empty list for the server placement candidates for service v
7 forλ1,minN,Cdo
8          Sλ the set of servers when service v has λ of servers
9          AλGetServerAssignmentN,Sλ
10         // The set of assignments for λ of servers Aλ consists of sets of key-value pairs
11         // key: a server, value: a node running the server
12         // i.e., Aλ=s1:n5,s2:n7,s3:n2,, , , siSλ,njN
13         for each aAλ do
14                 τasyncGetSyncTrafficv, a
15                 MaGetMappingInfoC, a
16                 // The set of mapping information for assignment a, Ma consists of sets of key-value pairs
17                 // key: a client, value: a server mapped with the client
18                 // i.e., Ma=c1:s2,c2:s2,c3:s1,, , ,ciC, sjSλ
19                 for each mMa do
20                         rmbaseGetBaseResourcev
21                         τmτasync
22                         for each cm.Keys do
23                                 sc the server mapped with client c
24                                 τmτm+uc×ftv×distsc, c
25                                 rmscrmsc+uc×fcpuv, fmemv, fstov
26                         end for
27                         for each sSλ do
28                                 rmsrmbase+rms
29                                 Rm.Addrms
30                         end for
31                         𝕔λmCreateCandidatea,m, τm,Rm
32                         C.Register𝕔λm
33                 end for
34         end for
35         C.Sortτ,ascending
36         if λ>1  𝕔λmC,  𝕔λm.τ<𝕔λ1m.τ then break
37 end for
38
39 Output:
40 returnC