Add comments to explain functions in ReplicationUtils.cpp

This commit is contained in:
Tapasweni Pathak 2019-09-26 23:03:13 +05:30
parent 8acce9c371
commit 50d43cff15
1 changed files with 17 additions and 0 deletions

View File

@ -26,6 +26,12 @@
#include "fdbrpc/Replication.h"
/**
* ratePolicy takes localitySet and ReplicationPolicy as arguments.
* localitySet is used for setting the logServerSet defining using WorkerDetails.
* Iterating nTestTotal number of times the replication is performed for the items.
*/
double ratePolicy(
Reference<LocalitySet> & localitySet,
Reference<IReplicationPolicy> const& policy,
@ -82,6 +88,12 @@ double ratePolicy(
return rating;
}
/**
* findBestPolicySet takes bestResults, localitySet, ReplicationPolicy, number of Min Iterms
* number of Select Test and number of Policy Tests as arguments and find the best
* from a locality set defined. The bestRate has value less than 0.0
**/
bool findBestPolicySet(
std::vector<LocalityEntry>& bestResults,
Reference<LocalitySet> & localitySet,
@ -158,6 +170,11 @@ bool findBestPolicySet(
return bSucceeded;
}
/**
* findBestUniquePolicySet takes mainluy localityUniquenessKey. Random unique items
* are compared with results, the output is returned.
**/
bool findBestUniquePolicySet(
std::vector<LocalityEntry>& bestResults,
Reference<LocalitySet> & localitySet,