本文整理匯總了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);
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例7: setUp
import com.cloudera.sqoop.tool.ExportTool; //導入依賴的package包/類
@Before
@Override
public void setUp() {
importTool = new ImportTool();
exportTool = new ExportTool();
}