A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/vdbread_8cpp_source.html below:

NCBI C++ ToolKit: src/sra/readers/sra/vdbread.cpp Source File

40 #include <klib/text.h> 41 #include <klib/sra-release-version.h> 42 #include <kfg/config.h> 43 #include <kdb/manager.h> 44 #include <kdb/database.h> 45 #include <kdb/kdb-priv.h> 46 #include <kns/manager.h> 50 #include <vfs/manager-priv.h> 51 #include <vfs/manager.h> 53 #include <vfs/resolver.h> 55 #include <sra/sradb-priv.h> 57 #include <vdb/vdb-priv.h> 58 #include <vdb/manager.h> 59 #include <vdb/database.h> 60 #include <vdb/schema.h> 61 #include <vdb/table.h> 62 #include <vdb/cursor.h> 83 #define NCBI_USE_ERRCODE_X VDBReader 125  auto

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 bool

s_Fails(

unsigned

frequency)

170  return

s_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()); \

184

NCBI_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_t

rc = KConfigMake(&cfg, 0) ) {

208  "Cannot create KConfig"

, rc);

217  if

(

rc_t

rc = KConfigAddRef(*

this

) ) {

220  "Cannot get reference to KConfig"

, rc);

229  "Cannot create KConfig singleton"

, rc);

236  if

(

rc_t

rc = 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_t

rc = VDBManagerGetKDBManagerRead(mgr,

x_InitPtr

()) ) {

287  "Cannot get KDBManager"

, rc);

301  "Cannot make KNSManager"

, rc);

311  "Cannot get KNSManager"

, rc);

335  if

(

rc_t

rc = VFSManagerMakeSysPath(mgr, &vpath, path.c_str()) ) {

338  "Cannot create sys VPath: "

<<path, rc);

342  if

(

rc_t

rc = VFSManagerMakeAccPath(mgr, &vpath, path.c_str()) ) {

345  "Cannot create acc VPath: "

<<path, rc);

349  if

