Package org.apache.sqoop.common

Examples of org.apache.sqoop.common.MapContext


    }

    Map<String,String> parameters = new HashMap<String, String>();
    parameters.putAll(config);

    return new MapContext(parameters);
  }
View Full Code Here


    validator = new FrameworkValidator();
  }

  public synchronized void initialize() {
    LOG.trace("Begin submission engine manager initialization");
    MapContext context = SqoopConfiguration.getInstance().getContext();

    // Register framework metadata in repository
    mFramework = RepositoryManager.getInstance().getRepository().registerFramework(mFramework);

    // Let's load configured submission engine
    String submissionEngineClassName =
      context.getString(FrameworkConstants.SYSCFG_SUBMISSION_ENGINE);

    submissionEngine = (SubmissionEngine) ClassUtils.instantiate(submissionEngineClassName);
    if(submissionEngine == null) {
      throw new SqoopException(FrameworkError.FRAMEWORK_0001,
        submissionEngineClassName);
    }

    submissionEngine.initialize(context, FrameworkConstants.PREFIX_SUBMISSION_ENGINE_CONFIG);

    // Execution engine
    String executionEngineClassName =
      context.getString(FrameworkConstants.SYSCFG_EXECUTION_ENGINE);

    executionEngine = (ExecutionEngine) ClassUtils.instantiate(executionEngineClassName);
    if(executionEngine == null) {
      throw new SqoopException(FrameworkError.FRAMEWORK_0007,
        executionEngineClassName);
    }

    // We need to make sure that user has configured compatible combination of
    // submission engine and execution engine
    if(! submissionEngine.isExecutionEngineSupported(executionEngine.getClass())) {
      throw new SqoopException(FrameworkError.FRAMEWORK_0008);
    }

    executionEngine.initialize(context, FrameworkConstants.PREFIX_EXECUTION_ENGINE_CONFIG);

    // Set up worker threads
    purgeThreshold = context.getLong(
      FrameworkConstants.SYSCFG_SUBMISSION_PURGE_THRESHOLD,
      DEFAULT_PURGE_THRESHOLD
    );
    purgeSleep = context.getLong(
      FrameworkConstants.SYSCFG_SUBMISSION_PURGE_SLEEP,
      DEFAULT_PURGE_SLEEP
    );

    purgeThread = new PurgeThread();
    purgeThread.start();

    updateSleep = context.getLong(
      FrameworkConstants.SYSCFG_SUBMISSION_UPDATE_SLEEP,
      DEFAULT_UPDATE_SLEEP
    );

    updateThread = new UpdateThread();
View Full Code Here

  }

  private RepositoryProvider provider;

  public synchronized void initialize() {
    MapContext context = SqoopConfiguration.getInstance().getContext();

    Map<String, String> repoSysProps = context.getNestedProperties(
        RepoConfigurationConstants.SYSCFG_REPO_SYSPROP_PREFIX);

    LOG.info("Setting system properties: " + repoSysProps);

    for (Map.Entry<String, String> entry : repoSysProps.entrySet()) {
      System.setProperty(entry.getKey(), entry.getValue());
    }

    String repoProviderClassName = context.getString(
        RepoConfigurationConstants.SYSCFG_REPO_PROVIDER);

    if (repoProviderClassName == null
        || repoProviderClassName.trim().length() == 0) {
      throw new SqoopException(RepositoryError.REPO_0001,
View Full Code Here

TOP

Related Classes of org.apache.sqoop.common.MapContext

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.