本文整理汇总了Java中com.cloudera.sqoop.util.ExportException类的典型用法代码示例。如果您正苦于以下问题:Java ExportException类的具体用法?Java ExportException怎么用?Java ExportException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExportException类属于com.cloudera.sqoop.util包,在下文中一共展示了ExportException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: exportTable
import com.cloudera.sqoop.util.ExportException; //导入依赖的package包/类
/**
* Export data stored in HDFS into a table in a database.
*/
public void exportTable(com.cloudera.sqoop.manager.ExportJobContext context)
throws IOException, ExportException {
options = context.getOptions();
context.setConnManager(this);
checkTable(); // Throws exception as necessary
NetezzaExternalTableExportJob exporter = null;
char qc = (char) options.getInputEnclosedBy();
char ec = (char) options.getInputEscapedBy();
checkNullValueStrings(options.getInNullStringValue(),
options.getInNullNonStringValue());
if (qc > 0 && !(qc == '"' || qc == '\'')) {
throw new ExportException("Input enclosed-by character must be '\"' "
+ "or ''' for netezza direct mode exports");
}
if (ec > 0 && ec != '\\') {
throw new ExportException("Input escaped-by character must be '\\' "
+ "for netezza direct mode exports");
}
exporter = new NetezzaExternalTableExportJob(context);
exporter.runExport();
}
示例2: updateTable
import com.cloudera.sqoop.util.ExportException; //导入依赖的package包/类
@Override
/**
* {@inheritDoc}
*/
public void updateTable(
com.cloudera.sqoop.manager.ExportJobContext context)
throws IOException, ExportException {
if (isNonResilientOperation()) {
super.updateTable(context);
} else {
context.setConnManager(this);
JdbcUpdateExportJob exportJob = new JdbcUpdateExportJob(context, null,
null, SQLServerResilientUpdateOutputFormat.class);
configureConnectionRecoveryForUpdate(context);
exportJob.runExport();
}
}
示例3: upsertTable
import com.cloudera.sqoop.util.ExportException; //导入依赖的package包/类
@Override
/**
* {@inheritDoc}
*/
public void upsertTable(com.cloudera.sqoop.manager.ExportJobContext context)
throws IOException, ExportException {
context.setConnManager(this);
// Propagate table hints to job
Configuration configuration = context.getOptions().getConf();
if (tableHints != null) {
configuration.set(TABLE_HINTS_PROP, tableHints);
}
JdbcUpsertExportJob exportJob =
new JdbcUpsertExportJob(context, SqlServerUpsertOutputFormat.class);
exportJob.runExport();
}
示例4: updateTable
import com.cloudera.sqoop.util.ExportException; //导入依赖的package包/类
@Override
public void updateTable(com.cloudera.sqoop.manager.ExportJobContext context)
throws IOException, ExportException {
if (options.getNumMappers() > 1) {
String msg = "Netezza update with multiple mappers can lead to "
+ "inconsistencies - Please set num-mappers option to 1 in the SQOOP "
+ "command line for update jobs with Netezza and SQOOP";
throw new ExportException(msg);
}
if (!options.isBatchMode()) {
if (!NetezzaManager.batchModeWarningPrinted) {
LOG.warn("It looks like you are exporting to Netezza in non-batch ");
LOG.warn("mode. Still this transfer can be made faster! Use the ");
LOG.warn("--batch option to exercise a Netezza-specific fast path.");
LOG.warn("Forcing records per statement to 1 in non batch mode");
NetezzaManager.batchModeWarningPrinted = true; // don't display this
// twice.
}
context.getOptions().getConf()
.setInt(AsyncSqlOutputFormat.RECORDS_PER_STATEMENT_KEY, 1);
}
super.updateTable(context);
}
示例5: updateTable
import com.cloudera.sqoop.util.ExportException; //导入依赖的package包/类
@Override
public void updateTable(ExportJobContext context) throws IOException,
ExportException {
logExportTableDetails(context);
context.setConnManager(this);
@SuppressWarnings("rawtypes")
Class<? extends OutputFormat> oraOopOutputFormatClass;
try {
oraOopOutputFormatClass = OraOopOutputFormatUpdate.class;
} catch (NoClassDefFoundError ex) {
explainWhyExportClassCannotBeLoaded(ex, "OraOopOutputFormatUpdate");
throw ex;
}
JdbcUpdateExportJob exportJob =
new JdbcUpdateExportJob(context, null, null, oraOopOutputFormatClass);
exportJob.runExport();
}
示例6: exportTable
import com.cloudera.sqoop.util.ExportException; //导入依赖的package包/类
private void exportTable(SqoopOptions options, String tableName)
throws ExportException, IOException {
String jarFile = null;
// Generate the ORM code for the tables.
jarFile = codeGenerator.generateORM(options, tableName);
ExportJobContext context = new ExportJobContext(tableName, jarFile,
options);
if (options.getUpdateKeyCol() != null) {
if (options.getUpdateMode() == UpdateMode.UpdateOnly) {
// UPDATE-based export.
manager.updateTable(context);
} else {
// Mixed update/insert export
manager.upsertTable(context);
}
} else if (options.getCall() != null) {
// Stored procedure-based export.
manager.callTable(context);
} else {
// INSERT-based export.
manager.exportTable(context);
}
}
示例7: exportTable
import com.cloudera.sqoop.util.ExportException; //导入依赖的package包/类
/**
* Export data stored in HDFS into a table in a database.
*/
public void exportTable(com.cloudera.sqoop.manager.ExportJobContext context)
throws IOException, ExportException {
options = context.getOptions();
context.setConnManager(this);
checkTable(); // Throws excpetion as necessary
NetezzaExternalTableExportJob exporter = null;
char qc = (char) options.getInputEnclosedBy();
char ec = (char) options.getInputEscapedBy();
checkNullValueStrings(options.getInNullStringValue(),
options.getInNullNonStringValue());
if (qc > 0 && !(qc == '"' || qc == '\'')) {
throw new ExportException("Input enclosed-by character must be '\"' "
+ "or ''' for netezza direct mode exports");
}
if (ec > 0 && ec != '\\') {
throw new ExportException("Input escaped-by character must be '\\' "
+ "for netezza direct mode exports");
}
exporter = new NetezzaExternalTableExportJob(context);
exporter.runExport();
}
示例8: exportTable
import com.cloudera.sqoop.util.ExportException; //导入依赖的package包/类
/**
* Export data stored in HDFS into a table in a database.
*/
@Override
public void exportTable(com.cloudera.sqoop.manager.ExportJobContext context)
throws IOException, ExportException {
context.setConnManager(this);
// Propagate table hints to job
Configuration configuration = context.getOptions().getConf();
if (tableHints != null) {
configuration.set(TABLE_HINTS_PROP, tableHints);
}
JdbcExportJob exportJob = new JdbcExportJob(context, null, null,
SqlServerExportBatchOutputFormat.class);
exportJob.runExport();
}
示例9: exportTable
import com.cloudera.sqoop.util.ExportException; //导入依赖的package包/类
/**
* Export the table from HDFS by using cpimport to insert the data
* back into the database.
*/
@Override
public void exportTable(com.cloudera.sqoop.manager.ExportJobContext context)
throws IOException, ExportException {
context.setConnManager(this);
if (context.getOptions().getColumns() != null) {
LOG.warn("Direct-mode export from InfiniDB does not support column");
LOG.warn("selection. Falling back to JDBC-based import.");
// Don't warn them "This could go faster..."
MySQLManager.markWarningPrinted();
// Use JDBC-based importTable() method.
// todo have to figure out how to call the grandparent method here
super.exportTable(context);
return;
}
InfiniDBExportJob exportJob = new InfiniDBExportJob(context);
exportJob.runExport();
}
示例10: exportTable
import com.cloudera.sqoop.util.ExportException; //导入依赖的package包/类
private void exportTable(SqoopOptions options, String tableName)
throws ExportException, IOException {
String jarFile = null;
// Generate the ORM code for the tables.
jarFile = codeGenerator.generateORM(options, tableName);
ExportJobContext context = new ExportJobContext(tableName, jarFile,
options);
if (options.getUpdateKeyCol() != null) {
if (options.getUpdateMode() == UpdateMode.UpdateOnly) {
// UPDATE-based export.
manager.updateTable(context);
} else {
// Mixed update/insert export
manager.upsertTable(context);
}
} else {
// INSERT-based export.
manager.exportTable(context);
}
}
示例11: exportTable
import com.cloudera.sqoop.util.ExportException; //导入依赖的package包/类
/**
* Export data stored in HDFS into a table in a database.
*/
public void exportTable(
com.cloudera.sqoop.manager.ExportJobContext context)
throws IOException, ExportException {
context.setConnManager(this);
JdbcExportJob exportJob = new JdbcExportJob(context, null, null,
ExportBatchOutputFormat.class);
exportJob.runExport();
}
示例12: upsertTable
import com.cloudera.sqoop.util.ExportException; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void upsertTable(
com.cloudera.sqoop.manager.ExportJobContext context)
throws IOException, ExportException {
context.setConnManager(this);
JdbcUpsertExportJob exportJob = new JdbcUpsertExportJob(context,
CubridUpsertOutputFormat.class);
exportJob.runExport();
}
示例13: exportTable
import com.cloudera.sqoop.util.ExportException; //导入依赖的package包/类
@Override
public void exportTable(ExportJobContext context)
throws IOException, ExportException {
context.setConnManager(this);
options.setStagingTableName(null);
PGBulkloadExportJob jobbase =
new PGBulkloadExportJob(context,
null,
ExportInputFormat.class,
NullOutputFormat.class);
jobbase.runExport();
}
示例14: exportTable
import com.cloudera.sqoop.util.ExportException; //导入依赖的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);
}
示例15: exportTable
import com.cloudera.sqoop.util.ExportException; //导入依赖的package包/类
public void exportTable(ExportJobContext context)
throws IOException, ExportException {
context.setConnManager(this);
PostgreSQLCopyExportJob job =
new PostgreSQLCopyExportJob(context,
null,
ExportInputFormat.class,
NullOutputFormat.class);
job.runExport();
}