(

rc_t

rc = 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  const

String*

str

= 0;

380  if

(

rc_t

rc = VPathMakeSysPath(*

this

, &

str

)) {

382  "Cannot get path from VPath"

, rc);

386  if

(

rc_t

rc = VPathMakeString(*

this

, &

str

)) {

388  "Cannot get path from VPath"

, rc);

391  string

ret(

str

->addr,

str

->size);

402  return

s.length() >= 2 &&

isalpha

(s[0]&0xff) && s[1] ==

':'

;

411

acc_or_path.find_first_of(

"/\\"

) ==

NPOS

;

413  return

acc_or_path.find(

'/'

) ==

NPOS

;

423  if

( sys_path[0] ==

'h'

&&

430

replace(path.begin(), path.end(),

'\\'

,

'/'

);

433

path[1] =

toupper

(path[0] & 0xff);

464  "Cannot get VResolver"

, rc);

472  if

(

rc_t

rc = VFSManagerMakeResolver(mgr,

x_InitPtr

(), cfg) ) {

475  "Cannot create VResolver"

, rc);

489  rc_t

rc = VResolverLocal(*

this

, acc, &path);

491  if

( GetRCObject(rc) == rcName &&

492

GetRCState(rc) == rcNotFound &&

493

GetRCContext(rc) == rcResolving ) {

498  "VResolverLocal("

<<acc_or_path<<

") failed"

, rc);

500

rc = VResolverRemote(*

this

, eProtocolNone, acc, &path);

504  if

( GetRCObject(rc) == rcName &&

505

GetRCState(rc) == rcNotFound &&

506

GetRCContext(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(&timestamp) ) {

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  const

ver_t kHTTP_1_1 = 0x01010000;

628  if

(

rc_t

rc = KNSManagerMakeClientRequest(mgr,

x_InitPtr

(),

630  "%s"

, path.c_str()) ) {

634  "Cannot create http client request"

, rc);

643

:

public CSraRef

<KClientHttpResult>

652  if

(

rc_t

rc = KClientHttpRequestHEAD(request,

x_InitPtr

()) ) {

656  "Cannot get http HEAD"

, rc);

672  if

(

rc_t

rc = 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() 717

SraReleaseVersion release_version;

718

SraReleaseVersionGet(&release_version);

719

s << (release_version.version>>24) <<

'.' 720

<< ((release_version.version>>16)&0xff) <<

'.' 721

<< (release_version.version&0xffff);

722  if

( release_version.revision != 0 ||

723

release_version.type != SraReleaseVersion::eSraReleaseVersionTypeFinal ) {

724  const char

*

type

=

""

;

725  switch

( release_version.type ) {

726  case

SraReleaseVersion::eSraReleaseVersionTypeDev:

type

=

"dev"

;

break

;

727  case

SraReleaseVersion::eSraReleaseVersionTypeAlpha:

type

=

"a"

;

break

;

728  case

SraReleaseVersion::eSraReleaseVersionTypeBeta:

type

=

"b"

;

break

;

729  case

SraReleaseVersion::eSraReleaseVersionTypeRC:

type

=

"RC"

;

break

;

730  default

:

type

=

""

;

break

;

732

s <<

'-'

<<

type

<< release_version.revision;

756

{

"debug:"

,

Trace

},

757

{

"fatal:"

,

Fatal

},

761  if

( !token.

empty

() && token[token.

size

()-1] ==

':'

) {

763  if

( token ==

tag

.tag ) {

772 static

thread::id s_DiagCheckThreadID;

778

s_DiagCheckThreadID = this_thread::get_id();

785  return

s_DiagCheckThreadID == this_thread::get_id();

799  for

(

SIZE_TYPE

token_pos = 0, token_end; token_pos <

msg

.size(); token_pos = token_end + 1 ) {

800

token_end =

msg

.find(

' '

, token_pos);

801  if

( token_end ==

NPOS

) {

802

token_end =

msg

.size();

805

sev_manip =

tag

->manip;

809  if

( sev_manip ==

Trace

) {

828  string

host = app->GetConfig().GetString(

"CONN"

,

"HTTP_PROXY_HOST"

,

kEmptyStr

);

829  int

port = 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  auto

req_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);

876

s_LastRequestContext = &req_ctx;

877

s_LastRequestContextVersion = req_ctx_version;

881

KNSManagerSetSessionID(kns_mgr, req_ctx.

GetSessionID

().c_str());

885

KNSManagerSetClientIP(kns_mgr, req_ctx.

GetClientIP

().c_str());

889

KNSManagerSetPageHitID(kns_mgr, req_ctx.

GetHitID

().c_str());

897  if

( app && app->

GetConfig

().

GetBool

(

"VDB"

,

"ALLOW_ALL_CERTS"

,

false

) ) {

898  if

(

rc_t

rc = 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 920

KNSManagerSetUserAgent(kns_mgr,

"%s; VDB %s"

,

942  static bool

initialized =

false

;

943  if

( !initialized ) {

950

ask_level = klogDebug;

952

ask_level = klogInfo;

955

KLogLevelSet(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;

994

s_RequestContextUpdaterRecursion =

r

+1;

1006 #ifndef UPDATE_REQUEST_CONTEXT_FINAL 1007  size_t r

= s_RequestContextUpdaterRecursion;

1008

s_RequestContextUpdaterRecursion =

r

+1;

1020 #ifndef UPDATE_REQUEST_CONTEXT_FINAL 1021  size_t r

= s_RequestContextUpdaterRecursion;

1022

s_RequestContextUpdaterRecursion =

r

-1;

1029 #ifndef UPDATE_REQUEST_CONTEXT_FINAL 1030  size_t r

= s_RequestContextUpdaterRecursion;

1031

s_RequestContextUpdaterRecursion =

r

-1;

1042  "Cannot open VDBManager"

, rc);

1045

VFSManagerLogNamesServiceErrors(vfs_mgr,

false

);

1048

VDBManagerDisablePagemapThread(*

this

);

1057  if

(

rc_t

rc = VDBManagerGetCacheRoot(*

this

, &ret) ) {

1058  if

( GetRCObject(rc) == RCObject(rcPath) &&

1059

GetRCState(rc) == rcNotFound ) {

1063  "CVDBMgr: Cannot get cache root"

, rc);

1072  if

(

rc_t

rc = VDBManagerSetCacheRoot(*

this

, vpath) ) {

1074  "CVDBMgr: Cannot set cache root"

, rc);

1081  if

(

rc_t

rc = 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_t

rc = 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) ||

1113

GetRCObject(rc) == RCObject(rcPath) ||

1114

GetRCObject(rc) == RCObject(rcFile)) &&

1115

GetRCState(rc) == rcNotFound ) {

1119  else if

( GetRCObject(rc) == rcName &&

1120

GetRCState(rc) == rcNotFound &&

1121

GetRCContext(rc) == rcResolving ) {

1125  else if

( GetRCObject(rc) == RCObject(rcFile) &&

1126

GetRCState(rc) == rcUnauthorized ) {

1130  else if

( GetRCObject(rc) == RCObject(rcDatabase) &&

1131

GetRCState(rc) == rcIncorrect ) {

1141  LOG_POST_X

(9,

"CVDBMgr: opened VDB: "

<< acc_or_path <<

" ("

<< path <<

")"

);

1144  const

KDatabase* kdb = 0;

1145  if

(

rc_t

rc = VDatabaseOpenKDatabaseRead(*

this

, &kdb) ) {

1148  const char

* kdb_path = 0;

1149  if

(

rc_t

rc = KDatabaseGetPath(kdb, &kdb_path) ) {

1152  LOG_POST

(

"CVDB("

<<acc_or_path<<

") -> "

<<path<<

" -> "

<<kdb_path);

1153  if

(

rc_t

rc = KDatabaseRelease(kdb) ) {

1189

RCState rc_state = GetRCState(rc);

1190  int

rc_object = GetRCObject(rc);

1191  if

( rc_state == rcNotFound &&

1192

(rc_object == rcParam ||

1193

rc_object == rcPath) ) {

1209  const string

& acc_or_path,

1211

: m_Name(acc_or_path)

1218  if

(

rc_t

rc = 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) ||

1224

GetRCObject(rc) == RCObject(rcPath)) &&

1225

GetRCState(rc) == rcNotFound ) {

1232  else if

( GetRCObject(rc) == RCObject(rcDatabase) &&

1233

GetRCState(rc) == rcIncorrect ) {

1277  const char

* index_name,

1288  if

( GetRCObject(rc) == RCObject(rcIndex) &&

1289

GetRCState(rc) == rcNotFound ) {

1318  if

(

rc_t

rc = KIndexFindText(*

this

,

value

.c_str(),

1319

&range.first, &range.second, 0, 0) ) {

1321  if

( GetRCObject(rc) == RCObject(rcString) &&

1322

GetRCState(rc) == rcNotFound ) {

1324

range.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_t

rc = VCursorPermitPostOpenAdd(*

this

) ) {

1366  "Cannot allow VDB cursor post open column add: "

<<

table

, rc);

1368  if

(

rc_t

rc = VCursorOpen(*

this

) ) {

1371  "Cannot open VDB cursor: "

<<

table

, rc);

1382  if

(

rc_t

rc = VCursorCloseRow(*

this

) ) {

1384  "Cannot close VDB cursor row"

, rc);

1394  if

(

rc_t

rc = VCursorSetRowId(*

this

, row_id) ) {

1397  if

(

rc_t

rc = VCursorOpenRow(*

this

) ) {

1410  "Cannot open VDB cursor row: "

<<*

this

<<

": "

<<row_id, rc);

1418  if

(

rc_t

rc = VCursorIdRange(*

this

,

column

, &ret.first, &ret.second) ) {

1421  "Cannot get VDB cursor row range: "

<<*

this

<<

": "

<<

column

, rc);

1430  return

range.first+range.second-1;

1437  if

(

rc_t

rc = VCursorParamsSet

1439

name,

"%.*s"

,

value

.size(),

value

.data()) ) {

1441  "Cannot set VDB cursor param: "

<<*

this

<<

": "

<<name,

1452  uint32_t

read_count, remaining_count;

1453  if

(

rc_t

rc = VCursorReadBitsDirect(*

this

,

row

,

column

.GetIndex(),

1454

elem_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  return

remaining_count;

1473  uint32_t

read_count, remaining_count;

1474  if

(

rc_t

rc = 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"

);

1528

TObjects::iterator best_it;

1532  if

( slot_row >=

row

) {

1534  if

( d <= best_d ) {

1547  CObject

* obj = best_it->second.Release();

1584  size_t

element_bit_size,

1586  const char

* backup_name,

1594  "NULL column name is not allowed"

<<cursor<<*

this

);

1601  if

(

rc_t

rc = 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_t

rc = VCursorIsStaticColumn(cursor,

GetIndex

(), &static_value) ) {

1644  "Cannot get static status of "

<<cursor<<*

this

,rc);

1646  return

static_value;

1693  if

(

rc_t

rc = 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 ) {

1736

s <<

"*** bad bit_length="

<<bit_length;

1752  if

(

rc_t

rc = 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: "

<<

1767

cursor<<

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 ) {

1800

s <<

"*** 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_t

bit_offset, bit_length, elem_count;

1868  if

(

rc_t

rc = VCursorCellDataDirect(cursor,

row

,

column

.GetIndex(),

1869

&bit_length, &

data

, &bit_offset,

1872

cursor<<

column

<<

'['

<<

row

<<

']'

, rc);

1874  "Cannot read VDB 4-bits value array: "

<<

1875

cursor<<

column

<<

'['

<<

row

<<

']'

, rc);

1877  if

( bit_offset >= 8 || (bit_offset&3) ) {

1879  "Cannot read VDB 4-bits value array with odd bit offset"

<<

1880

cursor<<

column

<<

'['

<<

row

<<

"]: "

<<bit_offset,

1881  RC

(rcApp, rcColumn, rcDecoding, rcOffset, rcUnsupported));

1883

m_RawData =

static_cast<const char

*

>

(

data

);

1884

m_ElemOffset = bit_offset >> 2;

1888  if

( bit_length == 4 ) {

1897

s <<

"*** 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_t

bit_offset, bit_length, elem_count;

1966  if

(

rc_t

rc = VCursorCellDataDirect(cursor,

row

,

column

.GetIndex(),

1967

&bit_length, &

data

, &bit_offset,

1970

cursor<<

column

<<

'['

<<

row

<<

']'

, rc);

1972  "Cannot read VDB 2-bits value array: "

<<

1973

cursor<<

column

<<

'['

<<

row

<<

']'

, rc);

1975  if

( bit_offset >= 8 || (bit_offset&1) ) {

1977  "Cannot read VDB 2-bits value array with odd bit offset"

<<

1978

cursor<<

column

<<

'['

<<

row

<<

"]: "

<<bit_offset,

1979  RC

(rcApp, rcColumn, rcDecoding, rcOffset, rcUnsupported));

1981

m_RawData =

static_cast<const char

*

>

(

data

);

1982

m_ElemOffset = bit_offset >> 1;

1986  if

( bit_length == 2 ) {

1995

s <<

"*** 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 &section, 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