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


Java ConnFactory.getManager方法代码示例

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

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

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

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


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