Examples of MFramework


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), detectFrameworkVersion(conn));

      // 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

Examples of org.apache.sqoop.model.MFramework

    connector.setPersistenceId(id);
    return connector;
  }

  private MFramework framework() {
    MFramework framework = new MFramework(new MConnectionForms(null),
      new LinkedList<MJobForms>(), "1");
    framework.setPersistenceId(1);
    return framework;
  }
View Full Code Here

Examples of org.apache.sqoop.model.MFramework

      List<MForm> job = restoreForms((JSONArray) entry.getValue());

      jobs.add(new MJobForms(type, job));
    }

    framework = new MFramework(new MConnectionForms(connForms), jobs,
      frameworkVersion);
    framework.setPersistenceId(id);

    bundle = restoreResourceBundle((JSONObject) jsonObject.get(RESOURCES));
  }
View Full Code Here

Examples of org.apache.sqoop.model.MFramework

    return new MConnector(name, name + ".class", "1.0-test",
      getConnectionForms(), getAllJobForms());
  }

  public static MFramework getFramework() {
    return new MFramework(getConnectionForms(), getAllJobForms(), "1");
  }
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

Examples of org.apache.sqoop.model.MFramework

    return new MConnector(name, name + ".class", "1.0-test",
      getConnectionForms(), getAllJobForms());
  }

  public static MFramework getFramework() {
    return new MFramework(getConnectionForms(), getAllJobForms());
  }
View Full Code Here

Examples of org.apache.sqoop.model.MFramework

   * Test that by JSON serialization followed by deserialization we will get
   * equal framework object.
   */
  @Test
  public void testSerialization() {
    MFramework framework = getFramework();

    // Serialize it to JSON object
    FrameworkBean bean = new FrameworkBean(framework, getResourceBundle());
    JSONObject json = bean.extract();

View Full Code Here

Examples of org.apache.sqoop.model.MFramework

    ConsoleReader reader = new ConsoleReader();

    FrameworkBean frameworkBean = readFramework();
    ConnectorBean connectorBean = readConnector(connectorId);

    MFramework framework = frameworkBean.getFramework();
    ResourceBundle frameworkBundle = frameworkBean.getResourceBundle();

    MConnector connector = connectorBean.getConnectors().get(0);
    ResourceBundle connectorBundle = connectorBean.getResourceBundles().get(connector.getPersistenceId());

    MConnection connection = new MConnection(connector.getPersistenceId(),
                                             connector.getConnectionForms(),
                                             framework.getConnectionForms());

    Status status = Status.FINE;

    io.out.println(getResource().getString(Constants.RES_PROMPT_FILL_CONN_METADATA));
View Full Code Here

Examples of org.apache.sqoop.model.MFramework

      List<MForm> job = restoreForms((JSONArray) entry.getValue());

      jobs.add(new MJobForms(type, job));
    }

    framework = new MFramework(new MConnectionForms(connForms), jobs);
    framework.setPersistenceId(id);

    bundle = restoreResourceBundle((JSONObject) jsonObject.get(RESOURCES));
  }
View Full Code Here

Examples of org.apache.sqoop.model.MFramework

  }

  private void showFramework() {
    FrameworkBean frameworkBean = readFramework();

    MFramework framework = frameworkBean.getFramework();
    ResourceBundle bundle = frameworkBean.getResourceBundle();
    io.out.println(StringEscapeUtils.unescapeJava(
        MessageFormat.format(Constants.RES_SHOW_PROMPT_FRAMEWORK_OPTS,
            framework.getPersistenceId())));

    displayFormMetadataDetails(io, framework, bundle);

    io.out.println();
  }
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.