Skip to content

Commit

Permalink
add an INDEX_HASH_PREFIX before the index hash to avoid loading old c…
Browse files Browse the repository at this point in the history
…aches after cache-breaking code changes, change type for internal and qlever ID to size_t
  • Loading branch information
patrickbr committed Sep 25, 2024
1 parent a066bdf commit 6f9d807
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/qlever-petrimaps/GeomCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ using util::geo::DPoint;
using util::geo::FPoint;
using util::geo::latLngToWebMerc;

// change on each index-breaking change to the code base
const static std::string INDEX_HASH_PREFIX = "_1_";

// Different SPAQRL queries to obtain the WKT geometries from an endpoint.
// It depends on the endpoint which query is used, see `getQuery`.
//
Expand Down Expand Up @@ -1313,7 +1316,7 @@ std::string GeomCache::requestIndexHash() {
return "";
}

return response;
return INDEX_HASH_PREFIX + response;
} else {
LOG(ERROR) << "[GEOMCACHE] Failed to perform curl request for index hash.";
return "";
Expand Down
5 changes: 2 additions & 3 deletions src/qlever-petrimaps/Misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
#ifndef PETRIMAPS_MISC_H_
#define PETRIMAPS_MISC_H_

#define ID_TYPE uint32_t
// #define QLEVER_ID_TYPE size_t
#define QLEVER_ID_TYPE uint32_t
#define ID_TYPE size_t
#define QLEVER_ID_TYPE size_t

const static ID_TYPE I_OFFSET = 500000000;
const static size_t MAXROWS = 18446744073709551615u;
Expand Down

0 comments on commit 6f9d807

Please sign in to comment.