Examples of RuntimeEnvironment


Examples of eu.stratosphere.nephele.execution.RuntimeEnvironment

   */
  public void register(Task task) throws InsufficientResourcesException {
    // Check if we can safely run this task with the given buffers
    ensureBufferAvailability(task);

    RuntimeEnvironment environment = task.getRuntimeEnvironment();

    // -------------------------------------------------------------------------------------------------------------
    //                                       Register output channels
    // -------------------------------------------------------------------------------------------------------------

    environment.registerGlobalBufferPool(this.globalBufferPool);

    if (this.localBuffersPools.containsKey(task.getVertexID())) {
      throw new IllegalStateException("Vertex " + task.getVertexID() + " has a previous buffer pool owner");
    }

    for (OutputGate gate : environment.outputGates()) {
      // add receiver list hints
      for (OutputChannel channel : gate.channels()) {
        // register envelope dispatcher with the channel
        channel.registerEnvelopeDispatcher(this);

        switch (channel.getChannelType()) {
          case IN_MEMORY:
            addReceiverListHint(channel.getID(), channel.getConnectedId());
            break;
          case NETWORK:
            addReceiverListHint(channel.getConnectedId(), channel.getID());
            break;
        }

        this.channels.put(channel.getID(), channel);
      }
    }

    this.localBuffersPools.put(task.getVertexID(), environment);

    // -------------------------------------------------------------------------------------------------------------
    //                                       Register input channels
    // -------------------------------------------------------------------------------------------------------------

    // register global
    for (InputGate<?> gate : environment.inputGates()) {
      gate.registerGlobalBufferPool(this.globalBufferPool);

      for (int i = 0; i < gate.getNumberOfInputChannels(); i++) {
        InputChannel<? extends IOReadableWritable> channel = gate.getInputChannel(i);
        channel.registerEnvelopeDispatcher(this);
View Full Code Here

Examples of liquibase.RuntimeEnvironment

    @Test
    public void runChangeSet_emptyFiltersIterator() throws Exception {
        TestChangeSetVisitor testChangeLogVisitor = new TestChangeSetVisitor();

        ChangeLogIterator iterator = new ChangeLogIterator(changeLog);
        iterator.run(testChangeLogVisitor, new RuntimeEnvironment(null, null, null));
        assertEquals(6, testChangeLogVisitor.visitedChangeSets.size());
    }
View Full Code Here

Examples of org.apache.flink.runtime.execution.RuntimeEnvironment

   */
  public void register(Task task) throws InsufficientResourcesException {
    // Check if we can safely run this task with the given buffers
    ensureBufferAvailability(task);

    RuntimeEnvironment environment = task.getEnvironment();

    // -------------------------------------------------------------------------------------------------------------
    //                                       Register output channels
    // -------------------------------------------------------------------------------------------------------------

    environment.registerGlobalBufferPool(this.globalBufferPool);

    if (this.localBuffersPools.containsKey(task.getExecutionId())) {
      throw new IllegalStateException("Execution " + task.getExecutionId() + " has a previous buffer pool owner");
    }

    for (OutputGate gate : environment.outputGates()) {
      // add receiver list hints
      for (OutputChannel channel : gate.channels()) {
        // register envelope dispatcher with the channel
        channel.registerEnvelopeDispatcher(this);

        switch (channel.getChannelType()) {
          case IN_MEMORY:
            addReceiverListHint(channel.getID(), channel.getConnectedId());
            break;
          case NETWORK:
            addReceiverListHint(channel.getConnectedId(), channel.getID());
            break;
        }

        this.channels.put(channel.getID(), channel);
      }
    }

    this.localBuffersPools.put(task.getExecutionId(), environment);

    // -------------------------------------------------------------------------------------------------------------
    //                                       Register input channels
    // -------------------------------------------------------------------------------------------------------------

    // register global
    for (InputGate<?> gate : environment.inputGates()) {
      gate.registerGlobalBufferPool(this.globalBufferPool);

      for (int i = 0; i < gate.getNumberOfInputChannels(); i++) {
        InputChannel<? extends IOReadableWritable> channel = gate.getInputChannel(i);
        channel.registerEnvelopeDispatcher(this);
View Full Code Here

Examples of org.jboss.gravia.provision.spi.RuntimeEnvironment

        // Installing a bundle does not trigger a {@link ModuleEvent#INSTALLED}
        // event because the Bundle's class loader is not (yet) available
        // We manually add the resource to the {@link RuntimeEnvironment}
        Resource envres = environment.getResource(resid);
        if (envres == null && module != null) {
            RuntimeEnvironment runtimeEnv = RuntimeEnvironment.assertRuntimeEnvironment(environment);
            runtimeEnv.addRuntimeResource(resource);
        }

        return new BundleResourceHandle(resource, module, bundle);
    }
View Full Code Here

Examples of org.jboss.gravia.provision.spi.RuntimeEnvironment

    private Set<ServiceRegistration<?>> registrations = new HashSet<ServiceRegistration<?>>();

    @Override
    public void start(final BundleContext context) throws Exception {
        Runtime runtime = RuntimeLocator.getRequiredRuntime();
        RuntimeEnvironment environment = new RuntimeEnvironment(runtime).initDefaultContent();
        BundleResourceInstaller installer = new BundleResourceInstaller(context, environment);
        registrations.add(context.registerService(RuntimeEnvironment.class, environment, null));
        registrations.add(context.registerService(ResourceInstaller.class, installer, null));
    }
View Full Code Here

Examples of org.jboss.gravia.provision.spi.RuntimeEnvironment

        // event because the Bundle's class loader is not (yet) available
        // We manually add the resource to the {@link RuntimeEnvironment}
        // [TODO] Revisit {@link ModuleListener} handling for OSGi
        Resource envres = environment.getResource(resid);
        if (envres == null && module != null) {
            RuntimeEnvironment runtimeEnv = RuntimeEnvironment.assertRuntimeEnvironment(environment);
            runtimeEnv.addRuntimeResource(resource);
        }

        return new BundleResourceHandle(resource, module, bundle);
    }
View Full Code Here

Examples of org.jboss.gravia.provision.spi.RuntimeEnvironment

        // event because the Bundle's class loader is not (yet) available
        // We manually add the resource to the {@link RuntimeEnvironment}
        // [TODO] Revisit {@link ModuleListener} handling for OSGi
        Resource envres = environment.getResource(identity);
        if (envres == null && module != null) {
            RuntimeEnvironment runtimeEnv = RuntimeEnvironment.assertRuntimeEnvironment(environment);
            runtimeEnv.addRuntimeResource(resource);
        }

        return new BundleResourceHandle(resource, module, bundle);
    }
View Full Code Here

Examples of org.jboss.gravia.provision.spi.RuntimeEnvironment

    @SuppressWarnings("deprecation")
    public void start(StartContext startContext) throws StartException {
        Runtime runtime = injectedRuntime.getValue();
        MatchPolicy matchPolicy = new DefaultMatchPolicy();
        File modulesDir = injectedServerEnvironment.getValue().getModulesDir();
        environment = new RuntimeEnvironment(runtime, new SystemResourceStore(modulesDir), matchPolicy);

        ModuleContext syscontext = runtime.getModuleContext();
        registration = syscontext.registerService(RuntimeEnvironment.class, environment, null);
    }
View Full Code Here

Examples of org.jboss.gravia.provision.spi.RuntimeEnvironment

        BundleContext bundleContext = sysmodule.adapt(Bundle.class).getBundleContext();
        servletContext.setAttribute(BundleContext.class.getName(), bundleContext);
    }

    private void registerServices(ServletContext servletContext, Runtime runtime) {
        RuntimeEnvironment environment = new RuntimeEnvironment(runtime).initDefaultContent();
        TomcatResourceInstaller installer = new TomcatResourceInstaller(environment);
        ModuleContext syscontext = runtime.getModuleContext();
        registrations.add(syscontext.registerService(RuntimeEnvironment.class, environment, null));
        registrations.add(syscontext.registerService(ResourceInstaller.class, installer, null));
    }
View Full Code Here

Examples of org.jboss.gravia.provision.spi.RuntimeEnvironment

        if (registration == null && resref != null  & repref != null) {
            context.removeServiceListener(listener);
            Resolver resolver = context.getService(resref);
            Repository repository = context.getService(repref);
            Runtime runtime = RuntimeLocator.getRequiredRuntime();
            RuntimeEnvironment environment = new RuntimeEnvironment(runtime).initDefaultContent();
            BundleResourceInstaller installer = new BundleResourceInstaller(context, environment);
            Provisioner provisioner = new DefaultProvisioner(environment, resolver, repository, installer);
            registration = context.registerService(Provisioner.class, provisioner, null);
        }
    }
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.