当前位置: 首页>>代码示例>>Java>>正文


Java MysqlRepoUtils.getJdbcHandler方法代码示例

本文整理汇总了Java中com.taobao.tddl.repo.mysql.utils.MysqlRepoUtils.getJdbcHandler方法的典型用法代码示例。如果您正苦于以下问题:Java MysqlRepoUtils.getJdbcHandler方法的具体用法?Java MysqlRepoUtils.getJdbcHandler怎么用?Java MysqlRepoUtils.getJdbcHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.taobao.tddl.repo.mysql.utils.MysqlRepoUtils的用法示例。


在下文中一共展示了MysqlRepoUtils.getJdbcHandler方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCursor

import com.taobao.tddl.repo.mysql.utils.MysqlRepoUtils; //导入方法依赖的package包/类
@Override
public ISchematicCursor getCursor(ExecutionContext executionContext, IndexMeta indexName, IQuery executor)
                                                                                                          throws TddlException {
    My_JdbcHandler jdbcHandler = MysqlRepoUtils.getJdbcHandler(this.dsGetter, executor, executionContext);
    ICursorMeta meta = ExecUtils.convertToICursorMeta(indexName);
    My_Cursor my_cursor = new My_Cursor(jdbcHandler, meta, executor, executor.isStreaming());
    return new SchematicMyCursor(my_cursor, meta, MysqlRepoUtils.buildOrderBy(executor, indexName));
}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:9,代码来源:My_Table.java

示例2: handle

import com.taobao.tddl.repo.mysql.utils.MysqlRepoUtils; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public ISchematicCursor handle(IDataNodeExecutor executor, ExecutionContext executionContext) throws TddlException {
    if (!canComposeOneSql(executor)) {
        return super.handle(executor, executionContext);
    }

    IndexMeta indexMeta = null;
    My_JdbcHandler jdbcHandler = MysqlRepoUtils.getJdbcHandler(dsGetter, executor, executionContext);
    ICursorMeta meta = ExecUtils.convertToICursorMeta((IQueryTree) executor);
    My_Cursor my_cursor = new My_Cursor(jdbcHandler, meta, executor, executor.isStreaming());

    // if (executor.getSql() != null) {
    // // TODO shenxun : 排序信息似乎丢了啊。。
    // return my_cursor.getResultSet();
    // }

    List<IOrderBy> orderBy = null;
    if (executor instanceof IJoin) {
        orderBy = ((IJoin) executor).getOrderBys();
    } else {
        orderBy = MysqlRepoUtils.buildOrderBy(executor, indexMeta);
    }

    orderBy = ExecUtils.copyOrderBys(orderBy);

    for (IOrderBy order : orderBy) {
        if (((IQueryTree) executor).getAlias() != null) {
            order.getColumn().setTableName(((IQueryTree) executor).getAlias());
        }
        if (order.getColumn().getAlias() != null) order.getColumn().setColumnName(order.getColumn().getAlias());
    }

    if (GeneralUtil.getExtraCmdBoolean(executionContext.getExtraCmds(), ExtraCmd.EXECUTE_QUERY_WHEN_CREATED, false)) {
        my_cursor.init();
    }
    return new SchematicMyCursor(my_cursor, meta, orderBy);
}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:39,代码来源:QueryMyHandler.java

示例3: handle

import com.taobao.tddl.repo.mysql.utils.MysqlRepoUtils; //导入方法依赖的package包/类
@Override
public ISchematicCursor handle(IDataNodeExecutor executor, ExecutionContext executionContext) throws TddlException {
    long time = System.currentTimeMillis();
    IPut put = (IPut) executor;
    My_JdbcHandler jdbcHandler = MysqlRepoUtils.getJdbcHandler(dsGetter, executor, executionContext);

    // 用于测试终止任务 Thread.sleep(1000000000l);
    buildTableAndMeta(put, executionContext);
    ITransaction transaction = executionContext.getTransaction();
    ITable table = executionContext.getTable();
    IndexMeta meta = executionContext.getMeta();

    boolean autoCommit = false;
    ISchematicCursor result = null;
    try {
        result = executePut(executionContext, put, table, meta, jdbcHandler);
        if (autoCommit) {
            commit(executionContext, transaction);
        }
    } catch (Exception e) {
        time = Monitor.monitorAndRenewTime(Monitor.KEY1, Monitor.ServerPut, Monitor.Key3Fail, time);
        if (autoCommit) {

            rollback(executionContext, transaction);
        }
        throw new TddlException(e);
    }
    time = Monitor.monitorAndRenewTime(Monitor.KEY1, Monitor.ServerPut, Monitor.Key3Success, time);
    return result;

}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:32,代码来源:PutMyHandlerCommon.java


注:本文中的com.taobao.tddl.repo.mysql.utils.MysqlRepoUtils.getJdbcHandler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。