Merge pull request #2149 from tapaswenipathak/ticket-2135

Add comments to explain functions in ReplicationUtils.cpp
This commit is contained in:
Alex Miller 2020-01-24 16:35:11 -08:00 committed by GitHub
commit d06d664ed7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View File

@ -294,10 +294,10 @@ bool validateAllCombinations(
for (int i = 0; i < newItems.size(); ++i) {
localGroup->add(newItems[i]);
}
std::string bitmask(nCombinationSize, 1); // K leading 1's
bitmask.resize(newItems.size(), 0); // N-K trailing 0's
std::vector<LocalityEntry> resultEntries;
do
{

View File

@ -27,9 +27,10 @@
typedef std::string repTestType;
//string value defining test type
extern repTestType convertToTestType(int iValue);
//converts integer value to a test type
extern int testReplication();
@ -37,6 +38,12 @@ extern double ratePolicy(
Reference<LocalitySet> & localitySet,
Reference<IReplicationPolicy> const& policy,
unsigned int nSelectTests);
//returns the value for the rate policy
//given a localitySet, replication policy and number of selected tests, apply the
//policy and return the rating
//rating can be -1 there are no unique results failing while applying the replication
//policy, otherwise largest mode from the items per unique set of locaility entry
//are returned.
extern bool findBestPolicySet(
std::vector<LocalityEntry>& bestResults,
@ -45,6 +52,11 @@ extern bool findBestPolicySet(
unsigned int nMinItems,
unsigned int nSelectTests,
unsigned int nPolicyTests);
//returns the best policy set
//given locality set, replication policy, number of min items, number of select
//test, number of policy tests, find the best from locality set, including few
//random items, get the rate policy having test rate, best rate and returning
//the success state.
extern bool findBestUniquePolicySet(
std::vector<LocalityEntry>& bestResults,