aboutsummaryrefslogtreecommitdiffstats
path: root/vdslib
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahoo-inc.com>2017-11-30 14:14:05 +0000
committerTor Brede Vekterli <vekterli@yahoo-inc.com>2017-12-01 12:16:38 +0000
commit3c5ac37073fa15a3f5a84ecade6e5b2bdb1c7a82 (patch)
tree6ab5b838e3b2eb396dbe119f2082525741643faa /vdslib
parentf996e2b07c041b41c3ad79fc1602a0d9b655981c (diff)
Less Gallic influence on naming
Diffstat (limited to 'vdslib')
-rw-r--r--vdslib/src/vespa/vdslib/distribution/redundancygroupdistribution.cpp38
-rw-r--r--vdslib/src/vespa/vdslib/distribution/redundancygroupdistribution.h2
2 files changed, 20 insertions, 20 deletions
diff --git a/vdslib/src/vespa/vdslib/distribution/redundancygroupdistribution.cpp b/vdslib/src/vespa/vdslib/distribution/redundancygroupdistribution.cpp
index 97bde0ca54f..f620dc15928 100644
--- a/vdslib/src/vespa/vdslib/distribution/redundancygroupdistribution.cpp
+++ b/vdslib/src/vespa/vdslib/distribution/redundancygroupdistribution.cpp
@@ -14,10 +14,10 @@ namespace {
void verifyLegal(vespalib::StringTokenizer& st,
vespalib::stringref serialized)
{
- // First, verify sanity of the serialized string
- uint32_t firstAsterix = st.size();
+ // First, verify sanity of the serialized string
+ uint32_t firstAsterisk = st.size();
for (uint32_t i=0; i<st.size(); ++i) {
- if (i > firstAsterix) {
+ if (i > firstAsterisk) {
if (st[i] != "*") {
throw vespalib::IllegalArgumentException(
"Illegal distribution spec \"" + serialized + "\". "
@@ -26,8 +26,8 @@ namespace {
}
continue;
}
- if (i < firstAsterix && st[i] == "*") {
- firstAsterix = i;
+ if (i < firstAsterisk && st[i] == "*") {
+ firstAsterisk = i;
continue;
}
uint32_t number = atoi(st[i].c_str());
@@ -76,21 +76,21 @@ RedundancyGroupDistribution::RedundancyGroupDistribution(
const RedundancyGroupDistribution& spec,
uint16_t redundancy)
{
- uint16_t firstAsterix = spec.getFirstAsterixIndex();
- // If redundancy is less than the group size, we only get one copy
- // in redundancy groups.
+ uint16_t firstAsterisk = spec.getFirstAsteriskIndex();
+ // If redundancy is less than the group size, we only get one copy
+ // in redundancy groups.
if (redundancy <= spec.size()) {
_values = std::vector<uint16_t>(redundancy, 1);
return;
}
- // If not we will have one copy at least for every wanted group.
+ // If not we will have one copy at least for every wanted group.
_values = std::vector<uint16_t>(spec.size(), 1);
redundancy -= spec.size();
- // Distribute extra copies to non-asterix entries first
- redundancy = divideSpecifiedCopies(0, firstAsterix, redundancy, spec._values);
- // Distribute remaining copies to asterix entries
- divideSpecifiedCopies(firstAsterix, spec.size(), redundancy, spec._values);
- // Lastly sort, so the most copies will end up first in ideal state
+ // Distribute extra copies to non-asterisk entries first
+ redundancy = divideSpecifiedCopies(0, firstAsterisk, redundancy, spec._values);
+ // Distribute remaining copies to asterisk entries
+ divideSpecifiedCopies(firstAsterisk, spec.size(), redundancy, spec._values);
+ // Lastly sort, so the most copies will end up first in ideal state
std::sort(_values.begin(), _values.end());
std::reverse(_values.begin(), _values.end());
assert(_values.front() >= _values.back());
@@ -111,18 +111,18 @@ RedundancyGroupDistribution::print(std::ostream& out,
}
uint16_t
-RedundancyGroupDistribution::getFirstAsterixIndex() const
+RedundancyGroupDistribution::getFirstAsteriskIndex() const
{
if (_values.empty() || _values.back() != 0) {
throw vespalib::IllegalArgumentException(
"Invalid spec given. No asterisk entries found.",
VESPA_STRLOC);
}
- uint16_t firstAsterix = _values.size() - 1;
- while (firstAsterix > 0 && _values[firstAsterix - 1] == 0) {
- --firstAsterix;
+ uint16_t firstAsterisk = _values.size() - 1;
+ while (firstAsterisk > 0 && _values[firstAsterisk - 1] == 0) {
+ --firstAsterisk;
}
- return firstAsterix;
+ return firstAsterisk;
}
uint16_t
diff --git a/vdslib/src/vespa/vdslib/distribution/redundancygroupdistribution.h b/vdslib/src/vespa/vdslib/distribution/redundancygroupdistribution.h
index 5dde7cf378d..33f895cadf0 100644
--- a/vdslib/src/vespa/vdslib/distribution/redundancygroupdistribution.h
+++ b/vdslib/src/vespa/vdslib/distribution/redundancygroupdistribution.h
@@ -41,7 +41,7 @@ public:
void print(std::ostream&, bool verbose, const std::string& indent) const override;
private:
- uint16_t getFirstAsterixIndex() const;
+ uint16_t getFirstAsteriskIndex() const;
uint16_t divideSpecifiedCopies(
uint16_t start, uint16_t end,
uint16_t redundancy, const std::vector<uint16_t>& maxValues);