Package org.apache.sqoop.job.etl

Examples of org.apache.sqoop.job.etl.Destroyer


   * @param configuration Configuration object to get destroyer class with context
   *                      and configuration objects.
   * @param propertyName Name of property that holds destroyer class.
   */
  public static void executeDestroyer(boolean success, Configuration configuration, String propertyName) {
    Destroyer destroyer = (Destroyer) ClassUtils.instantiate(configuration.get(propertyName));

    if(destroyer == null) {
      LOG.info("Skipping running destroyer as non was defined.");
      return;
    }

    // Objects that should be pass to the Destroyer execution
    PrefixContext subContext = new PrefixContext(configuration, JobConstants.PREFIX_CONNECTOR_CONTEXT);
    Object configConnection = ConfigurationUtils.getConfigConnectorConnection(configuration);
    Object configJob = ConfigurationUtils.getConfigConnectorJob(configuration);

    // Propagate connector schema in every case for now
    // TODO: Change to coditional choosing between HIO and Connector schema
    Schema schema = ConfigurationUtils.getConnectorSchema(configuration);

    DestroyerContext destroyerContext = new DestroyerContext(subContext, success, schema);

    LOG.info("Executing destroyer class " + destroyer.getClass());
    destroyer.destroy(destroyerContext, configConnection, configJob);
  }
View Full Code Here


   */
  private static void destroySubmission(SubmissionRequest request) {
    CallbackBase baseCallbacks = request.getConnectorCallbacks();

    Class<? extends Destroyer> destroyerClass = baseCallbacks.getDestroyer();
    Destroyer destroyer = (Destroyer) ClassUtils.instantiate(destroyerClass);

    if(destroyer == null) {
      throw  new SqoopException(FrameworkError.FRAMEWORK_0006,
        "Can't create destroyer instance: " + destroyerClass.getName());
    }

    // Initialize submission from connector perspective
    destroyer.destroy(false, request.getConnectorContext(),
      request.getConfigConnectorConnection(), request.getConfigConnectorJob());
  }
View Full Code Here

   * @param configuration Configuration object to get destroyer class with context
   *                      and configuration objects.
   * @param propertyName Name of property that holds destroyer class.
   */
  public static void executeDestroyer(boolean success, Configuration configuration, String propertyName) {
    Destroyer destroyer = (Destroyer) ClassUtils.instantiate(configuration.get(propertyName));

    if(destroyer == null) {
      LOG.info("Skipping running destroyer as non was defined.");
      return;
    }

    // Objects that should be pass to the Destroyer execution
    PrefixContext subContext = new PrefixContext(configuration, JobConstants.PREFIX_CONNECTOR_CONTEXT);
    Object configConnection = ConfigurationUtils.getConnectorConnection(configuration);
    Object configJob = ConfigurationUtils.getConnectorJob(configuration);

    LOG.info("Executing destroyer class " + destroyer.getClass());
    destroyer.destroy(success, subContext, configConnection, configJob);
  }
View Full Code Here

   * @param configuration Configuration object to get destroyer class with context
   *                      and configuration objects.
   * @param propertyName Name of property that holds destroyer class.
   */
  public static void executeDestroyer(boolean success, Configuration configuration, String propertyName) {
    Destroyer destroyer = (Destroyer) ClassUtils.instantiate(configuration.get(propertyName));

    if(destroyer == null) {
      LOG.info("Skipping running destroyer as non was defined.");
      return;
    }

    // Objects that should be pass to the Destroyer execution
    PrefixContext subContext = new PrefixContext(configuration, JobConstants.PREFIX_CONNECTOR_CONTEXT);
    Object configConnection = ConfigurationUtils.getConnectorConnection(configuration);
    Object configJob = ConfigurationUtils.getConnectorJob(configuration);

    DestroyerContext destroyerContext = new DestroyerContext(subContext, success);

    LOG.info("Executing destroyer class " + destroyer.getClass());
    destroyer.destroy(destroyerContext, configConnection, configJob);
  }
View Full Code Here

   */
  private void destroySubmission(SubmissionRequest request) {
    CallbackBase baseCallbacks = request.getConnectorCallbacks();

    Class<? extends Destroyer> destroyerClass = baseCallbacks.getDestroyer();
    Destroyer destroyer = (Destroyer) ClassUtils.instantiate(destroyerClass);

    if(destroyer == null) {
      throw  new SqoopException(FrameworkError.FRAMEWORK_0006,
        "Can't create destroyer instance: " + destroyerClass.getName());
    }

    DestroyerContext destroyerContext = new DestroyerContext(request.getConnectorContext(), false);

    // Initialize submission from connector perspective
    destroyer.destroy(destroyerContext, request.getConfigConnectorConnection(), request.getConfigConnectorJob());
  }
View Full Code Here

TOP

Related Classes of org.apache.sqoop.job.etl.Destroyer

Copyright © 2018 www.massapicom. 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.