old_level = var;
150 #define FAILS_VAR(name, suffix) NCBI_NAME3(VDB_, name, suffix) 152 #define VDB_RESOLVE_RANDOM_FAILS 1 153 #define VDB_OPEN_RANDOM_FAILS 1 154 #define VDB_SCHEMA_RANDOM_FAILS 1 155 #define VDB_READ_RANDOM_FAILS 1 157 #define VDB_RESOLVE_RANDOM_FAILS_FREQUENCY 20 158 #define VDB_RESOLVE_RANDOM_FAILS_RECOVER 10 159 #define VDB_OPEN_RANDOM_FAILS_FREQUENCY 10 160 #define VDB_OPEN_RANDOM_FAILS_RECOVER 5 161 #define VDB_SCHEMA_RANDOM_FAILS_FREQUENCY 50 162 #define VDB_SCHEMA_RANDOM_FAILS_RECOVER 100 163 #define VDB_READ_RANDOM_FAILS_FREQUENCY 20000 164 #define VDB_READ_RANDOM_FAILS_RECOVER 1000 166 #if defined(VDB_RANDOM_FAILS) 167 static bools_Fails(
unsignedfrequency)
170 returns_Random->GetRandIndex(frequency) == 0;
172 # define SIMULATE_ERROR(name) \ 173 if ( !(FAILS_VAR(name, _RANDOM_FAILS)) ) { \ 176 static thread_local unsigned recover_counter = 0; \ 177 if ( recover_counter > 0 ) { \ 181 if ( s_Fails(FAILS_VAR(name, _RANDOM_FAILS_FREQUENCY)) ) { \ 182 recover_counter = (FAILS_VAR(name, _RANDOM_FAILS_RECOVER)); \ 183 ERR_POST("VDB: Simulated "#name " failure: "<<CStackTrace()); \
184NCBI_THROW(CSraException, eOtherError, \
185"Simulated " #name " failure"); \
190 # define SIMULATE_ERROR(name) ((void)0) 193 #define SIMULATE_RESOLVE_ERROR() SIMULATE_ERROR(RESOLVE) 194 #define SIMULATE_OPEN_ERROR() SIMULATE_ERROR(OPEN) 195 #define SIMULATE_SCHEMA_ERROR() SIMULATE_ERROR(SCHEMA) 196 #define SIMULATE_READ_ERROR() SIMULATE_ERROR(READ) 205 if(
rc_trc = KConfigMake(&cfg, 0) ) {
208 "Cannot create KConfig", rc);
217 if(
rc_trc = KConfigAddRef(*
this) ) {
220 "Cannot get reference to KConfig", rc);
229 "Cannot create KConfig singleton", rc);
236 if(
rc_trc = KConfigCommit(
const_cast<KConfig*
>(
GetPointer())) ) {
238 "CKConfig: Cannot commit config changes", rc);
263 "Cannot create VFSManager", rc);
273 "Cannot get VFSManager", rc);
284 if(
rc_trc = VDBManagerGetKDBManagerRead(mgr,
x_InitPtr()) ) {
287 "Cannot get KDBManager", rc);
301 "Cannot make KNSManager", rc);
311 "Cannot get KNSManager", rc);
335 if(
rc_trc = VFSManagerMakeSysPath(mgr, &vpath, path.c_str()) ) {
338 "Cannot create sys VPath: "<<path, rc);
342 if(
rc_trc = VFSManagerMakeAccPath(mgr, &vpath, path.c_str()) ) {
345 "Cannot create acc VPath: "<<path, rc);
349 if(
rc_trc = VFSManagerMakePath(mgr, &vpath, path.c_str()) ) {
352 "Cannot create VPath: "<<path, rc);
366 if(
size== 4 && memcmp(
buffer,
"file", 4) == 0 ) {
369 if(
size== 9 && memcmp(
buffer,
"ncbi-file", 9) == 0 ) {
378 constString*
str= 0;
380 if(
rc_trc = VPathMakeSysPath(*
this, &
str)) {
382 "Cannot get path from VPath", rc);
386 if(
rc_trc = VPathMakeString(*
this, &
str)) {
388 "Cannot get path from VPath", rc);
391 stringret(
str->addr,
str->size);
402 returns.length() >= 2 &&
isalpha(s[0]&0xff) && s[1] ==
':';
411acc_or_path.find_first_of(
"/\\") ==
NPOS;
413 returnacc_or_path.find(
'/') ==
NPOS;
423 if( sys_path[0] ==
'h'&&
430replace(path.begin(), path.end(),
'\\',
'/');
433path[1] =
toupper(path[0] & 0xff);
464 "Cannot get VResolver", rc);
472 if(
rc_trc = VFSManagerMakeResolver(mgr,
x_InitPtr(), cfg) ) {
475 "Cannot create VResolver", rc);
489 rc_trc = VResolverLocal(*
this, acc, &path);
491 if( GetRCObject(rc) == rcName &&
492GetRCState(rc) == rcNotFound &&
493GetRCContext(rc) == rcResolving ) {
498 "VResolverLocal("<<acc_or_path<<
") failed", rc);
500rc = VResolverRemote(*
this, eProtocolNone, acc, &path);
504 if( GetRCObject(rc) == rcName &&
505GetRCState(rc) == rcNotFound &&
506GetRCContext(rc) == rcResolving ) {
511 "VResolverRemote("<<acc_or_path<<
") failed", rc);
513 if(
CDirEntry(acc_or_path).Exists() ) {
519 "Cannot find acc path: "<<acc_or_path, rc);
559 LOG_POST_X(6,
"CVDBMgr: resolving VDB accession: "<< acc_or_path);
563 LOG_POST_X(4,
"CVDBMgr: resolved VDB accession: "<< acc_or_path <<
" -> "<< path);
573 LOG_POST_X(7,
"CVDBMgr: checking file symbolic link: "<< acc_or_path <<
" -> "<< path);
578 if( de.
GetPath() != path ) {
581 LOG_POST_X(5,
"CVDBMgr: resolved file symbolic link: "<< acc_or_path <<
" -> "<< path);
592 if( path[0] ==
'h'&&
600 if( !
CDirEntry(path).GetTime(×tamp) ) {
602 "Cannot get timestamp of local path: "<< path);
609 LOG_POST_X(3,
"CVDBMgr: timestamp of "<< path <<
": "<<
CTime(timestamp).ToLocalTime());
622:
public CSraRef<KClientHttpRequest>
627 constver_t kHTTP_1_1 = 0x01010000;
628 if(
rc_trc = KNSManagerMakeClientRequest(mgr,
x_InitPtr(),
630 "%s", path.c_str()) ) {
634 "Cannot create http client request", rc);
643:
public CSraRef<KClientHttpResult>
652 if(
rc_trc = KClientHttpRequestHEAD(request,
x_InitPtr()) ) {
656 "Cannot get http HEAD", rc);
672 if(
rc_trc = KClientHttpResultGetHeader(
result,
"Last-Modified",
676 "No Last-Modified header in HEAD response", rc);
685 #ifdef NCBI_COMPILER_MSVC 690 # define DECLARE_SDK_GUARD() CFastMutexGuard guard(sx_SDKMutex) 692 # define DECLARE_SDK_GUARD() 696 # define DECLARE_SDK_GET_GUARD() CFastMutexGuard guard(sx_SDKMutex) 698 # define DECLARE_SDK_GET_GUARD() 717SraReleaseVersion release_version;
718SraReleaseVersionGet(&release_version);
719s << (release_version.version>>24) <<
'.' 720<< ((release_version.version>>16)&0xff) <<
'.' 721<< (release_version.version&0xffff);
722 if( release_version.revision != 0 ||
723release_version.type != SraReleaseVersion::eSraReleaseVersionTypeFinal ) {
724 const char*
type=
"";
725 switch( release_version.type ) {
726 caseSraReleaseVersion::eSraReleaseVersionTypeDev:
type=
"dev";
break;
727 caseSraReleaseVersion::eSraReleaseVersionTypeAlpha:
type=
"a";
break;
728 caseSraReleaseVersion::eSraReleaseVersionTypeBeta:
type=
"b";
break;
729 caseSraReleaseVersion::eSraReleaseVersionTypeRC:
type=
"RC";
break;
730 default:
type=
"";
break;
732s <<
'-'<<
type<< release_version.revision;
756{
"debug:",
Trace},
757{
"fatal:",
Fatal},
761 if( !token.
empty() && token[token.
size()-1] ==
':') {
763 if( token ==
tag.tag ) {
772 staticthread::id s_DiagCheckThreadID;
778s_DiagCheckThreadID = this_thread::get_id();
785 returns_DiagCheckThreadID == this_thread::get_id();
799 for(
SIZE_TYPEtoken_pos = 0, token_end; token_pos <
msg.size(); token_pos = token_end + 1 ) {
800token_end =
msg.find(
' ', token_pos);
801 if( token_end ==
NPOS) {
802token_end =
msg.size();
805sev_manip =
tag->manip;
809 if( sev_manip ==
Trace) {
828 stringhost = app->GetConfig().GetString(
"CONN",
"HTTP_PROXY_HOST",
kEmptyStr);
829 intport = app->GetConfig().GetInt(
"CONN",
"HTTP_PROXY_PORT", 0);
830 if( !host.empty() && port != 0 ) {
834 "/http/proxy/path", path.c_str()) ) {
836 "Cannot set KConfig proxy path", rc);
839 "/http/proxy/enabled",
true) ) {
841 "Cannot set KConfig proxy enabled", rc);
871 autoreq_ctx_version = req_ctx.
GetVersion();
872 if( &req_ctx == s_LastRequestContext && req_ctx_version == s_LastRequestContextVersion ) {
875 _TRACE(
"CVDBMgr: Updating request context with version: "<<req_ctx_version);
876s_LastRequestContext = &req_ctx;
877s_LastRequestContextVersion = req_ctx_version;
881KNSManagerSetSessionID(kns_mgr, req_ctx.
GetSessionID().c_str());
885KNSManagerSetClientIP(kns_mgr, req_ctx.
GetClientIP().c_str());
889KNSManagerSetPageHitID(kns_mgr, req_ctx.
GetHitID().c_str());
897 if( app && app->
GetConfig().
GetBool(
"VDB",
"ALLOW_ALL_CERTS",
false) ) {
898 if(
rc_trc = KNSManagerSetAllowAllCerts(kns_mgr,
true) ) {
900 "Cannot enable all HTTPS certificates in KNSManager", rc);
913 #ifdef NCBI_PRODUCTION_VER 914 str<< NCBI_PRODUCTION_VER <<
"/";
916 #ifdef NCBI_DEVELOPMENT_VER 920KNSManagerSetUserAgent(kns_mgr,
"%s; VDB %s",
942 static boolinitialized =
false;
943 if( !initialized ) {
950ask_level = klogDebug;
952ask_level = klogInfo;
955KLogLevelSet(ask_level);
959 const char*
msg=
"info: VDB initialized";
978 #ifndef UPDATE_REQUEST_CONTEXT_FINAL 992 #ifndef UPDATE_REQUEST_CONTEXT_FINAL 993 size_t r= s_RequestContextUpdaterRecursion;
994s_RequestContextUpdaterRecursion =
r+1;
1006 #ifndef UPDATE_REQUEST_CONTEXT_FINAL 1007 size_t r= s_RequestContextUpdaterRecursion;
1008s_RequestContextUpdaterRecursion =
r+1;
1020 #ifndef UPDATE_REQUEST_CONTEXT_FINAL 1021 size_t r= s_RequestContextUpdaterRecursion;
1022s_RequestContextUpdaterRecursion =
r-1;
1029 #ifndef UPDATE_REQUEST_CONTEXT_FINAL 1030 size_t r= s_RequestContextUpdaterRecursion;
1031s_RequestContextUpdaterRecursion =
r-1;
1042 "Cannot open VDBManager", rc);
1045VFSManagerLogNamesServiceErrors(vfs_mgr,
false);
1048VDBManagerDisablePagemapThread(*
this);
1057 if(
rc_trc = VDBManagerGetCacheRoot(*
this, &ret) ) {
1058 if( GetRCObject(rc) == RCObject(rcPath) &&
1059GetRCState(rc) == rcNotFound ) {
1063 "CVDBMgr: Cannot get cache root", rc);
1072 if(
rc_trc = VDBManagerSetCacheRoot(*
this, vpath) ) {
1074 "CVDBMgr: Cannot set cache root", rc);
1081 if(
rc_trc = VDBManagerDeleteCacheOlderThan(*
this, days) ) {
1083 "CVDBMgr: Cannot delete old cache files", rc);
1098: m_Name(acc_or_path)
1101 LOG_POST_X(8,
"CVDBMgr: opening VDB: "<< acc_or_path);
1107 if(
rc_trc = VDBManagerOpenDBRead(mgr,
x_InitPtr(), 0,
"%.*s",
1108 int(path.size()), path.data()) ) {
1110 string msg=
"Cannot open VDB: "+acc_or_path;
1112 if( (GetRCObject(rc) == RCObject(rcDirectory) ||
1113GetRCObject(rc) == RCObject(rcPath) ||
1114GetRCObject(rc) == RCObject(rcFile)) &&
1115GetRCState(rc) == rcNotFound ) {
1119 else if( GetRCObject(rc) == rcName &&
1120GetRCState(rc) == rcNotFound &&
1121GetRCContext(rc) == rcResolving ) {
1125 else if( GetRCObject(rc) == RCObject(rcFile) &&
1126GetRCState(rc) == rcUnauthorized ) {
1130 else if( GetRCObject(rc) == RCObject(rcDatabase) &&
1131GetRCState(rc) == rcIncorrect ) {
1141 LOG_POST_X(9,
"CVDBMgr: opened VDB: "<< acc_or_path <<
" ("<< path <<
")");
1144 constKDatabase* kdb = 0;
1145 if(
rc_trc = VDatabaseOpenKDatabaseRead(*
this, &kdb) ) {
1148 const char* kdb_path = 0;
1149 if(
rc_trc = KDatabaseGetPath(kdb, &kdb_path) ) {
1152 LOG_POST(
"CVDB("<<acc_or_path<<
") -> "<<path<<
" -> "<<kdb_path);
1153 if(
rc_trc = KDatabaseRelease(kdb) ) {
1189RCState rc_state = GetRCState(rc);
1190 intrc_object = GetRCObject(rc);
1191 if( rc_state == rcNotFound &&
1192(rc_object == rcParam ||
1193rc_object == rcPath) ) {
1209 const string& acc_or_path,
1211: m_Name(acc_or_path)
1218 if(
rc_trc = VDBManagerOpenTableRead(mgr,
x_InitPtr(), 0,
"%.*s",
1219 int(path.size()), path.data()) ) {
1221 string msg=
"Cannot open VDB: "+acc_or_path;
1223 if( (GetRCObject(rc) == RCObject(rcDirectory) ||
1224GetRCObject(rc) == RCObject(rcPath)) &&
1225GetRCState(rc) == rcNotFound ) {
1232 else if( GetRCObject(rc) == RCObject(rcDatabase) &&
1233GetRCState(rc) == rcIncorrect ) {
1277 const char* index_name,
1288 if( GetRCObject(rc) == RCObject(rcIndex) &&
1289GetRCState(rc) == rcNotFound ) {
1318 if(
rc_trc = KIndexFindText(*
this,
value.c_str(),
1319&range.first, &range.second, 0, 0) ) {
1321 if( GetRCObject(rc) == RCObject(rcString) &&
1322GetRCState(rc) == rcNotFound ) {
1324range.first = range.second = 0;
1328 "Cannot find value in index: "<<*
this<<
": "<<
value, rc);
1350 "Cannot init VDB cursor again",
1351 RC(rcApp, rcCursor, rcConstructing, rcSelf, rcOpen));
1355 "Cannot init VDB cursor",
1356 RC(rcApp, rcCursor, rcConstructing, rcTable, rcNull));
1362 "Cannot create VDB cursor: "<<
table, rc);
1364 if(
rc_trc = VCursorPermitPostOpenAdd(*
this) ) {
1366 "Cannot allow VDB cursor post open column add: "<<
table, rc);
1368 if(
rc_trc = VCursorOpen(*
this) ) {
1371 "Cannot open VDB cursor: "<<
table, rc);
1382 if(
rc_trc = VCursorCloseRow(*
this) ) {
1384 "Cannot close VDB cursor row", rc);
1394 if(
rc_trc = VCursorSetRowId(*
this, row_id) ) {
1397 if(
rc_trc = VCursorOpenRow(*
this) ) {
1410 "Cannot open VDB cursor row: "<<*
this<<
": "<<row_id, rc);
1418 if(
rc_trc = VCursorIdRange(*
this,
column, &ret.first, &ret.second) ) {
1421 "Cannot get VDB cursor row range: "<<*
this<<
": "<<
column, rc);
1430 returnrange.first+range.second-1;
1437 if(
rc_trc = VCursorParamsSet
1439name,
"%.*s",
value.size(),
value.data()) ) {
1441 "Cannot set VDB cursor param: "<<*
this<<
": "<<name,
1452 uint32_tread_count, remaining_count;
1453 if(
rc_trc = VCursorReadBitsDirect(*
this,
row,
column.GetIndex(),
1454elem_bits, 0, 0, 0, 0,
1455&read_count, &remaining_count) ) {
1457 '['<<
row<<
']', rc);
1459 "Cannot read VDB value array size: "<<*
this<<
column<<
1460 '['<<
row<<
']', rc);
1462 returnremaining_count;
1473 uint32_tread_count, remaining_count;
1474 if(
rc_trc = VCursorReadBitsDirect(*
this,
row,
column.GetIndex(),
1476&read_count, &remaining_count) ) {
1478 '['<<
row<<
"]["<<start<<
".."<<(start+
count-1)<<
']', rc);
1480 "Cannot read VDB value array: "<<*
this<<
column<<
1481 '['<<
row<<
"]["<<start<<
".."<<(start+
count-1)<<
']', rc);
1483 if( read_count !=
count) {
1485 "Cannot read VDB value array: "<<*
this<<
column<<
1486 '['<<
row<<
"]["<<start<<
".."<<(start+
count-1)<<
1487 "] only "<<read_count<<
" elements are read");
1528TObjects::iterator best_it;
1532 if( slot_row >=
row) {
1534 if( d <= best_d ) {
1547 CObject* obj = best_it->second.Release();
1584 size_telement_bit_size,
1586 const char* backup_name,
1594 "NULL column name is not allowed"<<cursor<<*
this);
1601 if(
rc_trc = VCursorAddColumn(cursor, &
m_Index, name) ) {
1604(rc = VCursorAddColumn(cursor, &
m_Index, backup_name)) == 0 ) {
1612 "Cannot get VDB column: "<<cursor<<*
this,rc);
1619 if( element_bit_size ) {
1624 "Cannot get VDB column type: "<<cursor<<*
this,rc);
1626 size_t size=
type.intrinsic_bits*
type.intrinsic_dim;
1627 if(
size!= element_bit_size ) {
1628 ERR_POST_X(1,
"Wrong VDB column size "<<cursor<<*
this<<
1629 " expected "<<element_bit_size<<
" bits != "<<
1630 type.intrinsic_dim<<
"*"<<
type.intrinsic_bits<<
" bits");
1632 "Wrong VDB column size: "<<cursor<<*
this<<
": "<<
size,
1633 RC(rcApp, rcColumn, rcConstructing, rcSelf, rcIncorrect));
1642 if(
rc_trc = VCursorIsStaticColumn(cursor,
GetIndex(), &static_value) ) {
1644 "Cannot get static status of "<<cursor<<*
this,rc);
1646 returnstatic_value;
1693 if(
rc_trc = VCursorCellData(cursor,
column.GetIndex(),
1694&bit_length, &
m_Data, &bit_offset,
1698 "Cannot read VDB value: "<<cursor<<
column, rc);
1702 "Cannot read VDB value with non-zero bit offset: " 1703<<cursor<<
column<<
": "<<bit_offset,
1704 RC(rcApp, rcColumn, rcDecoding, rcOffset, rcUnsupported));
1708 if( bit_length == 8 ) {
1711 else if( bit_length == 16 ) {
1719 else if( bit_length == 32 ) {
1727 else if( bit_length == 64 ) {
1736s <<
"*** bad bit_length="<<bit_length;
1752 if(
rc_trc = VCursorCellDataDirect(cursor,
row,
column.GetIndex(),
1753&bit_length, &
m_Data, &bit_offset,
1762 "Cannot read VDB value: "<<cursor<<
column<<
'['<<
row<<
']', rc);
1766 "Cannot read VDB value with non-zero bit offset: "<<
1767cursor<<
column<<
'['<<
row<<
"]: "<<bit_offset,
1768 RC(rcApp, rcColumn, rcDecoding, rcOffset, rcUnsupported));
1772 if( bit_length == 8 ) {
1775 else if( bit_length == 16 ) {
1783 else if( bit_length == 32 ) {
1791 else if( bit_length == 64 ) {
1800s <<
"*** bad bit_length="<<bit_length;
1810 if( index >=
size() ) {
1812 "Invalid index for VDB value array: "<<
1813*
this<<
'['<<index<<
']',
1814 RC(rcApp, rcData, rcRetrieving, rcOffset, rcTooBig));
1821 if(
size() != 1 ) {
1823 "VDB value array doen't have single value: "<<
1824*
this<<
'['<<
size()<<
']',
1825 RC(rcApp, rcData, rcRetrieving, rcSize, rcIncorrect));
1832 if( pos >
size() ) {
1834 "Invalid index for VDB value array: "<<
1835*
this<<
'['<<pos<<
']',
1836 RC(rcApp, rcData, rcRetrieving, rcOffset, rcTooBig));
1838 if( pos+
len< pos ) {
1840 "Invalid length for VDB value sub-array: "<<
1841*
this<<
'['<<pos<<
','<<
len<<
']',
1842 RC(rcApp, rcData, rcRetrieving, rcOffset, rcTooBig));
1846 "Invalid end of VDB value sub-array: "<<
1847*
this<<
'['<<pos<<
','<<
len<<
']',
1848 RC(rcApp, rcData, rcRetrieving, rcOffset, rcTooBig));
1866 uint32_tbit_offset, bit_length, elem_count;
1868 if(
rc_trc = VCursorCellDataDirect(cursor,
row,
column.GetIndex(),
1869&bit_length, &
data, &bit_offset,
1872cursor<<
column<<
'['<<
row<<
']', rc);
1874 "Cannot read VDB 4-bits value array: "<<
1875cursor<<
column<<
'['<<
row<<
']', rc);
1877 if( bit_offset >= 8 || (bit_offset&3) ) {
1879 "Cannot read VDB 4-bits value array with odd bit offset"<<
1880cursor<<
column<<
'['<<
row<<
"]: "<<bit_offset,
1881 RC(rcApp, rcColumn, rcDecoding, rcOffset, rcUnsupported));
1883m_RawData =
static_cast<const char*
>(
data);
1884m_ElemOffset = bit_offset >> 2;
1888 if( bit_length == 4 ) {
1897s <<
"*** bad bit_length="<<bit_length;
1907 if( index >=
size() ) {
1909 "Invalid index for VDB 4-bits value array: "<<
1910*
this<<
'['<<index<<
']',
1911 RC(rcApp, rcData, rcRetrieving, rcOffset, rcTooBig));
1919 if( pos >
size() ) {
1921 "Invalid index for VDB 4-bits value array: "<<
1922*
this<<
'['<<pos<<
']',
1923 RC(rcApp, rcData, rcRetrieving, rcOffset, rcTooBig));
1925 if( pos+
len< pos ) {
1927 "Invalid length for VDB 4-bits value sub-array: "<<
1928*
this<<
'['<<pos<<
','<<
len<<
']',
1929 RC(rcApp, rcData, rcRetrieving, rcOffset, rcTooBig));
1933 "Invalid end of VDB 4-bits value sub-array: "<<
1934*
this<<
'['<<pos<<
','<<
len<<
']',
1935 RC(rcApp, rcData, rcRetrieving, rcOffset, rcTooBig));
1943 size_t offset= m_ElemOffset + pos;
1944 const char* raw_data = m_RawData +
offset/2;
1964 uint32_tbit_offset, bit_length, elem_count;
1966 if(
rc_trc = VCursorCellDataDirect(cursor,
row,
column.GetIndex(),
1967&bit_length, &
data, &bit_offset,
1970cursor<<
column<<
'['<<
row<<
']', rc);
1972 "Cannot read VDB 2-bits value array: "<<
1973cursor<<
column<<
'['<<
row<<
']', rc);
1975 if( bit_offset >= 8 || (bit_offset&1) ) {
1977 "Cannot read VDB 2-bits value array with odd bit offset"<<
1978cursor<<
column<<
'['<<
row<<
"]: "<<bit_offset,
1979 RC(rcApp, rcColumn, rcDecoding, rcOffset, rcUnsupported));
1981m_RawData =
static_cast<const char*
>(
data);
1982m_ElemOffset = bit_offset >> 1;
1986 if( bit_length == 2 ) {
1995s <<
"*** bad bit_length="<<bit_length;
2005 if( index >=
size() ) {
2007 "Invalid index for VDB 2-bits value array: "<<
2008*
this<<
'['<<index<<
']',
2009 RC(rcApp, rcData, rcRetrieving, rcOffset, rcTooBig));
2017 if( pos >
size() ) {
2019 "Invalid index for VDB 2-bits value array: "<<
2020*
this<<
'['<<pos<<
']',
2021 RC(rcApp, rcData, rcRetrieving, rcOffset, rcTooBig));
2023 if( pos+
len< pos ) {
2025 "Invalid length for VDB 2-bits value sub-array: "<<
2026*
this<<
'['<<pos<<
','<<
len<<
']',
2027 RC(rcApp, rcData, rcRetrieving, rcOffset, rcTooBig));
2031 "Invalid end of VDB 2-bits value sub-array: "<<
2032*
this<<
'['<<pos<<
','<<
len<<
']',
2033 RC(rcApp, rcData, rcRetrieving, rcOffset, rcTooBig));
2041 size_t offset= m_ElemOffset + pos;
2042 const char* raw_data = m_RawData +
offset/4;
CClientHttpRequest(const CKNSManager &mgr, const string &path)
CClientHttpResult(const CClientHttpRequest &request, EHead)
CFinalRequestContextUpdater()
CFinalRequestContextUpdater(const CFinalRequestContextUpdater &)=delete
~CFinalRequestContextUpdater()
CKDBManager(const CVDBMgr &mgr)
CKNSManager(const CVFSManager &mgr)
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
TObject ** x_InitPtr(void)
TObject * GetPointer(void) const
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
TVDBColumnIdx GetIndex(void) const
void ResetIfAlwaysEmpty(const CVDBCursor &cursor)
bool IsStatic(const CVDBCursor &cursor) const
void Init(const CVDBCursor &cursor, size_t element_bit_size, const char *name, const char *backup_name, EMissing missing)
rc_t OpenRowRc(TVDBRowId row_id)
void OpenRow(TVDBRowId row_id)
bool RowIsOpened(void) const
uint32_t GetElementCount(TVDBRowId row, const CVDBColumn &column, uint32_t elem_bits) const
const CVDBTable & GetTable(void) const
void ReadElements(TVDBRowId row, const CVDBColumn &column, uint32_t elem_bits, uint32_t start, uint32_t count, void *buffer) const
void SetParam(const char *name, const CTempString &value) const
void Init(const CVDBTable &table)
TVDBRowId GetMaxRowId(void) const
TVDBRowIdRange GetRowIdRange(TVDBColumnIdx column=0) const
~CRequestContextUpdater()
void DeleteCacheOlderThan(Uint4 days)
static int SetDebugLevel(int new_level)
string GetCacheRoot() const
string FindDereferencedAccPath(const string &acc_or_path) const
CTime GetTimestamp(const string &path) const
CTime GetURLTimestamp(const string &url) const
string FindAccPath(const string &acc) const
void SetCacheRoot(const string &path)
static int GetDebugLevel()
void CommitConfig() const
CObject * Get(TVDBRowId row)
void Put(CObject *curs, TVDBRowId row)
pair< TVDBRowId, CRef< CObject > > TSlot
~CVDBObjectCacheBase(void)
CVDBObjectCacheBase(void)
string GetFullName(void) const
CNcbiOstream & PrintFullName(CNcbiOstream &out) const
const char * GetName(void) const
const CVDBTable & GetTable(void) const
TVDBRowIdRange Find(const string &value) const
string GetFullName(void) const
const CVDB & GetDb(void) const
const string & GetName(void) const
CNcbiOstream & PrintFullName(CNcbiOstream &out) const
CNcbiOstream & PrintFullName(CNcbiOstream &out) const
void x_Get(const CVDBCursor &cursor, TVDBRowId row, const CVDBColumn &column)
void x_ReportIndexOutOfBounds(size_t index) const
CVDBValueFor2Bits substr(size_t pos, size_t len) const
void x_CheckRange(size_t pos, size_t len) const
void x_CheckRange(size_t pos, size_t len) const
CVDBValueFor4Bits substr(size_t pos, size_t len) const
void x_ReportIndexOutOfBounds(size_t index) const
CNcbiOstream & PrintFullName(CNcbiOstream &out) const
void x_Get(const CVDBCursor &cursor, TVDBRowId row, const CVDBColumn &column)
void x_CheckRange(size_t pos, size_t len) const
CNcbiOstream & PrintFullName(CNcbiOstream &out) const
void x_Get(const CVDBCursor &cursor, const CVDBColumn &column)
void x_ReportNotOneValue(void) const
void x_ReportIndexOutOfBounds(size_t index) const
const string & GetFullName(void) const
const string & GetName(void) const
CNcbiOstream & PrintFullName(CNcbiOstream &out) const
string ToString(EType type=eSys) const
static string ConvertAccOrSysPathToPOSIX(const string &acc_or_path)
void x_Init(const CVFSManager &mgr, const string &path, EType type)
static bool IsPlainAccession(const string &acc_or_path)
static string ConvertSysPathToPOSIX(const string &sys_path)
CVResolver(const CVFSManager &mgr)
string Resolve(const string &acc) const
std::ofstream out("events_result.xml")
main entry point for tests
static const char table_name[]
static const char * str(char *buf, int n)
static const char * column
static string GetAppName(EAppNameType name_type=eBaseName, int argc=0, const char *const *argv=NULL)
static CNcbiApplicationGuard InstanceGuard(void)
Singleton method.
const CNcbiRegistry & GetConfig(void) const
Get the application's cached configuration parameters (read-only).
CVersionInfo GetVersion(void) const
Get the program version information.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define LOG_POST_X(err_subcode, message)
const CNcbiDiag &(* FManip)(const CNcbiDiag &)
Diagnostic stream manipulator.
string GetSessionID(void) const
Session ID.
CAtomicCounter::TValue TVersion
bool IsSetSessionID(void) const
static CRequestContext & GetRequestContext(void)
Shortcut to CDiagContextThreadData::GetThreadData().GetRequestContext()
string GetClientIP(void) const
Client IP/hostname.
bool IsSetHitID(EHitIDSource src=eHitID_Any) const
Check if there's an explicit hit id or the default one.
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
bool IsSetClientIP(void) const
string GetHitID(void) const
Get explicit hit id or the default one (from HTTP_NCBI_PHID etc).
TVersion GetVersion(void) const
Return version increased on every context change (hit/subhit id, client ip, session id).
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
void Trace(CExceptionArgs_Base &args)
void Warning(CExceptionArgs_Base &args)
void Fatal(CExceptionArgs_Base &args)
#define NCBI_THROW2(exception_class, err_code, message, extra)
Throw exception with extra parameter.
#define NCBI_THROW_FMT(exception_class, err_code, message)
The same as NCBI_THROW but with message processed as output to ostream.
void Info(CExceptionArgs_Base &args)
static string CreateAbsolutePath(const string &path, ERelativeToWhat rtw=eRelativeToCwd)
Get an absolute path from some, possibly relative, path.
void DereferencePath(void)
Dereference a path.
virtual bool Exists(void) const
Check the entry existence.
const string & GetPath(void) const
Get entry path.
bool Referenced(void) const THROWS_NONE
Check if object is referenced.
#define NCBI_PARAM_TYPE(section, name)
Generate typename for a parameter from its {section, name} attributes.
@ eParam_NoThread
Do not use per-thread values.
uint32_t Uint4
4-byte (32-bit) unsigned integer
virtual bool GetBool(const string §ion, const string &name, bool default_value, TFlags flags=0, EErrAction err_action=eThrow) const
Get boolean value of specified parameter name.
#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.
NCBI_NS_STD::string::size_type SIZE_TYPE
static string PrintableString(const CTempString str, TPrintableMode mode=fNewLine_Quote|fNonAscii_Passthru)
Get a printable version of the specified string.
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string (in-place)
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
bool empty(void) const
Return true if the represented string is empty (i.e., the length is zero)
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
size_type size(void) const
Return the length of the represented array.
bool IsUniversalTime(void) const
Is time universal (GMT/UTC/Z)?
bool IsEmpty(void) const
Is time object empty (date and time)?
CTime & ToUniversalTime(void)
Convert the time into universal (GMT/UTC) time.
virtual string Print(void) const
Print version information.
#define NCBI_SRAREAD_EXPORT
#define NCBI_DEVELOPMENT_VER
Definition of all error codes used in SRA C++ support libraries.
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
const TYPE & Get(const CNamedParameterList *param)
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::SIZE size
string s_Value(TValue value)
const GenericPointer< typename T::ValueType > T2 value
#define NCBI_PACKAGE_NAME
#define NCBI_PACKAGE_VERSION
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
Multi-threading â mutexes; rw-locks; semaphore.
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
Defines CRequestContext class for NCBI C++ diagnostic API.
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
#define CHECK_VDB_TIMEOUT_FMT(msg, rc)
#define CHECK_VDB_TIMEOUT(msg, rc)
#define NCBI_THROW2_FMT(exception_class, err_code, message, extra)
#define row(bind, expected)
void Set(const CVDBCursor &cursor, TVDBRowId row, const CVDBColumn &column)
const CVDBTable * m_Table
const char * m_ColumnName
CNcbiOstream & PrintFullName(CNcbiOstream &out) const
static const SVDBSeverityTag kSeverityTags[]
static int & s_GetDebugLevelVar(void)
static const size_t kCacheSize
static char s_VDBVersion[32]
static bool s_HasWindowsDriveLetter(const string &s)
static rc_t VDBLogWriter(void *, const char *buffer, size_t size, size_t *written)
DEFINE_SRA_REF_TRAITS(VDBManager, const)
static void s_InitLocalKNS(KNSManager *kns_mgr)
DECLARE_SRA_REF_TRAITS(KClientHttpRequest,)
static void s_InitAllKNS(KNSManager *kns_mgr)
static int s_GetDiagHandler(void)
static const SVDBSeverityTag * s_GetVDBSeverityTag(CTempString token)
DEFINE_STATIC_FAST_MUTEX(sx_SDKMutex)
static void s_InitVDBVersion()
#define SIMULATE_RESOLVE_ERROR()
static CKConfig s_InitProxyConfig()
#define DECLARE_SDK_GET_GUARD()
static void s_InitStaticKNS(KNSManager *kns_mgr)
#define SIMULATE_SCHEMA_ERROR()
static void s_InitDiagCheck()
#define DECLARE_SDK_GUARD()
static bool s_DiagIsSafe()
NCBI_DEFINE_ERR_SUBCODE_X(9)
NCBI_PARAM_DEF(int, VDB, DIAG_HANDLER, 1)
static void s_UpdateVDBRequestContext(void)
static int s_SetDebugLevel(int new_level)
NCBI_PARAM_DECL(int, VDB, DIAG_HANDLER)
NCBI_PARAM_DEF_EX(int, VDB, DEBUG, 0, eParam_NoThread, VDB_DEBUG)
static DECLARE_TLS_VAR(const CRequestContext *, s_LastRequestContext)
static CNcbiOstream & operator<<(CNcbiOstream &out, const CVDBTable &obj)
static int s_GetDebugLevel()
#define SIMULATE_OPEN_ERROR()
pair< TVDBRowId, TVDBRowCount > TVDBRowIdRange
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4