當前位置: 首頁>>代碼示例>>Java>>正文


Java ExportTool類代碼示例

本文整理匯總了Java中com.cloudera.sqoop.tool.ExportTool的典型用法代碼示例。如果您正苦於以下問題:Java ExportTool類的具體用法?Java ExportTool怎麽用?Java ExportTool使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ExportTool類屬於com.cloudera.sqoop.tool包,在下文中一共展示了ExportTool類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: runExport

import com.cloudera.sqoop.tool.ExportTool; //導入依賴的package包/類
/**
 * Actually run the export of the generated data to the user-created table.
 */
public void runExport(String connectStr, String username) throws Exception {
  SqoopOptions options = new SqoopOptions(getConf());
  options.setConnectString(connectStr);
  options.setTableName("ExportStressTestTable");
  options.setUsername(username);
  options.setExportDir("ExportStressTest");
  options.setNumMappers(4);
  options.setLinesTerminatedBy('\n');
  options.setFieldsTerminatedBy(',');
  options.setExplicitOutputDelims(true);

  SqoopTool exportTool = new ExportTool();
  Sqoop sqoop = new Sqoop(exportTool, getConf(), options);
  int ret = Sqoop.runSqoop(sqoop, new String[0]);
  if (0 != ret) {
    throw new Exception("Error doing export; ret=" + ret);
  }
}
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:22,代碼來源:ExportStressTest.java

示例2: runExport

import com.cloudera.sqoop.tool.ExportTool; //導入依賴的package包/類
/**
 * Run a MapReduce-based export (using the argv provided to control
 * execution).
 * @return the generated jar filename
 */
protected List<String> runExport(String [] argv) throws IOException {
  // run the tool through the normal entry-point.
  int ret;
  List<String> generatedJars = null;
  try {
    ExportTool exporter = new ExportTool();
    Sqoop sqoop = new Sqoop(exporter);
    ret = Sqoop.runSqoop(sqoop, argv);
    generatedJars = exporter.getGeneratedJarFiles();
  } catch (Exception e) {
    LOG.error("Got exception running Sqoop: "
        + StringUtils.stringifyException(e));
    ret = 1;
  }

  // expect a successful return.
  if (0 != ret) {
    throw new IOException("Failure during job; return status " + ret);
  }

  return generatedJars;
}
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:28,代碼來源:TestAvroImportExportRoundtrip.java

示例3: runExport

import com.cloudera.sqoop.tool.ExportTool; //導入依賴的package包/類
/**
 * Run a MapReduce-based export (using the argv provided to control
 * execution).
 * @return the generated jar filename
 */
protected List<String> runExport(String [] argv) throws IOException {
  // run the tool through the normal entry-point.
  int ret;
  List<String> generatedJars = null;
  try {
    ExportTool exporter = new ExportTool();
    Configuration conf = getConf();
    SqoopOptions opts = getSqoopOptions(conf);
    Sqoop sqoop = new Sqoop(exporter, conf, opts);
    ret = Sqoop.runSqoop(sqoop, argv);
    generatedJars = exporter.getGeneratedJarFiles();
  } catch (Exception e) {
    LOG.error("Got exception running Sqoop: "
        + StringUtils.stringifyException(e));
    ret = 1;
  }

  // expect a successful return.
  if (0 != ret) {
    throw new IOException("Failure during job; return status " + ret);
  }

  return generatedJars;
}
 
開發者ID:unicredit,項目名稱:zSqoop,代碼行數:30,代碼來源:ExportJobTestCase.java

示例4: runExport

import com.cloudera.sqoop.tool.ExportTool; //導入依賴的package包/類
/**
 * Actually run the export of the generated data to the user-created table.
 */
public void runExport(String connectStr, String username) throws Exception {
  SqoopOptions options = new SqoopOptions(getConf());
  options.setConnectString(connectStr);
  options.setTableName("ExportStressTestTable");
  options.setUsername(username);
  options.setExportDir("ExportStressTest");
  options.setNumMappers(4);
  options.setLinesTerminatedBy('\n');
  options.setFieldsTerminatedBy(',');
  options.setExplicitDelims(true);

  SqoopTool exportTool = new ExportTool();
  Sqoop sqoop = new Sqoop(exportTool, getConf(), options);
  int ret = Sqoop.runSqoop(sqoop, new String[0]);
  if (0 != ret) {
    throw new Exception("Error doing export; ret=" + ret);
  }
}
 
開發者ID:infinidb,項目名稱:sqoop,代碼行數:22,代碼來源:ExportStressTest.java

示例5: runExport

import com.cloudera.sqoop.tool.ExportTool; //導入依賴的package包/類
/**
 * Run a MapReduce-based export (using the argv provided to control
 * execution).
 *
 * @return the generated jar filename
 */
protected List<String> runExport(String[] argv) throws IOException {
  // run the tool through the normal entry-point.
  int ret;
  List<String> generatedJars = null;
  try {
    ExportTool exporter = new ExportTool();

    Sqoop sqoop = new Sqoop(exporter);

    String username = MSSQLTestUtils.getDBUserName();
    String password = MSSQLTestUtils.getDBPassWord();
    sqoop.getOptions().setUsername(username);
    sqoop.getOptions().setPassword(password);

    ret = Sqoop.runSqoop(sqoop, argv);
    generatedJars = exporter.getGeneratedJarFiles();
  } catch (Exception e) {
    LOG.error("Got exception running Sqoop: "
        + StringUtils.stringifyException(e));
    ret = 1;
  }

  // expect a successful return.
  if (0 != ret) {
    throw new IOException("Failure during job; return status " + ret);
  }

  return generatedJars;
}
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:36,代碼來源:ManagerCompatExport.java

示例6: runExport

import com.cloudera.sqoop.tool.ExportTool; //導入依賴的package包/類
/**
 * Run a MapReduce-based export (using the argv provided to control
 * execution).
 * @return the generated jar filename
 */
protected List<String> runExport(String [] argv) throws IOException {
  // run the tool through the normal entry-point.
  int ret;
  List<String> generatedJars = null;
  try {
    ExportTool exporter = new ExportTool();
    Configuration conf = getConf();
    //Need to disable OraOop for existing tests
    conf.set("oraoop.disabled", "true");
    SqoopOptions opts = getSqoopOptions(conf);
    Sqoop sqoop = new Sqoop(exporter, conf, opts);
    ret = Sqoop.runSqoop(sqoop, argv);
    generatedJars = exporter.getGeneratedJarFiles();
  } catch (Exception e) {
    LOG.error("Got exception running Sqoop: "
        + StringUtils.stringifyException(e));
    ret = 1;
  }

  // expect a successful return.
  if (0 != ret) {
    throw new IOException("Failure during job; return status " + ret);
  }

  return generatedJars;
}
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:32,代碼來源:ExportJobTestCase.java

示例7: setUp

import com.cloudera.sqoop.tool.ExportTool; //導入依賴的package包/類
@Before
@Override
public void setUp() {
  importTool = new ImportTool();
  exportTool = new ExportTool();
}
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:7,代碼來源:TestHCatalogBasic.java


注:本文中的com.cloudera.sqoop.tool.ExportTool類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。