1 #ifndef UTIL___ICACHE__REF__HPP
2 #define UTIL___ICACHE__REF__HPP
84 const string& hashed_content,
85 const string& ref_value);
92 const string& hashed_content);
107 const string& hashed_content);
132 const string& hashed_content,
140 const string& hashed_content);
145 string* hashed_content);
150 const string& hashed_content);
170 m_HashContentSubKey(
"CONTENT"),
171 m_RefValueSubKey(
"REF")
176 const string& hashed_content,
177 const string& ref_value)
183 const void*
data = hashed_content.c_str();
188 hashed_content.length());
189 data = ref_value.c_str();
201 const string& hashed_content)
203 const void*
data = hashed_content.c_str();
208 hashed_content.length());
228 const string& hashed_content)
231 const void*
data = hashed_content.c_str();
236 hashed_content.length());
242 string* hashed_content)
245 const size_t buf_size = 4 * 1024;
254 if (blob_access.
reader.get()) {
258 if (hashed_content) {
259 hashed_content->resize(0);
260 hashed_content->append(blob_access.
buf, blob_access.
buf_size);
271 const size_t buf_size = 4 * 1024;
272 char key_buf[buf_size];
307 const string& hashed_content,
315 const size_t buf_size = 4 * 1024;
327 if (blob_access.
reader.get()) {
332 ref_value->resize(0);
333 ref_value->append(blob_access.
buf, blob_access.
buf_size);
342 const string& hashed_content)
354 const string& hashed_content)
356 const size_t buf_size = 4 * 1024;
367 if (blob_access.
reader.get()) {
373 if (hashed_content.length() != blob_access.
blob_size) {
376 int cmp = memcmp(blob_access.
buf,
377 hashed_content.c_str(),
const string m_HashContentSubKey
CCacheHashedContent(ICache &cache)
CCacheHashedContent(const CCacheHashedContent &)
bool GetHashedContent(const string &hash_str, const string &hashed_content, string *ref_value)
Get hashed content Method compares both hash value and hashed content.
CCacheHashedContent & operator=(const CCacheHashedContent &)
bool GetMediatorKeyContent(const string &hash_str, const string &key, string *hashed_content)
Read hash content by mediator key.
IWriter * StoreHashedContentByMediator(const string &hash_str, const string &key)
Store hashed content defined by mediator key.
void StoreHashedContent(const string &hash_str, const string &hashed_content, const string &ref_value)
Store hashed content.
bool x_CheckHashContent(const string &hash_str, const string &hashed_content)
Returns TRUE if hash verification is successfull.
const string m_RefValueSubKey
void StoreMediatorKeyContent(const string &hash_str, const string &key, const string &hashed_content)
Store hashed content into intermidiate slot defined by hash + application key(mediator).
BLOB cache read/write/maintenance interface.
virtual void Remove(const string &key, TBlobVersion version, const string &subkey)=0
Remove specific cache entry.
virtual IWriter * GetWriteStream(const string &key, TBlobVersion version, const string &subkey, unsigned int time_to_live=0, const string &owner=kEmptyStr)=0
Return sequential stream interface to write BLOB data.
virtual void GetBlobAccess(const string &key, TBlobVersion version, const string &subkey, SBlobAccessDescr *blob_descr)=0
Get BLOB access using BlobAccessDescr.
virtual void Store(const string &key, TBlobVersion version, const string &subkey, const void *data, size_t size, unsigned int time_to_live=0, const string &owner=kEmptyStr)=0
Add or replace BLOB.
virtual IReader * GetReadStream(const string &key, TBlobVersion version, const string &subkey)=0
Return sequential stream interface to read BLOB data.
A very basic data-read interface.
A very basic data-write interface.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Interfaces for a local cache of versioned binary large objects (BLOBS).
const struct ncbi::grid::netcache::search::fields::KEY key
unique_ptr< IReader > reader