當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。