本文整理汇总了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);
}
示例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));
}
}
示例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));
}