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/test__bdb__split_8cpp_source.html below:

NCBI C++ ToolKit: src/db/bdb/test_split/test_bdb_split.cpp Source File

103  unsigned

blob_id = 1;

106  for

(

size_t i

= 0;

i

< test_set.size(); ++

i

) {

109

cout <<

"\nsize="

<<

r

.blob_size <<

" count="

<<

r

.count << endl;

111  for

(;

r

.count;

r

.count--) {

116  if

((

r

.count % 10000) == 0) {

120

cerr <<

"Elapsed = "

<<

sw

.

Elapsed

() << endl;

127  env

.SetLogInMemory(

true

);

128  env

.SetLogBSize(50 * 1024 * 1024);

129  env

.SetCacheSize(400 * 1024 * 1024);

132

vector<TestRec> test_set;

134

vector<TestRec> test_set2(test_set);

136  if

(test_set.size() == 0) {

137

cout <<

"Empty test load."

<< endl;

140

cout <<

"Loaded "

<< test_set.size() <<

" records."

<< endl;

144

split_store_hash.

Open

(

"split_hash"

,

151

cout <<

"Loading hash store."

<< endl;

153

cout <<

"Ok. elapsed="

<<

sw

.

Elapsed

() << endl << endl;

158

split_store_btree.

Open

(

"split_btree"

,

164

cout <<

"Loading btree store."

<< endl;

166

cout <<

"Ok. elapsed="

<<

sw

.

Elapsed

() << endl << endl;

174

cout <<

"Loading "

<<

file_name

<<

" ... "

<< endl;

181  for

(++

lr

; !

lr

.AtEOF(); ++

lr

) {

183  string

count_str, size_str;

196

test_set.push_back(rec);

198

cout <<

"Blank record: "

<<

st

<< endl;

201

cout <<

"ok "

<< endl;

217

d->SetUsageContext(

"test_bdb_split"

,

218  "test BDB split storage"

);

229

cout <<

"Run BDB split storage test"

<< endl << endl;

231  char

* buf_small =

new char

[256];

232  char

* buf_large =

new char

[1024*1024];

233  char

* buf_read =

new char

[2*1024*1024];

234  void

*

buf

= buf_read;

236

::strcpy(buf_small,

"test small 1"

);

237

::strcpy(buf_large,

"test large 1"

);

246

split_store.

Insert

(2, buf_large, 1024 * 1024);

247

split_store.

Insert

(1, buf_small, 256);

249

::strcpy(buf_small,

"test small 2"

);

250

::strcpy(buf_large,

"test large 2"

);

260

split_store.

Save

();

272  int

res =

strcmp

(buf_read,

"test small 1"

);

278

res =

strcmp

(buf_read,

"test large 2"

);

285

res =

strcmp

((

const char

*)&chbuf[0],

"test large 2"

);

294

cout <<

"Error! DBD errno exception:"

<< ex.what();

299

cout <<

"Error! DBD library exception:"

<< ex.what();

304

cout <<

"TEST execution completed successfully!"

<< endl << endl;

313 int main

(

int

argc,

const char

* argv[])

BDB library BLOB support.

ICache interface implementation on top of Berkeley DB.

Berkeley BDB file cursor.

Wrapper around Berkeley DB environment structure.

Exception specifications for BDB library.

BDB File covertion into text.

BDB library split BLOB store.

Wrapper around Berkeley DB transaction structure.

Volume split BLOB demultiplexer.

BLOB storage based on single unsigned integer key Supports BLOB volumes and different base page size ...

BDB environment object a collection including support for some or all of caching, locking,...

BDB errno exception class.

void LoadTestSet(const string &file_name)

CBDB_BlobSplitStore< bm::bvector<> > TBlobSplitStore

void ReadTestSet(vector< TestRec > &test_set, const string &file_name)

void Init(void)

Initialize the application.

int Run(void)

Run the application.

void LoadSplitStore(vector< TestRec > &test_set, TBlobSplitStore &split_store)

Reallocable memory buffer (no memory copy overhead) Mimics vector<>, without the overhead of explicit...

Simple implementation of ILineReader for i(o)streams.

CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...

int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)

Main function (entry point) for the NCBI application.

virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)

Setup the command line argument descriptions.

EBDB_ErrCode Insert(unsigned id, const void *data, size_t size, unsigned *coord)

Insert BLOB into the storage.

void FreeUnusedMem()

Reclaim unused memory.

EBDB_ErrCode ReadRealloc(unsigned id, CBDB_RawFile::TBuffer &buffer)

Read BLOB into vector.

void SetVolumeCacheSize(unsigned int cache_size)

EBDB_ErrCode UpdateInsert(unsigned id, const void *data, size_t size, unsigned *coord)

Update or insert BLOB.

void Save(typename TDeMuxStore::ECompact compact_vectors=TDeMuxStore::eCompact)

Save storage dictionary (demux disposition).

EBDB_ErrCode Fetch(unsigned id, void **buf, size_t buf_size, CBDB_RawFile::EReallocMode allow_realloc, size_t *blob_size)

Fetch LOB record directly into the provided '*buf'.

void SetEnv(CBDB_Env &env)

Associate with the environment. Should be called before opening.

void GetIdVector(TBitVector *bv) const

Get all id of all BLOBs stored.

void Open(const string &storage_name, CBDB_RawFile::EOpenMode open_mode, CBDB_RawFile::EDBType db_type=CBDB_RawFile::eBtree)

Open storage (reads storage dictionary into memory)

EBDB_ErrCode

BDB Return codes.

@ eCreate

implies 'eReadWrite' too

@ eThreaded

corresponds to DB_THREAD

void SetDiagPostFlag(EDiagPostFlag flag)

Set the specified flag (globally).

EDiagSev SetDiagPostLevel(EDiagSev post_sev=eDiag_Error)

Set the threshold severity for posting the messages.

void SetDiagTrace(EDiagTrace how, EDiagTrace dflt=eDT_Default)

Set the diagnostic trace settings.

@ eDPF_Trace

Default flags to use when tracing.

@ eDPF_File

File name (not full path)

@ eDT_Enable

Enable messages of severity "eDiag_Trace".

@ eDiag_Warning

Warning message.

IO_PREFIX::ifstream CNcbiIfstream

Portable alias for ifstream.

static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)

Split a string into two pieces using the specified delimiters.

static unsigned int StringToUInt(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to unsigned int.

static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)

Truncate whitespace in a string.

@ fAllowTrailingSpaces

Ignore trailing whitespace characters.

@ fConvErr_NoThrow

Do not throw an exception on error.

@ fAllowLeadingSpaces

Ignore leading whitespace characters in converted string.

double Elapsed(void) const

Return time elapsed since first Start() or last Restart() call (in seconds).

@ eStart

Start timer immediately after creating.

Lightweight interface for getting lines of data with minimal memory copying.

int strcmp(const char *str1, const char *str2)

Defines the CNcbiApplication and CAppException classes for creating NCBI applications.

Defines command line argument related classes.

Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...

Defines: CTimeFormat - storage class for time format.

double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)

static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

static SLJIT_INLINE sljit_ins lr(sljit_gpr dst, sljit_gpr src)

int main(int argc, const char *argv[])


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