本文整理汇总了Java中com.cloudera.sqoop.ConnFactory.getManager方法的典型用法代码示例。如果您正苦于以下问题:Java ConnFactory.getManager方法的具体用法?Java ConnFactory.getManager怎么用?Java ConnFactory.getManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.cloudera.sqoop.ConnFactory
的用法示例。
在下文中一共展示了ConnFactory.getManager方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import com.cloudera.sqoop.ConnFactory; //导入方法依赖的package包/类
@Before
public void setUp() {
Configuration conf = getConf();
opts = getSqoopOptions(conf);
opts.setConnectString("dummy.server");
opts.setTableName("dummy.pds");
opts.setConnManagerClassName("org.apache.sqoop.manager.MainframeManager");
context = new ImportJobContext(getTableName(), null, opts, null);
ConnFactory f = new ConnFactory(conf);
try {
this.manager = f.getManager(new JobData(opts, new MainframeImportTool()));
} catch (IOException ioe) {
fail("IOException instantiating manager: "
+ StringUtils.stringifyException(ioe));
}
}
示例2: setUp
import com.cloudera.sqoop.ConnFactory; //导入方法依赖的package包/类
@Before
public void setUp() {
MSSQLTestUtils utils = new MSSQLTestUtils();
try {
utils.createTableFromSQL(MSSQLTestUtils.CREATE_TALBE_LINEITEM);
utils.populateLineItem();
} catch (SQLException e) {
LOG.error("Setup fail with SQLException: " + StringUtils.stringifyException(e));
fail("Setup fail with SQLException: " + e.toString());
}
Configuration conf = getConf();
SqoopOptions opts = getSqoopOptions(conf);
String username = MSSQLTestUtils.getDBUserName();
String password = MSSQLTestUtils.getDBPassWord();
opts.setUsername(username);
opts.setPassword(password);
opts.setConnectString(getConnectString());
ConnFactory f = new ConnFactory(conf);
try {
this.manager = f.getManager(new JobData(opts, new ImportTool()));
System.out.println("Manger : " + this.manager);
} catch (IOException ioe) {
LOG.error("Setup fail with IOException: " + StringUtils.stringifyException(ioe));
fail("IOException instantiating manager: "
+ StringUtils.stringifyException(ioe));
}
}
示例3: setUp
import com.cloudera.sqoop.ConnFactory; //导入方法依赖的package包/类
@Before
public void setUp() {
// The assumption is that correct HADOOP configuration will have it set to
// hdfs://namenode
setOnPhysicalCluster(
!CommonArgs.LOCAL_FS.equals(System.getProperty(
CommonArgs.FS_DEFAULT_NAME)));
incrementTableNum();
if (!isLog4jConfigured) {
BasicConfigurator.configure();
isLog4jConfigured = true;
LOG.info("Configured log4j with console appender.");
}
if (useHsqldbTestServer()) {
testServer = new HsqldbTestServer();
try {
testServer.resetServer();
} catch (SQLException sqlE) {
LOG.error("Got SQLException: " + StringUtils.stringifyException(sqlE));
fail("Got SQLException: " + StringUtils.stringifyException(sqlE));
} catch (ClassNotFoundException cnfe) {
LOG.error("Could not find class for db driver: "
+ StringUtils.stringifyException(cnfe));
fail("Could not find class for db driver: "
+ StringUtils.stringifyException(cnfe));
}
manager = testServer.getManager();
} else {
Configuration conf = getConf();
//Need to disable OraOop for existing tests
conf.set("oraoop.disabled", "true");
SqoopOptions opts = getSqoopOptions(conf);
opts.setConnectString(getConnectString());
opts.setTableName(getTableName());
ConnFactory f = new ConnFactory(conf);
try {
this.manager = f.getManager(new JobData(opts, new ImportTool()));
} catch (IOException ioe) {
fail("IOException instantiating manager: "
+ StringUtils.stringifyException(ioe));
}
}
}
示例4: setUp
import com.cloudera.sqoop.ConnFactory; //导入方法依赖的package包/类
@Before
public void setUp() {
// The assumption is that correct HADOOP configuration will have it set to
// hdfs://namenode
setOnPhysicalCluster(
!CommonArgs.LOCAL_FS.equals(System.getProperty(
CommonArgs.FS_DEFAULT_NAME)));
incrementTableNum();
if (!isLog4jConfigured) {
BasicConfigurator.configure();
isLog4jConfigured = true;
LOG.info("Configured log4j with console appender.");
}
if (useHsqldbTestServer()) {
testServer = new HsqldbTestServer();
try {
testServer.resetServer();
} catch (SQLException sqlE) {
LOG.error("Got SQLException: " + StringUtils.stringifyException(sqlE));
fail("Got SQLException: " + StringUtils.stringifyException(sqlE));
} catch (ClassNotFoundException cnfe) {
LOG.error("Could not find class for db driver: "
+ StringUtils.stringifyException(cnfe));
fail("Could not find class for db driver: "
+ StringUtils.stringifyException(cnfe));
}
manager = testServer.getManager();
} else {
Configuration conf = getConf();
SqoopOptions opts = getSqoopOptions(conf);
opts.setConnectString(getConnectString());
opts.setTableName(getTableName());
ConnFactory f = new ConnFactory(conf);
try {
this.manager = f.getManager(new JobData(opts, new ImportTool()));
} catch (IOException ioe) {
fail("IOException instantiating manager: "
+ StringUtils.stringifyException(ioe));
}
}
}