Removed most ancient references to Beagle in the code, replaced by WebQueue or such to clarify things. No real changes

This commit is contained in:
Jean-Francois Dockes
2018-05-31 15:51:58 +02:00
parent be3ac2e180
commit 9f94b9ed20
12 changed files with 118 additions and 114 deletions
+11 -9
View File
@@ -17,10 +17,11 @@
#include "autoconfig.h"
#include "webstore.h"
#include <stdint.h>
#include "cstr.h"
#include "beaglequeuecache.h"
#include "circache.h"
#include "log.h"
#include "rclconfig.h"
@@ -29,42 +30,43 @@
const string cstr_bgc_mimetype("mimetype");
BeagleQueueCache::BeagleQueueCache(RclConfig *cnf)
WebStore::WebStore(RclConfig *cnf)
{
string ccdir = cnf->getWebcacheDir();
int maxmbs = 40;
cnf->getConfParam("webcachemaxmbs", &maxmbs);
if ((m_cache = new CirCache(ccdir)) == 0) {
LOGERR("BeagleQueueCache: cant create CirCache object\n" );
LOGERR("WebStore: cant create CirCache object\n" );
return;
}
if (!m_cache->create(int64_t(maxmbs)*1000*1024, CirCache::CC_CRUNIQUE)) {
LOGERR("BeagleQueueCache: cache file creation failed: " << (m_cache->getReason()) << "\n" );
LOGERR("WebStore: cache file creation failed: " <<
m_cache->getReason() << "\n");
delete m_cache;
m_cache = 0;
return;
}
}
BeagleQueueCache::~BeagleQueueCache()
WebStore::~WebStore()
{
delete m_cache;
}
// Read document from cache. Return the metadata as an Rcl::Doc
// @param htt Beagle Hit Type
bool BeagleQueueCache::getFromCache(const string& udi, Rcl::Doc &dotdoc,
// @param htt Web Hit Type
bool WebStore::getFromCache(const string& udi, Rcl::Doc &dotdoc,
string& data, string *htt)
{
string dict;
if (m_cache == 0) {
LOGERR("BeagleQueueCache::getFromCache: cache is null\n" );
LOGERR("WebStore::getFromCache: cache is null\n");
return false;
}
if (!m_cache->get(udi, dict, &data)) {
LOGDEB("BeagleQueueCache::getFromCache: get failed\n" );
LOGDEB("WebStore::getFromCache: get failed\n");
return false;
}
+11 -11
View File
@@ -14,11 +14,10 @@
* Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _beaglequeuecache_h_included_
#define _beaglequeuecache_h_included_
#ifndef _webstore_h_included_
#define _webstore_h_included_
#include <string>
using std::string;
class RclConfig;
namespace Rcl {
@@ -28,23 +27,24 @@ namespace Rcl {
class CirCache;
/**
* Manage the CirCache for the Beagle Queue indexer. Separated from the main
* Manage the CirCache for the Web Queue indexer. Separated from the main
* indexer code because it's also used for querying (getting the data for a
* preview
*/
class BeagleQueueCache {
class WebStore {
public:
BeagleQueueCache(RclConfig *config);
~BeagleQueueCache();
WebStore(RclConfig *config);
~WebStore();
bool getFromCache(const string& udi, Rcl::Doc &doc, string& data,
string *hittype = 0);
bool getFromCache(const std::string& udi, Rcl::Doc &doc, std::string& data,
std::string *hittype = 0);
// We could write proxies for all the circache ops, but why bother?
CirCache *cc() {return m_cache;}
private:
CirCache *m_cache;
};
extern const string cstr_bgc_mimetype;
#endif /* _beaglequeuecache_h_included_ */
extern const std::string cstr_bgc_mimetype;
#endif /* _webstore_h_included_ */