Examples of MFramework


Examples of org.apache.sqoop.model.MFramework

  @Override
  public MFramework registerFramework(final MFramework mFramework) {
    return (MFramework) doWithConnection(new DoWithConnection() {
      @Override
      public Object doIt(Connection conn) {
        MFramework result = handler.findFramework(conn);
        if (result == null) {
          handler.registerFramework(mFramework, conn);
          return mFramework;
        } else {
          if (!result.equals(mFramework)) {
            throw new SqoopException(RepositoryError.JDBCREPO_0014,
             "Framework: given: " + mFramework + " found:" + result);
          }
          return result;
        }
View Full Code Here

Examples of org.apache.sqoop.model.MFramework

   * {@inheritDoc}
   */
  @Override
  public MFramework findFramework(Connection conn) {
    LOG.debug("Looking up framework metadata");
    MFramework mf = null;
    PreparedStatement formFetchStmt = null;
    PreparedStatement inputFetchStmt = null;
    try {
      formFetchStmt = conn.prepareStatement(STMT_FETCH_FORM_FRAMEWORK);
      inputFetchStmt = conn.prepareStatement(STMT_FETCH_INPUT);

      List<MForm> connectionForms = new ArrayList<MForm>();
      Map<MJob.Type, List<MForm>> jobForms =
        new HashMap<MJob.Type, List<MForm>>();

      loadForms(connectionForms, jobForms, formFetchStmt, inputFetchStmt, 1);

      // Return nothing If there aren't any framework metadata
      if(connectionForms.isEmpty() && jobForms.isEmpty()) {
        return null;
      }

      mf = new MFramework(new MConnectionForms(connectionForms),
        convertToJobList(jobForms));

      // We're using hardcoded value for framework metadata as they are
      // represented as NULL in the database.
      mf.setPersistenceId(1);

    } catch (SQLException ex) {
      throw new SqoopException(DerbyRepoError.DERBYREPO_0004,
        "Framework metadata", ex);
    } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.