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


Java ExportException类代码示例

本文整理汇总了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();
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:28,代码来源:DirectNetezzaManager.java

示例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();
  }
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:18,代码来源:SQLServerManager.java

示例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();
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:19,代码来源:SQLServerManager.java

示例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);
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:25,代码来源:NetezzaManager.java

示例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();
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:22,代码来源:OraOopConnManager.java

示例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);
  }
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:26,代码来源:ExportTool.java

示例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();
}
 
开发者ID:unicredit,项目名称:zSqoop,代码行数:28,代码来源:DirectNetezzaManager.java

示例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();
}
 
开发者ID:unicredit,项目名称:zSqoop,代码行数:19,代码来源:SQLServerManager.java

示例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();
}
 
开发者ID:infinidb,项目名称:sqoop,代码行数:24,代码来源:DirectInfiniDBManager.java

示例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);
  }
}
 
开发者ID:infinidb,项目名称:sqoop,代码行数:23,代码来源:ExportTool.java

示例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();
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:13,代码来源:CubridManager.java

示例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();
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:14,代码来源:CubridManager.java

示例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();
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:13,代码来源:PGBulkloadManager.java

示例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);
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:10,代码来源:HsqldbManager.java

示例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();
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:11,代码来源:DirectPostgresqlManager.java


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