Skip to content

Commit

Permalink
Merge pull request #24167 from vespa-engine/balder/gc-void-code
Browse files Browse the repository at this point in the history
GC unused files and code.
  • Loading branch information
baldersheim authored Sep 21, 2022
2 parents d058fe5 + 4fe271e commit 31af4a6
Show file tree
Hide file tree
Showing 18 changed files with 31 additions and 216 deletions.
1 change: 0 additions & 1 deletion searchlib/src/vespa/searchlib/aggregation/fs4hit.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "hit.h"
#include "aggregationresult.h"
#include <vespa/document/base/globalid.h>
#include <vespa/searchlib/common/docstamp.h>

namespace search::aggregation {

Expand Down
14 changes: 0 additions & 14 deletions searchlib/src/vespa/searchlib/common/base.h

This file was deleted.

7 changes: 2 additions & 5 deletions searchlib/src/vespa/searchlib/common/converters.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
#include <vespa/searchcommon/common/iblobconverter.h>
#include <vespa/vespalib/stllike/string.h>

namespace search {
namespace common {
namespace search::common {

class PassThroughConverter : public BlobConverter
{
Expand All @@ -27,10 +26,8 @@ class ConverterFactory {
protected:
using stringref = vespalib::stringref;
public:
virtual ~ConverterFactory() { }
virtual ~ConverterFactory() = default;
virtual BlobConverter::UP create(stringref local, stringref strength) const = 0;
};

}
}

18 changes: 0 additions & 18 deletions searchlib/src/vespa/searchlib/common/docstamp.h

This file was deleted.

10 changes: 4 additions & 6 deletions searchlib/src/vespa/searchlib/common/documentlocations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@
#include <vespa/searchlib/attribute/attributeguard.h>
#include <vespa/searchlib/attribute/attributevector.h>

namespace search {
namespace common {
namespace search::common {

DocumentLocations::DocumentLocations()
: _vec(NULL)
: _vec(nullptr)
{
}

DocumentLocations::~DocumentLocations() { }
DocumentLocations::~DocumentLocations() = default;

DocumentLocations::DocumentLocations(DocumentLocations &&) = default;
DocumentLocations & DocumentLocations::operator = (DocumentLocations &&) = default;


} // namespace common
} // namespace search
}
11 changes: 3 additions & 8 deletions searchlib/src/vespa/searchlib/common/documentlocations.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

#include <memory>

namespace search {
namespace search { class AttributeGuard; }
namespace search::attribute { class IAttributeVector; }

namespace attribute { class IAttributeVector; }
class AttributeGuard;

namespace common {
namespace search::common {


/**
Expand Down Expand Up @@ -37,7 +35,4 @@ class DocumentLocations
}
};


}
}

5 changes: 1 addition & 4 deletions searchlib/src/vespa/searchlib/common/documentsummary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include "documentsummary.h"
#include <vespa/fastlib/io/bufferedfile.h>
#include <vespa/searchlib/util/filekit.h>
#include <vespa/vespalib/util/size_literals.h>
#include <vespa/vespalib/util/error.h>

Expand All @@ -11,8 +10,7 @@ LOG_SETUP(".searchlib.docsummary.documentsummary");

using vespalib::getLastErrorString;

namespace search {
namespace docsummary {
namespace search::docsummary {

bool
DocumentSummary::readDocIdLimit(const vespalib::string &dir, uint32_t &count)
Expand Down Expand Up @@ -63,4 +61,3 @@ DocumentSummary::writeDocIdLimit(const vespalib::string &dir, uint32_t count)
}

}
}
11 changes: 3 additions & 8 deletions searchlib/src/vespa/searchlib/common/documentsummary.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,14 @@

#include <vespa/vespalib/stllike/string.h>

namespace search {
namespace docsummary {
namespace search::docsummary {

class DocumentSummary
{
public:
static bool
readDocIdLimit(const vespalib::string &dir, uint32_t &docIdLimit);

static bool
writeDocIdLimit(const vespalib::string &dir, uint32_t docIdLimit);
static bool readDocIdLimit(const vespalib::string &dir, uint32_t &docIdLimit);
static bool writeDocIdLimit(const vespalib::string &dir, uint32_t docIdLimit);
};

}
}

29 changes: 0 additions & 29 deletions searchlib/src/vespa/searchlib/common/fslimits.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,5 @@

#pragma once

// define min/max number of bits that may be used to
// encode partid/rowid into the partition path field.
// NB: MIN_ROWBITS == 0
// Constraint: MIN_PARTBITS >= 1
// Constraint: MIN_PARTBITS <= 6 <= MAX_PARTBITS

#define MIN_PARTBITS 1
#define MAX_PARTBITS 8

#define MAX_ROWBITS 8

// Currently, max word length and max number of indexes are limited by
// the layout of binary dictionaries; see class FastS_Pagedict.

#define MAX_WORD_LEN 1000
#define MAX_INDEXES 64

// max number of tiers in a multi-tier dataset.
// may currently not be greater than 16, due to the
// partition path encoding algorithm used.

#define MAX_TIERS 16

// max number of explicitly defined term rank limits
#define MAX_TERMRANKLIMITS 32

// Max number of fallthrough classes in Multi-tier fallthrough selector, just set a limit..
#define MAX_FALLTHROUGH_SELECTORS 32

#define SEARCHLIB_FEF_UNKNOWN_FIELD_LENGTH 1000000u

51 changes: 0 additions & 51 deletions searchlib/src/vespa/searchlib/common/gid.h

This file was deleted.

17 changes: 0 additions & 17 deletions searchlib/src/vespa/searchlib/common/reserved.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#include "fileheadercontext.h"
#include "serialnum.h"

namespace search {

namespace common {
namespace search::common {

class SerialNumFileHeaderContext : public FileHeaderContext
{
Expand All @@ -21,7 +19,4 @@ class SerialNumFileHeaderContext : public FileHeaderContext
void addTags(vespalib::GenericHeader &header, const vespalib::string &name) const override;
};

} // namespace common

} // namespace search

}
18 changes: 9 additions & 9 deletions searchlib/src/vespa/searchlib/common/sortspec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#include <vespa/vespalib/text/utf8.h>
#include <stdexcept>

namespace search {
namespace common {
namespace search::common {

using vespalib::ConstBufferRef;
using vespalib::make_string;

ConstBufferRef PassThroughConverter::onConvert(const ConstBufferRef & src) const
ConstBufferRef
PassThroughConverter::onConvert(const ConstBufferRef & src) const
{
return src;
}
Expand All @@ -21,7 +21,8 @@ LowercaseConverter::LowercaseConverter() :
{
}

ConstBufferRef LowercaseConverter::onConvert(const ConstBufferRef & src) const
ConstBufferRef
LowercaseConverter::onConvert(const ConstBufferRef & src) const
{
_buffer.clear();
vespalib::stringref input((const char *)src.data(), src.size());
Expand All @@ -32,13 +33,13 @@ ConstBufferRef LowercaseConverter::onConvert(const ConstBufferRef & src) const
c = Fast_NormalizeWordFolder::ToFold(c);
w.putChar(c);
}
return ConstBufferRef(_buffer.begin(), _buffer.size());
return {_buffer.begin(), _buffer.size()};
}

SortInfo::SortInfo(const vespalib::string & field, bool ascending, const BlobConverter::SP & converter)
: _field(field), _ascending(ascending), _converter(converter)
{ }
SortInfo::~SortInfo() {}
SortInfo::~SortInfo() = default;

SortSpec::SortSpec(const vespalib::string & spec, const ConverterFactory & ucaFactory) :
_spec(spec)
Expand Down Expand Up @@ -98,13 +99,12 @@ SortSpec::SortSpec(const vespalib::string & spec, const ConverterFactory & ucaFa
throw std::runtime_error("Unknown func " + vespalib::string(func, p-func));
}
} else {
push_back(SortInfo(funcSpec, ascending, BlobConverter::SP(NULL)));
push_back(SortInfo(funcSpec, ascending, BlobConverter::SP()));
}
}
}
}

SortSpec::~SortSpec() {}
SortSpec::~SortSpec() = default;

}
}
31 changes: 0 additions & 31 deletions searchlib/src/vespa/searchlib/query/base.h
Original file line number Diff line number Diff line change
@@ -1,50 +1,19 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/vespalib/stllike/string.h>
#include <vespa/fastlib/text/unicodeutil.h>
#include <vector>

namespace search {

/// Type of general unsigned 8 bit data.
typedef unsigned char byte;
/// A simple container for the raw querystack.
typedef vespalib::stringref QueryPacketT;
/// The type of the local documentId.
typedef unsigned DocumentIdT;
/// This is the type of the CollectionId used in the StorageAPI.
typedef uint64_t CollectionIdT;
/// The type to identify a query.
typedef unsigned QueryIdT;
/// The rank type.
typedef unsigned RankT;
/// How time type. Used to represent seconds since 1970.
typedef unsigned TimeT;
/// Type to identify performance counters.
typedef uint64_t CounterT;
/// Type to identify performance values.
typedef int ValueT;
/// This is a 16 byte vector used in SSE2 integer operations.
typedef char v16qi __attribute__ ((__vector_size__(16)));
/// This is a 2 element uint64_t vector used in SSE2 integer operations.
typedef long long v2di __attribute__ ((__vector_size__(16)));
/// A type to represent a list of strings.
typedef std::vector<vespalib::string> StringListT;
/// A type to represent a vector of 32 bit signed integers.
typedef std::vector<int32_t> Int32ListT;
/// A type to represent a list of document ids.
typedef std::vector<DocumentIdT> DocumentIdList;

/// A debug macro the does "a" when l & the mask is true. The mask is set per file.
#define DEBUG(l, a) { if (l&DEBUGMASK) {a;} }
#ifdef __USE_RAWDEBUG__
#define RAWDEBUG(a) a
#else
#define RAWDEBUG(a)
#endif
/// A macro avoid warnings for unused parameters.
#define UNUSED_PARAM(p)
/// A macro that gives you number of elements in an array.
#define NELEMS(a) (sizeof(a)/sizeof(a[0]))

Expand Down
Loading

0 comments on commit 31af4a6

Please sign in to comment.