Search in sources :

Example 1 with IDeployedEvent

use of org.iobserve.common.record.IDeployedEvent in project iobserve-analysis by research-iobserve.

the class DynamicEventDispatcherTest method checkDeploymentDetection.

/**
 * Check whether all deployment records are found.
 */
@Test
public void checkDeploymentDetection() {
    final DynamicEventDispatcher eventDispatcher = new DynamicEventDispatcher(this.kiekerMetadataMatcher, true, true, false);
    final List<IDeployedEvent> localDeploymentRecords = new ArrayList<>();
    StageTester.test(eventDispatcher).and().send(this.inputRecords).to(eventDispatcher.getInputPort()).and().receive(localDeploymentRecords).from(this.deployedEventMatcher.getOutputPort()).start();
    Assert.assertThat("Did not collect all deployment events.", (int) eventDispatcher.getEventCount(), Is.is(this.inputRecords.size()));
    Assert.assertEquals("Wrong number of deployments", this.deploymentRecords.size(), localDeploymentRecords.size());
}
Also used : ArrayList(java.util.ArrayList) DynamicEventDispatcher(org.iobserve.stages.general.DynamicEventDispatcher) IDeployedEvent(org.iobserve.common.record.IDeployedEvent) Test(org.junit.Test)

Example 2 with IDeployedEvent

use of org.iobserve.common.record.IDeployedEvent in project iobserve-analysis by research-iobserve.

the class AnalysisConfiguration method containerManagement.

/**
 * Create all stages necessary for the container management.
 *
 * @param configuration
 *            potential configuration parameter for filters
 * @param resourceEnvironmentModelResource
 * @param systemModelResource
 * @param allocationModelResource
 * @param correspondenceModelResource
 *
 * @throws ConfigurationException
 *             when configuration fails
 */
private void containerManagement(final kieker.common.configuration.Configuration configuration, final Neo4JModelResource<ResourceEnvironment> resourceEnvironmentModelResource, final Neo4JModelResource<System> systemModelResource, final Neo4JModelResource<Allocation> allocationModelResource, final Neo4JModelResource<CorrespondenceModel> correspondenceModelResource) throws ConfigurationException {
    if (configuration.getBooleanProperty(ConfigurationKeys.CONTAINER_MANAGEMENT, false)) {
        /**
         * allocation.
         */
        this.allocationStage = new AllocationStage(resourceEnvironmentModelResource);
        final IEventMatcher<IAllocationEvent> allocationMatcher = new ImplementsEventMatcher<>(IAllocationEvent.class, null);
        /**
         * connect ports.
         */
        this.eventDispatcher.registerOutput(allocationMatcher);
        this.connectPorts(allocationMatcher.getOutputPort(), this.allocationStage.getInputPort());
        /**
         * deallocation.
         */
        this.deallocationStage = new DeallocationStage(resourceEnvironmentModelResource);
        /**
         * connect ports.
         */
        final IEventMatcher<IDeallocationEvent> deallocationMatcher = new ImplementsEventMatcher<>(IDeallocationEvent.class, null);
        this.eventDispatcher.registerOutput(deallocationMatcher);
        this.connectPorts(deallocationMatcher.getOutputPort(), this.deallocationStage.getInputPort());
        /**
         * deployment.
         */
        final IEventMatcher<IDeployedEvent> deployedEventMatcher = new ImplementsEventMatcher<>(IDeployedEvent.class, null);
        this.eventDispatcher.registerOutput(deployedEventMatcher);
        this.deploymentStage = new DeploymentCompositeStage(resourceEnvironmentModelResource, systemModelResource, allocationModelResource, correspondenceModelResource);
        /**
         * connect ports.
         */
        this.connectPorts(deployedEventMatcher.getOutputPort(), this.deploymentStage.getDeployedInputPort());
        /**
         * undeployment.
         */
        final IEventMatcher<IUndeployedEvent> undeployedEventMatcher = new ImplementsEventMatcher<>(IUndeployedEvent.class, null);
        this.eventDispatcher.registerOutput(undeployedEventMatcher);
        this.undeploymentStage = new UndeploymentCompositeStage(resourceEnvironmentModelResource, systemModelResource, allocationModelResource, correspondenceModelResource);
        /**
         * connect ports.
         */
        this.connectPorts(undeployedEventMatcher.getOutputPort(), this.undeploymentStage.getUndeployedInputPort());
        /**
         * dependent features.
         */
        this.createContainerManagementSink(configuration, resourceEnvironmentModelResource, systemModelResource, allocationModelResource);
    }
}
Also used : IDeallocationEvent(org.iobserve.common.record.IDeallocationEvent) ImplementsEventMatcher(org.iobserve.stages.general.ImplementsEventMatcher) IAllocationEvent(org.iobserve.common.record.IAllocationEvent) IDeployedEvent(org.iobserve.common.record.IDeployedEvent) IUndeployedEvent(org.iobserve.common.record.IUndeployedEvent) UndeploymentCompositeStage(org.iobserve.analysis.deployment.UndeploymentCompositeStage) AllocationStage(org.iobserve.analysis.deployment.AllocationStage) DeploymentCompositeStage(org.iobserve.analysis.deployment.DeploymentCompositeStage) DeallocationStage(org.iobserve.analysis.deployment.DeallocationStage)

Aggregations

IDeployedEvent (org.iobserve.common.record.IDeployedEvent)2 ArrayList (java.util.ArrayList)1 AllocationStage (org.iobserve.analysis.deployment.AllocationStage)1 DeallocationStage (org.iobserve.analysis.deployment.DeallocationStage)1 DeploymentCompositeStage (org.iobserve.analysis.deployment.DeploymentCompositeStage)1 UndeploymentCompositeStage (org.iobserve.analysis.deployment.UndeploymentCompositeStage)1 IAllocationEvent (org.iobserve.common.record.IAllocationEvent)1 IDeallocationEvent (org.iobserve.common.record.IDeallocationEvent)1 IUndeployedEvent (org.iobserve.common.record.IUndeployedEvent)1 DynamicEventDispatcher (org.iobserve.stages.general.DynamicEventDispatcher)1 ImplementsEventMatcher (org.iobserve.stages.general.ImplementsEventMatcher)1 Test (org.junit.Test)1