aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-05-07 12:06:22 +0200
committerHenning Baldersheim <balder@oath.com>2018-05-07 12:06:22 +0200
commit3f790e002a3d2cbea2374a38d5cffb6205ee40ab (patch)
tree2bd86259cd5d80cc0fc69f5283bad6d69a4edfb7 /searchcore
parent5751177bd4ca8de4d521876e66d9cedf0921b5a6 (diff)
Only lie about coverage if not enough nodes up to satisfy coverage depending on searchable copies.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/config/partitions.def4
-rw-r--r--searchcore/src/vespa/searchcore/fdispatch/search/configdesc.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/fdispatch/search/configdesc.h9
-rw-r--r--searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.cpp26
-rw-r--r--searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.h18
-rw-r--r--searchcore/src/vespa/searchcore/fdispatch/search/datasetcollection.cpp68
-rw-r--r--searchcore/src/vespa/searchcore/fdispatch/search/fnet_dataset.h29
-rw-r--r--searchcore/src/vespa/searchcore/fdispatch/search/fnet_search.cpp42
-rw-r--r--searchcore/src/vespa/searchcore/fdispatch/search/plain_dataset.h3
9 files changed, 98 insertions, 103 deletions
diff --git a/searchcore/src/vespa/searchcore/config/partitions.def b/searchcore/src/vespa/searchcore/config/partitions.def
index 2164b38a2c8..5213d4ef72e 100644
--- a/searchcore/src/vespa/searchcore/config/partitions.def
+++ b/searchcore/src/vespa/searchcore/config/partitions.def
@@ -10,6 +10,10 @@ dataset[].id int
## nonzero refcost to minimize the maximum active refcost.
dataset[].refcost int default=0
+## Number of searchable copies on each node.
+## Searchable copies - nodes down < 1 will trigger an estimate of coverage.
+dataset[].searchablecopies long default=1
+
## Defines the number of bits used to encode the partition number
## internally on a dispatch node. The value must be in the range [1,8].
## The default value is 6, allowing the numparts parameter to be up to 63.
diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/configdesc.cpp b/searchcore/src/vespa/searchcore/fdispatch/search/configdesc.cpp
index 53c1c8d4da0..045f5b20ee0 100644
--- a/searchcore/src/vespa/searchcore/fdispatch/search/configdesc.cpp
+++ b/searchcore/src/vespa/searchcore/fdispatch/search/configdesc.cpp
@@ -17,6 +17,7 @@ double FastS_DataSetDesc::_defaultSlowDocsumLimitBias = 100.0;
FastS_DataSetDesc::FastS_DataSetDesc(uint32_t datasetid)
: _id(datasetid),
_queryDistributionMode(QueryDistributionMode::AUTOMATIC, 100.0, 10000),
+ _searchableCopies(1),
_unitRefCost(0),
_partBits(6),
_rowBits(0),
@@ -283,6 +284,7 @@ FastS_DataSetCollDesc::ReadConfig(const PartitionsConfig& partmap)
FastS_DataSetDesc *dataset = LookupCreateDataSet(dsconfig.id);
+ dataset->setSearchableCopies(dsconfig.searchablecopies);
dataset->SetUnitRefCost(dsconfig.refcost);
dataset->SetPartBits(dsconfig.partbits);
dataset->SetRowBits(dsconfig.rowbits);
diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/configdesc.h b/searchcore/src/vespa/searchcore/fdispatch/search/configdesc.h
index be5dc80c35a..32f85e904ae 100644
--- a/searchcore/src/vespa/searchcore/fdispatch/search/configdesc.h
+++ b/searchcore/src/vespa/searchcore/fdispatch/search/configdesc.h
@@ -74,12 +74,6 @@ public:
FIXEDROW = PartitionsConfig::Dataset::FIXEDROW
};
- struct InvalidModeException {
- Mode _mode;
- InvalidModeException(Mode mode) : _mode(mode)
- {}
- };
-
QueryDistributionMode(Mode mode, double minGroupCoverage, double latencyDecayRate) :
_mode(mode),
_minGroupCoverage(minGroupCoverage),
@@ -126,6 +120,7 @@ private:
uint32_t _id;
QueryDistributionMode _queryDistributionMode;
+ uint32_t _searchableCopies;
uint32_t _unitRefCost; // Cost to reference us
uint32_t _partBits; // # bits used to encode part id
uint32_t _rowBits; // # bits used to encode row id
@@ -172,6 +167,7 @@ public:
uint32_t GetID() const { return _id; }
void SetUnitRefCost(uint32_t value) { _unitRefCost = value; }
+ void setSearchableCopies(uint32_t value) { _searchableCopies = value; }
void SetPartBits(uint32_t value) {
if (value >= MIN_PARTBITS && value <= MAX_PARTBITS)
@@ -233,6 +229,7 @@ public:
uint32_t GetEstPartCutoff() const { return _estPartCutoff; }
bool IsEstimatePartsSet() const { return _estimatePartsSet; }
bool IsEstPartCutoffSet() const { return _estPartCutoffSet; }
+ uint32_t getSearchableCopies() const { return _searchableCopies; }
uint32_t GetMinOurActive() const { return _minOurActive; }
uint32_t GetMaxOurActive() const { return _maxOurActive; }
uint32_t GetCutoffOurActive() const { return _cutoffOurActive; }
diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.cpp b/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.cpp
index 816bd69012a..1b96a48d35b 100644
--- a/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.cpp
+++ b/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.cpp
@@ -35,8 +35,8 @@ FastS_DataSetBase::overload_t::overload_t(FastS_DataSetDesc *desc)
//--------------------------------------------------------------------------
FastS_DataSetBase::queryQueue_t::queryQueue_t(FastS_DataSetDesc *desc)
- : _head(NULL),
- _tail(NULL),
+ : _head(nullptr),
+ _tail(nullptr),
_queueLen(0),
_active(0),
_drainAllowed(0.0),
@@ -55,10 +55,10 @@ FastS_DataSetBase::queryQueue_t::~queryQueue_t()
void
FastS_DataSetBase::queryQueue_t::QueueTail(queryQueued_t *newqueued)
{
- FastS_assert(newqueued->_next == NULL &&
+ FastS_assert(newqueued->_next == nullptr &&
_head != newqueued &&
_tail != newqueued);
- if (_tail != NULL)
+ if (_tail != nullptr)
_tail->_next = newqueued;
else
_head = newqueued;
@@ -72,11 +72,11 @@ FastS_DataSetBase::queryQueue_t::DeQueueHead()
{
queryQueued_t *queued = _head;
FastS_assert(_queueLen > 0);
- FastS_assert(queued->_next != NULL || _tail == queued);
+ FastS_assert(queued->_next != nullptr || _tail == queued);
_head = queued->_next;
- if (queued->_next == NULL)
- _tail = NULL;
- queued->_next = NULL;
+ if (queued->_next == nullptr)
+ _tail = nullptr;
+ queued->_next = nullptr;
_queueLen--;
}
@@ -92,8 +92,8 @@ FastS_DataSetBase::FastS_DataSetBase(FastS_AppContext *appCtx,
_id(desc->GetID()),
_unitrefcost(desc->GetUnitRefCost()),
_totalrefcost(0),
- _mldDocStamp(0u)
-
+ _mldDocStamp(0u),
+ _searchableCopies(desc->getSearchableCopies())
{
_createtime.SetNow();
}
@@ -122,7 +122,7 @@ FastS_DataSetBase::DeQueueHeadWakeup_HasLock()
_queryQueue.DeQueueHead();
queued->UnmarkQueued();
FNET_Task *dequeuedTask = queued->getDequeuedTask();
- if (dequeuedTask != NULL) {
+ if (dequeuedTask != nullptr) {
dequeuedTask->ScheduleNow();
} else {
queued->SignalCond();
@@ -202,7 +202,7 @@ FastS_DataSetBase::CheckQueryQueue_HasLock(FastS_TimeKeeper *timeKeeper)
while (_queryQueue._drainAllowed >= (double) dispatchnodes ||
active < _queryQueue._overload._minouractive) {
queued = _queryQueue.GetFirst();
- if (queued == NULL) {
+ if (queued == nullptr) {
return;
}
@@ -240,7 +240,7 @@ FastS_DataSetBase::AbortQueryQueue_HasLock()
_queryQueue._overload._cutoffouractive = 0;
for (;;) {
queued = _queryQueue.GetFirst();
- if (queued == NULL)
+ if (queued == nullptr)
break;
// Doesn't lock query, but other thread is waiting on queue
queued->MarkAbort();
diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.h b/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.h
index e1a8a5e3f35..042e18bf96f 100644
--- a/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.h
+++ b/searchcore/src/vespa/searchcore/fdispatch/search/dataset_base.h
@@ -17,9 +17,7 @@ class FastS_EngineDesc;
class FastS_DataSetCollection;
class FastS_ISearch;
class FastS_QueryResult;
-class FastS_QueryCache;
class FastS_PlainDataSet;
-class FastS_DataSetInfo;
class FastS_FNET_DataSet;
class FastS_AppContext;
class FastS_QueryPerf;
@@ -30,10 +28,6 @@ class FNET_Task;
class FastS_DataSetBase
{
friend class FastS_DataSetCollection;
-private:
- FastS_DataSetBase(const FastS_DataSetBase &);
- FastS_DataSetBase& operator=(const FastS_DataSetBase &);
-
public:
//----------------------------------------------------------------
@@ -175,10 +169,13 @@ protected:
// Total cost as seen by referencing objects
std::atomic<uint32_t> _totalrefcost;
uint32_t _mldDocStamp;
+private:
+ uint32_t _searchableCopies;
public:
- FastS_DataSetBase(FastS_AppContext *appCtx,
- FastS_DataSetDesc *desc);
+ FastS_DataSetBase(const FastS_DataSetBase &) = delete;
+ FastS_DataSetBase& operator=(const FastS_DataSetBase &) = delete;
+ FastS_DataSetBase(FastS_AppContext *appCtx, FastS_DataSetDesc *desc);
virtual ~FastS_DataSetBase();
// locking stuff
@@ -204,6 +201,7 @@ public:
void UpdateSearchTime(double tnow, double elapsed, bool timedout);
void UpdateEstimateCount();
void CountTimeout();
+ uint32_t getSearchableCopies() const { return _searchableCopies; }
void ScheduleCheckTempFail();
virtual void DeQueueHeadWakeup_HasLock();
@@ -226,8 +224,8 @@ public:
// typesafe down-cast
//-------------------
- virtual FastS_PlainDataSet *GetPlainDataSet() { return NULL; }
- virtual FastS_FNET_DataSet *GetFNETDataSet() { return NULL; }
+ virtual FastS_PlainDataSet *GetPlainDataSet() { return nullptr; }
+ virtual FastS_FNET_DataSet *GetFNETDataSet() { return nullptr; }
};
//---------------------------------------------------------------------------
diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/datasetcollection.cpp b/searchcore/src/vespa/searchcore/fdispatch/search/datasetcollection.cpp
index cf7cd21d9b9..ea981d1cc01 100644
--- a/searchcore/src/vespa/searchcore/fdispatch/search/datasetcollection.cpp
+++ b/searchcore/src/vespa/searchcore/fdispatch/search/datasetcollection.cpp
@@ -11,11 +11,11 @@ LOG_SETUP(".search.datasetcollection");
FastS_DataSetBase *
FastS_DataSetCollection::CreateDataSet(FastS_DataSetDesc *desc)
{
- FastS_DataSetBase *ret = NULL;
+ FastS_DataSetBase *ret = nullptr;
FNET_Transport *transport = _appCtx->GetFNETTransport();
FNET_Scheduler *scheduler = _appCtx->GetFNETScheduler();
- if (transport != NULL && scheduler != NULL) {
+ if (transport != nullptr && scheduler != nullptr) {
ret = new FastS_FNET_DataSet(transport, scheduler, _appCtx, desc);
} else {
LOG(error, "Non-available dataset transport: FNET");
@@ -33,27 +33,27 @@ FastS_DataSetCollection::AddDataSet(FastS_DataSetDesc *desc)
uint32_t newSize = datasetid + 1;
FastS_DataSetBase **newArray = new FastS_DataSetBase*[newSize];
- FastS_assert(newArray != NULL);
+ FastS_assert(newArray != nullptr);
uint32_t i;
for (i = 0; i < _datasets_size; i++)
newArray[i] = _datasets[i];
for (; i < newSize; i++)
- newArray[i] = NULL;
+ newArray[i] = nullptr;
delete [] _datasets;
_datasets = newArray;
_datasets_size = newSize;
}
- FastS_assert(_datasets[datasetid] == NULL);
+ FastS_assert(_datasets[datasetid] == nullptr);
FastS_DataSetBase *dataset = CreateDataSet(desc);
- if (dataset == NULL)
+ if (dataset == nullptr)
return false;
_datasets[datasetid] = dataset;
for (FastS_EngineDesc *engineDesc = desc->GetEngineList();
- engineDesc != NULL; engineDesc = engineDesc->GetNext()) {
+ engineDesc != nullptr; engineDesc = engineDesc->GetNext()) {
dataset->AddEngine(engineDesc);
}
@@ -64,10 +64,10 @@ FastS_DataSetCollection::AddDataSet(FastS_DataSetDesc *desc)
FastS_DataSetCollection::FastS_DataSetCollection(FastS_AppContext *appCtx)
- : _nextOld(NULL),
- _configDesc(NULL),
+ : _nextOld(nullptr),
+ _configDesc(nullptr),
_appCtx(appCtx),
- _datasets(NULL),
+ _datasets(nullptr),
_datasets_size(0),
_gencnt(0),
_frozen(false),
@@ -78,11 +78,11 @@ FastS_DataSetCollection::FastS_DataSetCollection(FastS_AppContext *appCtx)
FastS_DataSetCollection::~FastS_DataSetCollection()
{
- if (_datasets != NULL) {
+ if (_datasets != nullptr) {
for (uint32_t i = 0; i < _datasets_size; i++) {
- if (_datasets[i] != NULL) {
+ if (_datasets[i] != nullptr) {
_datasets[i]->Free();
- _datasets[i] = NULL;
+ _datasets[i] = nullptr;
}
}
}
@@ -101,8 +101,8 @@ FastS_DataSetCollection::Configure(FastS_DataSetCollDesc *cfgDesc,
if (_frozen) {
delete cfgDesc;
} else {
- FastS_assert(_configDesc == NULL);
- if (cfgDesc == NULL) {
+ FastS_assert(_configDesc == nullptr);
+ if (cfgDesc == nullptr) {
_configDesc = new FastS_DataSetCollDesc();
} else {
_configDesc = cfgDesc;
@@ -114,7 +114,7 @@ FastS_DataSetCollection::Configure(FastS_DataSetCollDesc *cfgDesc,
for (uint32_t i = 0; rc && i < _configDesc->GetMaxNumDataSets(); i++) {
FastS_DataSetDesc *datasetDesc = _configDesc->GetDataSet(i);
- if (datasetDesc != NULL) {
+ if (datasetDesc != nullptr) {
FastS_assert(datasetDesc->GetID() == i);
rc = AddDataSet(datasetDesc);
}
@@ -131,22 +131,22 @@ FastS_DataSetCollection::SuggestDataSet()
{
FastS_assert(_frozen);
- FastS_DataSetBase *dataset = NULL;
+ FastS_DataSetBase *dataset = nullptr;
for (uint32_t i = 0; i < _datasets_size; i++) {
FastS_DataSetBase *tmp = _datasets[i];
- if (tmp == NULL || tmp->_unitrefcost == 0)
+ if (tmp == nullptr || tmp->_unitrefcost == 0)
continue;
// NB: cost race condition
- if (dataset == NULL ||
+ if (dataset == nullptr ||
dataset->_totalrefcost + dataset->_unitrefcost >
tmp->_totalrefcost + tmp->_unitrefcost)
dataset = tmp;
}
- return (dataset == NULL)
+ return (dataset == nullptr)
? FastS_NoID32()
: dataset->GetID();
}
@@ -159,9 +159,9 @@ FastS_DataSetCollection::GetDataSet(uint32_t datasetid)
FastS_DataSetBase *dataset =
(datasetid < _datasets_size) ?
- _datasets[datasetid] : NULL;
+ _datasets[datasetid] : nullptr;
- if (dataset != NULL)
+ if (dataset != nullptr)
dataset->AddCost();
return dataset;
@@ -173,22 +173,22 @@ FastS_DataSetCollection::GetDataSet()
{
FastS_assert(_frozen);
- FastS_DataSetBase *dataset = NULL;
+ FastS_DataSetBase *dataset = nullptr;
for (uint32_t i = 0; i < _datasets_size; i++) {
FastS_DataSetBase *tmp = _datasets[i];
- if (tmp == NULL || tmp->_unitrefcost == 0)
+ if (tmp == nullptr || tmp->_unitrefcost == 0)
continue;
// NB: cost race condition
- if (dataset == NULL ||
+ if (dataset == nullptr ||
dataset->_totalrefcost + dataset->_unitrefcost >
tmp->_totalrefcost + tmp->_unitrefcost)
dataset = tmp;
}
- if (dataset != NULL)
+ if (dataset != nullptr)
dataset->AddCost();
return dataset;
@@ -205,7 +205,7 @@ FastS_DataSetCollection::AreEnginesReady()
datasetidx++)
{
FastS_DataSetBase *dataset = PeekDataSet(datasetidx);
- ready = (dataset != NULL && !dataset->AreEnginesReady());
+ ready = (dataset != nullptr && !dataset->AreEnginesReady());
}
return ready;
}
@@ -215,19 +215,19 @@ FastS_ISearch *
FastS_DataSetCollection::CreateSearch(uint32_t dataSetID,
FastS_TimeKeeper *timeKeeper)
{
- FastS_ISearch *ret = NULL;
+ FastS_ISearch *ret = nullptr;
FastS_DataSetBase *dataset;
if (dataSetID == FastS_NoID32()) {
dataset = GetDataSet();
- if (dataset != NULL)
+ if (dataset != nullptr)
dataSetID = dataset->GetID();
} else {
dataset = GetDataSet(dataSetID);
}
- if (dataset == NULL) {
+ if (dataset == nullptr) {
ret = new FastS_FailedSearch(dataSetID, false,
- search::engine::ECODE_ILLEGAL_DATASET, NULL);
+ search::engine::ECODE_ILLEGAL_DATASET, nullptr);
} else {
{
auto dsGuard(dataset->getDsGuard());
@@ -236,7 +236,7 @@ FastS_DataSetCollection::CreateSearch(uint32_t dataSetID,
/* XXX: Semantic change: precounted as active in dataset */
ret = dataset->CreateSearch(this, timeKeeper, /* async = */ false);
}
- FastS_assert(ret != NULL);
+ FastS_assert(ret != nullptr);
return ret;
}
@@ -247,7 +247,7 @@ FastS_DataSetCollection::CheckQueryQueues(FastS_TimeKeeper *timeKeeper)
for (uint32_t datasetidx(0); datasetidx < GetMaxNumDataSets(); datasetidx++) {
FastS_DataSetBase *dataset = PeekDataSet(datasetidx);
- if (dataset != NULL) {
+ if (dataset != nullptr) {
auto dsGuard(dataset->getDsGuard());
dataset->CheckQueryQueue_HasLock(timeKeeper);
}
@@ -261,7 +261,7 @@ FastS_DataSetCollection::AbortQueryQueues()
for (uint32_t datasetidx(0); datasetidx < GetMaxNumDataSets(); datasetidx++) {
FastS_DataSetBase *dataset = PeekDataSet(datasetidx);
- if (dataset != NULL) {
+ if (dataset != nullptr) {
auto dsGuard(dataset->getDsGuard());
dataset->AbortQueryQueue_HasLock();
}
diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/fnet_dataset.h b/searchcore/src/vespa/searchcore/fdispatch/search/fnet_dataset.h
index 62e9686f132..e51166a8456 100644
--- a/searchcore/src/vespa/searchcore/fdispatch/search/fnet_dataset.h
+++ b/searchcore/src/vespa/searchcore/fdispatch/search/fnet_dataset.h
@@ -8,10 +8,6 @@ class FNET_Transport;
class FastS_FNET_DataSet : public FastS_PlainDataSet
{
-private:
- FastS_FNET_DataSet(const FastS_FNET_DataSet &);
- FastS_FNET_DataSet& operator=(const FastS_FNET_DataSet &);
-
public:
//----------------------------------------------------------------
@@ -21,13 +17,12 @@ public:
class PingTask : public FNET_Task
{
private:
- PingTask(const PingTask &);
- PingTask& operator=(const PingTask &);
-
FastS_FNET_DataSet *_dataset;
double _delay;
public:
+ PingTask(const PingTask &) = delete;
+ PingTask& operator=(const PingTask &) = delete;
PingTask(FNET_Scheduler *scheduler,
FastS_FNET_DataSet *dataset,
double delay)
@@ -45,25 +40,27 @@ private:
uint64_t _failedRowsBitmask;
public:
+ FastS_FNET_DataSet(const FastS_FNET_DataSet &) = delete;
+ FastS_FNET_DataSet& operator=(const FastS_FNET_DataSet &) = delete;
FastS_FNET_DataSet(FNET_Transport *transport,
FNET_Scheduler *scheduler,
FastS_AppContext *appCtx,
FastS_DataSetDesc *desc);
- virtual ~FastS_FNET_DataSet();
+ ~FastS_FNET_DataSet() override;
FNET_Transport *GetTransport() { return _transport; }
// typesafe down-cast
- virtual FastS_FNET_DataSet *GetFNETDataSet() override { return this; }
+ FastS_FNET_DataSet *GetFNETDataSet() override { return this; }
// common dataset API
- virtual bool AddEngine(FastS_EngineDesc *desc) override;
- virtual void ConfigDone(FastS_DataSetCollection *) override;
- virtual void ScheduleCheckBad() override;
- virtual FastS_ISearch *CreateSearch(FastS_DataSetCollection *dsc,
- FastS_TimeKeeper *timeKeeper,
- bool async) override;
- virtual void Free() override;
+ bool AddEngine(FastS_EngineDesc *desc) override;
+ void ConfigDone(FastS_DataSetCollection *) override;
+ void ScheduleCheckBad() override;
+ FastS_ISearch *CreateSearch(FastS_DataSetCollection *dsc,
+ FastS_TimeKeeper *timeKeeper,
+ bool async) override;
+ void Free() override;
bool isGoodRow(uint32_t rowId);
};
diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/fnet_search.cpp b/searchcore/src/vespa/searchcore/fdispatch/search/fnet_search.cpp
index 151b1e1596b..86d4bae21c6 100644
--- a/searchcore/src/vespa/searchcore/fdispatch/search/fnet_search.cpp
+++ b/searchcore/src/vespa/searchcore/fdispatch/search/fnet_search.cpp
@@ -28,13 +28,13 @@ using search::engine::PacketConverter;
FastS_FNET_SearchNode::FastS_FNET_SearchNode(FastS_FNET_Search *search, uint32_t partid)
: _search(search),
- _engine(NULL),
- _channel(NULL),
+ _engine(nullptr),
+ _channel(nullptr),
_subds(0),
_partid(partid),
_rowid(0),
_stamp(0),
- _qresult(NULL),
+ _qresult(nullptr),
_queryTime(0.0),
_flags(),
_docidCnt(0),
@@ -42,14 +42,14 @@ FastS_FNET_SearchNode::FastS_FNET_SearchNode(FastS_FNET_Search *search, uint32_t
_docsumRow(0),
_docsum_offsets_idx(0),
_docsumTime(0.0),
- _gdx(NULL),
+ _gdx(nullptr),
_docsum_offsets(),
_extraDocsumNodes(),
_nextExtraDocsumNode(this),
_prevExtraDocsumNode(this),
- _hit_beg(NULL),
- _hit_cur(NULL),
- _hit_end(NULL),
+ _hit_beg(nullptr),
+ _hit_cur(nullptr),
+ _hit_end(nullptr),
_sortDataIterator()
{
}
@@ -58,10 +58,10 @@ FastS_FNET_SearchNode::FastS_FNET_SearchNode(FastS_FNET_Search *search, uint32_t
FastS_FNET_SearchNode::~FastS_FNET_SearchNode()
{
Disconnect();
- if (_qresult != NULL) {
+ if (_qresult != nullptr) {
_qresult->Free();
}
- if (_gdx != NULL) {
+ if (_gdx != nullptr) {
_gdx->Free();
}
}
@@ -80,7 +80,7 @@ FastS_FNET_SearchNode::NT_InitMerge(uint32_t *numDocs,
uint32_t *sortDataDocs)
{
uint32_t myNumDocs = 0;
- if (_qresult != NULL) {
+ if (_qresult != nullptr) {
myNumDocs = _qresult->_numDocs;
*numDocs += myNumDocs;
*totalHits += _qresult->_totNumDocs;
@@ -121,7 +121,7 @@ allocGDX(search::docsummary::GetDocsumArgs *args, const search::engine::Properti
_gdx = gdx;
_docsum_offsets.resize(_gdx->_docid.size());
_docsum_offsets_idx = 0;
- if (args == NULL)
+ if (args == nullptr)
return;
if (args->getRankProfile().size() != 0 || args->GetQueryFlags() != 0) {
@@ -172,7 +172,7 @@ FastS_FNET_SearchNode::postGDX(uint32_t *pendingDocsums, uint32_t *docsumNodes)
*pendingDocsums += _pendingDocsums;
(*docsumNodes)++;
}
- _gdx = NULL; // packet hand-over
+ _gdx = nullptr; // packet hand-over
_docsum_offsets_idx = 0;
}
@@ -214,7 +214,7 @@ allocExtraDocsumNode(bool mld, uint32_t rowid, uint32_t rowbits)
uint32_t idx = (rowid << 1) + (mld ? 1 : 0);
- if (_extraDocsumNodes[idx].get() == NULL) {
+ if (_extraDocsumNodes[idx].get() == nullptr) {
UP eNode(new FastS_FNET_SearchNode(_search, getPartID()));
eNode->_docsumRow = rowid;
eNode->_flags._docsumMld = mld;
@@ -338,7 +338,7 @@ FastS_FNET_Search::ConnectQueryNodes()
{
auto dsGuard(_dataset->getDsGuard());
for (uint32_t i = 0; i < _nodes.size(); i++) {
- FastS_EngineBase *engine = NULL;
+ FastS_EngineBase *engine = nullptr;
if (_dataset->useFixedRowDistribution()) {
engine = _dataset->getPartition(dsGuard, i, fixedRow);
LOG(debug, "FixedRow: getPartition(part=%u, row=%u) -> engine(%s)", i, fixedRow, (engine != nullptr ? engine->GetName() : "null"));
@@ -874,7 +874,7 @@ FastS_FNET_Search::CheckCoverage()
size_t cntNone(0);
for (const FastS_FNET_SearchNode & node : _nodes) {
- if (node._qresult != NULL) {
+ if (node._qresult != nullptr) {
covDocs += node._qresult->_coverageDocs;
activeDocs += node._qresult->_activeDocs;
soonActiveDocs += node._qresult->_soonActiveDocs;
@@ -886,7 +886,7 @@ FastS_FNET_Search::CheckCoverage()
cntNone++;
}
}
- if ((cntNone > 0) && (cntNone != _nodes.size())) {
+ if ((cntNone >= _dataset->getSearchableCopies()) && (cntNone != _nodes.size())) {
activeDocs += cntNone * activeDocs/(_nodes.size() - cntNone);
}
_util.SetCoverage(covDocs, activeDocs, soonActiveDocs, degradedReason, nodesQueried, nodesReplied);
@@ -959,7 +959,7 @@ void
FastS_FNET_Search::CheckQueryTimeout()
{
if (_queryNodes != 0 && _queryNodesTimedOut >= _queryNodes)
- SetError(search::engine::ECODE_TIMEOUT, NULL);
+ SetError(search::engine::ECODE_TIMEOUT, nullptr);
if (!_queryTimeout)
return;
@@ -990,7 +990,7 @@ void
FastS_FNET_Search::CheckDocsumTimeout()
{
if (_docsumNodes != 0 && _docsumNodesTimedOut >= _docsumNodes)
- SetError(search::engine::ECODE_TIMEOUT, NULL);
+ SetError(search::engine::ECODE_TIMEOUT, nullptr);
if (!_docsumTimeout)
return;
@@ -1127,7 +1127,7 @@ FastS_FNET_Search::Search(uint32_t searchOffset,
if (done) {
_FNET_mode = FNET_NONE;
if (all_down) {
- SetError(search::engine::ECODE_ALL_PARTITIONS_DOWN, NULL);
+ SetError(search::engine::ECODE_ALL_PARTITIONS_DOWN, nullptr);
}
}
}
@@ -1408,11 +1408,11 @@ FastS_FNET_Search::GetDocsums(const FastS_hitresult *hits, uint32_t hitcnt)
// patch in engine dependent features and send docsum requests
for (FastS_FNET_SearchNode & node : _nodes) {
- if (node._gdx != NULL)
+ if (node._gdx != nullptr)
node.postGDX(&_pendingDocsums, &_docsumNodes);
for (FastS_FNET_SearchNode::ExtraDocsumNodesIter iter(&node); iter.valid(); ++iter) {
FastS_FNET_SearchNode *eNode = *iter;
- if (eNode->_gdx != NULL)
+ if (eNode->_gdx != nullptr)
eNode->postGDX(&_pendingDocsums, &_docsumNodes);
}
}
diff --git a/searchcore/src/vespa/searchcore/fdispatch/search/plain_dataset.h b/searchcore/src/vespa/searchcore/fdispatch/search/plain_dataset.h
index 7c04834bd38..ab50efeb40c 100644
--- a/searchcore/src/vespa/searchcore/fdispatch/search/plain_dataset.h
+++ b/searchcore/src/vespa/searchcore/fdispatch/search/plain_dataset.h
@@ -87,9 +87,6 @@ private:
class FastS_PlainDataSet : public FastS_DataSetBase
{
friend class FastS_NodeManager;
-private:
- FastS_PlainDataSet(const FastS_PlainDataSet &);
- FastS_PlainDataSet& operator=(const FastS_PlainDataSet &);
public: