Examples of MFramework


Examples of org.apache.sqoop.model.MFramework

    FrameworkBean frameworkBean = readFramework();
    ConnectionBean connectionBean = readConnection(connectionId);
    ConnectorBean connectorBean;

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

    MConnection connection = connectionBean.getConnections().get(0);

    connectorBean = readConnector(String.valueOf(connection.getConnectorId()));
    MConnector connector = connectorBean.getConnectors().get(0);
    ResourceBundle connectorBundle = connectorBean.getResourceBundles().get(connector.getPersistenceId());

    MJob.Type jobType = MJob.Type.valueOf(type.toUpperCase());

    MJob job = new MJob(
      connector.getPersistenceId(),
      connection.getPersistenceId(),
      jobType,
      connector.getJobForms(jobType),
      framework.getJobForms(jobType)
    );

    Status status = Status.FINE;

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

Examples of org.apache.sqoop.model.MFramework

    return null;
  }

  private void showFramework() {
    MFramework framework = client.getFramework();
    ResourceBundle bundle = client.getFrameworkResourceBundle();

    printlnResource(Constants.RES_SHOW_PROMPT_FRAMEWORK_OPTS, framework.getPersistenceId());
    displayFormMetadataDetails(framework, bundle);
  }
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(false);

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

    connector.setPersistenceId(id);
    return connector;
  }

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

Examples of org.apache.sqoop.model.MFramework

    // Load framework into repository
    loadConnectorAndFramework();

    // Retrieve it
    MFramework framework = handler.findFramework(getDerbyConnection());
    assertNotNull(framework);

    // Get original structure
    MFramework original = getFramework();

    // And compare them
    assertEquals(original, framework);
  }
View Full Code Here

Examples of org.apache.sqoop.model.MFramework

    // And compare them
    assertEquals(original, framework);
  }

  public void testRegisterConnector() throws Exception {
    MFramework framework = getFramework();

    handler.registerFramework(framework, getDerbyConnection());

    // Connector should get persistence ID
    assertEquals(1, framework.getPersistenceId());

    // Now check content in corresponding tables
    assertCountForTable("SQOOP.SQ_CONNECTOR", 0);
    assertCountForTable("SQOOP.SQ_FORM", 6);
    assertCountForTable("SQOOP.SQ_INPUT", 12);

    // Registered framework should be easily recovered back
    MFramework retrieved = handler.findFramework(getDerbyConnection());
    assertNotNull(retrieved);
    assertEquals(framework, retrieved);
  }
View Full Code Here

Examples of org.apache.sqoop.model.MFramework

    List<MJobForms> jobForms = new LinkedList<MJobForms>();
    jobForms.add(new MJobForms(MJob.Type.IMPORT,
      FormUtils.toForms(getJobConfigurationClass(MJob.Type.IMPORT))));
    jobForms.add(new MJobForms(MJob.Type.EXPORT,
      FormUtils.toForms(getJobConfigurationClass(MJob.Type.EXPORT))));
    mFramework = new MFramework(connectionForms, jobForms);

    // Build validator
    validator = new FrameworkValidator();
  }
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

    return new MConnector("A", "org.apache.sqoop.test.A", "1.0-test",
      getConnectionForms(), getJobForms());
  }

  protected MFramework getFramework() {
    return new MFramework(getConnectionForms(), getJobForms());
  }
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.