|
Algorithm 1 Allocation/location of data in a pool of data containers. |
|
Require: data (D), netadata list (ML), operation type (op), load balancer algorithm |
| (LBalgorithm), data container pool (DP) |
|
Ensure: maps of data allocation/location (mapsAL) |
-
1:
dataHash = ""
-
2:
exist ← NULL
-
3:
mapsAL ← {}
-
4:
index = 0
-
5:
for alld ∈ D
do
-
6:
dataHash ← calculateHash(d)
-
7:
exist ← data.exist(dataHash,mL)
-
8:
if
op == "allocation"
then
-
9:
if
exist == FALSE
then
-
10:
mapsAL[index] ← LB(LBalgorithm,dataHash,DP)
-
11:
data.recordD(ML,mapsAL)
-
12:
data.allocation(d,mapsAL)
-
13:
index++
-
14:
else
-
15:
This file already exists
-
16:
end if
-
17:
end if
-
18:
if
op == "location"
then
-
19:
if
exist == TRUE
then
-
20:
mapsAL[index] ← data.location(dataHash,ML)
-
21:
index++
-
22:
else
-
23:
This file hasn’t been located
-
24:
end if
-
25.
end if
-
26:
end for
-
27:
returnmapsAL
|