Search in sources :

Example 1 with ImplementsEventMatcher

use of org.iobserve.stages.general.ImplementsEventMatcher 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)

Example 2 with ImplementsEventMatcher

use of org.iobserve.stages.general.ImplementsEventMatcher in project iobserve-analysis by research-iobserve.

the class AnalysisConfiguration method traceProcessing.

/**
 * Create trace related filter chains.
 *
 * @param configuration
 *            filter configurations
 * @throws ConfigurationException
 *             when configuration fails
 */
private void traceProcessing(final kieker.common.configuration.Configuration configuration) throws ConfigurationException {
    if (configuration.getBooleanProperty(ConfigurationKeys.TRACES, false)) {
        final TraceReconstructionCompositeStage traceReconstructionStage = new TraceReconstructionCompositeStage(configuration);
        OutputPort<EventBasedTrace> behaviorClusteringEventBasedTracePort = traceReconstructionStage.getTraceValidOutputPort();
        OutputPort<EventBasedTrace> dataFlowEventBasedTracePort = traceReconstructionStage.getTraceValidOutputPort();
        /**
         * Connect ports.
         */
        final IEventMatcher<IFlowRecord> flowRecordMatcher = new ImplementsEventMatcher<>(IFlowRecord.class, null);
        this.eventDispatcher.registerOutput(flowRecordMatcher);
        this.connectPorts(flowRecordMatcher.getOutputPort(), traceReconstructionStage.getInputPort());
        /**
         * Include distributor to support tow simultaneous sinks.
         */
        if (configuration.getBooleanProperty(ConfigurationKeys.DATA_FLOW, false) && !configuration.getStringProperty(ConfigurationKeys.BEHAVIOR_CLUSTERING).isEmpty()) {
            final IDistributorStrategy strategy = new CopyByReferenceStrategy();
            final Distributor<EventBasedTrace> distributor = new Distributor<>(strategy);
            this.connectPorts(traceReconstructionStage.getTraceValidOutputPort(), distributor.getInputPort());
            behaviorClusteringEventBasedTracePort = distributor.getNewOutputPort();
            dataFlowEventBasedTracePort = distributor.getNewOutputPort();
        }
        /**
         * Initialize depending features.
         */
        this.behaviorClustering(configuration, behaviorClusteringEventBasedTracePort);
        this.dataflow(configuration, dataFlowEventBasedTracePort);
    }
}
Also used : Distributor(teetime.stage.basic.distributor.Distributor) TraceReconstructionCompositeStage(org.iobserve.analysis.traces.TraceReconstructionCompositeStage) EventBasedTrace(org.iobserve.stages.data.trace.EventBasedTrace) IFlowRecord(kieker.common.record.flow.IFlowRecord) IDistributorStrategy(teetime.stage.basic.distributor.strategy.IDistributorStrategy) ImplementsEventMatcher(org.iobserve.stages.general.ImplementsEventMatcher) CopyByReferenceStrategy(teetime.stage.basic.distributor.strategy.CopyByReferenceStrategy)

Example 3 with ImplementsEventMatcher

use of org.iobserve.stages.general.ImplementsEventMatcher in project iobserve-analysis by research-iobserve.

the class AnalysisConfiguration method behaviorClustering.

/**
 * Create the behavioral clustering.
 *
 * @param configuration
 *            analysis configuration
 * @throws ConfigurationException
 *             when filter configuration fails
 */
private void behaviorClustering(final kieker.common.configuration.Configuration configuration, final OutputPort<EventBasedTrace> eventBasedTraceOutputPort) throws ConfigurationException {
    final String behaviorClustringClassName = configuration.getStringProperty(ConfigurationKeys.BEHAVIOR_CLUSTERING);
    if (!behaviorClustringClassName.isEmpty()) {
        final IBehaviorCompositeStage behavior = InstantiationFactory.createWithConfiguration(IBehaviorCompositeStage.class, behaviorClustringClassName, configuration);
        final IEventMatcher<ISessionEvent> sessionMatcher = new ImplementsEventMatcher<>(ISessionEvent.class, null);
        this.eventDispatcher.registerOutput(sessionMatcher);
        this.connectPorts(eventBasedTraceOutputPort, behavior.getEventBasedTraceInputPort());
        this.connectPorts(sessionMatcher.getOutputPort(), behavior.getSessionEventInputPort());
        if (configuration.getBooleanProperty(ConfigurationKeys.BEHAVIOR_CLUSTERING_SINK)) {
            // TODO needs visualization trigger
            AnalysisConfiguration.LOGGER.warn("Configuration for behavior sink missing.");
        }
    }
}
Also used : IBehaviorCompositeStage(org.iobserve.analysis.feature.IBehaviorCompositeStage) ImplementsEventMatcher(org.iobserve.stages.general.ImplementsEventMatcher) ISessionEvent(org.iobserve.common.record.ISessionEvent)

Aggregations

ImplementsEventMatcher (org.iobserve.stages.general.ImplementsEventMatcher)3 IFlowRecord (kieker.common.record.flow.IFlowRecord)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 IBehaviorCompositeStage (org.iobserve.analysis.feature.IBehaviorCompositeStage)1 TraceReconstructionCompositeStage (org.iobserve.analysis.traces.TraceReconstructionCompositeStage)1 IAllocationEvent (org.iobserve.common.record.IAllocationEvent)1 IDeallocationEvent (org.iobserve.common.record.IDeallocationEvent)1 IDeployedEvent (org.iobserve.common.record.IDeployedEvent)1 ISessionEvent (org.iobserve.common.record.ISessionEvent)1 IUndeployedEvent (org.iobserve.common.record.IUndeployedEvent)1 EventBasedTrace (org.iobserve.stages.data.trace.EventBasedTrace)1 Distributor (teetime.stage.basic.distributor.Distributor)1 CopyByReferenceStrategy (teetime.stage.basic.distributor.strategy.CopyByReferenceStrategy)1 IDistributorStrategy (teetime.stage.basic.distributor.strategy.IDistributorStrategy)1