NCBI C++ ToolKit
|
Search Toolkit Book for CPubseqGatewayCacheBlobProp
#include "psg_cache_blob_prop.hpp"
(Private to src/objtools/pubseq_gateway/cache
.)
Public Types | |
using | TBlobPropEnumerateFn = function< bool(int32_t, int64_t)> |
Public Member Functions | |
CPubseqGatewayCacheBlobProp (const string &file_name) | |
~CPubseqGatewayCacheBlobProp () override | |
void | Open (const set< int > &sat_ids) |
vector< CBlobRecord > | Fetch (CBlobFetchRequest const &request) |
vector< CBlobRecord > | FetchLast (CBlobFetchRequest const &request) |
void | EnumerateBlobProp (int32_t sat, TBlobPropEnumerateFn fn) |
![]() | |
CPubseqGatewayCacheBase (const string &file_name) | |
virtual | ~CPubseqGatewayCacheBase ()=default |
void | Open () |
void | UseReadAhead (bool value) |
Static Public Member Functions | |
static string | PackKey (int32_t sat_key) |
static string | PackKey (int32_t sat_key, int64_t last_modified) |
static bool | UnpackKey (const char *key, size_t key_sz, int64_t &last_modified) |
static bool | UnpackKey (const char *key, size_t key_sz, int64_t &last_modified, int32_t &sat_key) |
Private Member Functions | |
bool | x_ExtractRecord (CBlobRecord &record, lmdb::val const &value) const |
bool | x_CanOpenSatDatabase (int32_t sat, CLMDBReadOnlyTxn &rtxn) |
Private Attributes | |
vector< unique_ptr< lmdb::dbi, function< void(lmdb::dbi *)> > > | m_Dbis |
Additional Inherited Members | |
![]() | |
CLMDBReadOnlyTxn | BeginReadTxn () |
![]() | |
string | m_FileName |
unique_ptr< lmdb::env > | m_Env |
Definition at line 50 of file psg_cache_blob_prop.hpp.
using CPubseqGatewayCacheBlobProp::TBlobPropEnumerateFn = function<bool(int32_t, int64_t)> |
Definition at line 54 of file psg_cache_blob_prop.hpp.
Definition at line 60 of file psg_cache_blob_prop.cpp.
|
overridedefault |
void CPubseqGatewayCacheBlobProp::EnumerateBlobProp | ( | int32_t | sat, |
TBlobPropEnumerateFn | fn | ||
) |
Definition at line 250 of file psg_cache_blob_prop.cpp.
References CPubseqGatewayCacheBase::BeginReadTxn(), ncbi::grid::netcache::search::fields::key, kPackedKeySize, m_Dbis, CPubseqGatewayCacheBase::m_Env, MDB_FIRST, MDB_NEXT, lmdb::cursor::open(), UnpackKey(), and val.
vector< CBlobRecord > CPubseqGatewayCacheBlobProp::Fetch | ( | CBlobFetchRequest const & | request | ) |
Definition at line 162 of file psg_cache_blob_prop.cpp.
References CPubseqGatewayCacheBase::BeginReadTxn(), CBlobFetchRequest::eLastModified, CBlobFetchRequest::eSat, CBlobFetchRequest::eSatKey, CBlobFetchRequest::GetLastModified(), CBlobFetchRequest::GetSat(), CBlobFetchRequest::GetSatKey(), CBlobFetchRequest::HasField(), ncbi::grid::netcache::search::fields::key, kPackedKeySize, m_Dbis, CPubseqGatewayCacheBase::m_Env, MDB_GET_CURRENT, MDB_NEXT, MDB_SET_RANGE, lmdb::cursor::open(), PackKey(), UnpackKey(), val, and x_ExtractRecord().
vector< CBlobRecord > CPubseqGatewayCacheBlobProp::FetchLast | ( | CBlobFetchRequest const & | request | ) |
Definition at line 212 of file psg_cache_blob_prop.cpp.
References CPubseqGatewayCacheBase::BeginReadTxn(), CBlobFetchRequest::eSat, CBlobFetchRequest::GetSat(), CBlobFetchRequest::HasField(), ncbi::grid::netcache::search::fields::key, kPackedKeySize, m_Dbis, CPubseqGatewayCacheBase::m_Env, MDB_LAST, MDB_NEXT, lmdb::cursor::open(), UnpackKey(), val, and x_ExtractRecord().
Definition at line 67 of file psg_cache_blob_prop.cpp.
References CPubseqGatewayCacheBase::BeginReadTxn(), lmdb::dbi::close(), set< Key, Compare >::empty(), ERR_POST, m_Dbis, CPubseqGatewayCacheBase::m_Env, CPubseqGatewayCacheBase::Open(), lmdb::dbi::open(), lmdb::error::raise(), string, Warning(), lmdb::error::what(), and x_CanOpenSatDatabase().
Definition at line 274 of file psg_cache_blob_prop.cpp.
References kPackedSatKeySize, and CPubseqGatewayCachePackBytes::Pack().
Referenced by Fetch(), and CPubseqGatewayCache::PackBlobPropKey().
Definition at line 282 of file psg_cache_blob_prop.cpp.
References kPackedKeySize, kPackedLastModifiedSize, kPackedSatKeySize, and CPubseqGatewayCachePackBytes::Pack().
|
static |
Definition at line 292 of file psg_cache_blob_prop.cpp.
References ncbi::grid::netcache::search::fields::key, kPackedKeySize, kPackedLastModifiedSize, and CPubseqGatewayCacheUnpackBytes::Unpack().
Referenced by EnumerateBlobProp(), Fetch(), FetchLast(), and CPubseqGatewayCache::UnpackBlobPropKey().
|
static |
Definition at line 302 of file psg_cache_blob_prop.cpp.
References ncbi::grid::netcache::search::fields::key, kPackedKeySize, kPackedLastModifiedSize, kPackedSatKeySize, and CPubseqGatewayCacheUnpackBytes::Unpack().
|
private |
Definition at line 129 of file psg_cache_blob_prop.cpp.
References lmdb::dbi::close(), lmdb::error::code(), CPubseqGatewayCacheBase::m_Env, MDB_NOTFOUND, lmdb::dbi::open(), string, and rapidjson::value.
Referenced by Open().
|
private |
Definition at line 108 of file psg_cache_blob_prop.cpp.
References info, CBlobRecord::SetClass(), CBlobRecord::SetDateAsn1(), CBlobRecord::SetDiv(), CBlobRecord::SetFlags(), CBlobRecord::SetHupDate(), CBlobRecord::SetId2Info(), CBlobRecord::SetNChunks(), CBlobRecord::SetOwner(), CBlobRecord::SetSize(), CBlobRecord::SetSizeUnpacked(), CBlobRecord::SetUserName(), and rapidjson::value.
Referenced by Fetch(), and FetchLast().
|
private |
Definition at line 77 of file psg_cache_blob_prop.hpp.
Referenced by EnumerateBlobProp(), Fetch(), FetchLast(), and Open().