59 static atomic<int> saved_load_trace_level{-1};
60 auto load_trace_level = saved_load_trace_level.load(memory_order_acquire);
61 if ( load_trace_level < 0 ) {
63 saved_load_trace_level.store(load_trace_level, memory_order_release);
65 return load_trace_level;
74 : m_State(kUnknownState),
104 swap(ref->GetData(), list);
107 ref->GetData() = list;
140 ret.
gi = it->GetGi();
155 if ( !it->IsGi() && it->GetSeqId()->GetTextseq_Id() ) {
173 const char* sep =
"( ";
174 const char* end =
"()";
190 : m_State(kUnknownState),
221 swap(ref->GetData(), list);
224 ref->GetData() = list;
253 for (
auto& blob_info :
Get() ) {
255 infos.push_back(blob_info);
264 const char* sep =
"( ";
265 const char* end =
"()";
267 out << sep << it->GetBlob_id();
288 : m_Blob_id(blob_id),
303 if ( common_mask == 0 ) {
372 const string& name = *it;
485 return GetData()->GetSplitInfo().GetChunk(chunk_id).IsLoaded();
492 if ( TParent::IsLoaded() ) {
528 out <<
id.m_TSE.GetBlobId().ToString();
544 out <<
id.m_Chunk.GetSplitInfo().GetBlobId().ToString()<<
"."<<
id.m_Chunk.GetChunkId();
562 const char* sep =
"Bioseq( ";
563 const char* end =
"Bioseq()";
565 out << sep << (*it2)->AsFastaString();
579 : m_AllowIncompleteLoading(
false)
587 : m_AllowIncompleteLoading(
false)
597 m_AllowIncompleteLoading(
false)
608 TParent::operator=(lock);
671 if ( tse_name.IsNamed() ) {
673 const_cast<CBlob_id*
>(blob_id)->SetTSEName(tse_name.GetName());
713 if ( TParent::IsLoaded() ) {
787 : GBL::CInfoRequestor(manager),
788 m_ReadDispatcher(dispatcher),
790 m_RequestedId(requested_id),
794 m_AllocatedConnection(0),
936 m_InProcessor(in_processor)
939 result.m_RecursiveTime = 0;
940 ++
result.m_RecursionLevel;
962 if ( rec_time > time ) {
967 return time - rec_time;
978 : m_CacheAcc(GetMainMutex(), gc_size),
979 m_CacheSeqIds(GetMainMutex(), gc_size),
980 m_CacheGi(GetMainMutex(), gc_size),
981 m_CacheLabel(GetMainMutex(), gc_size),
982 m_CacheTaxId(GetMainMutex(), gc_size),
983 m_CacheHash(GetMainMutex(), gc_size),
984 m_CacheLength(GetMainMutex(), gc_size),
985 m_CacheType(GetMainMutex(), gc_size),
986 m_CacheBlobIds(GetMainMutex(), gc_size),
987 m_CacheBlobState(GetMainMutex(), gc_size),
988 m_CacheBlobVersion(GetMainMutex(), gc_size),
989 m_CacheBlob(GetMainMutex(), 0)
1081 const TData& blob_ids)
1094 const TData& blob_ids,
1095 TExpirationTime expiration)
1180 SetLoaded(*
this,
id,
value, exp_type);
1194 LOG_POST(
Info<<
"GBLoader:SeqId("<<
id<<
") seq_ids = "<<ids.GetData());
1207 LOG_POST(
Info<<
"GBLoader:SeqId("<<
id<<
") blob_ids = "<<ids.GetData());
1241 if ( !lock.IsLoaded() ) {
1267 SetLoaded(*
this,
id,
value, exp_type);
1278 if ( acc_lock.IsLoaded() ) {
1281 return acc_lock.SetLoadedFor(ids_lock.GetData().FindAccVer(),
1282 ids_lock.GetExpirationTime());
1294 SetLoadedFor(*
this,
id,
data, ids.GetExpirationTime());
1307 LOG_POST(
Info<<
"GBLoader:SeqId("<<
id<<
") seq_ids = null");
1322 LOG_POST(
Info<<
"GBLoader:SeqId("<<
id<<
") blob_ids = null");
1333 if ( gi_lock.IsLoaded() ) {
1336 return gi_lock.SetLoadedFor(ids_lock.GetData().FindGi(),
1337 ids_lock.GetExpirationTime());
1349 SetLoadedFor(*
this,
id,
data, ids.GetExpirationTime());
1379 if ( !lock.IsLoaded() ) {
1405 SetLoaded(*
this,
id,
value, exp_type);
1416 if ( label_lock.IsLoaded() ) {
1419 return label_lock.SetLoadedFor(ids_lock.GetData().FindLabel(),
1420 ids_lock.GetExpirationTime());
1432 SetLoadedFor(*
this,
id,
label, ids.GetExpirationTime());
1472 const string&
value)
1479 SetLoaded(*
this,
id,
value, exp_type);
1527 SetLoaded(*
this,
id,
value, exp_type);
1575 SetLoaded(*
this,
id,
value, exp_type);
1623 SetLoaded(*
this,
id,
value, exp_type);
1671 SetLoaded(*
this,
id,
value, exp_type);
1729 SetLoaded(*
this,
key,
value, exp_type);
1743 key.second += it->first;
1744 if (
key.second ==
"SNP") {
1766 SetLoaded(*
this, blob_id,
state, exp_type);
1811 writer->SaveBlobState(*
this, blob_id, blob_state);
1824 SetLoaded(*
this, blob_id,
version, exp_type);
1833 if ( old_version < 0 ) {
1875 writer->SaveBlobVersion(*
this, blob_id,
version);
void AddNamedAnnotName(const string &name)
const TNamedAnnotNames & GetNamedAnnotNames(void) const
TNamedAnnotNames m_NamedAnnotNames
bool Matches(const SAnnotSelector *sel) const
void AddAnnotInfo(const CID2S_Seq_annot_Info &info)
void SetAnnotInfo(CRef< CBlob_Annot_Info > &annot_info)
const TContentsMask & GetContentsMask(void) const
const CConstRef< CBlob_Annot_Info > & GetAnnotInfo(void) const
const CConstRef< CBlob_id > & GetBlob_id(void) const
TBlobContentsMask TContentsMask
bool IsSetAnnotInfo(void) const
bool Matches(TContentsMask mask, const SAnnotSelector *sel) const
CConstRef< CBlob_Annot_Info > m_AnnotInfo
const string & GetTSEName() const
void SetState(TState state)
CFixedBlob_ids Filter(const SAnnotSelector *sel) const
vector< CBlob_Info > TList
const TList & Get(void) const
CConstRef< TObject > m_Ref
CDataLoader::SGiFound FindGi(void) const
vector< CSeq_id_Handle > TList
string FindLabel(void) const
void SetState(TState state)
CDataLoader::SAccVerFound FindAccVer(void) const
CConstRef< TObject > m_Ref
TCacheBlobState m_CacheBlobState
CGBInfoManager(size_t gc_size)
TCacheLength m_CacheLength
TCacheBlobIds m_CacheBlobIds
TCacheSeqIds m_CacheSeqIds
TCacheBlobVersion m_CacheBlobVersion
CGBInfoManager::TCacheAcc::TInfoLock TParent
GBL::EExpirationType GetExpType(void) const
CGBInfoManager::TCacheBlobIds::TInfoLock TParent
GBL::EExpirationType GetExpType(void) const
bool SetLoadedBlob_ids(const TData &data, TExpirationTime expiration_time)
CGBInfoManager::TCacheBlobState::TInfoLock TParent
GBL::EExpirationType GetExpType(void) const
CGBInfoManager::TCacheBlobVersion::TInfoLock TParent
GBL::EExpirationType GetExpType(void) const
CLoadLockBlobVersion(void)
CConstRef< CTSE_Chunk_Info > m_Chunk
TChunkId GetSelectedChunkId(void) const
CGBInfoManager::TBlobVersion TBlobVersion
void x_ObtainTSE_LoadLock(CReaderRequestResult &result)
void SelectChunk(TChunkId chunk_id)
CGBInfoManager::TCacheBlob::TInfoLock TParent
bool NeedsDelayedMainChunk(void) const
CLoadLockBlob(CReaderRequestResult &src, const CBlob_id &blob_id, TChunkId chunk_id=kMain_ChunkId)
bool IsLoadedChunk(void) const
CTSE_LoadLock m_TSE_LoadLock
const CTSE_Split_Info & GetSplitInfo(void) const
bool IsLoadedBlob(void) const
CGBInfoManager::TChunkId TChunkId
CTSE_LoadLock & GetTSE_LoadLock(void)
TBlobVersion GetKnownBlobVersion(void) const
bool IsLoadedGi(void) const
TExpirationTime GetExpirationTimeGi(void) const
CGBInfoManager::TCacheGi::TInfoLock TParent
static TGi GetGi(const TData &data)
GBL::EExpirationType GetExpType(void) const
CGBInfoManager::TCacheHash::TInfoLock TParent
GBL::EExpirationType GetExpType(void) const
CGBInfoManager::TCacheLabel::TInfoLock TParent
GBL::EExpirationType GetExpType(void) const
CGBInfoManager::TCacheLength::TInfoLock TParent
GBL::EExpirationType GetExpType(void) const
CGBInfoManager::TCacheSeqIds::TInfoLock TParent
TData GetSeq_ids(void) const
bool SetLoadedSeq_ids(const TData &data)
GBL::EExpirationType GetExpType(void) const
void SetSeq_entry(CSeq_entry &entry, CTSE_SetObjectInfo *set_info=0)
CLoadLockSetter(CLoadLockBlob &blob)
void x_ObtainTSE_LoadLock(CReaderRequestResult &result, const CBlob_id &blob_id)
void x_SelectChunk(TChunkId chunk_id)
bool m_AllowIncompleteLoading
AutoPtr< CInitGuard > m_ChunkLoadLock
CTSE_Split_Info & GetSplitInfo(void)
CTSE_LoadLock m_TSE_LoadLock
bool IsLoaded(void) const
CGBInfoManager::TBlobState TBlobState
void AllowIncompleteLoading()
CRef< CTSE_Chunk_Info > m_Chunk
CGBInfoManager::TChunkId TChunkId
void x_Init(CLoadLockBlob &blob, TChunkId chunk_id)
TBlobState GetBlobState(void) const
CGBInfoManager::TCacheBlob::TInfoLock TParent
GBL::EExpirationType GetExpType(void) const
CGBInfoManager::TCacheTaxId::TInfoLock TParent
CGBInfoManager::TCacheType::TInfoLock TParent
GBL::EExpirationType GetExpType(void) const
static bool IsExtAnnot(const TBlobId &blob_id)
CWriter * GetWriter(const CReaderRequestResult &result, CWriter::EType type) const
~CReaderRequestResultRecursion(void)
CReaderRequestResult & m_Result
double GetCurrentRequestTime(void) const
CReaderRequestResultRecursion(CReaderRequestResult &result, bool in_processor=false)
bool IsLoadedLength(const CSeq_id_Handle &id)
bool SetLoadedBlobIdsFromZeroGi(const CSeq_id_Handle &id, const SAnnotSelector *sel, const CLoadLockGi &gi_lock)
CGBInfoManager::TCacheGi::TInfoLock TInfoLockGi
TTSE_LockSet m_TSE_LockSet
bool MarkLoadingLength(const CSeq_id_Handle &id)
CGBInfoManager::TCacheBlobIds::TInfoLock TInfoLockBlobIds
bool IsLoadedBlobVersion(const TKeyBlob &blob_id)
bool SetLoadedLabel(const CSeq_id_Handle &id, const string &value)
bool IsLoadedBlobState(const TKeyBlob &blob_id)
virtual void GetLoadedBlob_ids(const CSeq_id_Handle &idh, TLoadedBlob_ids &blob_ids) const
virtual TExpirationTime GetIdExpirationTimeout(GBL::EExpirationType type) const
TInfoLockTaxId GetLoadLockTaxId(const CSeq_id_Handle &id)
bool MarkLoadingSeqIds(const CSeq_id_Handle &id)
bool SetLoadedSeqIds(const CSeq_id_Handle &id, const CFixedSeq_ids &value)
TInfoLockHash GetLoadLockHash(const CSeq_id_Handle &id)
void SaveLocksTo(TTSE_LockSet &locks)
CWriter * GetBlobWriter(void) const
CGBInfoManager::TSequenceLength TSequenceLength
TInfoLockType GetLoadedType(const CSeq_id_Handle &id)
bool SetLoadedGiFromSeqIds(const CSeq_id_Handle &id, const CLoadLockSeqIds &ids_lock)
bool MarkLoadingLabel(const CSeq_id_Handle &id)
CGBInfoManager::TCacheLength::TInfoLock TInfoLockLength
bool IsLoadedTaxId(const CSeq_id_Handle &id)
bool MarkLoadingHash(const CSeq_id_Handle &id)
virtual ~CReaderRequestResult(void)
TInfoLockBlobIds GetLoadLockBlobIds(const CSeq_id_Handle &id, const SAnnotSelector *sel)
TInfoLockAcc GetLoadLockAcc(const CSeq_id_Handle &id)
bool SetLoadedBlobState(const TKeyBlob &blob_id, TBlobState state)
CReadDispatcher & m_ReadDispatcher
CGBInfoManager::TTaxId TTaxId
CGBInfoManager & GetGBInfoManager(void)
bool IsLoadedAcc(const CSeq_id_Handle &id)
bool SetLoadedAccFromSeqIds(const CSeq_id_Handle &id, const CLoadLockSeqIds &ids_lock)
CSeq_id_Handle m_RequestedId
bool SetLoadedAcc(const CSeq_id_Handle &id, const TSequenceAcc &value)
bool MarkLoadingGi(const CSeq_id_Handle &id)
CGBInfoManager::TCacheBlobState::TInfoLock TInfoLockBlobState
CGBInfoManager::TBlobState TBlobState
TExpirationTime GetNewIdExpirationTime(GBL::EExpirationType type) const
bool SetLoadedBlobIds(const CSeq_id_Handle &id, const SAnnotSelector *sel, const CLoadLockBlobIds &ids)
TInfoLockBlobIds GetLoadedBlobIds(const CSeq_id_Handle &id, const SAnnotSelector *sel)
CGBInfoManager::TCacheLabel::TInfoLock TInfoLockLabel
void x_AddTSE_LoadLock(const CTSE_LoadLock &lock)
CTSE_LoadLock GetBlobLoadLock(const TKeyBlob &blob_id)
bool SetLoadedHash(const CSeq_id_Handle &id, const TSequenceHash &value)
virtual bool GetAddWGSMasterDescr(void) const
CGBInfoManager::TBlobVersion TBlobVersion
void SetAndSaveBlobVersion(const TKeyBlob &blob_id, TBlobVersion version)
TInfoLockBlob GetLoadLockBlob(const TKeyBlob &blob_id)
TInfoLockLabel GetLoadLockLabel(const CSeq_id_Handle &id)
bool SetLoadedSeqIdsFromZeroGi(const CSeq_id_Handle &id, const CLoadLockGi &gi_lock)
bool IsLoadedSeqIds(const CSeq_id_Handle &id)
TInfoLockLabel GetLoadedLabel(const CSeq_id_Handle &id)
TInfoLockGi GetLoadLockGi(const CSeq_id_Handle &id)
CGBInfoManager::TCacheSeqIds::TInfoLock TInfoLockIds
CGBInfoManager::TCacheType::TInfoLock TInfoLockType
CReaderAllocatedConnection * m_AllocatedConnection
vector< CBlob_id > TLoadedBlob_ids
bool UpdateGiFromSeqIds(TInfoLockGi &gi_lock, const TInfoLockIds &ids_lock)
bool MarkLoadingType(const CSeq_id_Handle &id)
bool UpdateAccFromSeqIds(TInfoLockAcc &acc_lock, const TInfoLockIds &ids_lock)
bool SetLoadedLabelFromSeqIds(const CSeq_id_Handle &id, const CLoadLockSeqIds &ids_lock)
CGBInfoManager::TCacheHash::TInfoLock TInfoLockHash
TInfoLockAcc GetLoadedAcc(const CSeq_id_Handle &id)
TExpirationTime GetRequestTime(void) const
bool UpdateLabelFromSeqIds(TInfoLockLabel &label_lock, const TInfoLockIds &ids_lock)
bool SetLoadedType(const CSeq_id_Handle &id, const TSequenceType &value)
TInfoLockLength GetLoadLockLength(const CSeq_id_Handle &id)
TInfoLockType GetLoadLockType(const CSeq_id_Handle &id)
CGBInfoManager::TCacheTaxId::TInfoLock TInfoLockTaxId
TInfoLockBlobVersion GetLoadedBlobVersion(const TKeyBlob &blob_id)
TInfoLockLength GetLoadedLength(const CSeq_id_Handle &id)
CGBInfoManager::TCacheAcc::TInfoLock TInfoLockAcc
bool SetLoadedTaxId(const CSeq_id_Handle &id, const TTaxId &value)
TInfoLockIds GetLoadLockSeqIds(const CSeq_id_Handle &id)
CReaderRequestResult(const CSeq_id_Handle &requested_id, CReadDispatcher &dispatcher, CGBInfoManager &manager)
bool SetLoadedBlobVersion(const TKeyBlob &blob_id, TBlobVersion version)
bool SetNoBlob(const TKeyBlob &blob_id, TBlobState blob_state)
void SetAndSaveBlobState(const TKeyBlob &blob_id, TBlobState state)
bool MarkLoadingTaxId(const CSeq_id_Handle &id)
TInfoLockGi GetLoadedGi(const CSeq_id_Handle &id)
bool IsLoadedGi(const CSeq_id_Handle &id)
CGBInfoManager::TCacheBlobVersion::TInfoLock TInfoLockBlobVersion
static TKeyBlob_ids s_KeyBlobIds(const CSeq_id_Handle &id, const SAnnotSelector *sel)
void ReleaseNotLoadedBlobs(void)
bool IsLoadedType(const CSeq_id_Handle &id)
CGBInfoManager::TCacheBlob::TInfoLock TInfoLockBlob
TInfoLockHash GetLoadedHash(const CSeq_id_Handle &id)
void SetRequestedId(const CSeq_id_Handle &requested_id)
TExpirationTime GetStartTime(void) const
virtual EGBErrorAction GetPTISErrorAction(void) const
TInfoLockBlob GetLoadedBlob(const TKeyBlob &blob_id)
bool SetLoadedGi(const CSeq_id_Handle &id, const TSequenceGi &value)
GBL::CInfo_Base::TExpirationTime TExpirationTime
bool IsLoadedHash(const CSeq_id_Handle &id)
bool MarkLoadingBlobIds(const CSeq_id_Handle &id, const SAnnotSelector *sel)
pair< CSeq_id_Handle, string > TKeyBlob_ids
TInfoLockBlobState GetLoadLockBlobState(const TKeyBlob &blob_id)
virtual CGBDataLoader * GetLoaderPtr(void)
TInfoLockBlobVersion GetLoadLockBlobVersion(const TKeyBlob &blob_id)
bool SetLoadedLength(const CSeq_id_Handle &id, const TSequenceLength &value)
bool IsLoadedLabel(const CSeq_id_Handle &id)
CWriter * GetIdWriter(void) const
TInfoLockIds GetLoadedSeqIds(const CSeq_id_Handle &id)
TInfoLockTaxId GetLoadedTaxId(const CSeq_id_Handle &id)
TInfoLockBlobState GetLoadedBlobState(const TKeyBlob &blob_id)
TExpirationTime GetNewExpirationTime(GBL::EExpirationType type) const
bool IsLoadedBlobIds(const CSeq_id_Handle &id, const SAnnotSelector *sel)
bool MarkLoadingAcc(const CSeq_id_Handle &id)
void SetLoaded(CObject *obj=0)
void x_LoadSeq_entry(CSeq_entry &entry, CTSE_SetObjectInfo *set_info=0)
TChunkId GetChunkId(void) const
CInitGuard * GetLoadInitGuard(void)
bool IsLoaded(void) const
TBlobVersion GetBlobVersion(void) const
TBlobState GetBlobState(void) const
void SetBlobState(TBlobState state)
void SetName(const CAnnotName &name)
const TBlobId & GetBlobId(void) const
const CAnnotName & GetName(void) const
CTSE_Split_Info & GetSplitInfo(void)
bool x_NeedsDelayedMainChunk(void) const
void SetSeq_entry(CSeq_entry &entry, CTSE_SetObjectInfo *set_info=0)
void SetBlobVersion(TBlobVersion version)
bool IsLoaded(void) const
CTSE_Chunk_Info & GetChunk(TChunkId chunk_id)
Template class for iteration on objects of class C (non-medifiable version)
iterator_bool insert(const value_type &val)
std::ofstream out("events_result.xml")
main entry point for tests
void reset(element_type *p=0, EOwnership ownership=eTakeOwnership)
Reset will delete the old pointer (if owned), set content to the new value, and assume the ownership ...
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
element_type * get(void) const
Get pointer.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
@ eTakeOwnership
An object can take ownership of another.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Warning(CExceptionArgs_Base &args)
void Info(CExceptionArgs_Base &args)
static const char * GetSNPScaleLimit_Name(ESNPScaleLimit value)
string GetLabel(const CSeq_id &id)
CBeginInfo Begin(C &obj)
Get starting point of object hierarchy.
bool IsIncludedAnyNamedAnnotAccession(void) const
check if any named annot accession is included in the search
bool IsIncludedNamedAnnotAccession(const string &acc) const
check if named annot accession is included in the search
TSNPScaleLimit GetSNPScaleLimit(void) const
const TNamedAnnotAccessions & GetNamedAnnotAccessions(void) const
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
#define NCBI_PARAM_TYPE(section, name)
Generate typename for a parameter from its {section, name} attributes.
@ eParam_NoThread
Do not use per-thread values.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
double Elapsed(void) const
Return time elapsed since first Start() or last Restart() call (in seconds).
ENcbiOwnership
Ownership relations between objects.
static const char label[]
@ e_Gi
GenInfo Integrated Database.
const TId & GetId(void) const
Get the Id member data.
list< CRef< CSeq_id > > TId
constexpr bool empty(list< Ts... >) noexcept
const string version
version string
const struct ncbi::grid::netcache::search::fields::KEY key
const GenericPointer< typename T::ValueType > T2 value
Multi-threading – classes, functions, and features.
static const CReaderRequestResult::TBlobVersion kBlobVersionNotSet
static CReaderRequestResult::TExpirationTime sx_GetCurrentTime(void)
static int s_GetLoadTraceLevel(void)
CNcbiOstream & operator<<(CNcbiOstream &out, const CFixedSeq_ids &ids)
NCBI_PARAM_DECL(int, GENBANK, TRACE_LOAD)
NCBI_PARAM_DEF_EX(int, GENBANK, TRACE_LOAD, 0, eParam_NoThread, GENBANK_TRACE_LOAD)
Better replacement of GetAccVer(), this method should be defined in data loaders, GetAccVer() is left...
Better replacement of GetGi(), this method should be defined in data loaders, GetGi() is left for com...
Better replacement of GetSequenceHash(), this method should be defined in data loaders,...
Better replacement of GetSequenceType(), this method should be defined in data loaders,...
SBlobId(const CTSE_Info &tse)
SChunkId(const CTSE_Chunk_Info &chunk)
const CTSE_Chunk_Info & m_Chunk
const CSeq_entry & m_Entry
SSeqIds(const CSeq_entry &entry)