Examples of MapContext


Examples of org.apache.sqoop.common.MapContext

  }

  @Override
  public synchronized void configurationChanged() {
    LOG.info("Begin repository manager reconfiguring");
    MapContext newContext = SqoopConfiguration.getInstance().getContext();
    MapContext oldContext = SqoopConfiguration.getInstance().getOldContext();

    String newProviderClassName = newContext.getString(RepoConfigurationConstants.SYSCFG_REPO_PROVIDER);
    if (newProviderClassName == null
        || newProviderClassName.trim().length() == 0) {
      throw new SqoopException(RepositoryError.REPO_0001,
          RepoConfigurationConstants.SYSCFG_REPO_PROVIDER);
    }

    String oldProviderClassName = oldContext.getString(RepoConfigurationConstants.SYSCFG_REPO_PROVIDER);
    if (!newProviderClassName.equals(oldProviderClassName)) {
      LOG.warn("Repository provider cannot be replaced at the runtime. " +
               "You might need to restart the server.");
    }
View Full Code Here

Examples of org.apache.sqoop.common.MapContext

  }

  private void initializeLoggers() {
    loggers.clear();

    MapContext context = SqoopConfiguration.getInstance().getContext();

    Map<String, String> auditLoggerProps = context.getNestedProperties(
        AuditLoggerConstants.PREFIX_AUDITLOGGER_CONFIG);

    // Initialize audit loggers
    for (String key : auditLoggerProps.keySet()) {
      if (key.endsWith(AuditLoggerConstants.SUFFIX_AUDITLOGGER_CLASS)) {
View Full Code Here

Examples of org.apache.sqoop.common.MapContext

  public synchronized MapContext getContext() {
    if (!initialized) {
      throw new SqoopException(CoreError.CORE_0007);
    }

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

Examples of org.apache.sqoop.common.MapContext

    if (oldConfig == null) {
      throw new SqoopException(CoreError.CORE_0008);
    }

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

Examples of org.apache.sqoop.common.MapContext

  private static final Logger LOG = Logger.getLogger(RepositoryManager.class);

  private static RepositoryProvider provider;

  public static synchronized void initialize() {
    MapContext context = SqoopConfiguration.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

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

Examples of org.apache.sqoop.common.MapContext

    validator = new Validator();
  }

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

    // Register framework metadata in repository
    mFramework = RepositoryManager.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

Examples of org.geomajas.gwt.client.gfx.MapContext

    Composite c = new Composite();
    MockPaintable r = new MockPaintable();
    c.addChild(r);

    PainterVisitor pv = new PainterVisitor(new MapContext(){

      public MenuContext getMenuContext() {
        return null;
      }
View Full Code Here

Examples of org.geotools.map.MapContext

  @Autowired
  private RenderingService renderingService;

  public void execute(PipelineContext context, RasterizingContainer response) throws GeomajasException {
    MapContext mapContext = context.get(RasterizingPipelineCode.MAP_CONTEXT_KEY, MapContext.class);
    context.put(RasterizingPipelineCode.RENDERED_IMAGE, renderingService.paintLegend(mapContext));
  }
View Full Code Here

Examples of org.geotools.map.MapContext

  @Autowired
  private RenderingService renderingService;

  public void execute(PipelineContext context, RasterizingContainer response) throws GeomajasException {
    MapContext mapContext = context.get(RasterizingPipelineCode.MAP_CONTEXT_KEY, MapContext.class);
    RenderingHints renderingHints = context.get(RasterizingPipelineCode.RENDERING_HINTS, RenderingHints.class);
    Rectangle paintArea = mapContext.getViewport().getScreenArea();
    MapRasterizingInfo mapRasterizingInfo = (MapRasterizingInfo) mapContext.getUserData().get(
        LayerFactory.USERDATA_RASTERIZING_INFO);
    BufferedImage image = createImage(paintArea.width, paintArea.height, mapRasterizingInfo.isTransparent());
    Graphics2D graphics = getGraphics(image, mapRasterizingInfo.isTransparent(), renderingHints);
    renderingService.paintMap(mapContext, graphics);
    context.put(RasterizingPipelineCode.RENDERED_IMAGE, image);
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.