Skip to content

Commit

Permalink
Some additional fixes and comments.
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Kalmbach <[email protected]>
  • Loading branch information
joka921 committed Feb 5, 2025
1 parent 3e7f494 commit 825f8bf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
3 changes: 0 additions & 3 deletions src/global/Pattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,6 @@ struct CompactStringVectorWriter {
commonInitialization();
}

CompactStringVectorWriter(CompactStringVectorWriter&&) = default;
CompactStringVectorWriter& operator=(CompactStringVectorWriter&&) = default;

void push(const data_type* data, size_t elementSize) {
AD_CONTRACT_CHECK(!_finished);
_offsets.push_back(_nextOffset);
Expand Down
9 changes: 4 additions & 5 deletions src/index/IndexBuilderMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ int main(int argc, char** argv) {
std::optional<ad_utility::MemorySize> stxxlMemory;
std::optional<ad_utility::MemorySize> parserBufferSize;
std::optional<ad_utility::VocabularyType> vocabType;
// VocabularyEnum vocabType;
optind = 1;

Index index{ad_utility::makeUnlimitedAllocator<Id>()};
Expand Down Expand Up @@ -228,8 +227,9 @@ int main(int argc, char** argv) {
"Only build the PSO and POS permutations. This is faster, but then "
"queries with predicate variables are not supported");
add("vocabulary-type", po::value(&vocabType),
"The vocabulary implementation for strings in qlever, can be any of ... "
"(TODO joka)");
absl::StrCat(
"The vocabulary implementation for strings in qlever, can be any of ",
ad_utility::VocabularyType::getListOfSupportedValues()));

// Options for the index building process.
add("stxxl-memory,m", po::value(&stxxlMemory),
Expand Down Expand Up @@ -262,11 +262,10 @@ int main(int argc, char** argv) {
if (parserBufferSize.has_value()) {
index.parserBufferSize() = parserBufferSize.value();
}
/*

if (vocabType.has_value()) {
index.getImpl().setVocabularyTypeForIndexBuilding(vocabType.value());
}
*/

// If no text index name was specified, take the part of the wordsfile after
// the last slash.
Expand Down
2 changes: 0 additions & 2 deletions src/index/IndexImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1133,8 +1133,6 @@ void IndexImpl::readConfiguration() {
loadDataMember("num-triples", numTriples_, NumNormalAndInternal{});
loadDataMember("num-non-literals-text-index", nofNonLiteralsInTextIndex_, 0);

// TODO<joka921> Comment and also write the configuration.
// The default value is the one the used to be the only.
ad_utility::VocabularyType vocabType(
ad_utility::VocabularyType::Enum::CompressedOnDisk);
loadDataMember("vocabulary-type", vocabType, vocabType);
Expand Down
2 changes: 2 additions & 0 deletions src/index/IndexImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ class IndexImpl {
std::optional<Id> idOfHasPatternDuringIndexBuilding_;
std::optional<Id> idOfInternalGraphDuringIndexBuilding_;

// The vocabulary type that is used (only relevant during index building).
// The default is chosen s.t. the compatibility to old index builds.
ad_utility::VocabularyType vocabularyTypeForIndexBuilding_{
ad_utility::VocabularyType::Enum::CompressedOnDisk};

Expand Down
7 changes: 5 additions & 2 deletions src/index/vocabulary/VocabularyType.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ class VocabularyType {
absl::StrCat("\"", description,
"\" is not a valid vocabulary type. The currently "
"supported vocabulary types are ",
absl::StrJoin(descriptions, ", "))};
;
getListOfSupportedValues())};
}
return VocabularyType{static_cast<Enum>(it - descriptions.begin())};
}

static std::string getListOfSupportedValues() {
return absl::StrJoin(descriptions, ", ");
}
std::string_view toString() const {
return descriptions.at(static_cast<size_t>(value_));
}
Expand Down

0 comments on commit 825f8bf

Please sign in to comment.