Research Article
ER-Store: A Hybrid Storage Mechanism with Erasure Coding and Replication in Distributed Database Systems
Algorithm 1
Data temperature recognition algorithm.
| Require: | | , of each tablet, = 1, ; | | Thresholds of each temperature-type tablet set by the system, , , ; | | Ensure: | | The data temperature conversion table in n period, ; | | (1) | : Initialize Tidsum is the sum of tablets; | | (2) | : Initialize Tid is the ID of the tablet; | | (3) | : Initialize is the current period and is the new period; | | (4) | : for Tid = 1 to Tidsum do | | (5) | : | | (6) | : end for | | (7) | : Use any sorting algorithm to rank the tablet temperature in the descending order; | | (8) | : is the sorted position of this tablet; | | (9) | : is the size of TCT; | | (10) | : for = 1 to do | | (11) | : ifthen | | (12) | : ; | | (13) | : ifthen | | (14) | : TCT.insert(, ); | | (15) | : end if; | | (16) | : else ifthen | | (17) | : ; | | (18) | : ifthen | | (19) | : TCT.insert(, ); | | (20) | : end if; | | (21) | : else | | (22) | : | | (23) | : ifthen | | (24) | : TCT.insert(, ); | | (25) | : end if; | | (26) | : end for | | (27) | : return; |
|