Research Article

ER-Store: A Hybrid Storage Mechanism with Erasure Coding and Replication in Distributed Database Systems

Algorithm 2

Data temperature conversion algorithm.
Require:
  The data temperature conversion table, TCT;
  The set of hot tablets to be converted, hotTablets;
  The set of warm tablets to be converted, warmTablets;
  The set of cold tablets to be converted, coldTablets;
(1) ID is the sequence number of the tuple in the TCT;
(2) Tid is the tablet ID to be converted in the TCT;
(3) is the size of TCT;
(4)for Id = 1 to do
(5)if  = = 0 then
(6)   hotTablets.insert(Tid);
(7)else if  = = 1 then
(8)   warmTablets.insert(Tid);
(9)else
(10)   coldTablets.insert(Tid);
(11)end for
(12)while Tid hotTablets do
(13)  Use three replicas to back up the tablet;
(14)  CS notifies RS to update column RI and SS = 0 of the RootTable;
(15) use two replicas and Reed–Solomon to store redundant tablets; /
(16): while each 4 tablets warmTablets do
(17):  re init nn k(rs,4,4,1,tablets);
(18):  CS notifies RS to update column RI and SS = 1 of the RootTable;
(19):/ use Reed–Solomon to encode redundant tablets; /
(20): while each 6 tablets coldTablets do
(21):  rs init n k(rs,6,2,tablets);
(22):  CS notifies RS to update column RI and SS = 2 of the RootTable;