本文整理汇总了C++中OracleEnv::dbgPrintf方法的典型用法代码示例。如果您正苦于以下问题:C++ OracleEnv::dbgPrintf方法的具体用法?C++ OracleEnv::dbgPrintf怎么用?C++ OracleEnv::dbgPrintf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OracleEnv
的用法示例。
在下文中一共展示了OracleEnv::dbgPrintf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prepareTautomer
void MangoShadowFetch::prepareTautomer (OracleEnv &env, int right_part)
{
if (right_part == 1)
env.dbgPrintf("preparing shadow table for tautomer match\n");
else
env.dbgPrintf("preparing shadow table for non-tautomer match\n");
_fetch_type = _TAUTOMER;
_right_part = right_part;
_env.reset(new OracleEnv(env.ctx(), env.logger()));
_statement.reset(new OracleStatement(_env.ref()));
_lob_cmf.reset(new OracleLOB(_env.ref()));
_statement->append("SELECT mol_rowid, cmf FROM %s", _table_name.ptr());
if (right_part == 1)
_statement->append(" WHERE gross = :gross OR gross LIKE :grossh");
_statement->prepare();
_statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));
_statement->defineBlobByPos(2, _lob_cmf.ref());
if (right_part == 1)
{
ArrayOutput output(_counting_select);
output.printf("SELECT COUNT(*) FROM %s WHERE gross = :gross", _table_name.ptr());
}
else
_counting_select.clear();
}
示例2: prepareExact
void RingoShadowFetch::prepareExact (OracleEnv &env, int right_part)
{
RingoExact & instance = _context.exact;
if (right_part == 1)
env.dbgPrintf("preparing shadow table for exact\n");
else
env.dbgPrintf("preparing shadow table for non-exact\n");
_fetch_type = _EXACT;
_right_part = right_part;
_env.reset(new OracleEnv(env.ctx(), env.logger()));
_statement.reset(new OracleStatement(_env.ref()));
_lob_crf.reset(new OracleLOB(_env.ref()));
_statement->append("SELECT sh.rid, sh.crf FROM %s sh", _table_name.ptr());
if (right_part == 1)
_statement->append(" WHERE hash = :hash");
_statement->prepare();
_statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));
_statement->defineBlobByPos(2, _lob_crf.ref());
if (_right_part == 1)
{
const char *hash_str = instance.getQueryHashStr();
_statement->bindStringByName(":hash", hash_str, strlen(hash_str) + 1);
}
ArrayOutput output_cnt(_counting_select);
output_cnt.printf("SELECT COUNT(*) FROM %s sh", _table_name.ptr());
if (right_part == 1)
output_cnt.printf(" WHERE hash = :hash");
}
示例3: _ringoRegisterReaction
bool _ringoRegisterReaction (OracleEnv &env, const char *rowid,
const Array<char> &reaction_buf,
RingoOracleContext &context,
RingoIndex &index,
BingoFingerprints &fingerprints)
{
QS_DEF(Array<char>, data);
QS_DEF(Array<char>, compressed_rowid);
ArrayOutput output(data);
output.writeChar(0); // 0 -- present, 1 -- removed from index
ArrayOutput rid_output(compressed_rowid);
RowIDSaver rid_saver(context.context().rid_dict, rid_output);
rid_saver.saveRowID(rowid);
output.writeByte((byte)compressed_rowid.size());
output.writeArray(compressed_rowid);
TRY_READ_TARGET_RXN
{
BufferScanner scanner(reaction_buf);
try
{
index.prepare(scanner, output, NULL);
}
catch (CmfSaver::Error &e)
{
if (context.context().reject_invalid_structures)
throw; // Rethrow this exception further
env.dbgPrintf(bad_reaction_warning_rowid, rowid, e.message());
return false;
}
catch (CrfSaver::Error &e)
{
if (context.context().reject_invalid_structures)
throw; // Rethrow this exception further
env.dbgPrintf(bad_reaction_warning_rowid, rowid, e.message());
return false;
}
}
CATCH_READ_TARGET_RXN_ROWID(rowid, {
if (context.context().reject_invalid_structures)
throw; // Rethrow this exception further
return false;
});
示例4: prepareNonSubstructure
void MangoShadowFetch::prepareNonSubstructure (OracleEnv &env)
{
env.dbgPrintf("preparing shadow table for non-substructure match\n");
_fetch_type = _NON_SUBSTRUCTURE;
_need_xyz = _context.substructure.needCoords();
_env.reset(new OracleEnv(env.ctx(), env.logger()));
_statement.reset(new OracleStatement(_env.ref()));
if (_need_xyz)
{
_lob_cmf.reset(new OracleLOB(_env.ref()));
_lob_xyz.reset(new OracleLOB(_env.ref()));
_statement->append("SELECT mol_rowid, cmf, xyz FROM %s", _table_name.ptr());
_statement->prepare();
_statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));
_statement->defineBlobByPos(2, _lob_cmf.ref());
_statement->defineBlobByPos(3, _lob_xyz.ref());
}
else
{
_lob_cmf.reset(new OracleLOB(_env.ref()));
_statement->append("SELECT mol_rowid, cmf FROM %s", _table_name.ptr());
_statement->prepare();
_statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));
_statement->defineBlobByPos(2, _lob_cmf.ref());
}
_counting_select.clear();
}
示例5: prepareMass
void MangoShadowFetch::prepareMass (OracleEnv &env)
{
env.dbgPrintf("preparing shadow table for molecular mass match\n");
QS_DEF(Array<char>, where);
{
ArrayOutput where_out(where);
where_out.printf("");
where_out.writeChar(0);
}
_fetch_type = _MASS;
_env.reset(new OracleEnv(env.ctx(), env.logger()));
_statement.reset(new OracleStatement(_env.ref()));
_statement->append("SELECT mol_rowid FROM %s WHERE mass >= :mass_min AND mass <= :mass_max",
_table_name.ptr());
_statement->prepare();
_statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));
ArrayOutput output(_counting_select);
output.printf("SELECT COUNT(*) FROM %s WHERE WHERE mass >= :mass_min AND mass <= :mass_max",
_table_name.ptr());
}
示例6: _finishIndexLob
void BingoStorage::_finishIndexLob (OracleEnv &env)
{
env.dbgPrintf("flushing index LOB\n");
OracleLOB *index_lob = _getLob(env, 0);
index_lob->write(_index_lob_pending_mark, _index_lob_pending_data);
_index_lob_pending_mark += _index_lob_pending_data.size();
_index_lob_pending_data.clear();
delete index_lob;
}
示例7: prepareExact
void MangoShadowFetch::prepareExact (OracleEnv &env, int right_part)
{
const MangoExact & instance = _context.exact;
if (right_part == 1)
env.dbgPrintf("preparing shadow table for exact\n");
else
env.dbgPrintf("preparing shadow table for non-exact\n");
_fetch_type = _EXACT;
_right_part = right_part;
_need_xyz = instance.needCoords();
_env.reset(new OracleEnv(env.ctx(), env.logger()));
_statement.reset(new OracleStatement(_env.ref()));
_lob_cmf.reset(new OracleLOB(_env.ref()));
_statement->append("SELECT sh.mol_rowid, sh.cmf");
if (_need_xyz)
_statement->append(", sh.xyz", _table_name.ptr());
_statement->append(" FROM %s sh", _table_name.ptr());
QS_DEF(Array<char>, table_copies);
QS_DEF(Array<char>, where_clause);
_prepareExactQueryStrings(table_copies, where_clause);
_statement->append(table_copies.ptr());
_statement->append(where_clause.ptr());
_statement->prepare();
_statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));
_statement->defineBlobByPos(2, _lob_cmf.ref());
if (_need_xyz)
{
_lob_xyz.reset(new OracleLOB(_env.ref()));
_statement->defineBlobByPos(3, _lob_xyz.ref());
}
ArrayOutput output_cnt(_counting_select);
output_cnt.printf("SELECT COUNT(*) FROM %s sh", _table_name.ptr());
output_cnt.printf("%s", table_copies.ptr());
output_cnt.printf("%s", where_clause.ptr());
}
示例8: _finishTopLob
void BingoStorage::_finishTopLob (OracleEnv &env)
{
OracleLOB *top_lob = _getLob(env, _blocks.size());
env.dbgPrintf("flushing storage LOB\n");
top_lob->write(_top_lob_pending_mark, _top_lob_pending_data);
_top_lob_pending_mark += _top_lob_pending_data.size();
_top_lob_pending_data.clear();
delete top_lob;
top_lob = 0;
}
示例9: prepareSubstructure
void RingoFastIndex::prepareSubstructure (OracleEnv &env)
{
env.dbgPrintf("preparing fastindex for reaction substructure search\n");
_context.context().context().storage.validate(env);
_context.context().fingerprints.validate(env);
_context.context().fingerprints.screenInit(_context.substructure.getQueryFingerprint(), _screening);
_fetch_type = _SUBSTRUCTURE;
_cur_idx = 0;
_matched = 0;
_unmatched = 0;
}
示例10: fetch
void MangoFastIndex::fetch (OracleEnv &env, int max_matches)
{
env.dbgPrintf("requested %d hits\n", max_matches);
matched.clear();
if (_fetch_type == _SUBSTRUCTURE || _fetch_type == _TAUTOMER_SUBSTRUCTURE)
_fetchSubstructure(env, max_matches);
else if (_fetch_type == _SIMILARITY)
_fetchSimilarity(env, max_matches);
else
throw Error("unexpected fetch type: %d", _fetch_type);
}
示例11: countOracleBlocks
int MangoShadowFetch::countOracleBlocks (OracleEnv &env)
{
int res;
env.dbgPrintf("countOracleBlocks\n");
if (!OracleStatement::executeSingleInt(res, env, "select blocks from user_tables where "
"table_name = upper('%s')", _table_name.ptr()))
return 0;
return res;
}
示例12: mangoPrepareMolecule
bool mangoPrepareMolecule (OracleEnv &env, const char *rowid,
const Array<char> &molfile_buf,
MangoOracleContext &context,
MangoIndex &index,
Array<char> &data,
OsLock *lock_for_exclusive_access)
{
profTimerStart(tall, "moleculeIndex.prepare");
ArrayOutput output(data);
output.writeChar(0); // 0 -- present, 1 -- removed from index
QS_DEF(Array<char>, compressed_rowid);
ArrayOutput rid_output(compressed_rowid);
{
// RowIDSaver modifies context.context().rid_dict and
// requires exclusive access for this
OsLockerNullable locker(lock_for_exclusive_access);
RowIDSaver rid_saver(context.context().rid_dict, rid_output);
rid_saver.saveRowID(rowid);
}
output.writeByte((byte)compressed_rowid.size());
output.writeArray(compressed_rowid);
TRY_READ_TARGET_MOL
{
BufferScanner scanner(molfile_buf);
try
{
index.prepare(scanner, output, lock_for_exclusive_access);
}
catch (CmfSaver::Error &e)
{
OsLockerNullable locker(lock_for_exclusive_access);
env.dbgPrintf(bad_molecule_warning_rowid, rowid, e.message());
return false;
}
}
CATCH_READ_TARGET_MOL_ROWID(rowid, return false);
// some magic: round it up to avoid ora-22282
if (data.size() % 2 == 1)
output.writeChar(0);
return true;
}
示例13: fetch
void RingoFastIndex::fetch (OracleEnv &env, int max_matches)
{
env.dbgPrintf("requested %d hits\n", max_matches);
matched.clear();
BingoFingerprints &fingerprints = _context.context().fingerprints;
if (_fetch_type == _SUBSTRUCTURE)
{
if (fingerprints.ableToScreen(_screening))
{
while (matched.size() < max_matches)
{
if (_screening.passed.size() > 0)
{
int idx = _screening.passed.begin();
_match(env, _screening.passed.at(idx));
_screening.passed.remove(idx);
continue;
}
if (fingerprints.screenPart_Init(env, _screening))
{
while (fingerprints.screenPart_Next(env, _screening))
;
fingerprints.screenPart_End(env, _screening);
_unmatched += _screening.block->used - _screening.passed.size();
}
else
{
env.dbgPrintfTS("screening ended\n");
break;
}
_screening.items_passed += _screening.passed.size();
env.dbgPrintfTS("%d reactions passed screening\n", _screening.passed.size());
}
}
else
{
while (matched.size() < max_matches && _cur_idx < _context.context().context().storage.count())
_match(env, _cur_idx++);
env.dbgPrintfTS("%d reactions matched\n", matched.size());
}
}
else
throw Error("unexpected fetch type: %d", _fetch_type);
}
示例14: prepareSubstructure
void MangoFastIndex::prepareSubstructure (OracleEnv &env)
{
env.dbgPrintf("preparing fastindex for substructure search\n");
_context.context().context().storage.validate(env);
_context.context().fingerprints.validate(env);
_context.context().fingerprints.screenInit(_context.substructure.getQueryFingerprint(), _screening);
env.dbgPrintfTS("Have %d bits in query fingerprint\n", _screening.query_ones.size());
_fetch_type = _SUBSTRUCTURE;
_cur_idx = 0;
_matched = 0;
_unmatched = 0;
}
示例15: _fetchSubstructure
void MangoFastIndex::_fetchSubstructure (OracleEnv &env, int max_matches)
{
BingoFingerprints &fingerprints = _context.context().fingerprints;
if (fingerprints.ableToScreen(_screening))
{
while (matched.size() < max_matches)
{
if (_screening.passed.size() > 0)
{
int idx = _screening.passed.begin();
_match(env, _screening.passed.at(idx));
_screening.passed.remove(idx);
continue;
}
if (fingerprints.screenPart_Init(env, _screening))
{
while (fingerprints.screenPart_Next(env, _screening))
{
if (_screening.passed_pre.size() <= _context.context().context().sub_screening_pass_mark ||
_screening.query_bit_idx >= _context.context().context().sub_screening_max_bits)
{
env.dbgPrintfTS("stopping at bit #%d; ", _screening.query_bit_idx);
break;
}
}
fingerprints.screenPart_End(env, _screening);
_unmatched += _screening.block->used - _screening.passed.size();
}
else
{
env.dbgPrintfTS("screening ended\n");
break;
}
_screening.items_passed += _screening.passed.size();
env.dbgPrintf("%d molecules passed screening\n", _screening.passed.size());
}
}
else
{
while (matched.size() < max_matches && _cur_idx < _context.context().context().storage.count())
_match(env, _cur_idx++);
env.dbgPrintfTS("%d molecules matched of tested %d\n", matched.size(), _cur_idx);
}
}