From 7d14f5c3310f5380ca14391e79bd1fc214d5f5c9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 21 Apr 2016 17:53:47 +0200 Subject: Implement S3BinaryCacheStore::queryAllValidPaths() This allows commands like "nix verify --all" or "nix path-info --all" to work on S3 caches. Unfortunately, this requires some ugly hackery: when querying the contents of the bucket, we don't want to have to read every .narinfo file. But the S3 bucket keys only include the hash part of each store path, not the name part. So as a special exception queryAllValidPaths() can now return store paths *without* the name part, and queryPathInfo() accepts such store paths (returning a ValidPathInfo object containing the full name). --- src/libstore/nar-info-disk-cache.hh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libstore/nar-info-disk-cache.hh') diff --git a/src/libstore/nar-info-disk-cache.hh b/src/libstore/nar-info-disk-cache.hh index ee1aafc63a5d..f4e3fbbdcbdc 100644 --- a/src/libstore/nar-info-disk-cache.hh +++ b/src/libstore/nar-info-disk-cache.hh @@ -15,10 +15,11 @@ public: virtual bool cacheExists(const std::string & uri) = 0; virtual std::pair> lookupNarInfo( - const std::string & uri, const Path & storePath) = 0; + const std::string & uri, const std::string & hashPart) = 0; virtual void upsertNarInfo( - const std::string & uri, std::shared_ptr narInfo) = 0; + const std::string & uri, const std::string & hashPart, + std::shared_ptr info) = 0; }; /* Return a singleton cache object that can be used concurrently by -- cgit 1.4.1