本文整理汇总了C++中TaskQueue::get_task方法的典型用法代码示例。如果您正苦于以下问题:C++ TaskQueue::get_task方法的具体用法?C++ TaskQueue::get_task怎么用?C++ TaskQueue::get_task使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaskQueue
的用法示例。
在下文中一共展示了TaskQueue::get_task方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
}
}
}
static SQLHENV odbc_env;
PyThreadState *state = NULL;
if (source_type == ST_PYTHON)
{
Py_Initialize();
PyEval_InitThreads();
state = PyEval_SaveThread();
}
try
{
if (count_only)
{
boost::scoped_ptr<CopyDataSource> psource;
if (source_type == ST_ODBC)
{
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &odbc_env);
SQLSetEnvAttr(odbc_env, SQL_ATTR_ODBC_VERSION, (void *) SQL_OV_ODBC3, 0);
psource.reset(new ODBCCopyDataSource(odbc_env, source_connstring, source_password, source_is_utf8, source_rdbms_type));
}
else if (source_type == ST_MYSQL)
psource.reset(new MySQLCopyDataSource(source_host, source_port, source_user, source_password, source_socket, source_use_cleartext_plugin));
else
psource.reset(new PythonCopyDataSource(source_connstring, source_password));
boost::scoped_ptr<MySQLCopyDataTarget> ptarget;
TableParam task;
while(tables.get_task(task))
{
std::vector<std::string> last_pkeys;
if (task.copy_spec.resume)
{
if(!ptarget.get())
ptarget.reset(new MySQLCopyDataTarget(target_host, target_port, target_user, target_password, target_socket, target_use_cleartext_plugin, app_name, source_charset, source_rdbms_type));
last_pkeys = ptarget->get_last_pkeys(task.target_pk_columns, task.target_schema, task.target_table);
}
count_rows(psource, task.source_schema, task.source_table, task.source_pk_columns, task.copy_spec, last_pkeys);
}
}
else if (reenable_triggers || disable_triggers)
{
boost::scoped_ptr<MySQLCopyDataTarget> ptarget;
ptarget.reset(new MySQLCopyDataTarget(target_host, target_port, target_user, target_password, target_socket, target_use_cleartext_plugin, app_name, source_charset, source_rdbms_type));
if (disable_triggers)
ptarget->backup_triggers(trigger_schemas);
else
ptarget->restore_triggers(trigger_schemas);
}
else
{
std::vector<CopyDataTask*> threads;
boost::scoped_ptr<MySQLCopyDataTarget> ptarget_conn;
MySQLCopyDataTarget *ptarget = NULL;
CopyDataSource *psource = NULL;
if (disable_triggers_on_copy)
{
ptarget_conn.reset(new MySQLCopyDataTarget(target_host, target_port, target_user, target_password, target_socket, target_use_cleartext_plugin, app_name, source_charset, source_rdbms_type));