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


Java AsyncSqlOutputFormat类代码示例

本文整理汇总了Java中com.cloudera.sqoop.mapreduce.AsyncSqlOutputFormat的典型用法代码示例。如果您正苦于以下问题:Java AsyncSqlOutputFormat类的具体用法?Java AsyncSqlOutputFormat怎么用?Java AsyncSqlOutputFormat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: exportTable

import com.cloudera.sqoop.mapreduce.AsyncSqlOutputFormat; //导入依赖的package包/类
@Override
/** {@inheritDoc} */
public void exportTable(com.cloudera.sqoop.manager.ExportJobContext context)
    throws IOException, ExportException {
  // HSQLDB does not support multi-row inserts; disable that before export.
  context.getOptions().getConf().setInt(
      AsyncSqlOutputFormat.RECORDS_PER_STATEMENT_KEY, 1);
  super.exportTable(context);
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:10,代码来源:HsqldbManager.java

示例2: updateBatchSizeInConfigurationToAllowOracleAppendValuesHint

import com.cloudera.sqoop.mapreduce.AsyncSqlOutputFormat; //导入依赖的package包/类
protected void updateBatchSizeInConfigurationToAllowOracleAppendValuesHint(
    TaskAttemptContext context) {

  Configuration conf = context.getConfiguration();

  // If using APPEND_VALUES, check the batch size and commit frequency...
  int originalBatchesPerCommit =
      conf.getInt(AsyncSqlOutputFormat.STATEMENTS_PER_TRANSACTION_KEY, 0);
  if (originalBatchesPerCommit != 1) {
    conf.setInt(AsyncSqlOutputFormat.STATEMENTS_PER_TRANSACTION_KEY, 1);
    LOG.info(String
        .format(
            "The number of batch-inserts to perform per commit has been "
                + "changed from %d to %d. This is in response "
                + "to the Oracle APPEND_VALUES hint being used.",
            originalBatchesPerCommit, 1));
  }

  int originalBatchSize =
      conf.getInt(AsyncSqlOutputFormat.RECORDS_PER_STATEMENT_KEY, 0);
  int minAppendValuesBatchSize =
      OraOopUtilities.getMinAppendValuesBatchSize(conf);
  if (originalBatchSize < minAppendValuesBatchSize) {
    conf.setInt(AsyncSqlOutputFormat.RECORDS_PER_STATEMENT_KEY,
        minAppendValuesBatchSize);
    LOG.info(String
        .format(
            "The number of rows per batch-insert has been changed from %d "
                + "to %d. This is in response "
                + "to the Oracle APPEND_VALUES hint being used.",
            originalBatchSize, minAppendValuesBatchSize));
  }
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:34,代码来源:OraOopOutputFormatBase.java

示例3: logBatchSettings

import com.cloudera.sqoop.mapreduce.AsyncSqlOutputFormat; //导入依赖的package包/类
protected void logBatchSettings() {

      LOG.info(String.format("The number of rows per batch is: %d",
          this.rowsPerStmt));

      int stmtsPerTx =
          this.getConf().getInt(
              AsyncSqlOutputFormat.STATEMENTS_PER_TRANSACTION_KEY,
              AsyncSqlOutputFormat.DEFAULT_STATEMENTS_PER_TRANSACTION);

      LOG.info(String.format("The number of batches per commit is: %d",
          stmtsPerTx));
    }
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:14,代码来源:OraOopOutputFormatBase.java


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