NCBI C++ ToolKit
request_result.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: request_result.cpp 102225 2024-04-09 17:26:05Z vasilche $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government have not placed any restriction on its use or reproduction.
13 *
14 * Although all reasonable efforts have been taken to ensure the accuracy
15 * and reliability of the software and data, the NLM and the U.S.
16 * Government do not and cannot warrant the performance or results that
17 * may be obtained by using this software or data. The NLM and the U.S.
18 * Government disclaim all warranties, express or implied, including
19 * warranties of performance, merchantability or fitness for any particular
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * Author: Eugene Vasilchenko
27 *
28 * File Description: GenBank Data loader
29 *
30 */
31 
32 #include <ncbi_pch.hpp>
38 #include <objmgr/impl/tse_info.hpp>
41 #include <corelib/ncbithr.hpp>
42 #include <serial/iterator.hpp>
43 
46 
47 using namespace GBL;
48 
50 
51 NCBI_PARAM_DECL(int, GENBANK, TRACE_LOAD);
52 NCBI_PARAM_DEF_EX(int, GENBANK, TRACE_LOAD, 0,
53  eParam_NoThread, GENBANK_TRACE_LOAD);
54 
55 
56 static
58 {
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 ) {
62  load_trace_level = NCBI_PARAM_TYPE(GENBANK, TRACE_LOAD)::GetDefault();
63  saved_load_trace_level.store(load_trace_level, memory_order_release);
64  }
65  return load_trace_level;
66 }
67 
68 
69 /////////////////////////////////////////////////////////////////////////////
70 // CFixedSeq_ids
71 /////////////////////////////////////////////////////////////////////////////
72 
74  : m_State(kUnknownState),
75  m_Ref(new TObject)
76 {
77 }
78 
79 
81  : m_State(state),
82  m_Ref(new TObject)
83 {
84  SetNotFound();
85 }
86 
87 
89  : m_State(state),
90  m_Ref(new TObject(list))
91 {
92  if ( empty() ) {
93  SetNotFound();
94  }
95 }
96 
97 
99  TState state)
100  : m_State(state)
101 {
102  CRef<TObject> ref(new TObject);
103  if ( ownership == eTakeOwnership ) {
104  swap(ref->GetData(), list);
105  }
106  else {
107  ref->GetData() = list;
108  }
109  m_Ref = ref;
110  if ( empty() ) {
111  SetNotFound();
112  }
113 }
114 
115 
117 {
118  m_State = state;
119 }
120 
121 
123 {
124  if ( m_State == kUnknownState ) {
125  m_State = 0;
126  }
127  m_State |=
130 }
131 
132 
134 {
136  if ( IsFound() ) {
137  ret.sequence_found = true;
138  ITERATE ( CFixedSeq_ids, it, *this ) {
139  if ( it->Which() == CSeq_id::e_Gi ) {
140  ret.gi = it->GetGi();
141  break;
142  }
143  }
144  }
145  return ret;
146 }
147 
148 
150 {
152  if ( IsFound() ) {
153  ret.sequence_found = true;
154  ITERATE ( CFixedSeq_ids, it, *this ) {
155  if ( !it->IsGi() && it->GetSeqId()->GetTextseq_Id() ) {
156  ret.acc_ver = *it;
157  break;
158  }
159  }
160  }
161  return ret;
162 }
163 
164 
165 string CFixedSeq_ids::FindLabel(void) const
166 {
167  return IsFound()? objects::GetLabel(*this): string();
168 }
169 
170 
172 {
173  const char* sep = "( ";
174  const char* end = "()";
175  ITERATE ( CFixedSeq_ids, it, ids ) {
176  out << sep << *it;
177  sep = ", ";
178  end = " )";
179  }
180  out << end;
181  return out;
182 }
183 
184 
185 /////////////////////////////////////////////////////////////////////////////
186 // CFixedBlob_ids
187 /////////////////////////////////////////////////////////////////////////////
188 
190  : m_State(kUnknownState),
191  m_Ref(new TObject)
192 {
193 }
194 
195 
197  : m_State(state),
198  m_Ref(new TObject)
199 {
200  SetNotFound();
201 }
202 
203 
205  TState state)
206  : m_State(state),
207  m_Ref(new TObject(list))
208 {
209  if ( empty() ) {
210  SetNotFound();
211  }
212 }
213 
214 
216  TState state)
217  : m_State(state)
218 {
219  CRef<TObject> ref(new TObject);
220  if ( ownership == eTakeOwnership ) {
221  swap(ref->GetData(), list);
222  }
223  else {
224  ref->GetData() = list;
225  }
226  m_Ref = ref;
227  if ( empty() ) {
228  SetNotFound();
229  }
230 }
231 
232 
234 {
235  m_State = state;
236 }
237 
238 
240 {
241  if ( m_State == kUnknownState ) {
242  m_State = 0;
243  }
244  m_State |=
247 }
248 
249 
251 {
252  TList infos;
253  for ( auto& blob_info : Get() ) {
254  if ( blob_info.Matches(fBlobHasExtAnnot|fBlobHasNamedAnnot, sel) ) {
255  infos.push_back(blob_info);
256  }
257  }
258  return CFixedBlob_ids(eTakeOwnership, infos);
259 }
260 
261 
263 {
264  const char* sep = "( ";
265  const char* end = "()";
266  ITERATE ( CFixedBlob_ids, it, ids ) {
267  out << sep << it->GetBlob_id();
268  sep = ", ";
269  end = " )";
270  }
271  out << end;
272  return out;
273 }
274 
275 
276 /////////////////////////////////////////////////////////////////////////////
277 // CBlob_Info
278 /////////////////////////////////////////////////////////////////////////////
279 
280 
282  : m_Contents(0)
283 {
284 }
285 
286 
288  : m_Blob_id(blob_id),
289  m_Contents(contents)
290 {
291 }
292 
293 
295 {
296 }
297 
298 
300  const SAnnotSelector* sel) const
301 {
302  TContentsMask common_mask = GetContentsMask() & mask;
303  if ( common_mask == 0 ) {
304  return false;
305  }
306 
308  // not named accession, but external annots
309  return true;
310  }
311 
312  if ( (common_mask & ~(fBlobHasExtAnnot|fBlobHasNamedAnnot)) != 0 ) {
313  // not only features;
314  return true;
315  }
316 
317  // only features
318 
319  if ( !IsSetAnnotInfo() ) {
320  // no known annot info -> assume matching
321  return true;
322  }
323  else {
324  return GetAnnotInfo()->Matches(sel);
325  }
326 }
327 
328 
330 {
332  m_AnnotInfo = annot_info;
333 }
334 
335 
336 /////////////////////////////////////////////////////////////////////////////
337 // CBlob_Annot_Info
338 /////////////////////////////////////////////////////////////////////////////
339 
340 
341 void CBlob_Annot_Info::AddNamedAnnotName(const string& name)
342 {
344 }
345 
346 
348 {
349  m_AnnotInfo.push_back(ConstRef(&info));
350 }
351 
352 
354 {
355  if ( GetNamedAnnotNames().empty() ) {
356  // no filtering by name
357  return true;
358  }
359 
360  if ( !sel || !sel->IsIncludedAnyNamedAnnotAccession() ) {
361  // no names included
362  return false;
363  }
364 
365  if ( sel->IsIncludedNamedAnnotAccession("NA*") ) {
366  // all accessions are included
367  return true;
368  }
369 
370  // annot filtering by name
372  const string& name = *it;
373  if ( !NStr::StartsWith(name, "NA") ) {
374  // not named accession
375  return true;
376  }
377  if ( sel->IsIncludedNamedAnnotAccession(name) ) {
378  // matches
379  return true;
380  }
381  }
382  // no match by name found
383  return false;
384 }
385 
386 
387 /////////////////////////////////////////////////////////////////////////////
388 // CLoadLockBlob
389 /////////////////////////////////////////////////////////////////////////////
390 
391 
393  const CBlob_id& blob_id,
394  TChunkId chunk_id)
395  : TParent(result.GetLoadLockBlob(blob_id)),
396  m_Blob_id(blob_id)
397 {
399  if ( chunk_id != kMain_ChunkId ) {
400  SelectChunk(chunk_id);
401  }
402 }
403 
404 
406 {
407 }
408 
409 
411 {
412  if ( !m_TSE_LoadLock ) {
414  dynamic_cast<CReaderRequestResult&>(GetRequestor());
418  }
419  return m_TSE_LoadLock;
420 }
421 
422 
424 {
425  if ( !m_TSE_LoadLock ) {
426  return kBlobVersionNotSet;
427  }
428  return m_TSE_LoadLock->GetBlobVersion();
429 }
430 
431 
433 {
435  return m_TSE_LoadLock->GetSplitInfo();
436 }
437 
438 
440 {
442 }
443 
444 
446 {
447  if ( chunk_id == kMain_ChunkId ) {
448  m_Chunk = null;
449  }
450  else {
452  m_Chunk = &GetSplitInfo().GetChunk(chunk_id);
453  _ASSERT(m_Chunk && m_Chunk->GetChunkId() == chunk_id);
454  }
455 }
456 
457 
459 {
461 }
462 
463 
465 {
466  if ( !m_Chunk ) {
467  return IsLoadedBlob();
468  }
469  else {
470  return m_Chunk->IsLoaded();
471  }
472 }
473 
474 
476 {
477  if ( chunk_id == kMain_ChunkId ) {
478  return IsLoadedBlob();
479  }
480  else {
481  if ( m_Chunk && m_Chunk->GetChunkId() == chunk_id ) {
482  return m_Chunk->IsLoaded();
483  }
485  return GetData()->GetSplitInfo().GetChunk(chunk_id).IsLoaded();
486  }
487 }
488 
489 
491 {
492  if ( TParent::IsLoaded() ) {
493  m_TSE_LoadLock = GetData();
496  result.x_AddTSE_LoadLock(m_TSE_LoadLock);
497  return;
498  }
499  m_TSE_LoadLock = result.GetTSE_LoadLockIfLoaded(m_Blob_id);
500  if ( m_TSE_LoadLock ) {
502  TParent::SetLoaded(m_TSE_LoadLock, GBL::eExpire_normal);
503  result.x_AddTSE_LoadLock(m_TSE_LoadLock);
504  return;
505  }
506 }
507 
508 
509 /////////////////////////////////////////////////////////////////////////////
510 // CLoadLockChunkSetter
511 /////////////////////////////////////////////////////////////////////////////
512 
513 
515 
516 struct SBlobId
517 {
518  SBlobId(const CTSE_Info& tse)
519  : m_TSE(tse)
520  {
521  }
522 
523  const CTSE_Info& m_TSE;
524 };
525 
527 {
528  out << id.m_TSE.GetBlobId().ToString();
529  return out;
530 }
531 
532 struct SChunkId
533 {
534  SChunkId(const CTSE_Chunk_Info& chunk)
535  : m_Chunk(chunk)
536  {
537  }
538 
540 };
541 
543 {
544  out << id.m_Chunk.GetSplitInfo().GetBlobId().ToString()<<"."<<id.m_Chunk.GetChunkId();
545  return out;
546 }
547 
548 struct SSeqIds
549 {
550  SSeqIds(const CSeq_entry& entry)
551  : m_Entry(entry)
552  {
553  }
554 
556 };
557 
559 {
560  for ( CTypeConstIterator<CBioseq> it = Begin(ids.m_Entry); it; ++it ) {
561  const CBioseq& seq = *it;
562  const char* sep = "Bioseq( ";
563  const char* end = "Bioseq()";
564  ITERATE ( CBioseq::TId, it2, seq.GetId() ) {
565  out << sep << (*it2)->AsFastaString();
566  sep = ", ";
567  end = " )";
568  }
569  out << end;
570  break;
571  }
572  return out;
573 }
574 
576 
577 
579  : m_AllowIncompleteLoading(false)
580 {
581  x_Init(lock, lock.GetSelectedChunkId());
582 }
583 
584 
586  TChunkId chunk_id)
587  : m_AllowIncompleteLoading(false)
588 {
589  x_Init(lock, chunk_id);
590 }
591 
592 
594  const CBlob_id& blob_id,
595  TChunkId chunk_id)
596  : TParent(result.GetLoadLockBlob(blob_id)),
597  m_AllowIncompleteLoading(false)
598 {
599  x_ObtainTSE_LoadLock(result, blob_id);
600  if ( chunk_id != kMain_ChunkId ) {
601  x_SelectChunk(chunk_id);
602  }
603 }
604 
605 
607 {
608  TParent::operator=(lock);
610  if ( chunk_id == kMain_ChunkId ) {
611  if ( !m_TSE_LoadLock ) {
613  dynamic_cast<CReaderRequestResult&>(GetRequestor());
615  }
616  }
617  else {
620  if ( chunk_id == lock.GetSelectedChunkId() ) {
621  m_Chunk = &const_cast<CTSE_Chunk_Info&>(*lock.m_Chunk);
622  }
623  else {
624  x_SelectChunk(chunk_id);
625  }
626  if ( m_Chunk ) {
628  if ( !m_ChunkLoadLock.get() || !*m_ChunkLoadLock.get() ) {
630  }
631  }
632  }
633 }
634 
635 
637 {
638  if ( !m_AllowIncompleteLoading && !IsLoaded() ) {
639  ERR_POST("Incomplete loading");
640  }
641 }
642 
643 
645 {
646  if ( !m_Chunk ) {
647  return m_TSE_LoadLock.IsLoaded();
648  }
649  else {
650  return m_Chunk->IsLoaded();
651  }
652 }
653 
654 
656 {
658 }
659 
660 
662 {
663  _ASSERT(!IsLoaded());
664  if ( !m_Chunk ) {
665  if ( s_GetLoadTraceLevel() > 0 ) {
666  LOG_POST(Info<<"GBLoader:"<<SBlobId(*m_TSE_LoadLock)<<" loaded");
667  }
668  const CBlob_id* blob_id = dynamic_cast<const CBlob_id*>(&*m_TSE_LoadLock->GetBlobId());
669  if ( blob_id ) {
670  auto& tse_name = m_TSE_LoadLock->GetName();
671  if ( tse_name.IsNamed() ) {
672  // save the name into blob_id
673  const_cast<CBlob_id*>(blob_id)->SetTSEName(tse_name.GetName());
674  }
675  else if ( blob_id->HasTSEName() ) {
676  m_TSE_LoadLock->SetName(blob_id->GetTSEName());
677  }
678  }
680  TParent::SetLoaded(m_TSE_LoadLock, GBL::eExpire_normal);
682  dynamic_cast<CReaderRequestResult&>(GetRequestor());
683  result.x_AddTSE_LoadLock(m_TSE_LoadLock);
684  }
685  else {
686  if ( s_GetLoadTraceLevel() >= 2 ||
687  (s_GetLoadTraceLevel() >= 1 &&
689  LOG_POST(Info<<"GBLoader:"<<SChunkId(*m_Chunk)<<" loaded");
690  }
691  m_Chunk->SetLoaded();
693  }
694 }
695 
696 
698 {
699  if ( chunk_id == kMain_ChunkId ) {
700  m_Chunk = null;
701  }
702  else {
704  m_Chunk = &GetSplitInfo().GetChunk(chunk_id);
705  _ASSERT(m_Chunk && m_Chunk->GetChunkId() == chunk_id);
706  }
707 }
708 
709 
711  const CBlob_id& blob_id)
712 {
713  if ( TParent::IsLoaded() ) {
714  m_TSE_LoadLock = GetData();
717  result.x_AddTSE_LoadLock(m_TSE_LoadLock);
718  return;
719  }
720  m_TSE_LoadLock = result.GetTSE_LoadLock(blob_id);
722  if ( m_TSE_LoadLock.IsLoaded() ) {
723  TParent::SetLoaded(m_TSE_LoadLock, GBL::eExpire_normal);
724  result.x_AddTSE_LoadLock(m_TSE_LoadLock);
725  return;
726  }
728  if ( state ) {
729  m_TSE_LoadLock->SetBlobState(state.GetBlobState());
730  }
732  if ( version ) {
733  m_TSE_LoadLock->SetBlobVersion(version.GetBlobVersion());
734  }
735 }
736 
737 
739 {
741  return m_TSE_LoadLock->GetSplitInfo();
742 }
743 
744 
746 {
748  return m_TSE_LoadLock->GetBlobState();
749 }
750 
751 
753  CTSE_SetObjectInfo* set_info)
754 {
755  _ASSERT(!IsLoaded());
756  if ( !m_Chunk ) {
757  if ( s_GetLoadTraceLevel() > 0 ) {
758  LOG_POST(Info<<"GBLoader:"<<SBlobId(*m_TSE_LoadLock)<<" entry = "<<SSeqIds(entry));
759  }
760  m_TSE_LoadLock->SetSeq_entry(entry, set_info);
761  }
762  else {
763  if ( s_GetLoadTraceLevel() > 0 ) {
764  LOG_POST(Info<<"GBLoader:"<<SChunkId(*m_Chunk)<<" entry = "<<SSeqIds(entry));
765  }
766  m_Chunk->x_LoadSeq_entry(entry, set_info);
767  }
768 }
769 
770 
771 /////////////////////////////////////////////////////////////////////////////
772 // CReaderRequestResult
773 /////////////////////////////////////////////////////////////////////////////
774 
775 
776 // helper method to get system time for expiration
777 static inline
779 {
781 }
782 
783 
785  CReadDispatcher& dispatcher,
786  CGBInfoManager& manager)
787  : GBL::CInfoRequestor(manager),
788  m_ReadDispatcher(dispatcher),
789  m_Level(0),
790  m_RequestedId(requested_id),
791  m_RecursionLevel(0),
792  m_InProcessor(0),
793  m_RecursiveTime(0),
794  m_AllocatedConnection(0),
795  m_RetryDelay(0),
796  m_StartTime(sx_GetCurrentTime())
797 {
798 }
799 
800 
802 {
804 }
805 
806 
808 {
810 }
811 
812 
815 {
817 }
818 
819 
822 {
823  return type == GBL::eExpire_normal? 2*3600: 5;
824 }
825 
826 
828 {
829  return false;
830 }
831 
832 
834 {
835  return eGBErrorAction_report;
836 }
837 
838 
840 {
841  ReleaseLocks();
843 }
844 
845 
847 {
848  return 0;
849 }
850 
851 
853 {
854  if ( !m_RequestedId ) {
855  m_RequestedId = requested_id;
856  }
857 }
858 
859 
861 {
862  return CTSE_LoadLock();
863 }
864 
865 
867  TBlobState blob_state)
868 {
869  SetLoadedBlobState(blob_id, blob_state);
870  CLoadLockBlob blob(*this, blob_id);
871  if ( !blob.IsLoadedBlob() ) {
872  CLoadLockSetter setter(blob);
873  setter.SetLoaded();
874  return true;
875  }
876  return false;
877 }
878 
879 
881 {
882 }
883 
884 
886  TLoadedBlob_ids& /*blob_ids*/) const
887 {
888  return;
889 }
890 
891 
893 {
894  m_TSE_LockSet.insert(lock);
895 }
896 
897 
899 {
901  locks.insert(*it);
902  }
903 }
904 
905 
907 {
909 }
910 
911 
914 {
915  return GetStartTime();
916 }
917 
918 
921 {
923 }
924 
925 
926 /////////////////////////////////////////////////////////////////////////////
927 // CReaderRequestResultRecursion
928 /////////////////////////////////////////////////////////////////////////////
929 
930 
933  bool in_processor)
934  : CStopWatch(eStart),
935  m_Result(result),
936  m_InProcessor(in_processor)
937 {
938  m_SaveTime = result.m_RecursiveTime;
939  result.m_RecursiveTime = 0;
940  ++result.m_RecursionLevel;
941  if ( m_InProcessor ) {
942  ++result.m_InProcessor;
943  }
944 }
945 
946 
948 {
952  if ( m_InProcessor ) {
954  }
955 }
956 
957 
959 {
960  double time = Elapsed();
961  double rec_time = m_Result.m_RecursiveTime;
962  if ( rec_time > time ) {
963  return 0;
964  }
965  else {
966  m_Result.m_RecursiveTime = time;
967  return time - rec_time;
968  }
969 }
970 
971 
972 /////////////////////////////////////////////////////////////////////////////
973 // CGBLoaderManager
974 /////////////////////////////////////////////////////////////////////////////
975 
976 
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)
990 {
991 }
992 
993 
995 {
996 }
997 
998 
1000  const CSeq_id_Handle& id)
1001  : TParent(result.GetLoadLockSeqIds(id))
1002 {
1003 }
1004 
1005 
1007  const CSeq_id_Handle& id,
1009  : TParent(result.GetLoadedSeqIds(id))
1010 {
1011 }
1012 
1013 
1015  const CSeq_id_Handle& id)
1016  : TParent(result.GetLoadLockAcc(id))
1017 {
1018 }
1019 
1020 
1022  const CSeq_id_Handle& id)
1023  : TParent(result.GetLoadLockGi(id))
1024 {
1025 }
1026 
1027 
1029  const CSeq_id_Handle& id)
1030  : TParent(result.GetLoadLockLabel(id))
1031 {
1032 }
1033 
1034 
1036  const CSeq_id_Handle& id)
1037  : TParent(result.GetLoadLockTaxId(id))
1038 {
1039 }
1040 
1041 
1043  const CSeq_id_Handle& id)
1044  : TParent(result.GetLoadLockHash(id))
1045 {
1046 }
1047 
1048 
1050  const CSeq_id_Handle& id)
1051  : TParent(result.GetLoadLockLength(id))
1052 {
1053 }
1054 
1055 
1057  const CSeq_id_Handle& id)
1058  : TParent(result.GetLoadLockType(id))
1059 {
1060 }
1061 
1062 
1064  const CSeq_id_Handle& id,
1065  const SAnnotSelector* sel)
1066  : TParent(result.GetLoadLockBlobIds(id, sel)),
1067  m_Seq_id(id)
1068 {
1069 }
1071  const CSeq_id_Handle& id,
1072  const SAnnotSelector* sel,
1074  : TParent(result.GetLoadedBlobIds(id, sel)),
1075  m_Seq_id(id)
1076 {
1077 }
1078 
1079 
1081  const TData& blob_ids)
1082 {
1083  if ( !sel || sel->IsIncludedNamedAnnotAccession("NA*") ) {
1084  // no filtering
1085  return SetLoadedBlob_ids(blob_ids);
1086  }
1087  else {
1088  return SetLoadedBlob_ids(blob_ids.Filter(sel));
1089  }
1090 }
1091 
1092 
1094  const TData& blob_ids,
1095  TExpirationTime expiration)
1096 {
1097  if ( !sel || sel->IsIncludedNamedAnnotAccession("NA*") ) {
1098  // no filtering
1099  return SetLoadedBlob_ids(blob_ids, expiration);
1100  }
1101  else {
1102  return SetLoadedBlob_ids(blob_ids.Filter(sel), expiration);
1103  }
1104 }
1105 
1106 
1108  const CBlob_id& id)
1109  : TParent(result.GetLoadLockBlobState(id))
1110 {
1111 }
1112 
1113 
1115  const CBlob_id& id,
1117  : TParent(result.GetLoadedBlobState(id))
1118 {
1119 }
1120 
1121 
1123  const CBlob_id& id)
1124  : TParent(result.GetLoadLockBlobVersion(id))
1125 {
1126 }
1127 
1128 
1130  const CBlob_id& id,
1132  : TParent(result.GetLoadedBlobVersion(id))
1133 {
1134 }
1135 
1136 
1137 /////////////////////////////////////////////////////////////////////////////
1138 // Seq-id -> Seq-ids
1139 
1140 bool
1142 {
1143  return GetGBInfoManager().m_CacheSeqIds.IsLoaded(*this, id);
1144 }
1145 
1146 
1147 bool
1149 {
1150  return GetGBInfoManager().m_CacheSeqIds.MarkLoading(*this, id);
1151 }
1152 
1153 
1156 {
1157  // if connection is allocated we cannot wait for another lock because
1158  // of possible deadlock.
1160  return GetGBInfoManager().m_CacheSeqIds.GetLoadLock(*this, id, do_not_wait);
1161 }
1162 
1163 
1166 {
1167  return GetGBInfoManager().m_CacheSeqIds.GetLoaded(*this, id);
1168 }
1169 
1170 
1171 bool
1173  const CFixedSeq_ids& value)
1174 {
1175  if ( s_GetLoadTraceLevel() > 0 ) {
1176  LOG_POST(Info<<"GBLoader:SeqId("<<id<<") seq_ids = "<<value);
1177  }
1179  bool changed = GetGBInfoManager().m_CacheSeqIds.
1180  SetLoaded(*this, id, value, exp_type);
1181  return changed && exp_type == GBL::eExpire_normal;
1182 }
1183 
1184 
1185 /////////////////////////////////////////////////////////////////////////////
1186 // Copy info
1187 
1188 
1189 bool
1191  const CLoadLockSeqIds& ids)
1192 {
1193  if ( s_GetLoadTraceLevel() > 0 ) {
1194  LOG_POST(Info<<"GBLoader:SeqId("<<id<<") seq_ids = "<<ids.GetData());
1195  }
1196  CLoadLockSeqIds lock(*this, id);
1197  return lock.SetLoadedSeq_ids(ids);
1198 }
1199 
1200 
1201 bool
1203  const SAnnotSelector* sel,
1204  const CLoadLockBlobIds& ids)
1205 {
1206  if ( s_GetLoadTraceLevel() > 0 ) {
1207  LOG_POST(Info<<"GBLoader:SeqId("<<id<<") blob_ids = "<<ids.GetData());
1208  }
1209  CLoadLockBlobIds lock(*this, id, sel);
1210  return lock.SetLoadedBlob_ids(ids);
1211 }
1212 
1213 
1214 /////////////////////////////////////////////////////////////////////////////
1215 // Seq-id -> Acc.Ver
1216 
1217 bool
1219 {
1220  return GetGBInfoManager().m_CacheAcc.IsLoaded(*this, id) ||
1221  IsLoadedSeqIds(id);
1222 }
1223 
1224 
1225 bool
1227 {
1228  return GetGBInfoManager().m_CacheAcc.MarkLoading(*this, id);
1229 }
1230 
1231 
1234 {
1235  // if connection is allocated we cannot wait for another lock because
1236  // of possible deadlock.
1238  TInfoLockAcc lock =
1239  GetGBInfoManager().m_CacheAcc.GetLoadLock(*this, id, do_not_wait);
1240 
1241  if ( !lock.IsLoaded() ) {
1242  TInfoLockIds ids_lock = GetLoadedSeqIds(id);
1243  if ( ids_lock ) {
1244  UpdateAccFromSeqIds(lock, ids_lock);
1245  }
1246  }
1247  return lock;
1248 }
1249 
1250 
1253 {
1254  return GetGBInfoManager().m_CacheAcc.GetLoaded(*this, id);
1255 }
1256 
1257 
1258 bool
1260  const TSequenceAcc& value)
1261 {
1262  if ( s_GetLoadTraceLevel() > 0 ) {
1263  LOG_POST(Info<<"GBLoader:SeqId("<<id<<") acc = "<<value.acc_ver);
1264  }
1266  bool changed = GetGBInfoManager().m_CacheAcc.
1267  SetLoaded(*this, id, value, exp_type);
1268  return changed && exp_type == GBL::eExpire_normal;
1269 }
1270 
1271 
1272 /////////////////////////////////////////////////////////////////////////////
1273 // Seq-ids -> Acc.Ver
1274 
1276  const TInfoLockIds& ids_lock)
1277 {
1278  if ( acc_lock.IsLoaded() ) {
1279  return false;
1280  }
1281  return acc_lock.SetLoadedFor(ids_lock.GetData().FindAccVer(),
1282  ids_lock.GetExpirationTime());
1283 }
1284 
1285 
1287  const CLoadLockSeqIds& ids)
1288 {
1289  TSequenceAcc data = ids.GetSeq_ids().FindAccVer();
1290  if ( s_GetLoadTraceLevel() > 0 ) {
1291  LOG_POST(Info<<"GBLoader:SeqId("<<id<<") acc = "<<data.acc_ver);
1292  }
1293  return GetGBInfoManager().m_CacheAcc.
1294  SetLoadedFor(*this, id, data, ids.GetExpirationTime());
1295 }
1296 
1297 
1298 /////////////////////////////////////////////////////////////////////////////
1299 // Seq-ids <-> GI
1300 
1301 bool
1303  const CLoadLockGi& gi_lock)
1304 {
1305  _ASSERT(gi_lock.IsLoadedGi() && gi_lock.GetGi(gi_lock.GetGi()) == ZERO_GI );
1306  if ( s_GetLoadTraceLevel() > 0 ) {
1307  LOG_POST(Info<<"GBLoader:SeqId("<<id<<") seq_ids = null");
1308  }
1309  CLoadLockSeqIds lock(*this, id);
1310  return lock.SetLoadedSeq_ids(CFixedSeq_ids(0),
1311  gi_lock.GetExpirationTimeGi());
1312 }
1313 
1314 
1315 bool
1317  const SAnnotSelector* sel,
1318  const CLoadLockGi& gi_lock)
1319 {
1320  _ASSERT(gi_lock.IsLoadedGi() && gi_lock.GetGi(gi_lock.GetGi()) == ZERO_GI);
1321  if ( s_GetLoadTraceLevel() > 0 ) {
1322  LOG_POST(Info<<"GBLoader:SeqId("<<id<<") blob_ids = null");
1323  }
1324  CLoadLockBlobIds lock(*this, id, sel);
1325  return lock.SetLoadedBlob_ids(CFixedBlob_ids(0),
1326  gi_lock.GetExpirationTimeGi());
1327 }
1328 
1329 
1331  const TInfoLockIds& ids_lock)
1332 {
1333  if ( gi_lock.IsLoaded() ) {
1334  return false;
1335  }
1336  return gi_lock.SetLoadedFor(ids_lock.GetData().FindGi(),
1337  ids_lock.GetExpirationTime());
1338 }
1339 
1340 
1342  const CLoadLockSeqIds& ids)
1343 {
1344  TSequenceGi data = ids.GetSeq_ids().FindGi();
1345  if ( s_GetLoadTraceLevel() > 0 ) {
1346  LOG_POST(Info<<"GBLoader:SeqId("<<id<<") gi = "<<data.gi);
1347  }
1348  return GetGBInfoManager().m_CacheGi.
1349  SetLoadedFor(*this, id, data, ids.GetExpirationTime());
1350 }
1351 
1352 
1353 /////////////////////////////////////////////////////////////////////////////
1354 // Seq-id -> GI
1355 
1356 bool
1358 {
1359  return GetGBInfoManager().m_CacheGi.IsLoaded(*this, id) ||
1360  IsLoadedSeqIds(id);
1361 }
1362 
1363 
1364 bool
1366 {
1367  return GetGBInfoManager().m_CacheGi.MarkLoading(*this, id);
1368 }
1369 
1370 
1373 {
1374  // if connection is allocated we cannot wait for another lock because
1375  // of possible deadlock.
1377  TInfoLockGi lock =
1378  GetGBInfoManager().m_CacheGi.GetLoadLock(*this, id, do_not_wait);
1379  if ( !lock.IsLoaded() ) {
1380  TInfoLockIds ids_lock = GetLoadedSeqIds(id);
1381  if ( ids_lock ) {
1382  UpdateGiFromSeqIds(lock, ids_lock);
1383  }
1384  }
1385  return lock;
1386 }
1387 
1388 
1391 {
1392  return GetGBInfoManager().m_CacheGi.GetLoaded(*this, id);
1393 }
1394 
1395 
1396 bool
1398  const TSequenceGi& value)
1399 {
1400  if ( s_GetLoadTraceLevel() > 0 ) {
1401  LOG_POST(Info<<"GBLoader:SeqId("<<id<<") gi = "<<value.gi);
1402  }
1404  bool changed = GetGBInfoManager().m_CacheGi.
1405  SetLoaded(*this, id, value, exp_type);
1406  return changed && exp_type == GBL::eExpire_normal;
1407 }
1408 
1409 
1410 /////////////////////////////////////////////////////////////////////////////
1411 // Seq-ids -> Label
1412 
1414  const TInfoLockIds& ids_lock)
1415 {
1416  if ( label_lock.IsLoaded() ) {
1417  return false;
1418  }
1419  return label_lock.SetLoadedFor(ids_lock.GetData().FindLabel(),
1420  ids_lock.GetExpirationTime());
1421 }
1422 
1423 
1425  const CLoadLockSeqIds& ids)
1426 {
1427  string label = ids.GetSeq_ids().FindLabel();
1428  if ( s_GetLoadTraceLevel() > 0 ) {
1429  LOG_POST(Info<<"GBLoader:SeqId("<<id<<") label = "<<label);
1430  }
1431  return GetGBInfoManager().m_CacheLabel.
1432  SetLoadedFor(*this, id, label, ids.GetExpirationTime());
1433 }
1434 
1435 
1436 /////////////////////////////////////////////////////////////////////////////
1437 // Seq-id -> Label
1438 
1439 bool
1441 {
1442  return GetGBInfoManager().m_CacheLabel.IsLoaded(*this, id);
1443 }
1444 
1445 
1446 bool
1448 {
1449  return GetGBInfoManager().m_CacheLabel.MarkLoading(*this, id);
1450 }
1451 
1452 
1455 {
1456  // if connection is allocated we cannot wait for another lock because
1457  // of possible deadlock.
1459  return GetGBInfoManager().m_CacheLabel.GetLoadLock(*this, id, do_not_wait);
1460 }
1461 
1462 
1465 {
1466  return GetGBInfoManager().m_CacheLabel.GetLoaded(*this, id);
1467 }
1468 
1469 
1470 bool
1472  const string& value)
1473 {
1474  if ( s_GetLoadTraceLevel() > 0 ) {
1475  LOG_POST(Info<<"GBLoader:SeqId("<<id<<") label = "<<value);
1476  }
1478  bool changed = GetGBInfoManager().m_CacheLabel.
1479  SetLoaded(*this, id, value, exp_type);
1480  return changed && exp_type == GBL::eExpire_normal;
1481 }
1482 
1483 
1484 /////////////////////////////////////////////////////////////////////////////
1485 // Seq-id -> TaxID
1486 
1487 bool
1489 {
1490  return GetGBInfoManager().m_CacheTaxId.IsLoaded(*this, id);
1491 }
1492 
1493 
1494 bool
1496 {
1497  return GetGBInfoManager().m_CacheTaxId.MarkLoading(*this, id);
1498 }
1499 
1500 
1503 {
1504  // if connection is allocated we cannot wait for another lock because
1505  // of possible deadlock.
1507  return GetGBInfoManager().m_CacheTaxId.GetLoadLock(*this, id, do_not_wait);
1508 }
1509 
1510 
1513 {
1514  return GetGBInfoManager().m_CacheTaxId.GetLoaded(*this, id);
1515 }
1516 
1517 
1518 bool
1520  const TTaxId& value)
1521 {
1522  if ( s_GetLoadTraceLevel() > 0 ) {
1523  LOG_POST(Info<<"GBLoader:SeqId("<<id<<") tax_id = "<<value);
1524  }
1526  bool changed = GetGBInfoManager().m_CacheTaxId.
1527  SetLoaded(*this, id, value, exp_type);
1528  return changed && exp_type == GBL::eExpire_normal;
1529 }
1530 
1531 
1532 /////////////////////////////////////////////////////////////////////////////
1533 // Seq-id -> Hash
1534 
1535 bool
1537 {
1538  return GetGBInfoManager().m_CacheHash.IsLoaded(*this, id);
1539 }
1540 
1541 
1542 bool
1544 {
1545  return GetGBInfoManager().m_CacheHash.MarkLoading(*this, id);
1546 }
1547 
1548 
1551 {
1552  // if connection is allocated we cannot wait for another lock because
1553  // of possible deadlock.
1555  return GetGBInfoManager().m_CacheHash.GetLoadLock(*this, id, do_not_wait);
1556 }
1557 
1558 
1561 {
1562  return GetGBInfoManager().m_CacheHash.GetLoaded(*this, id);
1563 }
1564 
1565 
1566 bool
1568  const TSequenceHash& value)
1569 {
1570  if ( s_GetLoadTraceLevel() > 0 ) {
1571  LOG_POST(Info<<"GBLoader:SeqId("<<id<<") hash = "<<value.hash);
1572  }
1574  bool changed = GetGBInfoManager().m_CacheHash.
1575  SetLoaded(*this, id, value, exp_type);
1576  return changed && exp_type == GBL::eExpire_normal;
1577 }
1578 
1579 
1580 /////////////////////////////////////////////////////////////////////////////
1581 // Seq-id -> Length
1582 
1583 bool
1585 {
1586  return GetGBInfoManager().m_CacheLength.IsLoaded(*this, id);
1587 }
1588 
1589 
1590 bool
1592 {
1593  return GetGBInfoManager().m_CacheLength.MarkLoading(*this, id);
1594 }
1595 
1596 
1599 {
1600  // if connection is allocated we cannot wait for another lock because
1601  // of possible deadlock.
1603  return GetGBInfoManager().m_CacheLength.GetLoadLock(*this, id, do_not_wait);
1604 }
1605 
1606 
1609 {
1610  return GetGBInfoManager().m_CacheLength.GetLoaded(*this, id);
1611 }
1612 
1613 
1614 bool
1616  const TSequenceLength& value)
1617 {
1618  if ( s_GetLoadTraceLevel() > 0 ) {
1619  LOG_POST(Info<<"GBLoader:SeqId("<<id<<") hash = "<<value);
1620  }
1622  bool changed = GetGBInfoManager().m_CacheLength.
1623  SetLoaded(*this, id, value, exp_type);
1624  return changed && exp_type == GBL::eExpire_normal;
1625 }
1626 
1627 
1628 /////////////////////////////////////////////////////////////////////////////
1629 // Seq-id -> Type
1630 
1631 bool
1633 {
1634  return GetGBInfoManager().m_CacheType.IsLoaded(*this, id);
1635 }
1636 
1637 
1638 bool
1640 {
1641  return GetGBInfoManager().m_CacheType.MarkLoading(*this, id);
1642 }
1643 
1644 
1647 {
1648  // if connection is allocated we cannot wait for another lock because
1649  // of possible deadlock.
1651  return GetGBInfoManager().m_CacheType.GetLoadLock(*this, id, do_not_wait);
1652 }
1653 
1654 
1657 {
1658  return GetGBInfoManager().m_CacheType.GetLoaded(*this, id);
1659 }
1660 
1661 
1662 bool
1664  const TSequenceType& value)
1665 {
1666  if ( s_GetLoadTraceLevel() > 0 ) {
1667  LOG_POST(Info<<"GBLoader:SeqId("<<id<<") type = "<<value.type);
1668  }
1670  bool changed = GetGBInfoManager().m_CacheType.
1671  SetLoaded(*this, id, value, exp_type);
1672  return changed && exp_type == GBL::eExpire_normal;
1673 }
1674 
1675 
1676 /////////////////////////////////////////////////////////////////////////////
1677 // Seq-id -> BlobIds
1678 
1679 bool
1681  const SAnnotSelector* sel)
1682 {
1683  TKeyBlob_ids key = s_KeyBlobIds(id, sel);
1684  return GetGBInfoManager().m_CacheBlobIds.IsLoaded(*this, key);
1685 }
1686 
1687 
1688 bool
1690  const SAnnotSelector* sel)
1691 {
1692  TKeyBlob_ids key = s_KeyBlobIds(id, sel);
1693  return GetGBInfoManager().m_CacheBlobIds.MarkLoading(*this, key);
1694 }
1695 
1696 
1699  const SAnnotSelector* sel)
1700 {
1701  // if connection is allocated we cannot wait for another lock because
1702  // of possible deadlock.
1704  TKeyBlob_ids key = s_KeyBlobIds(id, sel);
1705  return GetGBInfoManager().m_CacheBlobIds.GetLoadLock(*this, key, do_not_wait);
1706 }
1707 
1708 
1711  const SAnnotSelector* sel)
1712 {
1713  TKeyBlob_ids key = s_KeyBlobIds(id, sel);
1714  return GetGBInfoManager().m_CacheBlobIds.GetLoaded(*this, key);
1715 }
1716 
1717 
1718 bool
1720  const SAnnotSelector* sel,
1721  const CFixedBlob_ids& value)
1722 {
1723  TKeyBlob_ids key = s_KeyBlobIds(id, sel);
1724  if ( s_GetLoadTraceLevel() > 0 ) {
1725  LOG_POST(Info<<"GBLoader:SeqId("<<id<<") blob_ids("<<key.second<<") = "<<value);
1726  }
1728  bool changed = GetGBInfoManager().m_CacheBlobIds.
1729  SetLoaded(*this, key, value, exp_type);
1730  return changed && exp_type == GBL::eExpire_normal;
1731 }
1732 
1733 
1736  const SAnnotSelector* sel)
1737 {
1738  TKeyBlob_ids key;
1739  key.first = seq_id;
1740  if ( sel && sel->IsIncludedAnyNamedAnnotAccession() ) {
1742  sel->GetNamedAnnotAccessions() ) {
1743  key.second += it->first;
1744  if (key.second == "SNP") {
1745  auto scale_limit = sel->GetSNPScaleLimit();
1746  if (scale_limit != CSeq_id::eSNPScaleLimit_Default) {
1747  key.second += "@";
1748  key.second += CSeq_id::GetSNPScaleLimit_Name(scale_limit);
1749  }
1750  }
1751  key.second += ',';
1752  }
1753  }
1754  return key;
1755 }
1756 
1757 
1758 /////////////////////////////////////////////////////////////////////////////
1759 // Blob state
1760 
1762  TBlobState state)
1763 {
1765  bool changed = GetGBInfoManager().m_CacheBlobState.
1766  SetLoaded(*this, blob_id, state, exp_type);
1767  if ( changed ) {
1768  if ( s_GetLoadTraceLevel() > 0 ) {
1769  LOG_POST(Info<<"GBLoader:"<<blob_id<<" state = "<<state);
1770  }
1771  // set to TSE_Info
1772  CLoadLockBlob blob(*this, blob_id);
1773  if ( blob.IsLoadedBlob() ) {
1775  }
1776  }
1777  return changed && exp_type == eExpire_normal;
1778 }
1779 
1780 
1782 {
1783  return GetGBInfoManager().m_CacheBlobState.IsLoaded(*this, blob_id);
1784 }
1785 
1786 
1789 {
1790  // if connection is allocated we cannot wait for another lock because
1791  // of possible deadlock.
1793  return GetGBInfoManager().m_CacheBlobState.GetLoadLock(*this, id, do_not_wait);
1794 }
1795 
1796 
1799 {
1800  return GetGBInfoManager().m_CacheBlobState.GetLoaded(*this, id);
1801 }
1802 
1803 
1805  TBlobVersion blob_state)
1806 {
1807  if ( !SetLoadedBlobState(blob_id, blob_state) ) {
1808  return;
1809  }
1810  if ( CWriter* writer = GetIdWriter() ) {
1811  writer->SaveBlobState(*this, blob_id, blob_state);
1812  }
1813 }
1814 
1815 
1816 /////////////////////////////////////////////////////////////////////////////
1817 // Blob version
1818 
1821 {
1823  bool changed = GetGBInfoManager().m_CacheBlobVersion.
1824  SetLoaded(*this, blob_id, version, exp_type);
1825  if ( changed ) {
1826  if ( s_GetLoadTraceLevel() > 0 ) {
1827  LOG_POST(Info<<"GBLoader:"<<blob_id<<" version = "<<version);
1828  }
1829  // set to TSE_Info
1830  CLoadLockBlob blob(*this, blob_id);
1831  if ( blob.IsLoadedBlob() ) {
1832  TBlobVersion old_version = blob.GetKnownBlobVersion();
1833  if ( old_version < 0 ) {
1835  }
1836  if ( blob.GetKnownBlobVersion() != version ) {
1837  LOG_POST(Warning<<"GBLoader:"<<blob_id<<" set version "<<version<<", but GetKnownBlobVersion() returns "<<blob.GetKnownBlobVersion());
1838  }
1839  }
1840  }
1841  return changed && exp_type == GBL::eExpire_normal;
1842 }
1843 
1844 
1846 {
1847  return GetGBInfoManager().m_CacheBlobVersion.IsLoaded(*this, blob_id);
1848 }
1849 
1850 
1853 {
1854  // if connection is allocated we cannot wait for another lock because
1855  // of possible deadlock.
1857  return GetGBInfoManager().m_CacheBlobVersion.GetLoadLock(*this, id, do_not_wait);
1858 }
1859 
1860 
1863 {
1864  return GetGBInfoManager().m_CacheBlobVersion.GetLoaded(*this, id);
1865 }
1866 
1867 
1870 {
1871  if ( !SetLoadedBlobVersion(blob_id, version) ) {
1872  return;
1873  }
1874  if ( CWriter* writer = GetIdWriter() ) {
1875  writer->SaveBlobVersion(*this, blob_id, version);
1876  }
1877 }
1878 
1879 /////////////////////////////////////////////////////////////////////////////
1880 // Blob
1881 
1884 {
1885  // if connection is allocated we cannot wait for another lock because
1886  // of possible deadlock.
1888  return GetGBInfoManager().m_CacheBlob.GetLoadLock(*this, id, do_not_wait);
1889 }
1890 
1891 
1894 {
1895  return GetGBInfoManager().m_CacheBlob.GetLoaded(*this, id);
1896 }
1897 
1898 
1899 /*
1900 void CReaderRequestResult::SetSeq_entry(const TKeyBlob& blob_id,
1901  CLoadLockBlob& blob,
1902  TChunkId chunk_id,
1903  CRef<CSeq_entry> entry,
1904  CTSE_SetObjectInfo* set_info)
1905 {
1906  if ( !entry ) {
1907  return;
1908  }
1909  if ( chunk_id == kMain_ChunkId ) {
1910  blob->SetSeq_entry(*entry, set_info);
1911  }
1912  else {
1913  blob->GetSplitInfo().GetChunk(chunk_id).
1914  x_LoadSeq_entry(*entry, set_info);
1915  }
1916 }
1917 */
1918 
1919 
ncbi::TMaskedQueryRegions mask
void AddNamedAnnotName(const string &name)
const TNamedAnnotNames & GetNamedAnnotNames(void) const
TNamedAnnotNames m_NamedAnnotNames
bool Matches(const SAnnotSelector *sel) const
TAnnotInfo m_AnnotInfo
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
Definition: blob_id.hpp:118
bool HasTSEName() const
Definition: blob_id.hpp:122
void SetState(TState state)
CFixedBlob_ids Filter(const SAnnotSelector *sel) const
void SetNotFound(void)
vector< CBlob_Info > TList
bool empty(void) const
const TList & Get(void) const
CConstRef< TObject > m_Ref
CDataLoader::SGiFound FindGi(void) const
bool IsFound(void) const
vector< CSeq_id_Handle > TList
string FindLabel(void) const
void SetState(TState state)
bool empty(void) const
void SetNotFound(void)
CDataLoader::SAccVerFound FindAccVer(void) const
CConstRef< TObject > m_Ref
TCacheBlobState m_CacheBlobState
TCacheType m_CacheType
CGBInfoManager(size_t gc_size)
TCacheTaxId m_CacheTaxId
TCacheLength m_CacheLength
TCacheBlobIds m_CacheBlobIds
TCacheBlob m_CacheBlob
TCacheSeqIds m_CacheSeqIds
TCacheHash m_CacheHash
TCacheBlobVersion m_CacheBlobVersion
TCacheAcc m_CacheAcc
TCacheLabel m_CacheLabel
CID2S_Seq_annot_Info –.
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
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)
AutoPtr< CInitGuard > m_ChunkLoadLock
void SetLoaded(void)
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
CObjectFor –.
Definition: ncbiobj.hpp:2335
static bool IsExtAnnot(const TBlobId &blob_id)
CWriter * GetWriter(const CReaderRequestResult &result, CWriter::EType type) const
Definition: dispatcher.cpp:204
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
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)
Definition: Seq_entry.hpp:56
CStopWatch –.
Definition: ncbitime.hpp:1937
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
Definition: tse_info.hpp:877
TBlobState GetBlobState(void) const
Definition: tse_info.hpp:834
void SetBlobState(TBlobState state)
Definition: tse_info.hpp:848
void SetName(const CAnnotName &name)
Definition: tse_info.cpp:333
const TBlobId & GetBlobId(void) const
Definition: tse_info.hpp:907
const CAnnotName & GetName(void) const
Definition: tse_info.hpp:893
CTSE_Split_Info & GetSplitInfo(void)
Definition: tse_info.cpp:1395
bool x_NeedsDelayedMainChunk(void) const
Definition: tse_info.cpp:1407
void SetSeq_entry(CSeq_entry &entry, CTSE_SetObjectInfo *set_info=0)
Definition: tse_info.cpp:351
void SetBlobVersion(TBlobVersion version)
Definition: tse_info.cpp:324
bool IsLoaded(void) const
void SetLoaded(void)
CTSE_Chunk_Info & GetChunk(TChunkId chunk_id)
Template class for iteration on objects of class C (non-medifiable version)
Definition: iterator.hpp:767
@ eBlobWriter
Definition: writer.hpp:65
@ eIdWriter
Definition: writer.hpp:66
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
void clear()
Definition: set.hpp:153
std::ofstream out("events_result.xml")
main entry point for tests
#define false
Definition: bool.h:36
char data[12]
Definition: iconv.c:80
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 ...
Definition: ncbimisc.hpp:480
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
element_type * get(void) const
Get pointer.
Definition: ncbimisc.hpp:469
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
Definition: ncbimisc.hpp:1508
#define ZERO_GI
Definition: ncbimisc.hpp:1088
@ eTakeOwnership
An object can take ownership of another.
Definition: ncbi_types.h:136
string
Definition: cgiapp.hpp:690
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
Definition: ncbidiag.hpp:186
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
Definition: ncbidiag.hpp:226
void Warning(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1191
void Info(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1185
static const char * GetSNPScaleLimit_Name(ESNPScaleLimit value)
Definition: Seq_id.cpp:3549
string GetLabel(const CSeq_id &id)
@ eSNPScaleLimit_Default
Definition: Seq_id.hpp:848
CBeginInfo Begin(C &obj)
Get starting point of object hierarchy.
Definition: iterator.hpp:1004
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.
Definition: ncbiobj.hpp:2024
#define NCBI_PARAM_TYPE(section, name)
Generate typename for a parameter from its {section, name} attributes.
Definition: ncbi_param.hpp:149
@ eParam_NoThread
Do not use per-thread values.
Definition: ncbi_param.hpp:418
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Definition: ncbistr.hpp:5406
double Elapsed(void) const
Return time elapsed since first Start() or last Restart() call (in seconds).
Definition: ncbitime.hpp:2775
ENcbiOwnership
Ownership relations between objects.
Definition: ncbi_types.h:134
static const char label[]
@ e_Gi
GenInfo Integrated Database.
Definition: Seq_id_.hpp:106
const TId & GetId(void) const
Get the Id member data.
Definition: Bioseq_.hpp:290
list< CRef< CSeq_id > > TId
Definition: Bioseq_.hpp:94
EDoNotWait
Definition: info_cache.hpp:73
@ eDoNotWait
Definition: info_cache.hpp:75
@ eAllowWaiting
Definition: info_cache.hpp:74
EExpirationType
Definition: info_cache.hpp:78
@ eExpire_normal
Definition: info_cache.hpp:79
static MDB_envinfo info
Definition: mdb_load.c:37
constexpr bool empty(list< Ts... >) noexcept
const string version
version string
Definition: variables.hpp:66
const struct ncbi::grid::netcache::search::fields::KEY key
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Multi-threading – classes, functions, and features.
EGBErrorAction
Definition: blob_id.hpp:205
@ eGBErrorAction_report
Definition: blob_id.hpp:207
@ kMain_ChunkId
Definition: blob_id.hpp:147
@ kMasterWGS_ChunkId
Definition: blob_id.hpp:148
@ fBlobHasNamedAnnot
Definition: blob_id.hpp:178
@ fBlobHasExtAnnot
Definition: blob_id.hpp:175
static const CReaderRequestResult::TBlobVersion kBlobVersionNotSet
BEGIN_LOCAL_NAMESPACE
static CReaderRequestResult::TExpirationTime sx_GetCurrentTime(void)
static int s_GetLoadTraceLevel(void)
END_LOCAL_NAMESPACE
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)
EAlreadyLoaded
@ eAlreadyLoaded
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,...
SAnnotSelector –.
const CTSE_Info & m_TSE
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)
Definition: type.c:6
#define _ASSERT
else result
Definition: token2.c:20
Modified on Fri Sep 20 14:56:57 2024 by modify_doxy.py rev. 669887