summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2020-04-25 22:51:49 +0200
committerTor Egge <Tor.Egge@broadpark.no>2020-04-25 22:58:30 +0200
commitd4bf2e41fab0adce629308de75b3e1763dfadccb (patch)
tree2d4ac70964ab3a16fc46c38d3c7510aec64d8c34 /searchcore
parent35decca41db6b9a44b24b6f7501c84d159ebd6a7 (diff)
Reduce code duplication. Rand48 class is in vespalib.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/apps/vespa-gen-testdocs/vespa-gen-testdocs.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/searchcore/src/apps/vespa-gen-testdocs/vespa-gen-testdocs.cpp b/searchcore/src/apps/vespa-gen-testdocs/vespa-gen-testdocs.cpp
index 2f54cefac29..080d98734bd 100644
--- a/searchcore/src/apps/vespa-gen-testdocs/vespa-gen-testdocs.cpp
+++ b/searchcore/src/apps/vespa-gen-testdocs/vespa-gen-testdocs.cpp
@@ -1,6 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/searchlib/util/rand48.h>
+#include <vespa/vespalib/util/rand48.h>
#include <vespa/vespalib/stllike/string.h>
#include <vespa/vespalib/stllike/hash_set.h>
#include <vespa/vespalib/stllike/asciistream.h>
@@ -98,10 +98,10 @@ shafile(const string &baseDir,
class StringGenerator
{
- search::Rand48 &_rnd;
+ vespalib::Rand48 &_rnd;
public:
- StringGenerator(search::Rand48 &rnd);
+ StringGenerator(vespalib::Rand48 &rnd);
void
rand_string(string &res, uint32_t minLen, uint32_t maxLen);
@@ -114,7 +114,7 @@ public:
};
-StringGenerator::StringGenerator(search::Rand48 &rnd)
+StringGenerator::StringGenerator(vespalib::Rand48 &rnd)
: _rnd(rnd)
{
}
@@ -283,7 +283,7 @@ PrefixTextFieldGenerator::generateValue(vespalib::asciistream &doc, uint32_t id)
class RandTextFieldGenerator : public FieldGenerator
{
- search::Rand48 &_rnd;
+ vespalib::Rand48 &_rnd;
uint32_t _numWords;
StringArray _strings;
uint32_t _minFill;
@@ -291,7 +291,7 @@ class RandTextFieldGenerator : public FieldGenerator
public:
RandTextFieldGenerator(const string &name,
- search::Rand48 &rnd,
+ vespalib::Rand48 &rnd,
uint32_t numWords,
uint32_t minFill,
uint32_t maxFill);
@@ -302,7 +302,7 @@ public:
RandTextFieldGenerator::RandTextFieldGenerator(const string &name,
- search::Rand48 &rnd,
+ vespalib::Rand48 &rnd,
uint32_t numWords,
uint32_t minFill,
uint32_t randFill)
@@ -354,7 +354,7 @@ class ModTextFieldGenerator : public FieldGenerator
public:
ModTextFieldGenerator(const string &name,
- search::Rand48 &rnd,
+ vespalib::Rand48 &rnd,
const std::vector<uint32_t> &mods);
virtual ~ModTextFieldGenerator();
virtual void generateValue(vespalib::asciistream &doc, uint32_t id) override;
@@ -362,7 +362,7 @@ public:
ModTextFieldGenerator::ModTextFieldGenerator(const string &name,
- [[maybe_unused]] search::Rand48 &rnd,
+ [[maybe_unused]] vespalib::Rand48 &rnd,
const std::vector<uint32_t> &mods)
: FieldGenerator(name),
_mods(mods)
@@ -419,13 +419,13 @@ IdTextFieldGenerator::generateValue(vespalib::asciistream &doc, uint32_t id)
class RandIntFieldGenerator : public FieldGenerator
{
- search::Rand48 &_rnd;
+ vespalib::Rand48 &_rnd;
uint32_t _low;
uint32_t _count;
public:
RandIntFieldGenerator(const string &name,
- search::Rand48 &rnd,
+ vespalib::Rand48 &rnd,
uint32_t low,
uint32_t count);
virtual ~RandIntFieldGenerator();
@@ -436,7 +436,7 @@ public:
RandIntFieldGenerator::RandIntFieldGenerator(const string &name,
- search::Rand48 &rnd,
+ vespalib::Rand48 &rnd,
uint32_t low,
uint32_t count)
: FieldGenerator(name),
@@ -617,7 +617,7 @@ class GenTestDocsApp : public SubApp
int _optIndex;
std::vector<FieldGenerator::SP> _fields;
std::vector<uint32_t> _mods;
- search::Rand48 _rnd;
+ vespalib::Rand48 _rnd;
string _outFile;
bool _headers;
bool _json;