62 error_list.pop_front();
65 error_list.emplace_back(
error);
75 if (!response.empty()) {
76 auto& latest_record = response[0];
79 for (
auto const & seq_id : record.
GetSeqIds()) {
80 seq_id_types.
insert(get<0>(seq_id));
82 for (
auto const & seq_id : latest_record.GetSeqIds()) {
83 if (seq_id_types.count(get<0>(seq_id)) == 0) {
101 const string& bioseq_info_file_name,
102 const string& si2csi_file_name,
103 const string& blob_prop_file_name
105 : m_BioseqInfoPath(bioseq_info_file_name)
106 , m_Si2CsiPath(si2csi_file_name)
107 , m_BlobPropPath(blob_prop_file_name)
124 << e.
what() <<
", bioseq_info cache will not be used.";
136 s <<
"Failed to open '" <<
m_Si2CsiPath <<
"' cache: " << e.
what() <<
", si2csi cache will not be used.";
149 <<
"' cache: " << e.
what() <<
", blob prop cache will not be used.";
166 for (
auto & record : response) {
178 for (
auto & record : response) {
251 const char*
key,
size_t key_sz,
string& accession,
int&
version,
int& seq_id_type,
int64_t& gi)
#define BEGIN_IDBLOB_SCOPE
CBioseqInfoFetchRequest & SetSeqIdType(CBioseqInfoRecord::TSeqIdType value)
bool HasField(EFields field) const
CBioseqInfoFetchRequest & SetAccession(CBioseqInfoRecord::TAccession const &value)
TSeqIdType GetSeqIdType() const
TAccession const & GetAccession() const
vector< CBioseqInfoRecord > Fetch(CBioseqInfoFetchRequest const &request)
static string PackKey(const string &accession, int version)
static bool UnpackKey(const char *key, size_t key_sz, int &version, int &seq_id_type, int64_t &gi)
static bool UnpackKey(const char *key, size_t key_sz, int64_t &last_modified)
static string PackKey(int32_t sat_key)
static string PackKey(const string &sec_seqid, int sec_seq_id_type)
static bool UnpackKey(const char *key, size_t key_sz, int &sec_seq_id_type)
TBioseqInfoResponse FetchBioseqInfo(TBioseqInfoRequest const &request)
TBioseqInfoResponse FetchBioseqInfoLast()
static bool UnpackBlobPropKey(const char *key, size_t key_sz, int64_t &last_modified)
unique_ptr< CPubseqGatewayCacheBlobProp > m_BlobPropCache
static bool UnpackSiKey(const char *key, size_t key_sz, int &sec_seq_id_type)
vector< CBlobRecord > TBlobPropResponse
TSi2CsiResponse FetchSi2CsiLast()
TBlobPropResponse FetchBlobPropLast(TBlobPropRequest const &request)
TRuntimeErrorList m_RuntimeErrors
vector< CBioseqInfoRecord > TBioseqInfoResponse
static string PackSiKey(const string &sec_seqid, int sec_seq_id_type)
void Open(const set< int > &sat_ids)
void EnumerateBlobProp(int32_t sat, TBlobPropEnumerateFn fn)
vector< CSI2CSIRecord > TSi2CsiResponse
virtual ~CPubseqGatewayCache()
static string PackBlobPropKey(int32_t sat_key)
function< bool(int32_t, int64_t)> TBlobPropEnumerateFn
unique_ptr< CPubseqGatewayCacheBioseqInfo > m_BioseqInfoCache
static bool UnpackBioseqInfoKey(const char *key, size_t key_sz, int &version, int &seq_id_type, int64_t &gi)
TSi2CsiResponse FetchSi2Csi(CSi2CsiFetchRequest const &request)
static string PackBioseqInfoKey(const string &accession, int version)
unique_ptr< CPubseqGatewayCacheSi2Csi > m_Si2CsiCache
TBlobPropResponse FetchBlobProp(TBlobPropRequest const &request)
static const size_t kRuntimeErrorLimit
bool HasField(EFields field) const
Base class for LMDB exception conditions.
virtual const char * what() const noexcept
Returns the underlying LMDB error code.
iterator_bool insert(const value_type &val)
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
void Warning(CExceptionArgs_Base &args)
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_SCOPE(ns)
Define a new scope.
const struct ncbi::grid::netcache::search::fields::KEY key
void sAddRuntimeError(CPubseqGatewayCache::TRuntimeErrorList &error_list, CPubseqGatewayCache::TRuntimeError error)
void ApplyInheritedSeqIds(CPubseqGatewayCacheBioseqInfo *cache, CBioseqInfoRecord &record)