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

Go to the SVN repository for this file.

1 /* $Id: writer_cache.cpp 91835 2020-12-14 18:35:57Z grichenk $
2  * ===========================================================================
3  * PUBLIC DOMAIN NOTICE
4  * National Center for Biotechnology Information
5  *
6  * This software/database is a "United States Government Work" under the
7  * terms of the United States Copyright Act. It was written as part of
8  * the author's official duties as a United States Government employee and
9  * thus cannot be copyrighted. This software/database is freely available
10  * to the public for use. The National Library of Medicine and the U.S.
11  * Government have not placed any restriction on its use or reproduction.
12  *
13  * Although all reasonable efforts have been taken to ensure the accuracy
14  * and reliability of the software and data, the NLM and the U.S.
15  * Government do not and cannot warrant the performance or results that
16  * may be obtained by using this software or data. The NLM and the U.S.
17  * Government disclaim all warranties, express or implied, including
18  * warranties of performance, merchantability or fitness for any particular
19  * purpose.
20  *
21  * Please cite the author in any work or product based on this material.
22  *
23  * ===========================================================================
24  *
25  * Author: Eugene Vasilchenko, Anatoliy Kuznetsov
26  *
27  * File Description: Cached writer for GenBank data loader
28  *
29  */
30 #include <ncbi_pch.hpp>
34 #include <objtools/data_loaders/genbank/readers.hpp> // for entry point
38 
39 #include <corelib/rwstream.hpp>
41 
42 #include <serial/objostrasnb.hpp>
43 #include <serial/serial.hpp>
44 
46 
47 #include <util/cache/icache.hpp>
48 
49 #include <memory>
50 
53 
55 {
56 }
57 
58 
60  const TPluginManagerParamTree* params)
61 {
62  const TPluginManagerParamTree* writer_params = params ?
64  ICache* id_cache = 0;
65  ICache* blob_cache = 0;
66  unique_ptr<TParams> id_params
67  (GetCacheParams(writer_params, eCacheWriter, eIdCache));
68  unique_ptr<TParams> blob_params
69  (GetCacheParams(writer_params, eCacheWriter, eBlobCache));
70  _ASSERT(id_params.get());
71  _ASSERT(blob_params.get());
72  const TParams* share_id_param =
74  bool share_id = !share_id_param ||
75  NStr::StringToBool(share_id_param->GetValue().value);
76  const TParams* share_blob_param =
78  bool share_blob = !share_blob_param ||
79  NStr::StringToBool(share_blob_param->GetValue().value);
80  if (share_id || share_blob) {
81  if ( share_id ) {
82  ICache* cache = cache_manager.
84  id_params.get());
85  if ( cache ) {
86  _ASSERT(!id_cache);
87  id_cache = cache;
88  }
89  }
90  if ( share_blob ) {
91  ICache* cache = cache_manager.
93  blob_params.get());
94  if ( cache ) {
95  _ASSERT(!blob_cache);
96  blob_cache = cache;
97  }
98  }
99  }
100  if ( !id_cache ) {
101  id_cache = CreateCache(writer_params, eCacheWriter, eIdCache);
102  if ( id_cache ) {
103  cache_manager.RegisterCache(*id_cache,
105  }
106  }
107  if ( !blob_cache ) {
108  blob_cache = CreateCache(writer_params, eCacheWriter, eBlobCache);
109  if ( blob_cache ) {
110  cache_manager.RegisterCache(*blob_cache,
112  }
113  }
114  SetIdCache(id_cache);
115  SetBlobCache(blob_cache);
116 }
117 
118 
120 {
121  SetIdCache(0);
122  SetBlobCache(0);
123 }
124 
125 
127 {
128  if ( m_Ptr + add > m_End ) {
129  size_t old_size = size();
130  size_t new_size = (old_size+add)*2;
131  char* new_buf = new char[new_size];
132  memcpy(new_buf, data(), old_size);
133  x_FreeBuffer();
134  m_Buffer = new_buf;
135  m_Ptr = new_buf + old_size;
136  m_End = new_buf + new_size;
137  }
138  _ASSERT(m_Ptr + add <= m_End);
139 }
140 
141 
143 {
144  size_t size = s.size();
145  CheckSpace(4+size);
146  x_StoreUint4(ToUint4(size));
147  memcpy(m_Ptr, s.data(), size);
148  m_Ptr += size;
149 }
150 
151 
153 {
154  if ( m_Buffer != m_Buffer0 ) {
155  delete[] m_Buffer;
156  m_Buffer = m_End = m_Ptr = 0;
157  }
158 }
159 
160 
161 void CCacheWriter::x_WriteId(const string& key,
162  const string& subkey,
163  const char* data,
164  size_t size)
165 {
166  try {
167  if ( GetDebugLevel() > 0 ) {
168  CReader::CDebugPrinter s("CCacheWriter");
169  s<<key<<","<<subkey<<" size="<<size;
170  }
171  m_IdCache->Store(key, 0, subkey, data, size);
172  }
173  catch ( exception& ) { // ignored
174  }
175 }
176 
177 
179  const CSeq_id_Handle& seq_id)
180 {
181  if( !m_IdCache) {
182  return;
183  }
184 
185  CLoadLockSeqIds ids(result, seq_id);
186  WriteSeq_ids(GetIdKey(seq_id), ids);
187 }
188 
189 
191  const CSeq_id_Handle& seq_id)
192 {
193  if( !m_IdCache) {
194  return;
195  }
197  return;
198  }
199 
200  CLoadLockGi lock(result, seq_id);
201  if ( lock.IsLoadedGi() && lock.GetExpType() == GBL::eExpire_normal ) {
204  _ASSERT(lock.IsFound(data));
205  str.StoreInt8(GI_TO(Int8, lock.GetGi(data)));
206  x_WriteId(GetIdKey(seq_id), GetGiSubkey(), str);
207  }
208 }
209 
210 
212  const CSeq_id_Handle& seq_id)
213 {
214  if( !m_IdCache) {
215  return;
216  }
218  return;
219  }
220 
221  CLoadLockAcc lock(result, seq_id);
222  if ( lock.IsLoadedAccVer() && lock.GetExpType() == GBL::eExpire_normal ) {
223  string str;
224  CReader::TSequenceAcc acc = lock.GetAccVer();
225  _ASSERT(lock.IsFound(acc));
226  if ( lock.GetAcc(acc) ) {
227  str = lock.GetAcc(acc).AsString();
228  }
229  x_WriteId(GetIdKey(seq_id), GetAccVerSubkey(), str);
230  }
231 }
232 
233 
235  const CSeq_id_Handle& seq_id)
236 {
237  if( !m_IdCache) {
238  return;
239  }
240 
241  CLoadLockLabel lock(result, seq_id);
242  if ( lock.IsLoadedLabel() && lock.GetExpType() == GBL::eExpire_normal ) {
243  const string& str = lock.GetLabel();
244  _ASSERT(!str.empty());
245  x_WriteId(GetIdKey(seq_id), GetLabelSubkey(), str);
246  }
247 }
248 
249 
251  const CSeq_id_Handle& seq_id)
252 {
253  if( !m_IdCache) {
254  return;
255  }
256 
257  CLoadLockTaxId lock(result, seq_id);
258  if ( lock.IsLoadedTaxId() && lock.GetExpType() == GBL::eExpire_normal ) {
260  _ASSERT(lock.GetTaxId() != INVALID_TAX_ID);
261  str.StoreInt4(TAX_ID_TO(Int4, lock.GetTaxId()));
262  x_WriteId(GetIdKey(seq_id), GetTaxIdSubkey(), str);
263  }
264 }
265 
266 
268  const CSeq_id_Handle& seq_id)
269 {
270  if( !m_IdCache) {
271  return;
272  }
273 
274  CLoadLockHash lock(result, seq_id);
275  if ( lock.IsLoadedHash() && lock.GetExpType() == GBL::eExpire_normal ) {
278  str.StoreInt4(data.hash);
279  str.StoreBool(data.sequence_found);
280  str.StoreBool(data.hash_known);
281  x_WriteId(GetIdKey(seq_id), GetHashSubkey(), str);
282  }
283 }
284 
285 
287  const CSeq_id_Handle& seq_id)
288 {
289  if( !m_IdCache) {
290  return;
291  }
292 
293  CLoadLockLength lock(result, seq_id);
294  if ( lock.IsLoadedLength() && lock.GetExpType() == GBL::eExpire_normal ) {
296  _ASSERT(lock.GetLength() != kInvalidSeqPos);
297  str.StoreUint4(lock.GetLength());
298  x_WriteId(GetIdKey(seq_id), GetLengthSubkey(), str);
299  }
300 }
301 
302 
304  const CSeq_id_Handle& seq_id)
305 {
306  if( !m_IdCache) {
307  return;
308  }
309 
310  CLoadLockType lock(result, seq_id);
311  if ( lock.IsLoadedType() && lock.GetExpType() == GBL::eExpire_normal ) {
313  str.StoreInt4(lock.GetType().type);
314  x_WriteId(GetIdKey(seq_id), GetTypeSubkey(), str);
315  }
316 }
317 
318 
319 void CCacheWriter::WriteSeq_ids(const string& key,
320  const CLoadLockSeqIds& lock)
321 {
322  if( !m_IdCache) {
323  return;
324  }
325 
326  if ( !lock.IsLoaded() || lock.GetExpType() != GBL::eExpire_normal ) {
327  return;
328  }
329 
330  try {
331  if ( GetDebugLevel() > 0 ) {
332  CReader::CDebugPrinter s("CCacheWriter");
333  s<<key<<","<<GetSeq_idsSubkey();
334  }
335  _ASSERT(!lock.GetSeq_ids().empty());
336  unique_ptr<IWriter> writer
338  if ( !writer.get() ) {
339  return;
340  }
341 
342  CWStream w_stream(writer.release(), 0, 0, CRWStreambuf::fOwnAll);
343  CObjectOStreamAsnBinary obj_stream(w_stream);
344  CFixedSeq_ids seq_ids = lock.GetSeq_ids();
345  static_cast<CObjectOStream&>(obj_stream). // cast because of protected
346  WriteUint4(CStoreBuffer::ToUint4(seq_ids.size()));
347  ITERATE ( CFixedSeq_ids, it, seq_ids ) {
348  obj_stream << *it->GetSeqId();
349  }
350  }
351  catch ( exception& ) {
352  // In case of an error we need to remove incomplete data
353  // from the cache.
354  try {
356  }
357  catch ( exception& ) { // ignored
358  }
359  // ignore cache write error - it doesn't affect application
360  }
361 }
362 
363 
365  const CSeq_id_Handle& seq_id,
366  const SAnnotSelector* sel)
367 {
368  if ( !m_IdCache ) {
369  return;
370  }
371 
372  CLoadLockBlobIds ids(result, seq_id, sel);
373  if ( !ids.IsLoaded() || ids.GetExpType() != GBL::eExpire_normal ) {
374  return;
375  }
376 
377  string subkey, true_subkey;
378  GetBlob_idsSubkey(sel, subkey, true_subkey);
380  str.StoreInt4(BLOB_IDS_MAGIC);
381  CFixedBlob_ids blob_ids = ids.GetBlob_ids();
382  str.StoreUint4(blob_ids.GetState());
383  str.StoreUint4(str.ToUint4(blob_ids.size()));
384  ITERATE ( CFixedBlob_ids, it, blob_ids ) {
385  const CBlob_Info& info = *it;
386  const CBlob_id& id = *info.GetBlob_id();
387  str.StoreInt4(id.GetSat());
388  str.StoreInt4(id.GetSubSat());
389  str.StoreInt4(id.GetSatKey());
390  str.StoreUint4(info.GetContentsMask());
391  CConstRef<CBlob_Annot_Info> annot_info = info.GetAnnotInfo();
392  if ( annot_info ) {
394  annot_info->GetNamedAnnotNames();
395  str.StoreUint4(str.ToUint4(names.size()));
397  str.StoreString(*it2);
398  }
399  }
400  else {
401  str.StoreUint4(0);
402  }
403  if ( !annot_info || annot_info->GetAnnotInfo().empty() ) {
404  str.StoreString(kEmptyStr);
405  }
406  else {
407  CNcbiOstrstream stream_str;
408  {{
409  CObjectOStreamAsnBinary stream(stream_str);
411  annot_info->GetAnnotInfo() ) {
412  stream << **it2;
413  }
414  }}
415  str.StoreString(CNcbiOstrstreamToString(stream_str));
416  }
417  }
418  if ( !true_subkey.empty() ) {
419  str.StoreString(true_subkey);
420  }
421  x_WriteId(GetIdKey(seq_id), subkey, str);
422 }
423 
424 
426  const TBlobId& blob_id,
427  TBlobState blob_state)
428 {
429  if( !m_IdCache ) {
430  return;
431  }
433  return;
434  }
435 
436  _ASSERT(blob_state >= 0);
438  str.StoreInt4(blob_state);
440 }
441 
442 
444  const TBlobId& blob_id,
446 {
447  if( !m_IdCache ) {
448  return;
449  }
451  return;
452  }
453 
454  _ASSERT(version >= 0);
456  str.StoreInt4(version);
458 }
459 
460 
462 {
463 public:
464  typedef int TVersion;
465 
466  CCacheBlobStream(ICache* cache, const string& key,
467  TVersion version, const string& subkey)
468  : m_Cache(cache), m_Key(key), m_Version(version), m_Subkey(subkey),
469  m_Writer(cache->GetWriteStream(key, version, subkey))
470  {
471  _ASSERT(version >= 0);
472  if ( SCacheInfo::GetDebugLevel() > 0 ) {
473  CReader::CDebugPrinter s("CCacheWriter");
474  s<<key<<","<<subkey<<","<<version;
475  }
476  if ( version == -1 ) {
477  ERR_POST("Cache:Write: "<<key<<","<<subkey<<","<<version);
478  }
479  if ( m_Writer.get() ) {
480  m_Stream.reset(new CWStream(m_Writer.get()));
481  }
482  }
484  {
485  if ( m_Stream.get() ) {
486  Abort();
487  }
488  }
489 
490  bool CanWrite(void) const
491  {
492  return m_Stream.get() != 0;
493  }
494 
496  {
497  _ASSERT(m_Stream.get());
498  return *m_Stream;
499  }
500 
501  void Close(void)
502  {
503  *m_Stream << flush;
504  if ( !*m_Stream ) {
505  Abort();
506  }
507  m_Stream.reset();
508  m_Writer.reset();
509  }
510 
511  void Abort(void)
512  {
513  m_Stream.reset();
514  m_Writer.reset();
515  Remove();
516  }
517 
518  void Remove(void)
519  {
520  try {
521  m_Cache->Remove(m_Key, m_Version, m_Subkey);
522  }
523  catch ( exception& ) { // ignored
524  }
525  }
526 
527 private:
529  string m_Key;
531  string m_Subkey;
532  unique_ptr<IWriter> m_Writer;
533  unique_ptr<CWStream> m_Stream;
534 };
535 
536 
539  const TBlobId& blob_id,
540  TChunkId chunk_id,
541  const CProcessor& processor)
542 {
543  if( !m_BlobCache ) {
544  return null;
545  }
546 
547  try {
548  CLoadLockBlob blob(result, blob_id, chunk_id);
550  if ( chunk_id == kMain_ChunkId && CProcessor_ExtAnnot::IsExtAnnot(blob_id) ) {
551  version = 0;
552  }
553  if ( version < 0 ) {
554  CLoadLockBlobVersion version_lock(result, blob_id, eAlreadyLoaded);
555  if ( version_lock ) {
556  version = version_lock.GetBlobVersion();
557  }
558  }
559  _ASSERT(version >= 0);
560  CRef<CBlobStream> stream
561  (new CCacheBlobStream(m_BlobCache, GetBlobKey(blob_id),
562  version,
563  GetBlobSubkey(blob, chunk_id)));
564  if ( !stream->CanWrite() ) {
565  return null;
566  }
567 
568  WriteProcessorTag(**stream, processor);
569  return stream;
570  }
571  catch ( exception& ) { // ignored
572  return null;
573  }
574 }
575 
576 
578 {
579  return (type == eIdWriter ? m_IdCache : m_BlobCache) != 0;
580 }
581 
582 
584 
585 
586 using namespace objects;
587 
588 
589 /// Class factory for Cache writer
590 ///
591 /// @internal
592 ///
594  public CSimpleClassFactoryImpl<CWriter, CCacheWriter>
595 {
596 private:
598 public:
602 
603 
604  CWriter*
605  CreateInstance(const string& driver = kEmptyStr,
607  const TPluginManagerParamTree* params = 0) const
608  {
609  if ( !driver.empty() && driver != m_DriverName )
610  return 0;
611 
612  if ( !version.Match(NCBI_INTERFACE_VERSION(CWriter)) ) {
613  return 0;
614  }
615  return new CCacheWriter();
616  }
617 };
618 
619 
623 {
625  method);
626 }
627 
628 
632 {
633  NCBI_EntryPoint_CacheWriter(info_list, method);
634 }
635 
636 
638 {
639  RegisterEntryPoint<CWriter>(NCBI_EntryPoint_CacheWriter);
640 }
641 
642 
SCacheInfo::TParams * GetCacheParams(const SCacheInfo::TParams *src_params, SCacheInfo::EReaderOrWriter reader_or_writer, SCacheInfo::EIdOrBlob id_or_blob)
const TAnnotInfo & GetAnnotInfo(void) const
const TNamedAnnotNames & GetNamedAnnotNames(void) const
vector< CConstRef< CID2S_Seq_annot_Info > > TAnnotInfo
unique_ptr< CWStream > m_Stream
CCacheBlobStream(ICache *cache, const string &key, TVersion version, const string &subkey)
unique_ptr< IWriter > m_Writer
bool CanWrite(void) const
CNcbiOstream & operator*(void)
void SetIdCache(ICache *id_cache)
ICache * m_BlobCache
void SetBlobCache(ICache *blob_cache)
ICache * m_IdCache
static bool NoNeedToSave(ECacheEntryType type)
Class factory for Cache writer.
CWriter * CreateInstance(const string &driver=kEmptyStr, CVersionInfo version=NCBI_INTERFACE_VERSION(CWriter), const TPluginManagerParamTree *params=0) const
Create instance of TDriver.
CSimpleClassFactoryImpl< CWriter, CCacheWriter > TParent
size_t size(void) const
const char * data(void) const
static Uint4 ToUint4(size_t size)
void StoreString(const string &s)
void CheckSpace(size_t size)
CCacheWriter(void)
virtual void SaveSequenceType(CReaderRequestResult &result, const CSeq_id_Handle &seq_id)
virtual bool CanWrite(EType type) const
virtual void InitializeCache(CReaderCacheManager &cache_manager, const TPluginManagerParamTree *params)
virtual void SaveSeq_idTaxId(CReaderRequestResult &result, const CSeq_id_Handle &seq_id)
virtual void SaveSeq_idAccVer(CReaderRequestResult &result, const CSeq_id_Handle &seq_id)
void x_WriteId(const string &key, const string &subkey, const char *data, size_t size)
virtual void SaveSequenceLength(CReaderRequestResult &result, const CSeq_id_Handle &seq_id)
virtual void SaveSeq_idLabel(CReaderRequestResult &result, const CSeq_id_Handle &seq_id)
void WriteSeq_ids(const string &key, const CLoadLockSeqIds &ids)
virtual void SaveSeq_idGi(CReaderRequestResult &result, const CSeq_id_Handle &seq_id)
virtual void ResetCache(void)
virtual void SaveSequenceHash(CReaderRequestResult &result, const CSeq_id_Handle &seq_id)
virtual void SaveSeq_idBlob_ids(CReaderRequestResult &result, const CSeq_id_Handle &seq_id, const SAnnotSelector *sel)
virtual CRef< CBlobStream > OpenBlobStream(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, const CProcessor &processor)
virtual void SaveBlobState(CReaderRequestResult &result, const TBlobId &blob_id, TBlobState blob_state)
virtual void SaveSeq_idSeq_ids(CReaderRequestResult &result, const CSeq_id_Handle &seq_id)
virtual void SaveBlobVersion(CReaderRequestResult &result, const TBlobId &blob_id, TBlobVersion version)
TState GetState(void) const
size_t size(void) const
size_t size(void) const
static bool IsFound(const TData &data)
TData GetAccVer(void) const
static const CSeq_id_Handle & GetAcc(const TData &data)
bool IsLoadedAccVer(void) const
static GBL::EExpirationType GetExpType(const TData &data)
static GBL::EExpirationType GetExpType(const TData &data)
TData GetBlob_ids(void) const
TData GetBlobVersion(void) const
TBlobVersion GetKnownBlobVersion(void) const
bool IsLoadedGi(void) const
static bool IsFound(const TData &data)
static TGi GetGi(const TData &data)
static GBL::EExpirationType GetExpType(const TData &data)
static GBL::EExpirationType GetExpType(const TData &data)
bool IsLoadedHash(void) const
static int GetHash(const TData &data)
static GBL::EExpirationType GetExpType(const TData &data)
bool IsLoadedLabel(void) const
TData GetLabel(void) const
TData GetLength(void) const
bool IsLoadedLength(void) const
static GBL::EExpirationType GetExpType(const TData &data)
TData GetSeq_ids(void) const
static GBL::EExpirationType GetExpType(const TData &data)
bool IsLoadedTaxId(void) const
TData GetTaxId(void) const
static GBL::EExpirationType GetExpType(const TData &data)
static CSeq_inst::TMol GetType(const TData &data)
bool IsLoadedType(void) const
static GBL::EExpirationType GetExpType(const TData &data)
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
Definition: ncbistre.hpp:802
CObjectOStreamAsnBinary –.
Definition: objostrasnb.hpp:58
CObjectOStream –.
Definition: objostr.hpp:83
static bool IsExtAnnot(const TBlobId &blob_id)
virtual void RegisterCache(ICache &cache, ECacheType cache_type)=0
CRef –.
Definition: ncbiobj.hpp:618
Template class helps to implement one driver class factory.
definition of a Culling tree
Definition: ncbi_tree.hpp:100
CVersionInfo –.
Writer-based output stream.
Definition: rwstream.hpp:171
int TChunkId
Definition: writer.hpp:59
@ eIdWriter
Definition: writer.hpp:66
int TBlobState
Definition: writer.hpp:60
int TBlobVersion
Definition: writer.hpp:61
static void WriteProcessorTag(CNcbiOstream &stream, const CProcessor &processor)
Definition: writer.cpp:99
BLOB cache read/write/maintenance interface.
Definition: icache.hpp:64
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 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.
static const struct name_t names[]
static const char * str(char *buf, int n)
Definition: stats.c:84
char data[12]
Definition: iconv.c:80
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define INVALID_TAX_ID
Definition: ncbimisc.hpp:1116
#define TAX_ID_TO(T, tax_id)
Definition: ncbimisc.hpp:1110
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
Definition: ncbimisc.hpp:878
#define GI_TO(T, gi)
Definition: ncbimisc.hpp:1085
NCBI_XNCBI_EXPORT void Abort(void)
Smart abort function.
Definition: ncbidiag.cpp:8150
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
Definition: ncbidiag.hpp:186
string AsString(void) const
static void NCBI_EntryPointImpl(TDriverInfoList &info_list, EEntryPointRequest method)
Entry point implementation.
#define NCBI_INTERFACE_VERSION(iface)
Macro to construct CVersionInfo class using interface name (relies on CInterfaceVersion class)
list< SDriverInfo > TDriverInfoList
List of driver information.
EEntryPointRequest
Actions performed by the entry point.
int32_t Int4
4-byte (32-bit) signed integer
Definition: ncbitype.h:102
int64_t Int8
8-byte (64-bit) signed integer
Definition: ncbitype.h:104
#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 StringToBool(const CTempString str)
Convert string to bool.
Definition: ncbistr.cpp:2812
#define kEmptyStr
Definition: ncbistr.hpp:123
const TTreeType * FindNode(const TKeyType &key, TNodeSearchMode sflag=eImmediateAndTop) const
Search for node.
Definition: ncbi_tree.hpp:970
const TValue & GetValue(void) const
Return node's value.
Definition: ncbi_tree.hpp:184
Interfaces for a local cache of versioned binary large objects (BLOBS).
@ eExpire_normal
Definition: info_cache.hpp:79
static MDB_envinfo info
Definition: mdb_load.c:37
const string version
version string
Definition: variables.hpp:66
const struct ncbi::grid::netcache::search::fields::SIZE size
const struct ncbi::grid::netcache::search::fields::KEY key
const struct ncbi::grid::netcache::search::fields::SUBKEY subkey
@ kMain_ChunkId
Definition: blob_id.hpp:147
#define NCBI_GBLOADER_WRITER_CACHE_DRIVER_NAME
#define NCBI_GBLOADER_WRITER_CACHE_PARAM_SHARE
@ eAlreadyLoaded
Reader-writer based streams.
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,...
SAnnotSelector –.
static void GetBlob_idsSubkey(const SAnnotSelector *sel, string &subkey, string &true_subkey)
Id cache subkeys:
static ICache * CreateCache(const TParams *params, EReaderOrWriter reader_or_writer, EIdOrBlob id_or_blob)
static string GetBlobSubkey(CLoadLockBlob &blob, int chunk_id=kMain_ChunkId)
BLOB cache subkeys:
static string GetIdKey(const CSeq_id &id)
Return Id cache key string based on CSeq_id of gi.
static const char * GetAccVerSubkey(void)
static const char * GetTypeSubkey(void)
static const char * GetBlobStateSubkey(void)
static const char * GetGiSubkey(void)
static int GetDebugLevel(void)
static const char * GetHashSubkey(void)
static const char * GetLabelSubkey(void)
static const char * GetLengthSubkey(void)
static const char * GetTaxIdSubkey(void)
static const char * GetSeq_idsSubkey(void)
static const char * GetBlobVersionSubkey(void)
static string GetBlobKey(const CBlob_id &blob_id)
Return BLOB cache key string based on Sat() and SatKey()
static const int BLOB_IDS_MAGIC
Definition: type.c:6
#define _ASSERT
else result
Definition: token2.c:20
void GenBankWriters_Register_Cache(void)
void NCBI_EntryPoint_CacheWriter(CPluginManager< CWriter >::TDriverInfoList &info_list, CPluginManager< CWriter >::EEntryPointRequest method)
void NCBI_EntryPoint_xwriter_cache(CPluginManager< CWriter >::TDriverInfoList &info_list, CPluginManager< CWriter >::EEntryPointRequest method)
Modified on Fri Sep 20 14:58:27 2024 by modify_doxy.py rev. 669887