From 899b7dcffa44b934e07de1e636e0d8c7e96d5eb1 Mon Sep 17 00:00:00 2001 From: Nelson Tavares de Sousa <stu103017@mail.uni-kiel.de> Date: Mon, 6 Oct 2014 16:51:56 +0200 Subject: [PATCH] #18 non-relevant variants removed --- .../ComparisonMethodcallWithPorts.launch | 4 +- src/main/java/experiment/Experiment1.java | 301 ------ src/main/java/experiment/Experiment2.java | 270 ----- .../examples/ThroughputTimestampAnalysis.java | 6 +- .../analysis/stage/StartTimestampFilter.java | 4 +- .../analysis/stage/StopTimestampFilter.java | 4 +- .../core => framework}/AbstractPort.java | 4 +- .../core => framework}/AbstractStage.java | 10 +- .../core => framework}/Analysis.java | 2 +- .../AnalysisConfiguration.java | 2 +- .../core => framework}/ConsumerStage.java | 2 +- .../core => framework}/HeadPipeline.java | 2 +- .../core => framework}/HeadStage.java | 2 +- .../core => framework}/InputPort.java | 4 +- .../OldAnalysis.java} | 5 +- .../core => framework}/OutputPort.java | 4 +- .../core => framework}/Pipeline.java | 6 +- .../core => framework}/ProducerStage.java | 2 +- .../core => framework}/RunnableStage.java | 10 +- .../core => framework}/StageWithPort.java | 6 +- .../core => framework}/pipe/AbstractPipe.java | 8 +- .../pipe/CommittablePipe.java | 6 +- .../pipe/CouldNotFindPipeImplException.java | 2 +- .../core => framework}/pipe/DummyPipe.java | 8 +- .../core => framework}/pipe/IPipe.java | 8 +- .../teetime/framework/pipe/IPipeFactory.java | 23 + .../pipe/InterThreadPipe.java | 8 +- .../pipe/IntraThreadPipe.java | 8 +- .../pipe/OrderedGrowableArrayPipe.java | 6 +- .../pipe/OrderedGrowableArrayPipeFactory.java | 10 +- .../pipe/OrderedGrowablePipe.java | 6 +- .../core => framework}/pipe/PipeFactory.java | 2 +- .../pipe/PipeFactoryLoader.java | 2 +- .../pipe/RelayTestPipe.java | 2 +- .../pipe/SingleElementPipe.java | 6 +- .../pipe/SingleElementPipeFactory.java | 10 +- .../core => framework}/pipe/SpScPipe.java | 6 +- .../pipe/SpScPipeFactory.java | 10 +- .../pipe/UnorderedGrowablePipe.java | 6 +- .../pipe/UnorderedGrowablePipeFactory.java | 10 +- .../teetime/framework/signal/ISignal.java | 8 + .../signal/StartingSignal.java | 4 +- .../signal/TerminatingSignal.java | 4 +- .../signal/ValidatingSignal.java | 6 +- .../validation/AnalysisNotValidException.java | 2 +- .../validation/InvalidPortConnection.java | 6 +- .../methodcallWithPorts => }/stage/Cache.java | 6 +- .../methodcallWithPorts => }/stage/Clock.java | 4 +- .../stage/CollectorSink.java | 4 +- .../stage/Counter.java | 6 +- .../stage/ElementDelayMeasuringStage.java | 8 +- .../ElementThroughputMeasuringStage.java | 8 +- .../stage/FileExtensionSwitch.java | 6 +- .../stage/InitialElementProducer.java | 4 +- .../stage/InstanceCounter.java | 6 +- .../stage/InstanceOfFilter.java | 6 +- .../stage/NoopFilter.java | 6 +- .../stage/ObjectProducer.java | 4 +- .../stage/PortTypeConfiguration.java | 4 +- .../methodcallWithPorts => }/stage/Relay.java | 10 +- .../stage/StartTimestampFilter.java | 8 +- .../stage/StopTimestampFilter.java | 8 +- .../stage/basic/Delay.java | 8 +- .../stage/basic/Sink.java | 4 +- .../basic/distributor/CloneStrategy.java | 4 +- .../distributor/CopyByReferenceStrategy.java | 4 +- .../stage/basic/distributor/Distributor.java | 6 +- .../distributor/IDistributorStrategy.java | 4 +- .../basic/distributor/RoundRobinStrategy.java | 4 +- .../stage/basic/merger/IMergerStrategy.java | 2 +- .../stage/basic/merger/Merger.java | 10 +- .../basic/merger/RoundRobinStrategy.java | 4 +- .../explorviz/KiekerRecordTcpReader.java | 4 +- .../stage/io/DbReader.java | 27 +- .../stage/io/Directory2FilesFilter.java | 6 +- .../stage/io/File2TextLinesFilter.java | 10 +- .../stage/io/IRecordFactoryMethod.java | 2 +- .../stage/io/Printer.java | 8 +- .../stage/io/RecordFactory.java | 2 +- .../stage/io/TCPReader.java | 4 +- .../stage/kieker/Dir2RecordsFilter.java | 32 +- .../stage/kieker/DirWithBin2RecordFilter.java | 16 +- .../stage/kieker/DirWithDat2RecordFilter.java | 16 +- .../stage/kieker/TCPReaderSink.java | 4 +- .../kieker/className/ClassNameRegistry.java | 2 +- .../ClassNameRegistryCreationFilter.java | 6 +- .../ClassNameRegistryRepository.java | 2 +- .../kieker/className/MappingFileParser.java | 2 +- .../fileToRecord/BinaryFile2RecordFilter.java | 8 +- .../fileToRecord/DatFile2RecordFilter.java | 16 +- .../RecordFromBinaryFileCreator.java | 6 +- .../RecordFromTextLineCreator.java | 10 +- .../fileToRecord/ZipFile2RecordFilter.java | 10 +- .../TextLine2MappingRegistryFilter.java | 4 +- .../textLine/TextLine2RecordFilter.java | 16 +- .../TraceReconstructionFilter.java | 6 +- .../TraceAggregationBuffer.java | 2 +- .../traceReduction/TraceComperator.java | 2 +- .../traceReduction/TraceReductionFilter.java | 8 +- .../stringBuffer/StringBufferFilter.java | 10 +- .../handler/AbstractDataTypeHandler.java | 4 +- .../handler/IMonitoringRecordHandler.java | 2 +- .../stringBuffer/handler/StringHandler.java | 2 +- .../stringBuffer/util/KiekerHashMap.java | 2 +- .../util}/MappingException.java | 4 +- .../stage/util/TextLine.java | 4 +- .../throughput => util}/TimestampObject.java | 6 +- .../ConcurrentCountWordsAnalysis.java | 292 ------ .../countWords/CountWordsAnalysis.java | 135 --- .../examples/countWords/CountWordsStage.java | 80 -- .../countWords/DirectoryName2Files.java | 66 -- .../countWords/OutputWordsCountSink.java | 69 -- .../countWords/QueuedCountWordsAnalysis.java | 143 --- .../CountingObjectsAnalysis.java | 142 --- .../recordReader/RecordReaderAnalysis.java | 169 ---- .../throughput/ThroughputAnalysis.java | 120 --- .../ThroughputTimestampAnalysis.java | 191 ---- .../traceReconstruction/TraceAnalysis.java | 67 -- .../TraceReconstructionAnalysis.java | 111 --- .../TraceReconstructionAnalysis2.java | 163 --- .../concurrent/ConcurrentPipeline.java.todo | 157 --- .../ConcurrentWorkStealingPipe.java | 145 --- .../ConcurrentWorkStealingPipeFactory.java | 46 - .../framework/concurrent/IStageScheduler.java | 35 - .../framework/concurrent/IStageWorkList.java | 40 - .../SingleProducerSingleConsumerPipe.java | 84 -- .../concurrent/StageTerminationPolicy.java | 30 - .../concurrent/StageWorkArrayList.java | 124 --- .../framework/concurrent/StageWorkList.java | 83 -- .../framework/concurrent/TokenBundle.java | 16 - .../framework/concurrent/WorkerThread.java | 281 ------ .../concurrent/steal/IStealStrategy.java | 33 - .../steal/StealIfEmptyStrategy.java | 42 - .../framework/core/AbstractFilter.java | 285 ------ .../framework/core/AbstractMultiPort.java | 49 - .../framework/core/AbstractPipe.java | 126 --- .../framework/core/AbstractPort.java | 37 - .../framework/core/AbstractStage.java | 71 -- .../framework/core/CompositeFilter.java | 45 - .../framework/core/Context.java | 187 ---- .../framework/core/Description.java | 34 - .../framework/core/IBaseStage.java | 25 - .../framework/core/IInputPort.java | 40 - .../framework/core/IOutputPort.java | 14 - .../framework/core/IPipe.java | 123 --- .../framework/core/IPipeCommand.java | 26 - .../framework/core/IPipeline.java | 34 - .../framework/core/IPort.java | 22 - .../framework/core/IPortListener.java | 26 - .../framework/core/IReservablePipe.java | 10 - .../framework/core/ISink.java | 30 - .../framework/core/ISource.java | 27 - .../framework/core/IStage.java | 165 --- .../framework/core/InputPortImpl.java | 52 - .../framework/core/OutputPortImpl.java | 10 - .../framework/core/Pipeline.java | 58 -- .../framework/core/ReservableContext.java | 5 - .../scheduling/NextStageScheduler.java | 106 -- .../scheduling/StageStateContainer.java | 25 - .../scheduling/StageStateManager.java | 84 -- .../SynchronizedStageStateContainer.java | 21 - .../UnsynchronizedStageStateContainer.java | 19 - .../framework/sequential/MethodCallPipe.java | 105 -- .../framework/sequential/Pipeline.java.todo | 190 ---- .../framework/sequential/QueuePipe.java | 108 -- .../sequential/ReservableQueuePipe.java | 63 -- .../util/BaseStage2StageExtractor.java | 49 - .../framework/util/Cloner.java | 128 --- .../explicitScheduling/stage/Cache.java | 90 -- .../stage/CollectorSink.java | 68 -- .../stage/CountingFilter.java | 58 -- .../stage/FileExtensionFilter.java | 78 -- .../stage/InstanceOfFilter.java | 53 - .../explicitScheduling/stage/NoopFilter.java | 45 - .../stage/StartTimestampFilter.java | 48 - .../stage/StopTimestampFilter.java | 48 - .../stage/SuperTypeFilter.java | 23 - .../stage/TypeLoggerFilter.java | 71 -- .../explicitScheduling/stage/basic/Clock.java | 79 -- .../explicitScheduling/stage/basic/Delay.java | 32 - .../stage/basic/ObjectProducer.java | 85 -- .../stage/basic/RepeaterSource.java | 75 -- .../basic/distributor/CloneStrategy.java | 34 - .../distributor/CopyByReferenceStrategy.java | 39 - .../stage/basic/distributor/Distributor.java | 60 -- .../distributor/IDistributorStrategy.java | 32 - .../basic/distributor/RoundRobinStrategy.java | 48 - .../stage/basic/merger/IMergerStrategy.java | 32 - .../stage/basic/merger/Merger.java | 65 -- .../basic/merger/RoundRobinStrategy.java | 54 - .../stage/composite/CycledCountingFilter.java | 57 -- .../ReadRecordFromCsvFileFilter.java | 65 -- .../stage/composite/TeeFilter.java | 56 -- .../explicitScheduling/stage/io/DbReader.java | 187 ---- .../stage/io/Directory2FilesFilter.java | 116 --- .../stage/io/File2TextLinesFilter.java | 89 -- .../explicitScheduling/stage/io/Printer.java | 144 --- .../stage/io/TCPReader.java | 207 ---- .../stage/kieker/File2RecordFilter.java | 144 --- .../kieker/MonitoringLogDirectory2Files.java | 88 -- .../ClassNameRegistryCreationFilter.java | 93 -- .../kieker/className/MappingFileParser.java | 130 --- .../fileToRecord/BinaryFile2RecordFilter.java | 113 --- .../fileToRecord/DatFile2RecordFilter.java | 58 -- .../RecordFromBinaryFileCreator.java | 117 --- .../fileToRecord/ZipFile2RecordFilter.java | 140 --- .../TextLine2MappingRegistryFilter.java | 77 -- .../textLine/TextLine2RecordFilter.java | 118 --- .../TraceReconstructionFilter.java | 192 ---- .../predicate/FileExtensionPredicate.java | 39 - .../stage/predicate/IsDirectoryPredicate.java | 33 - .../predicate/IsIMonitoringRecordInRange.java | 40 - .../predicate/IsInstanceOfPredicate.java | 47 - .../IsOperationExecutionRecordInRange.java | 43 - ...rationExecutionRecordTraceIdPredicate.java | 42 - .../stage/predicate/IsSuperTypePredicate.java | 47 - .../stage/predicate/IsTimestampInRange.java | 42 - .../stage/predicate/IsTraceIdPredicate.java | 44 - .../stage/predicate/PredicateFilter.java | 72 -- .../stringBuffer/StringBufferFilter.java | 93 -- .../handler/AbstractDataTypeHandler.java | 57 -- .../throughput/AnalysisThroughputFilter.java | 60 -- .../throughput/ThroughputAnalysisResult.java | 44 - .../visualization/IWebVisualizationSink.java | 35 - .../PlainTextWebVisualizationSink.java | 73 -- .../framework/core/AbstractStage.java | 96 -- .../framework/core/ConsumerStage.java | 26 - .../methodcall/framework/core/Pipeline.java | 160 --- .../framework/core/ProducerStage.java | 28 - .../methodcall/framework/core/Stage.java | 38 - .../methodcall/stage/CollectorSink.java | 63 -- .../variant/methodcall/stage/EndStage.java | 71 -- .../variant/methodcall/stage/NoopFilter.java | 40 - .../methodcall/stage/ObjectProducer.java | 90 -- .../stage/StartTimestampFilter.java | 42 - .../methodcall/stage/StopTimestampFilter.java | 43 - .../SysOutFilter.java | 33 - .../framework/core/pipe/IPipeFactory.java | 23 - .../framework/core/signal/ISignal.java | 8 - .../kieker/MonitoringLogDirectory2Files.java | 88 -- .../kieker/className/ClassNameRegistry.java | 29 - .../ClassNameRegistryRepository.java | 61 -- .../RecordFromTextLineCreator.java | 116 --- .../handler/IMonitoringRecordHandler.java | 60 -- .../stringBuffer/handler/StringHandler.java | 35 - .../stringBuffer/util/KiekerHashMap.java | 291 ------ src/main/java/util/KiekerLoadDriver.java | 16 +- src/main/java/util/PerformanceTest.java | 2 +- src/main/java/util/StatisticsUtil.java | 4 +- .../ThroughputTimestampAnalysisTest.java | 4 +- .../ChwHomeComparisonMethodcallWithPorts.java | 2 +- .../ChwWorkComparisonMethodcallWithPorts.java | 2 +- .../ComparisonMethodcallWithPorts.java | 21 +- .../NieWorkComparisonMethodcallWithPorts.java | 2 +- .../experiment01/ChwHomePerformanceCheck.java | 2 +- .../experiment01/ChwWorkPerformanceCheck.java | 2 +- ...odCallThoughputTimestampAnalysis1Test.java | 6 +- .../MethodCallThroughputAnalysis1.java | 81 +- ...odCallThoughputTimestampAnalysis9Test.java | 6 +- .../MethodCallThroughputAnalysis9.java | 26 +- ...dCallThoughputTimestampAnalysis10Test.java | 4 +- .../MethodCallThroughputAnalysis10.java | 24 +- ...dCallThoughputTimestampAnalysis11Test.java | 4 +- .../MethodCallThroughputAnalysis11.java | 26 +- ...dCallThoughputTimestampAnalysis14Test.java | 4 +- .../MethodCallThroughputAnalysis14.java | 30 +- ...dCallThoughputTimestampAnalysis15Test.java | 4 +- .../MethodCallThroughputAnalysis15.java | 36 +- .../experiment16/ChwHomePerformanceCheck.java | 2 +- .../experiment16/ChwWorkPerformanceCheck.java | 2 +- ...dCallThoughputTimestampAnalysis16Test.java | 4 +- .../MethodCallThroughputAnalysis16.java | 30 +- ...dCallThoughputTimestampAnalysis17Test.java | 4 +- .../MethodCallThroughputAnalysis17.java | 42 +- .../MethodCallThroughputAnalysis18.java | 30 +- ...dCallThoughputTimestampAnalysis19Test.java | 4 +- .../MethodCallThroughputAnalysis19.java | 30 +- .../examples/kiekerdays/TcpTraceLogging.java | 12 +- .../kiekerdays/TcpTraceLoggingExplorviz.java | 18 +- .../kiekerdays/TcpTraceReconstruction.java | 28 +- .../kiekerdays/TcpTraceReduction.java | 36 +- .../examples/loopStage/Countdown.java | 8 +- .../loopStage/FiniteSignalPassingTest.java | 4 +- .../LoopStageAnalysisConfiguration.java | 8 +- .../RecordReaderAnalysisTest.java | 4 +- .../RecordReaderConfiguration.java | 20 +- .../ChwHomeTcpTraceReadingTest.java | 2 +- .../TcpTraceLoggingExtAnalysis.java | 26 +- ...omeTcpTraceReconstructionAnalysisTest.java | 2 +- ...hwHomeTraceReconstructionAnalysisTest.java | 2 +- ...orkTcpTraceReconstructionAnalysisTest.java | 2 +- ...hwWorkTraceReconstructionAnalysisTest.java | 2 +- .../KiekerTraceReconstructionAnalysis.java | 6 +- ...KiekerTraceReconstructionAnalysisTest.java | 2 +- .../TcpTraceReconstructionAnalysis.java | 30 +- .../TraceReconstructionAnalysis.java | 42 +- ...ReconstructionAnalysisWithThreadsTest.java | 6 +- ...ReconstructionAnalysisWithThreadsTest.java | 6 +- ...ctionAnalysisWithThreadsConfiguration.java | 34 +- ...TraceReductionAnalysisWithThreadsTest.java | 2 +- .../TcpTraceReductionAnalysisWithThreads.java | 44 +- .../runtime/typeCheck/ConnectionTypeTest.java | 22 +- .../RecordReaderAnalysisTest.java | 128 --- .../throughput/ThroughputAnalysisTest.java | 74 -- .../ThroughputTimestampAnalysisTest.java | 64 -- .../examples/ChwComparisonMethodcall.java | 80 -- .../examples/NieComparisonMethodcall.java | 80 -- ...odCallThoughputTimestampAnalysis2Test.java | 55 - .../MethodCallThroughputAnalysis2.java | 115 --- ...odCallThoughputTimestampAnalysis3Test.java | 58 -- .../MethodCallThroughputAnalysis3.java | 146 --- ...odCallThoughputTimestampAnalysis4Test.java | 58 -- .../MethodCallThroughputAnalysis4.java | 137 --- ...odCallThoughputTimestampAnalysis5Test.java | 58 -- .../MethodCallThroughputAnalysis5.java | 146 --- ...odCallThoughputTimestampAnalysis6Test.java | 55 - .../MethodCallThroughputAnalysis6.java | 939 ------------------ ...odCallThoughputTimestampAnalysis7Test.java | 55 - .../MethodCallThroughputAnalysis7.java | 149 --- ...odCallThoughputTimestampAnalysis8Test.java | 55 - .../MethodCallThroughputAnalysis8.java | 152 --- ...dCallThoughputTimestampAnalysis12Test.java | 55 - .../MethodCallThroughputAnalysis12.java | 113 --- ...dCallThoughputTimestampAnalysis13Test.java | 55 - .../MethodCallThroughputAnalysis13.java | 138 --- 325 files changed, 764 insertions(+), 15188 deletions(-) delete mode 100644 src/main/java/experiment/Experiment1.java delete mode 100644 src/main/java/experiment/Experiment2.java rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/AbstractPort.java (77%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/AbstractStage.java (92%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/Analysis.java (97%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/AnalysisConfiguration.java (91%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/ConsumerStage.java (87%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/HeadPipeline.java (86%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/HeadStage.java (63%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/InputPort.java (84%) rename src/main/java/teetime/{variant/explicitScheduling/framework/core/Analysis.java => framework/OldAnalysis.java} (92%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/OutputPort.java (78%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/Pipeline.java (85%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/ProducerStage.java (92%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/RunnableStage.java (79%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/StageWithPort.java (71%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/AbstractPipe.java (80%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/CommittablePipe.java (88%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/CouldNotFindPipeImplException.java (81%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/DummyPipe.java (73%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/IPipe.java (54%) create mode 100644 src/main/java/teetime/framework/pipe/IPipeFactory.java rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/InterThreadPipe.java (68%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/IntraThreadPipe.java (65%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/OrderedGrowableArrayPipe.java (85%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/OrderedGrowableArrayPipeFactory.java (67%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/OrderedGrowablePipe.java (82%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/PipeFactory.java (97%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/PipeFactoryLoader.java (95%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/RelayTestPipe.java (92%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/SingleElementPipe.java (81%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/SingleElementPipeFactory.java (69%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/SpScPipe.java (87%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/SpScPipeFactory.java (66%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/UnorderedGrowablePipe.java (91%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/pipe/UnorderedGrowablePipeFactory.java (68%) create mode 100644 src/main/java/teetime/framework/signal/ISignal.java rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/signal/StartingSignal.java (50%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/signal/TerminatingSignal.java (51%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/signal/ValidatingSignal.java (65%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/validation/AnalysisNotValidException.java (91%) rename src/main/java/teetime/{variant/methodcallWithPorts/framework/core => framework}/validation/InvalidPortConnection.java (78%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/Cache.java (82%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/Clock.java (89%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/CollectorSink.java (93%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/Counter.java (74%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/ElementDelayMeasuringStage.java (85%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/ElementThroughputMeasuringStage.java (89%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/FileExtensionSwitch.java (83%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/InitialElementProducer.java (71%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/InstanceCounter.java (73%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/InstanceOfFilter.java (81%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/NoopFilter.java (85%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/ObjectProducer.java (93%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/PortTypeConfiguration.java (79%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/Relay.java (64%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/StartTimestampFilter.java (81%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/StopTimestampFilter.java (81%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/basic/Delay.java (81%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/basic/Sink.java (67%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/basic/distributor/CloneStrategy.java (88%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/basic/distributor/CopyByReferenceStrategy.java (88%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/basic/distributor/Distributor.java (88%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/basic/distributor/IDistributorStrategy.java (87%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/basic/distributor/RoundRobinStrategy.java (90%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/basic/merger/IMergerStrategy.java (93%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/basic/merger/Merger.java (86%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/basic/merger/RoundRobinStrategy.java (92%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/explorviz/KiekerRecordTcpReader.java (98%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/io/DbReader.java (92%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/io/Directory2FilesFilter.java (92%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/io/File2TextLinesFilter.java (88%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/io/IRecordFactoryMethod.java (81%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/io/Printer.java (93%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/io/RecordFactory.java (95%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/io/TCPReader.java (98%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/kieker/Dir2RecordsFilter.java (77%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/kieker/DirWithBin2RecordFilter.java (69%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/kieker/DirWithDat2RecordFilter.java (69%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/kieker/TCPReaderSink.java (98%) rename src/main/java/teetime/{variant/explicitScheduling => }/stage/kieker/className/ClassNameRegistry.java (93%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/kieker/className/ClassNameRegistryCreationFilter.java (92%) rename src/main/java/teetime/{variant/explicitScheduling => }/stage/kieker/className/ClassNameRegistryRepository.java (96%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/kieker/className/MappingFileParser.java (98%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/kieker/fileToRecord/BinaryFile2RecordFilter.java (91%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/kieker/fileToRecord/DatFile2RecordFilter.java (73%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/kieker/fileToRecord/RecordFromBinaryFileCreator.java (94%) rename src/main/java/teetime/{variant/explicitScheduling => }/stage/kieker/fileToRecord/RecordFromTextLineCreator.java (93%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/kieker/fileToRecord/ZipFile2RecordFilter.java (91%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/kieker/fileToRecord/textLine/TextLine2MappingRegistryFilter.java (93%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/kieker/fileToRecord/textLine/TextLine2RecordFilter.java (86%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/kieker/traceReconstruction/TraceReconstructionFilter.java (95%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/kieker/traceReduction/TraceAggregationBuffer.java (92%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/kieker/traceReduction/TraceComperator.java (96%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/kieker/traceReduction/TraceReductionFilter.java (93%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/stringBuffer/StringBufferFilter.java (86%) rename src/main/java/teetime/{variant/methodcallWithPorts => }/stage/stringBuffer/handler/AbstractDataTypeHandler.java (89%) rename src/main/java/teetime/{variant/explicitScheduling => }/stage/stringBuffer/handler/IMonitoringRecordHandler.java (96%) rename src/main/java/teetime/{variant/explicitScheduling => }/stage/stringBuffer/handler/StringHandler.java (93%) rename src/main/java/teetime/{variant/explicitScheduling => }/stage/stringBuffer/util/KiekerHashMap.java (99%) rename src/main/java/teetime/{variant/explicitScheduling/stage => stage/util}/MappingException.java (94%) rename src/main/java/teetime/{variant/explicitScheduling => }/stage/util/TextLine.java (95%) rename src/main/java/teetime/{variant/explicitScheduling/examples/throughput => util}/TimestampObject.java (95%) delete mode 100644 src/main/java/teetime/variant/explicitScheduling/examples/countWords/ConcurrentCountWordsAnalysis.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/examples/countWords/CountWordsAnalysis.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/examples/countWords/CountWordsStage.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/examples/countWords/DirectoryName2Files.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/examples/countWords/OutputWordsCountSink.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/examples/countWords/QueuedCountWordsAnalysis.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/examples/countingObjects/CountingObjectsAnalysis.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/examples/recordReader/RecordReaderAnalysis.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputAnalysis.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputTimestampAnalysis.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/examples/traceReconstruction/TraceAnalysis.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/examples/traceReconstruction/TraceReconstructionAnalysis.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/examples/traceReconstruction/TraceReconstructionAnalysis2.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/concurrent/ConcurrentPipeline.java.todo delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/concurrent/ConcurrentWorkStealingPipe.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/concurrent/ConcurrentWorkStealingPipeFactory.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/concurrent/IStageScheduler.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/concurrent/IStageWorkList.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/concurrent/SingleProducerSingleConsumerPipe.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/concurrent/StageTerminationPolicy.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/concurrent/StageWorkArrayList.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/concurrent/StageWorkList.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/concurrent/TokenBundle.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/concurrent/WorkerThread.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/concurrent/steal/IStealStrategy.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/concurrent/steal/StealIfEmptyStrategy.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractMultiPort.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractPipe.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractPort.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractStage.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/CompositeFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/Context.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/Description.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/IBaseStage.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/IInputPort.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/IOutputPort.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/IPipe.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/IPipeCommand.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/IPipeline.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/IPort.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/IPortListener.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/IReservablePipe.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/ISink.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/ISource.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/IStage.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/InputPortImpl.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/OutputPortImpl.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/Pipeline.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/core/ReservableContext.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/scheduling/NextStageScheduler.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/scheduling/StageStateContainer.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/scheduling/StageStateManager.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/scheduling/SynchronizedStageStateContainer.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/scheduling/UnsynchronizedStageStateContainer.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/sequential/MethodCallPipe.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/sequential/Pipeline.java.todo delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/sequential/QueuePipe.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/sequential/ReservableQueuePipe.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/util/BaseStage2StageExtractor.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/framework/util/Cloner.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/Cache.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/CollectorSink.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/CountingFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/FileExtensionFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/InstanceOfFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/NoopFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/StartTimestampFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/StopTimestampFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/SuperTypeFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/TypeLoggerFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/basic/Clock.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/basic/Delay.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/basic/ObjectProducer.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/basic/RepeaterSource.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/CloneStrategy.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/CopyByReferenceStrategy.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/Distributor.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/IDistributorStrategy.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/RoundRobinStrategy.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/basic/merger/IMergerStrategy.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/basic/merger/Merger.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/basic/merger/RoundRobinStrategy.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/composite/CycledCountingFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/composite/ReadRecordFromCsvFileFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/composite/TeeFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/io/DbReader.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/io/Directory2FilesFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/io/File2TextLinesFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/io/Printer.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/io/TCPReader.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/kieker/File2RecordFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/kieker/MonitoringLogDirectory2Files.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/kieker/className/ClassNameRegistryCreationFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/kieker/className/MappingFileParser.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/BinaryFile2RecordFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/DatFile2RecordFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/RecordFromBinaryFileCreator.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/ZipFile2RecordFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/textLine/TextLine2MappingRegistryFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/textLine/TextLine2RecordFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/kieker/traceReconstruction/TraceReconstructionFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/predicate/FileExtensionPredicate.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsDirectoryPredicate.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsIMonitoringRecordInRange.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsInstanceOfPredicate.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsOperationExecutionRecordInRange.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsOperationExecutionRecordTraceIdPredicate.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsSuperTypePredicate.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsTimestampInRange.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsTraceIdPredicate.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/predicate/PredicateFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/StringBufferFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/handler/AbstractDataTypeHandler.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/throughput/AnalysisThroughputFilter.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/throughput/ThroughputAnalysisResult.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/visualization/IWebVisualizationSink.java delete mode 100644 src/main/java/teetime/variant/explicitScheduling/stage/visualization/PlainTextWebVisualizationSink.java delete mode 100644 src/main/java/teetime/variant/methodcall/framework/core/AbstractStage.java delete mode 100644 src/main/java/teetime/variant/methodcall/framework/core/ConsumerStage.java delete mode 100644 src/main/java/teetime/variant/methodcall/framework/core/Pipeline.java delete mode 100644 src/main/java/teetime/variant/methodcall/framework/core/ProducerStage.java delete mode 100644 src/main/java/teetime/variant/methodcall/framework/core/Stage.java delete mode 100644 src/main/java/teetime/variant/methodcall/stage/CollectorSink.java delete mode 100644 src/main/java/teetime/variant/methodcall/stage/EndStage.java delete mode 100644 src/main/java/teetime/variant/methodcall/stage/NoopFilter.java delete mode 100644 src/main/java/teetime/variant/methodcall/stage/ObjectProducer.java delete mode 100644 src/main/java/teetime/variant/methodcall/stage/StartTimestampFilter.java delete mode 100644 src/main/java/teetime/variant/methodcall/stage/StopTimestampFilter.java delete mode 100644 src/main/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/SysOutFilter.java delete mode 100644 src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/IPipeFactory.java delete mode 100644 src/main/java/teetime/variant/methodcallWithPorts/framework/core/signal/ISignal.java delete mode 100644 src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/MonitoringLogDirectory2Files.java delete mode 100644 src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/className/ClassNameRegistry.java delete mode 100644 src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/className/ClassNameRegistryRepository.java delete mode 100644 src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/RecordFromTextLineCreator.java delete mode 100644 src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/handler/IMonitoringRecordHandler.java delete mode 100644 src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/handler/StringHandler.java delete mode 100644 src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/util/KiekerHashMap.java rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/ChwHomeComparisonMethodcallWithPorts.java (99%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/ChwWorkComparisonMethodcallWithPorts.java (99%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/ComparisonMethodcallWithPorts.java (58%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/NieWorkComparisonMethodcallWithPorts.java (98%) rename src/test/java/teetime/{variant/methodcall => }/examples/experiment01/ChwHomePerformanceCheck.java (91%) rename src/test/java/teetime/{variant/methodcall => }/examples/experiment01/ChwWorkPerformanceCheck.java (91%) rename src/test/java/teetime/{variant/methodcall => }/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java (92%) rename src/test/java/teetime/{variant/methodcall => }/examples/experiment01/MethodCallThroughputAnalysis1.java (51%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment09/MethodCallThoughputTimestampAnalysis9Test.java (91%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment09/MethodCallThroughputAnalysis9.java (79%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment10/MethodCallThoughputTimestampAnalysis10Test.java (92%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment10/MethodCallThroughputAnalysis10.java (80%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java (92%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment11/MethodCallThroughputAnalysis11.java (81%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment14/MethodCallThoughputTimestampAnalysis14Test.java (92%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment14/MethodCallThroughputAnalysis14.java (78%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java (92%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment15/MethodCallThroughputAnalysis15.java (78%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment16/ChwHomePerformanceCheck.java (95%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment16/ChwWorkPerformanceCheck.java (95%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java (95%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment16/MethodCallThroughputAnalysis16.java (85%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment17/MethodCallThoughputTimestampAnalysis17Test.java (92%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment17/MethodCallThroughputAnalysis17.java (82%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment18/MethodCallThroughputAnalysis18.java (84%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java (95%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/experiment19/MethodCallThroughputAnalysis19.java (84%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/kiekerdays/TcpTraceLogging.java (66%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/kiekerdays/TcpTraceLoggingExplorviz.java (65%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/kiekerdays/TcpTraceReconstruction.java (82%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/kiekerdays/TcpTraceReduction.java (81%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/loopStage/Countdown.java (77%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/loopStage/FiniteSignalPassingTest.java (82%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/loopStage/LoopStageAnalysisConfiguration.java (53%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/recordReader/RecordReaderAnalysisTest.java (95%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/recordReader/RecordReaderConfiguration.java (75%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/traceReading/ChwHomeTcpTraceReadingTest.java (97%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/traceReading/TcpTraceLoggingExtAnalysis.java (75%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/traceReconstruction/ChwHomeTcpTraceReconstructionAnalysisTest.java (97%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/traceReconstruction/ChwHomeTraceReconstructionAnalysisTest.java (98%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/traceReconstruction/ChwWorkTcpTraceReconstructionAnalysisTest.java (97%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/traceReconstruction/ChwWorkTraceReconstructionAnalysisTest.java (98%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/traceReconstruction/KiekerTraceReconstructionAnalysis.java (96%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/traceReconstruction/NieWorkKiekerTraceReconstructionAnalysisTest.java (98%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/traceReconstruction/TcpTraceReconstructionAnalysis.java (82%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/traceReconstruction/TraceReconstructionAnalysis.java (76%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/traceReconstructionWithThreads/ChwHomeTcpTraceReconstructionAnalysisWithThreadsTest.java (96%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/traceReconstructionWithThreads/ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest.java (95%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/traceReconstructionWithThreads/TcpTraceReconstructionAnalysisWithThreadsConfiguration.java (89%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/traceReductionWithThreads/ChwWorkTcpTraceReductionAnalysisWithThreadsTest.java (98%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/examples/traceReductionWithThreads/TcpTraceReductionAnalysisWithThreads.java (86%) rename src/test/java/teetime/{variant/methodcallWithPorts => }/runtime/typeCheck/ConnectionTypeTest.java (82%) delete mode 100644 src/test/java/teetime/variant/explicitScheduling/examples/recordReader/RecordReaderAnalysisTest.java delete mode 100644 src/test/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputAnalysisTest.java delete mode 100644 src/test/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputTimestampAnalysisTest.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/ChwComparisonMethodcall.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/NieComparisonMethodcall.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment02/MethodCallThoughputTimestampAnalysis2Test.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment02/MethodCallThroughputAnalysis2.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment03/MethodCallThoughputTimestampAnalysis3Test.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment03/MethodCallThroughputAnalysis3.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment04/MethodCallThoughputTimestampAnalysis4Test.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment04/MethodCallThroughputAnalysis4.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment05/MethodCallThoughputTimestampAnalysis5Test.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment05/MethodCallThroughputAnalysis5.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment06/MethodCallThoughputTimestampAnalysis6Test.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment06/MethodCallThroughputAnalysis6.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment07/MethodCallThoughputTimestampAnalysis7Test.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment07/MethodCallThroughputAnalysis7.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment08/MethodCallThoughputTimestampAnalysis8Test.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment08/MethodCallThroughputAnalysis8.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment12/MethodCallThoughputTimestampAnalysis12Test.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment12/MethodCallThroughputAnalysis12.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment13/MethodCallThoughputTimestampAnalysis13Test.java delete mode 100644 src/test/java/teetime/variant/methodcall/examples/experiment13/MethodCallThroughputAnalysis13.java diff --git a/run-configurations/ComparisonMethodcallWithPorts.launch b/run-configurations/ComparisonMethodcallWithPorts.launch index d45df627..077755f8 100644 --- a/run-configurations/ComparisonMethodcallWithPorts.launch +++ b/run-configurations/ComparisonMethodcallWithPorts.launch @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> -<listEntry value="/teetime/src/test/java/teetime/variant/methodcallWithPorts/examples/ComparisonMethodcallWithPorts.java"/> +<listEntry value="/teetime/src/test/java/teetime/examples/ComparisonMethodcallWithPorts.java"/> </listAttribute> <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> <listEntry value="1"/> @@ -12,7 +12,7 @@ <stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/> -<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="teetime.variant.methodcallWithPorts.examples.ComparisonMethodcallWithPorts"/> +<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="teetime.examples.ComparisonMethodcallWithPorts"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="teetime"/> <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/> </launchConfiguration> diff --git a/src/main/java/experiment/Experiment1.java b/src/main/java/experiment/Experiment1.java deleted file mode 100644 index 8793f7d0..00000000 --- a/src/main/java/experiment/Experiment1.java +++ /dev/null @@ -1,301 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package experiment; - -import java.io.FileWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Callable; - -import teetime.variant.explicitScheduling.framework.concurrent.StageTerminationPolicy; -import teetime.variant.explicitScheduling.framework.concurrent.WorkerThread; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.explicitScheduling.framework.core.IStage; -import teetime.variant.explicitScheduling.framework.core.Pipeline; -import teetime.variant.explicitScheduling.framework.sequential.MethodCallPipe; -import teetime.variant.explicitScheduling.framework.sequential.QueuePipe; -import teetime.variant.explicitScheduling.stage.NoopFilter; -import util.StatisticsUtil; - -import kieker.analysis.AnalysisController; -import kieker.analysis.IAnalysisController; -import kieker.analysis.stage.EmptyPassOnFilter; -import kieker.analysis.stage.ObjectProducer; -import kieker.common.configuration.Configuration; - -/** - * @author Nils Christian Ehmke - * - * @since 1.10 - */ -public class Experiment1 { - - private static final int NUMBER_OF_WARMUP_RUNS_PER_EXPERIMENT = 5; - private static final int NUMBER_OF_MEASURED_RUNS_PER_EXPERIMENT = 50; - - private static final int NUMBER_OF_OBJECTS_TO_SEND = 10000; - - private static final int NUMBER_OF_MINIMAL_FILTERS = 50; - private static final int NUMBER_OF_MAXIMAL_FILTERS = 1000; - private static final int NUMBER_OF_FILTERS_PER_STEP = 50; - - private static final IAnalysis[] analyses = { new TeeTimeMethodCallAnalysis(), new TeeTimeAnalysis(), new KiekerAnalysis() }; - - private static final List<Long> measuredTimes = new ArrayList<Long>(); - - public static void main(final String[] args) throws Exception { - System.setProperty("kieker.common.logging.Log", "NONE"); - - for (final IAnalysis analysis : analyses) { - for (int numberOfFilters = NUMBER_OF_MINIMAL_FILTERS; numberOfFilters <= NUMBER_OF_MAXIMAL_FILTERS; numberOfFilters += NUMBER_OF_FILTERS_PER_STEP) { - // Warmup - for (int run = 0; run < NUMBER_OF_WARMUP_RUNS_PER_EXPERIMENT; run++) { - analysis.initialize(numberOfFilters, NUMBER_OF_OBJECTS_TO_SEND); - analysis.execute(); - } - - // Actual measurement - for (int run = 0; run < NUMBER_OF_MEASURED_RUNS_PER_EXPERIMENT; run++) { - final long tin = System.nanoTime(); - - analysis.initialize(numberOfFilters, NUMBER_OF_OBJECTS_TO_SEND); - analysis.execute(); - - final long tout = System.nanoTime(); - Experiment1.addMeasuredTime((tout - tin)); - } - - Experiment1.writeAndClearMeasuredTime(analysis.getName(), numberOfFilters); - } - } - } - - private static void addMeasuredTime(final long time) { - measuredTimes.add(new Long(time)); - } - - private static void writeAndClearMeasuredTime(final String analysisName, final int numberOfFilters) throws IOException { - final FileWriter fileWriter = new FileWriter(analysisName + ".csv", true); - fileWriter.write(Integer.toString(numberOfFilters)); - fileWriter.write(";"); - - final Map<Double, Long> quintiles = StatisticsUtil.calculateQuintiles(measuredTimes); - for (final Long value : quintiles.values()) { - fileWriter.write(Long.toString(value)); - fileWriter.write(";"); - } - - fileWriter.write(Long.toString(StatisticsUtil.calculateAverage(measuredTimes))); - fileWriter.write(";"); - - fileWriter.write(Long.toString(StatisticsUtil.calculateConfidenceWidth(measuredTimes))); - - fileWriter.write("\n"); - fileWriter.close(); - - measuredTimes.clear(); - } - - private static interface IAnalysis { - - public void initialize(int numberOfFilters, int numberOfObjectsToSend) throws Exception; - - public String getName(); - - public void execute() throws Exception; - - } - - private static final class TeeTimeMethodCallAnalysis extends Analysis implements IAnalysis { - - private static final int SECONDS = 1000; - - private Pipeline pipeline; - private WorkerThread workerThread; - - public TeeTimeMethodCallAnalysis() {} - - @Override - public void initialize(final int numberOfFilters, final int numberOfObjectsToSend) { - - @SuppressWarnings("unchecked") - final NoopFilter<Object>[] noopFilters = new NoopFilter[numberOfFilters]; - // create stages - final teetime.variant.explicitScheduling.stage.basic.ObjectProducer<Object> objectProducer = new teetime.variant.explicitScheduling.stage.basic.ObjectProducer<Object>( - numberOfObjectsToSend, new Callable<Object>() { - @Override - public Object call() throws Exception { - return new Object(); - } - }); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<Object>(); - noopFilters[i].setSchedulable(false); - } - - // add each stage to a stage list - final List<IStage> startStages = new LinkedList<IStage>(); - startStages.add(objectProducer); - - final List<IStage> stages = new LinkedList<IStage>(); - stages.add(objectProducer); - stages.addAll(Arrays.asList(noopFilters)); - - // connect stages by pipes - MethodCallPipe.connect(objectProducer.outputPort, noopFilters[0].inputPort); - for (int i = 1; i < noopFilters.length; i++) { - MethodCallPipe.connect(noopFilters[i - 1].outputPort, noopFilters[i].inputPort); - } - - this.pipeline = new Pipeline(); - this.pipeline.setStartStages(startStages); - this.pipeline.setStages(stages); - - this.workerThread = new WorkerThread(this.pipeline, 0); - this.workerThread.setTerminationPolicy(StageTerminationPolicy.TERMINATE_STAGE_AFTER_UNSUCCESSFUL_EXECUTION); - } - - @Override - public String getName() { - return "TeeTimeMethodCall"; - } - - @Override - public void execute() { - super.start(); - - this.workerThread.start(); - try { - this.workerThread.join(60 * SECONDS); - } catch (final InterruptedException e) { - e.printStackTrace(); - } - } - - } - - private static final class TeeTimeAnalysis extends Analysis implements IAnalysis { - - private static final int SECONDS = 1000; - - private Pipeline pipeline; - private WorkerThread workerThread; - - public TeeTimeAnalysis() {} - - @Override - public void initialize(final int numberOfFilters, final int numberOfObjectsToSend) { - - @SuppressWarnings("unchecked") - final NoopFilter<Object>[] noopFilters = new NoopFilter[numberOfFilters]; - // create stages - final teetime.variant.explicitScheduling.stage.basic.ObjectProducer<Object> objectProducer = new teetime.variant.explicitScheduling.stage.basic.ObjectProducer<Object>( - numberOfObjectsToSend, new Callable<Object>() { - @Override - public Object call() throws Exception { - return new Object(); - } - }); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<Object>(); - } - - // add each stage to a stage list - final List<IStage> startStages = new LinkedList<IStage>(); - startStages.add(objectProducer); - - final List<IStage> stages = new LinkedList<IStage>(); - stages.add(objectProducer); - stages.addAll(Arrays.asList(noopFilters)); - - // connect stages by pipes - QueuePipe.connect(objectProducer.outputPort, noopFilters[0].inputPort); - for (int i = 1; i < noopFilters.length; i++) { - QueuePipe.connect(noopFilters[i - 1].outputPort, noopFilters[i].inputPort); - } - - this.pipeline = new Pipeline(); - this.pipeline.setStartStages(startStages); - this.pipeline.setStages(stages); - - this.workerThread = new WorkerThread(this.pipeline, 0); - this.workerThread.setTerminationPolicy(StageTerminationPolicy.TERMINATE_STAGE_AFTER_UNSUCCESSFUL_EXECUTION); - } - - @Override - public String getName() { - return "TeeTime"; - } - - @Override - public void execute() { - super.start(); - - this.workerThread.start(); - try { - this.workerThread.join(60 * SECONDS); - } catch (final InterruptedException e) { - e.printStackTrace(); - } - } - - } - - private static final class KiekerAnalysis implements IAnalysis { - - private IAnalysisController ac; - - public KiekerAnalysis() {} - - @Override - public void initialize(final int numberOfFilters, final int numberOfObjectsToSend) throws Exception { - this.ac = new AnalysisController(); - - final Configuration producerConfig = new Configuration(); - producerConfig.setProperty(ObjectProducer.CONFIG_PROPERTY_NAME_OBJECTS_TO_CREATE, Long.toString(numberOfObjectsToSend)); - final ObjectProducer<Object> producer = new ObjectProducer<Object>(producerConfig, this.ac, new Callable<Object>() { - @Override - public Object call() throws Exception { - return new Object(); - } - }); - - EmptyPassOnFilter predecessor = new EmptyPassOnFilter(new Configuration(), this.ac); - this.ac.connect(producer, ObjectProducer.OUTPUT_PORT_NAME, predecessor, EmptyPassOnFilter.INPUT_PORT_NAME); - for (int idx = 0; idx < (numberOfFilters - 1); idx++) { - final EmptyPassOnFilter newPredecessor = new EmptyPassOnFilter(new Configuration(), this.ac); - this.ac.connect(predecessor, EmptyPassOnFilter.OUTPUT_PORT_NAME, newPredecessor, EmptyPassOnFilter.INPUT_PORT_NAME); - predecessor = newPredecessor; - } - } - - @Override - public String getName() { - return "Kieker"; - } - - @Override - public void execute() throws Exception { - this.ac.run(); - } - - } - -} diff --git a/src/main/java/experiment/Experiment2.java b/src/main/java/experiment/Experiment2.java deleted file mode 100644 index 8f488558..00000000 --- a/src/main/java/experiment/Experiment2.java +++ /dev/null @@ -1,270 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package experiment; - -import java.io.FileWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Callable; - -import kieker.analysis.AnalysisController; -import kieker.analysis.IAnalysisController; -import kieker.analysis.stage.CollectorSink; -import kieker.analysis.stage.EmptyPassOnFilter; -import kieker.analysis.stage.ObjectProducer; -import kieker.analysis.stage.StartTimestampFilter; -import kieker.analysis.stage.StopTimestampFilter; -import kieker.common.configuration.Configuration; - -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.concurrent.WorkerThread; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.explicitScheduling.framework.core.IStage; -import teetime.variant.explicitScheduling.framework.core.Pipeline; -import teetime.variant.explicitScheduling.framework.sequential.MethodCallPipe; -import teetime.variant.explicitScheduling.framework.sequential.QueuePipe; -import teetime.variant.explicitScheduling.stage.NoopFilter; -import util.StatisticsUtil; - -/** - * @author Nils Christian Ehmke - * - * @since 1.10 - */ -public class Experiment2 { - - private static final int NUMBER_OF_WARMUP_RUNS_PER_EXPERIMENT = 5; - private static final int NUMBER_OF_MEASURED_RUNS_PER_EXPERIMENT = 50; - - private static final int NUMBER_OF_OBJECTS_TO_SEND = 10000; - - private static final int NUMBER_OF_MINIMAL_FILTERS = 50; - private static final int NUMBER_OF_MAXIMAL_FILTERS = 1000; - private static final int NUMBER_OF_FILTERS_PER_STEP = 50; - - private static final IAnalysis[] analyses = { new TeeTimeAnalysis(true), new TeeTimeAnalysis(false), new KiekerAnalysis() }; - - private static final List<Long> measuredTimes = new ArrayList<Long>(); - - public static void main(final String[] args) throws Exception { - System.setProperty("kieker.common.logging.Log", "NONE"); - - for (final IAnalysis analysis : analyses) { - for (int numberOfFilters = NUMBER_OF_MINIMAL_FILTERS; numberOfFilters <= NUMBER_OF_MAXIMAL_FILTERS; numberOfFilters += NUMBER_OF_FILTERS_PER_STEP) { - // Warmup - for (int run = 0; run < NUMBER_OF_WARMUP_RUNS_PER_EXPERIMENT; run++) { - analysis.initialize(numberOfFilters, NUMBER_OF_OBJECTS_TO_SEND); - analysis.execute(); - } - - // Actual measurement - for (int run = 0; run < NUMBER_OF_MEASURED_RUNS_PER_EXPERIMENT; run++) { - final long tin = System.nanoTime(); - - analysis.initialize(numberOfFilters, NUMBER_OF_OBJECTS_TO_SEND); - analysis.execute(); - - final long tout = System.nanoTime(); - Experiment2.addMeasuredTime((tout - tin)); - } - - Experiment2.writeAndClearMeasuredTime(analysis.getName(), numberOfFilters); - } - } - } - - private static void addMeasuredTime(final long time) { - measuredTimes.add(new Long(time)); - } - - private static void writeAndClearMeasuredTime(final String analysisName, final int numberOfFilters) throws IOException { - final FileWriter fileWriter = new FileWriter(analysisName + ".csv", true); - fileWriter.write(Integer.toString(numberOfFilters)); - fileWriter.write(";"); - - final Map<Double, Long> quintiles = StatisticsUtil.calculateQuintiles(measuredTimes); - for (final Long value : quintiles.values()) { - fileWriter.write(Long.toString(value)); - fileWriter.write(";"); - } - - fileWriter.write(Long.toString(StatisticsUtil.calculateAverage(measuredTimes))); - fileWriter.write(";"); - - fileWriter.write(Long.toString(StatisticsUtil.calculateConfidenceWidth(measuredTimes))); - - fileWriter.write("\n"); - fileWriter.close(); - - measuredTimes.clear(); - } - - private static interface IAnalysis { - - public String getName(); - - public void execute() throws Exception; - - public void initialize(int numberOfFilters, int numberOfObjectsToSend) throws Exception; - - } - - private static final class TeeTimeAnalysis extends Analysis implements IAnalysis { - - private static final int SECONDS = 1000; - - private Pipeline pipeline; - private WorkerThread workerThread; - private final boolean shouldUseQueue; - - // FIXME instantiate me - private Collection<TimestampObject> timestampObjects; - - public TeeTimeAnalysis(final boolean shouldUseQueue) { - this.shouldUseQueue = shouldUseQueue; - } - - @Override - public void initialize(final int numberOfFilters, final int numberOfObjectsToSend) throws Exception { - @SuppressWarnings("unchecked") - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[numberOfFilters]; - // create stages - final teetime.variant.explicitScheduling.stage.basic.ObjectProducer<TimestampObject> objectProducer = new teetime.variant.explicitScheduling.stage.basic.ObjectProducer<TimestampObject>( - numberOfObjectsToSend, new Callable<TimestampObject>() { - @Override - public TimestampObject call() throws Exception { - return new TimestampObject(); - } - }); - final teetime.variant.explicitScheduling.stage.StartTimestampFilter startTimestampFilter = new teetime.variant.explicitScheduling.stage.StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final teetime.variant.explicitScheduling.stage.StopTimestampFilter stopTimestampFilter = new teetime.variant.explicitScheduling.stage.StopTimestampFilter(); - final teetime.variant.explicitScheduling.stage.CollectorSink<TimestampObject> collectorSink = new teetime.variant.explicitScheduling.stage.CollectorSink<TimestampObject>( - this.timestampObjects); - - // add each stage to a stage list - final List<IStage> startStages = new LinkedList<IStage>(); - startStages.add(objectProducer); - - final List<IStage> stages = new LinkedList<IStage>(); - stages.add(objectProducer); - if (this.shouldUseQueue) { - stages.add(startTimestampFilter); - stages.addAll(Arrays.asList(noopFilters)); - stages.add(stopTimestampFilter); - stages.add(collectorSink); - - // connect stages by pipes - QueuePipe.connect(objectProducer.outputPort, startTimestampFilter.inputPort); - QueuePipe.connect(startTimestampFilter.outputPort, noopFilters[0].inputPort); - for (int i = 1; i < noopFilters.length; i++) { - QueuePipe.connect(noopFilters[i - 1].outputPort, noopFilters[i].inputPort); - } - QueuePipe.connect(noopFilters[noopFilters.length - 1].outputPort, stopTimestampFilter.inputPort); - QueuePipe.connect(stopTimestampFilter.outputPort, collectorSink.objectInputPort); - } else { - // connect stages by pipes - MethodCallPipe.connect(objectProducer.outputPort, startTimestampFilter.inputPort); - MethodCallPipe.connect(startTimestampFilter.outputPort, noopFilters[0].inputPort); - for (int i = 1; i < noopFilters.length; i++) { - MethodCallPipe.connect(noopFilters[i - 1].outputPort, noopFilters[i].inputPort); - } - MethodCallPipe.connect(noopFilters[noopFilters.length - 1].outputPort, stopTimestampFilter.inputPort); - MethodCallPipe.connect(stopTimestampFilter.outputPort, collectorSink.objectInputPort); - } - - this.pipeline = new Pipeline(); - this.pipeline.setStartStages(startStages); - this.pipeline.setStages(stages); - } - - @Override - public String getName() { - return "TeeTime" + (this.shouldUseQueue ? "-Queues" : "-NoQueues"); - } - - @Override - public void execute() { - super.start(); - - this.workerThread.start(); - try { - this.workerThread.join(60 * SECONDS); - } catch (final InterruptedException e) { - e.printStackTrace(); - } - } - - } - - private static final class KiekerAnalysis implements IAnalysis { - - private IAnalysisController ac; - - // FIXME instantiate me - private Collection<TimestampObject> timestampObjects; - - public KiekerAnalysis() {} - - @Override - public void initialize(final int numberOfFilters, final int numberOfObjectsToSend) throws Exception { - this.ac = new AnalysisController(); - - final Configuration producerConfig = new Configuration(); - producerConfig.setProperty(ObjectProducer.CONFIG_PROPERTY_NAME_OBJECTS_TO_CREATE, Long.toString(numberOfObjectsToSend)); - final ObjectProducer<TimestampObject> producer = new ObjectProducer<TimestampObject>(producerConfig, this.ac, new Callable<TimestampObject>() { - @Override - public TimestampObject call() throws Exception { - return new TimestampObject(); - } - }); - - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(new Configuration(), this.ac); - EmptyPassOnFilter predecessor = new EmptyPassOnFilter(new Configuration(), this.ac); - this.ac.connect(producer, ObjectProducer.OUTPUT_PORT_NAME, startTimestampFilter, StartTimestampFilter.INPUT_PORT_NAME); - this.ac.connect(startTimestampFilter, StartTimestampFilter.OUTPUT_PORT_NAME, predecessor, EmptyPassOnFilter.INPUT_PORT_NAME); - for (int idx = 0; idx < (numberOfFilters - 1); idx++) { - final EmptyPassOnFilter newPredecessor = new EmptyPassOnFilter(new Configuration(), this.ac); - this.ac.connect(predecessor, EmptyPassOnFilter.OUTPUT_PORT_NAME, newPredecessor, EmptyPassOnFilter.INPUT_PORT_NAME); - predecessor = newPredecessor; - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(new Configuration(), this.ac); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(new Configuration(), this.ac, this.timestampObjects); - - this.ac.connect(predecessor, EmptyPassOnFilter.OUTPUT_PORT_NAME, stopTimestampFilter, StopTimestampFilter.INPUT_PORT_NAME); - this.ac.connect(stopTimestampFilter, StopTimestampFilter.OUTPUT_PORT_NAME, collectorSink, CollectorSink.INPUT_PORT_NAME); - } - - @Override - public String getName() { - return "Kieker"; - } - - @Override - public void execute() throws Exception { - this.ac.run(); - } - - } - -} diff --git a/src/main/java/kieker/analysis/examples/ThroughputTimestampAnalysis.java b/src/main/java/kieker/analysis/examples/ThroughputTimestampAnalysis.java index 83924f8c..f06b4e17 100644 --- a/src/main/java/kieker/analysis/examples/ThroughputTimestampAnalysis.java +++ b/src/main/java/kieker/analysis/examples/ThroughputTimestampAnalysis.java @@ -18,6 +18,8 @@ package kieker.analysis.examples; import java.util.Collection; import java.util.concurrent.Callable; +import teetime.util.TimestampObject; + import kieker.analysis.AnalysisController; import kieker.analysis.IAnalysisController; import kieker.analysis.exception.AnalysisConfigurationException; @@ -28,11 +30,9 @@ import kieker.analysis.stage.StartTimestampFilter; import kieker.analysis.stage.StopTimestampFilter; import kieker.common.configuration.Configuration; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; - /** * @author Nils Christian Ehmke - * + * * @since 1.10 */ public class ThroughputTimestampAnalysis { diff --git a/src/main/java/kieker/analysis/stage/StartTimestampFilter.java b/src/main/java/kieker/analysis/stage/StartTimestampFilter.java index 0daf1ad5..c82b0ff6 100644 --- a/src/main/java/kieker/analysis/stage/StartTimestampFilter.java +++ b/src/main/java/kieker/analysis/stage/StartTimestampFilter.java @@ -15,6 +15,8 @@ ***************************************************************************/ package kieker.analysis.stage; +import teetime.util.TimestampObject; + import kieker.analysis.IProjectContext; import kieker.analysis.plugin.annotation.InputPort; import kieker.analysis.plugin.annotation.OutputPort; @@ -22,8 +24,6 @@ import kieker.analysis.plugin.annotation.Plugin; import kieker.analysis.plugin.filter.AbstractFilterPlugin; import kieker.common.configuration.Configuration; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; - @Plugin(outputPorts = @OutputPort(name = StartTimestampFilter.OUTPUT_PORT_NAME)) public class StartTimestampFilter extends AbstractFilterPlugin { diff --git a/src/main/java/kieker/analysis/stage/StopTimestampFilter.java b/src/main/java/kieker/analysis/stage/StopTimestampFilter.java index db723d7b..77eeb95c 100644 --- a/src/main/java/kieker/analysis/stage/StopTimestampFilter.java +++ b/src/main/java/kieker/analysis/stage/StopTimestampFilter.java @@ -15,6 +15,8 @@ ***************************************************************************/ package kieker.analysis.stage; +import teetime.util.TimestampObject; + import kieker.analysis.IProjectContext; import kieker.analysis.plugin.annotation.InputPort; import kieker.analysis.plugin.annotation.OutputPort; @@ -22,8 +24,6 @@ import kieker.analysis.plugin.annotation.Plugin; import kieker.analysis.plugin.filter.AbstractFilterPlugin; import kieker.common.configuration.Configuration; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; - @Plugin(outputPorts = @OutputPort(name = StopTimestampFilter.OUTPUT_PORT_NAME)) public class StopTimestampFilter extends AbstractFilterPlugin { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/AbstractPort.java b/src/main/java/teetime/framework/AbstractPort.java similarity index 77% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/AbstractPort.java rename to src/main/java/teetime/framework/AbstractPort.java index 53aed08c..29568b17 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/AbstractPort.java +++ b/src/main/java/teetime/framework/AbstractPort.java @@ -1,6 +1,6 @@ -package teetime.variant.methodcallWithPorts.framework.core; +package teetime.framework; -import teetime.variant.methodcallWithPorts.framework.core.pipe.IPipe; +import teetime.framework.pipe.IPipe; public abstract class AbstractPort<T> { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/AbstractStage.java b/src/main/java/teetime/framework/AbstractStage.java similarity index 92% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/AbstractStage.java rename to src/main/java/teetime/framework/AbstractStage.java index a2bd9887..53ed24f0 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/AbstractStage.java +++ b/src/main/java/teetime/framework/AbstractStage.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.framework.core; +package teetime.framework; import java.util.ArrayList; import java.util.HashMap; @@ -9,10 +9,10 @@ import java.util.UUID; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import teetime.variant.methodcallWithPorts.framework.core.pipe.DummyPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.IPipe; -import teetime.variant.methodcallWithPorts.framework.core.signal.ISignal; -import teetime.variant.methodcallWithPorts.framework.core.validation.InvalidPortConnection; +import teetime.framework.pipe.DummyPipe; +import teetime.framework.pipe.IPipe; +import teetime.framework.signal.ISignal; +import teetime.framework.validation.InvalidPortConnection; public abstract class AbstractStage implements StageWithPort { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/Analysis.java b/src/main/java/teetime/framework/Analysis.java similarity index 97% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/Analysis.java rename to src/main/java/teetime/framework/Analysis.java index 78575116..c9fd8e11 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/Analysis.java +++ b/src/main/java/teetime/framework/Analysis.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.framework.core; +package teetime.framework; import java.lang.Thread.UncaughtExceptionHandler; import java.util.Collection; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/AnalysisConfiguration.java b/src/main/java/teetime/framework/AnalysisConfiguration.java similarity index 91% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/AnalysisConfiguration.java rename to src/main/java/teetime/framework/AnalysisConfiguration.java index 158cb892..1a291c2e 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/AnalysisConfiguration.java +++ b/src/main/java/teetime/framework/AnalysisConfiguration.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.framework.core; +package teetime.framework; import java.util.LinkedList; import java.util.List; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/ConsumerStage.java b/src/main/java/teetime/framework/ConsumerStage.java similarity index 87% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/ConsumerStage.java rename to src/main/java/teetime/framework/ConsumerStage.java index 36c4893b..769ca731 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/ConsumerStage.java +++ b/src/main/java/teetime/framework/ConsumerStage.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.framework.core; +package teetime.framework; public abstract class ConsumerStage<I> extends AbstractStage { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/HeadPipeline.java b/src/main/java/teetime/framework/HeadPipeline.java similarity index 86% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/HeadPipeline.java rename to src/main/java/teetime/framework/HeadPipeline.java index 2f57679e..3c9dd139 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/HeadPipeline.java +++ b/src/main/java/teetime/framework/HeadPipeline.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.framework.core; +package teetime.framework; public class HeadPipeline<FirstStage extends HeadStage, LastStage extends StageWithPort> extends Pipeline<FirstStage, LastStage> implements HeadStage { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/HeadStage.java b/src/main/java/teetime/framework/HeadStage.java similarity index 63% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/HeadStage.java rename to src/main/java/teetime/framework/HeadStage.java index 2c80f08c..373b150d 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/HeadStage.java +++ b/src/main/java/teetime/framework/HeadStage.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.framework.core; +package teetime.framework; public interface HeadStage extends StageWithPort { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/InputPort.java b/src/main/java/teetime/framework/InputPort.java similarity index 84% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/InputPort.java rename to src/main/java/teetime/framework/InputPort.java index be4ed828..f221f511 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/InputPort.java +++ b/src/main/java/teetime/framework/InputPort.java @@ -1,6 +1,6 @@ -package teetime.variant.methodcallWithPorts.framework.core; +package teetime.framework; -import teetime.variant.methodcallWithPorts.framework.core.pipe.IPipe; +import teetime.framework.pipe.IPipe; public class InputPort<T> extends AbstractPort<T> { diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/Analysis.java b/src/main/java/teetime/framework/OldAnalysis.java similarity index 92% rename from src/main/java/teetime/variant/explicitScheduling/framework/core/Analysis.java rename to src/main/java/teetime/framework/OldAnalysis.java index 8b147e41..914c52b8 100644 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/Analysis.java +++ b/src/main/java/teetime/framework/OldAnalysis.java @@ -14,14 +14,15 @@ * limitations under the License. ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.core; +package teetime.framework; /** * @author Christian Wulf * * @since 1.10 */ -public class Analysis { +@Deprecated +public class OldAnalysis { public void init() { System.out.println("Analysis initialized."); diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/OutputPort.java b/src/main/java/teetime/framework/OutputPort.java similarity index 78% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/OutputPort.java rename to src/main/java/teetime/framework/OutputPort.java index 790aa531..e53b5aff 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/OutputPort.java +++ b/src/main/java/teetime/framework/OutputPort.java @@ -1,6 +1,6 @@ -package teetime.variant.methodcallWithPorts.framework.core; +package teetime.framework; -import teetime.variant.methodcallWithPorts.framework.core.signal.ISignal; +import teetime.framework.signal.ISignal; public final class OutputPort<T> extends AbstractPort<T> { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/Pipeline.java b/src/main/java/teetime/framework/Pipeline.java similarity index 85% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/Pipeline.java rename to src/main/java/teetime/framework/Pipeline.java index d44473d7..91b0ae86 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/Pipeline.java +++ b/src/main/java/teetime/framework/Pipeline.java @@ -1,9 +1,9 @@ -package teetime.variant.methodcallWithPorts.framework.core; +package teetime.framework; import java.util.List; -import teetime.variant.methodcallWithPorts.framework.core.signal.ISignal; -import teetime.variant.methodcallWithPorts.framework.core.validation.InvalidPortConnection; +import teetime.framework.signal.ISignal; +import teetime.framework.validation.InvalidPortConnection; public class Pipeline<FirstStage extends StageWithPort, LastStage extends StageWithPort> implements StageWithPort { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/ProducerStage.java b/src/main/java/teetime/framework/ProducerStage.java similarity index 92% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/ProducerStage.java rename to src/main/java/teetime/framework/ProducerStage.java index 48cb06fb..5ef9c813 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/ProducerStage.java +++ b/src/main/java/teetime/framework/ProducerStage.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.framework.core; +package teetime.framework; /** * The <code>ProducerStage</code> produces at least one element at each execution.<br> diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/RunnableStage.java b/src/main/java/teetime/framework/RunnableStage.java similarity index 79% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/RunnableStage.java rename to src/main/java/teetime/framework/RunnableStage.java index 22a95ff6..a2240015 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/RunnableStage.java +++ b/src/main/java/teetime/framework/RunnableStage.java @@ -1,12 +1,12 @@ -package teetime.variant.methodcallWithPorts.framework.core; +package teetime.framework; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import teetime.variant.methodcallWithPorts.framework.core.signal.StartingSignal; -import teetime.variant.methodcallWithPorts.framework.core.signal.TerminatingSignal; -import teetime.variant.methodcallWithPorts.framework.core.signal.ValidatingSignal; -import teetime.variant.methodcallWithPorts.framework.core.validation.AnalysisNotValidException; +import teetime.framework.signal.StartingSignal; +import teetime.framework.signal.TerminatingSignal; +import teetime.framework.signal.ValidatingSignal; +import teetime.framework.validation.AnalysisNotValidException; public class RunnableStage implements Runnable { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/StageWithPort.java b/src/main/java/teetime/framework/StageWithPort.java similarity index 71% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/StageWithPort.java rename to src/main/java/teetime/framework/StageWithPort.java index b315a000..281b9485 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/StageWithPort.java +++ b/src/main/java/teetime/framework/StageWithPort.java @@ -1,9 +1,9 @@ -package teetime.variant.methodcallWithPorts.framework.core; +package teetime.framework; import java.util.List; -import teetime.variant.methodcallWithPorts.framework.core.signal.ISignal; -import teetime.variant.methodcallWithPorts.framework.core.validation.InvalidPortConnection; +import teetime.framework.signal.ISignal; +import teetime.framework.validation.InvalidPortConnection; public interface StageWithPort { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/AbstractPipe.java b/src/main/java/teetime/framework/pipe/AbstractPipe.java similarity index 80% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/AbstractPipe.java rename to src/main/java/teetime/framework/pipe/AbstractPipe.java index d34fd860..c89cd964 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/AbstractPipe.java +++ b/src/main/java/teetime/framework/pipe/AbstractPipe.java @@ -1,8 +1,8 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.StageWithPort; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; +import teetime.framework.StageWithPort; public abstract class AbstractPipe implements IPipe { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/CommittablePipe.java b/src/main/java/teetime/framework/pipe/CommittablePipe.java similarity index 88% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/CommittablePipe.java rename to src/main/java/teetime/framework/pipe/CommittablePipe.java index 2badc2ea..fddb53c6 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/CommittablePipe.java +++ b/src/main/java/teetime/framework/pipe/CommittablePipe.java @@ -1,8 +1,8 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; import teetime.util.list.CommittableResizableArrayQueue; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; public final class CommittablePipe extends IntraThreadPipe { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/CouldNotFindPipeImplException.java b/src/main/java/teetime/framework/pipe/CouldNotFindPipeImplException.java similarity index 81% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/CouldNotFindPipeImplException.java rename to src/main/java/teetime/framework/pipe/CouldNotFindPipeImplException.java index 4cc05179..ed80b4dc 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/CouldNotFindPipeImplException.java +++ b/src/main/java/teetime/framework/pipe/CouldNotFindPipeImplException.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; public class CouldNotFindPipeImplException extends RuntimeException { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/DummyPipe.java b/src/main/java/teetime/framework/pipe/DummyPipe.java similarity index 73% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/DummyPipe.java rename to src/main/java/teetime/framework/pipe/DummyPipe.java index aa27ebbd..98629184 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/DummyPipe.java +++ b/src/main/java/teetime/framework/pipe/DummyPipe.java @@ -1,8 +1,8 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.signal.ISignal; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; +import teetime.framework.signal.ISignal; /** * A pipe implementation used to connect unconnected output ports. diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/IPipe.java b/src/main/java/teetime/framework/pipe/IPipe.java similarity index 54% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/IPipe.java rename to src/main/java/teetime/framework/pipe/IPipe.java index 154ac923..1e9d2f43 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/IPipe.java +++ b/src/main/java/teetime/framework/pipe/IPipe.java @@ -1,8 +1,8 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.signal.ISignal; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; +import teetime.framework.signal.ISignal; public interface IPipe { diff --git a/src/main/java/teetime/framework/pipe/IPipeFactory.java b/src/main/java/teetime/framework/pipe/IPipeFactory.java new file mode 100644 index 00000000..b3fde09b --- /dev/null +++ b/src/main/java/teetime/framework/pipe/IPipeFactory.java @@ -0,0 +1,23 @@ +package teetime.framework.pipe; + +import teetime.framework.InputPort; +import teetime.framework.OutputPort; +import teetime.framework.pipe.PipeFactory.PipeOrdering; +import teetime.framework.pipe.PipeFactory.ThreadCommunication; + +public interface IPipeFactory { + + @Deprecated + IPipe create(int capacity); + + <T> IPipe create(OutputPort<? extends T> sourcePort, InputPort<T> targetPort); + + <T> IPipe create(OutputPort<? extends T> sourcePort, InputPort<T> targetPort, int capacity); + + ThreadCommunication getThreadCommunication(); + + PipeOrdering getOrdering(); + + boolean isGrowable(); + +} diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/InterThreadPipe.java b/src/main/java/teetime/framework/pipe/InterThreadPipe.java similarity index 68% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/InterThreadPipe.java rename to src/main/java/teetime/framework/pipe/InterThreadPipe.java index 7c2ede98..377b01b1 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/InterThreadPipe.java +++ b/src/main/java/teetime/framework/pipe/InterThreadPipe.java @@ -1,10 +1,10 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; import java.util.concurrent.atomic.AtomicReference; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.signal.ISignal; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; +import teetime.framework.signal.ISignal; public abstract class InterThreadPipe extends AbstractPipe { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/IntraThreadPipe.java b/src/main/java/teetime/framework/pipe/IntraThreadPipe.java similarity index 65% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/IntraThreadPipe.java rename to src/main/java/teetime/framework/pipe/IntraThreadPipe.java index e34547b0..27a7aa2a 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/IntraThreadPipe.java +++ b/src/main/java/teetime/framework/pipe/IntraThreadPipe.java @@ -1,8 +1,8 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.signal.ISignal; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; +import teetime.framework.signal.ISignal; public abstract class IntraThreadPipe extends AbstractPipe { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/OrderedGrowableArrayPipe.java b/src/main/java/teetime/framework/pipe/OrderedGrowableArrayPipe.java similarity index 85% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/OrderedGrowableArrayPipe.java rename to src/main/java/teetime/framework/pipe/OrderedGrowableArrayPipe.java index e059acd4..5ee042d0 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/OrderedGrowableArrayPipe.java +++ b/src/main/java/teetime/framework/pipe/OrderedGrowableArrayPipe.java @@ -1,8 +1,8 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; import teetime.util.concurrent.workstealing.CircularArray; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; public final class OrderedGrowableArrayPipe extends IntraThreadPipe { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/OrderedGrowableArrayPipeFactory.java b/src/main/java/teetime/framework/pipe/OrderedGrowableArrayPipeFactory.java similarity index 67% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/OrderedGrowableArrayPipeFactory.java rename to src/main/java/teetime/framework/pipe/OrderedGrowableArrayPipeFactory.java index 7290a782..76f17f5d 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/OrderedGrowableArrayPipeFactory.java +++ b/src/main/java/teetime/framework/pipe/OrderedGrowableArrayPipeFactory.java @@ -1,9 +1,9 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.PipeOrdering; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.ThreadCommunication; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; +import teetime.framework.pipe.PipeFactory.PipeOrdering; +import teetime.framework.pipe.PipeFactory.ThreadCommunication; public class OrderedGrowableArrayPipeFactory implements IPipeFactory { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/OrderedGrowablePipe.java b/src/main/java/teetime/framework/pipe/OrderedGrowablePipe.java similarity index 82% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/OrderedGrowablePipe.java rename to src/main/java/teetime/framework/pipe/OrderedGrowablePipe.java index eab5df8f..0163ba6a 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/OrderedGrowablePipe.java +++ b/src/main/java/teetime/framework/pipe/OrderedGrowablePipe.java @@ -1,9 +1,9 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; import java.util.LinkedList; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; public class OrderedGrowablePipe extends IntraThreadPipe { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/PipeFactory.java b/src/main/java/teetime/framework/pipe/PipeFactory.java similarity index 97% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/PipeFactory.java rename to src/main/java/teetime/framework/pipe/PipeFactory.java index 20fbec00..57de4c11 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/PipeFactory.java +++ b/src/main/java/teetime/framework/pipe/PipeFactory.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; import java.io.IOException; import java.util.HashMap; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/PipeFactoryLoader.java b/src/main/java/teetime/framework/pipe/PipeFactoryLoader.java similarity index 95% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/PipeFactoryLoader.java rename to src/main/java/teetime/framework/pipe/PipeFactoryLoader.java index df1b844f..365918f0 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/PipeFactoryLoader.java +++ b/src/main/java/teetime/framework/pipe/PipeFactoryLoader.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; import java.io.BufferedReader; import java.io.FileReader; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/RelayTestPipe.java b/src/main/java/teetime/framework/pipe/RelayTestPipe.java similarity index 92% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/RelayTestPipe.java rename to src/main/java/teetime/framework/pipe/RelayTestPipe.java index 26e8da05..9950af66 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/RelayTestPipe.java +++ b/src/main/java/teetime/framework/pipe/RelayTestPipe.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; import teetime.util.ConstructorClosure; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/SingleElementPipe.java b/src/main/java/teetime/framework/pipe/SingleElementPipe.java similarity index 81% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/SingleElementPipe.java rename to src/main/java/teetime/framework/pipe/SingleElementPipe.java index f40eca65..bccc7c9c 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/SingleElementPipe.java +++ b/src/main/java/teetime/framework/pipe/SingleElementPipe.java @@ -1,7 +1,7 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; public final class SingleElementPipe extends IntraThreadPipe { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/SingleElementPipeFactory.java b/src/main/java/teetime/framework/pipe/SingleElementPipeFactory.java similarity index 69% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/SingleElementPipeFactory.java rename to src/main/java/teetime/framework/pipe/SingleElementPipeFactory.java index 22309e35..ee8d3cf4 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/SingleElementPipeFactory.java +++ b/src/main/java/teetime/framework/pipe/SingleElementPipeFactory.java @@ -1,9 +1,9 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.PipeOrdering; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.ThreadCommunication; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; +import teetime.framework.pipe.PipeFactory.PipeOrdering; +import teetime.framework.pipe.PipeFactory.ThreadCommunication; public class SingleElementPipeFactory implements IPipeFactory { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/SpScPipe.java b/src/main/java/teetime/framework/pipe/SpScPipe.java similarity index 87% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/SpScPipe.java rename to src/main/java/teetime/framework/pipe/SpScPipe.java index acb1cc62..329e4cff 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/SpScPipe.java +++ b/src/main/java/teetime/framework/pipe/SpScPipe.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; import java.util.Queue; @@ -7,8 +7,8 @@ import org.jctools.queues.spec.ConcurrentQueueSpec; import org.jctools.queues.spec.Ordering; import org.jctools.queues.spec.Preference; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; public final class SpScPipe extends InterThreadPipe { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/SpScPipeFactory.java b/src/main/java/teetime/framework/pipe/SpScPipeFactory.java similarity index 66% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/SpScPipeFactory.java rename to src/main/java/teetime/framework/pipe/SpScPipeFactory.java index fa0686e2..25331aa3 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/SpScPipeFactory.java +++ b/src/main/java/teetime/framework/pipe/SpScPipeFactory.java @@ -1,9 +1,9 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.PipeOrdering; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.ThreadCommunication; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; +import teetime.framework.pipe.PipeFactory.PipeOrdering; +import teetime.framework.pipe.PipeFactory.ThreadCommunication; public class SpScPipeFactory implements IPipeFactory { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/UnorderedGrowablePipe.java b/src/main/java/teetime/framework/pipe/UnorderedGrowablePipe.java similarity index 91% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/UnorderedGrowablePipe.java rename to src/main/java/teetime/framework/pipe/UnorderedGrowablePipe.java index 878844e2..be8c1545 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/UnorderedGrowablePipe.java +++ b/src/main/java/teetime/framework/pipe/UnorderedGrowablePipe.java @@ -1,7 +1,7 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; public final class UnorderedGrowablePipe extends IntraThreadPipe { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/UnorderedGrowablePipeFactory.java b/src/main/java/teetime/framework/pipe/UnorderedGrowablePipeFactory.java similarity index 68% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/UnorderedGrowablePipeFactory.java rename to src/main/java/teetime/framework/pipe/UnorderedGrowablePipeFactory.java index 536efc0c..e18e896d 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/UnorderedGrowablePipeFactory.java +++ b/src/main/java/teetime/framework/pipe/UnorderedGrowablePipeFactory.java @@ -1,9 +1,9 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; +package teetime.framework.pipe; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.PipeOrdering; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.ThreadCommunication; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; +import teetime.framework.pipe.PipeFactory.PipeOrdering; +import teetime.framework.pipe.PipeFactory.ThreadCommunication; public class UnorderedGrowablePipeFactory implements IPipeFactory { diff --git a/src/main/java/teetime/framework/signal/ISignal.java b/src/main/java/teetime/framework/signal/ISignal.java new file mode 100644 index 00000000..b94fc752 --- /dev/null +++ b/src/main/java/teetime/framework/signal/ISignal.java @@ -0,0 +1,8 @@ +package teetime.framework.signal; + +import teetime.framework.AbstractStage; + +public interface ISignal { + + void trigger(AbstractStage stage); +} diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/signal/StartingSignal.java b/src/main/java/teetime/framework/signal/StartingSignal.java similarity index 50% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/signal/StartingSignal.java rename to src/main/java/teetime/framework/signal/StartingSignal.java index 11dc8c72..d1b7aa54 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/signal/StartingSignal.java +++ b/src/main/java/teetime/framework/signal/StartingSignal.java @@ -1,6 +1,6 @@ -package teetime.variant.methodcallWithPorts.framework.core.signal; +package teetime.framework.signal; -import teetime.variant.methodcallWithPorts.framework.core.AbstractStage; +import teetime.framework.AbstractStage; public class StartingSignal implements ISignal { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/signal/TerminatingSignal.java b/src/main/java/teetime/framework/signal/TerminatingSignal.java similarity index 51% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/signal/TerminatingSignal.java rename to src/main/java/teetime/framework/signal/TerminatingSignal.java index 1c523522..0aba57ba 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/signal/TerminatingSignal.java +++ b/src/main/java/teetime/framework/signal/TerminatingSignal.java @@ -1,6 +1,6 @@ -package teetime.variant.methodcallWithPorts.framework.core.signal; +package teetime.framework.signal; -import teetime.variant.methodcallWithPorts.framework.core.AbstractStage; +import teetime.framework.AbstractStage; public class TerminatingSignal implements ISignal { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/signal/ValidatingSignal.java b/src/main/java/teetime/framework/signal/ValidatingSignal.java similarity index 65% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/signal/ValidatingSignal.java rename to src/main/java/teetime/framework/signal/ValidatingSignal.java index 3b9cd684..2b4858ca 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/signal/ValidatingSignal.java +++ b/src/main/java/teetime/framework/signal/ValidatingSignal.java @@ -1,10 +1,10 @@ -package teetime.variant.methodcallWithPorts.framework.core.signal; +package teetime.framework.signal; import java.util.LinkedList; import java.util.List; -import teetime.variant.methodcallWithPorts.framework.core.AbstractStage; -import teetime.variant.methodcallWithPorts.framework.core.validation.InvalidPortConnection; +import teetime.framework.AbstractStage; +import teetime.framework.validation.InvalidPortConnection; public class ValidatingSignal implements ISignal { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/validation/AnalysisNotValidException.java b/src/main/java/teetime/framework/validation/AnalysisNotValidException.java similarity index 91% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/validation/AnalysisNotValidException.java rename to src/main/java/teetime/framework/validation/AnalysisNotValidException.java index 7fd84f20..a827d7f1 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/validation/AnalysisNotValidException.java +++ b/src/main/java/teetime/framework/validation/AnalysisNotValidException.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.framework.core.validation; +package teetime.framework.validation; import java.util.List; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/validation/InvalidPortConnection.java b/src/main/java/teetime/framework/validation/InvalidPortConnection.java similarity index 78% rename from src/main/java/teetime/variant/methodcallWithPorts/framework/core/validation/InvalidPortConnection.java rename to src/main/java/teetime/framework/validation/InvalidPortConnection.java index de60a0a4..183f3700 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/validation/InvalidPortConnection.java +++ b/src/main/java/teetime/framework/validation/InvalidPortConnection.java @@ -1,7 +1,7 @@ -package teetime.variant.methodcallWithPorts.framework.core.validation; +package teetime.framework.validation; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; public class InvalidPortConnection { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/Cache.java b/src/main/java/teetime/stage/Cache.java similarity index 82% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/Cache.java rename to src/main/java/teetime/stage/Cache.java index ea9bb2e9..44588ceb 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/Cache.java +++ b/src/main/java/teetime/stage/Cache.java @@ -1,12 +1,12 @@ -package teetime.variant.methodcallWithPorts.stage; +package teetime.stage; import java.util.LinkedList; import java.util.List; import java.util.concurrent.TimeUnit; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; import teetime.util.StopWatch; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; public class Cache<T> extends ConsumerStage<T> { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/Clock.java b/src/main/java/teetime/stage/Clock.java similarity index 89% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/Clock.java rename to src/main/java/teetime/stage/Clock.java index e140fed5..e9439886 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/Clock.java +++ b/src/main/java/teetime/stage/Clock.java @@ -1,6 +1,6 @@ -package teetime.variant.methodcallWithPorts.stage; +package teetime.stage; -import teetime.variant.methodcallWithPorts.framework.core.ProducerStage; +import teetime.framework.ProducerStage; public class Clock extends ProducerStage<Long> { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/CollectorSink.java b/src/main/java/teetime/stage/CollectorSink.java similarity index 93% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/CollectorSink.java rename to src/main/java/teetime/stage/CollectorSink.java index 6af3d421..33d4b434 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/CollectorSink.java +++ b/src/main/java/teetime/stage/CollectorSink.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage; +package teetime.stage; import java.util.List; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; +import teetime.framework.ConsumerStage; /** * @author Christian Wulf diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/Counter.java b/src/main/java/teetime/stage/Counter.java similarity index 74% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/Counter.java rename to src/main/java/teetime/stage/Counter.java index 88b446f0..7d3d8c95 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/Counter.java +++ b/src/main/java/teetime/stage/Counter.java @@ -1,7 +1,7 @@ -package teetime.variant.methodcallWithPorts.stage; +package teetime.stage; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; public class Counter<T> extends ConsumerStage<T> { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/ElementDelayMeasuringStage.java b/src/main/java/teetime/stage/ElementDelayMeasuringStage.java similarity index 85% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/ElementDelayMeasuringStage.java rename to src/main/java/teetime/stage/ElementDelayMeasuringStage.java index 2ab1fa47..452f75e3 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/ElementDelayMeasuringStage.java +++ b/src/main/java/teetime/stage/ElementDelayMeasuringStage.java @@ -1,11 +1,11 @@ -package teetime.variant.methodcallWithPorts.stage; +package teetime.stage; import java.util.LinkedList; import java.util.List; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.ConsumerStage; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; public class ElementDelayMeasuringStage<T> extends ConsumerStage<T> { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/ElementThroughputMeasuringStage.java b/src/main/java/teetime/stage/ElementThroughputMeasuringStage.java similarity index 89% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/ElementThroughputMeasuringStage.java rename to src/main/java/teetime/stage/ElementThroughputMeasuringStage.java index 33ad7d5f..ea36801a 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/ElementThroughputMeasuringStage.java +++ b/src/main/java/teetime/stage/ElementThroughputMeasuringStage.java @@ -1,12 +1,12 @@ -package teetime.variant.methodcallWithPorts.stage; +package teetime.stage; import java.util.LinkedList; import java.util.List; import java.util.concurrent.TimeUnit; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.ConsumerStage; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; public class ElementThroughputMeasuringStage<T> extends ConsumerStage<T> { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/FileExtensionSwitch.java b/src/main/java/teetime/stage/FileExtensionSwitch.java similarity index 83% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/FileExtensionSwitch.java rename to src/main/java/teetime/stage/FileExtensionSwitch.java index 235cd360..da609993 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/FileExtensionSwitch.java +++ b/src/main/java/teetime/stage/FileExtensionSwitch.java @@ -1,11 +1,11 @@ -package teetime.variant.methodcallWithPorts.stage; +package teetime.stage; import java.io.File; import java.util.HashMap; import java.util.Map; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; import com.google.common.io.Files; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/InitialElementProducer.java b/src/main/java/teetime/stage/InitialElementProducer.java similarity index 71% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/InitialElementProducer.java rename to src/main/java/teetime/stage/InitialElementProducer.java index 8a303610..a5084ce6 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/InitialElementProducer.java +++ b/src/main/java/teetime/stage/InitialElementProducer.java @@ -1,6 +1,6 @@ -package teetime.variant.methodcallWithPorts.stage; +package teetime.stage; -import teetime.variant.methodcallWithPorts.framework.core.ProducerStage; +import teetime.framework.ProducerStage; public class InitialElementProducer<T> extends ProducerStage<T> { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/InstanceCounter.java b/src/main/java/teetime/stage/InstanceCounter.java similarity index 73% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/InstanceCounter.java rename to src/main/java/teetime/stage/InstanceCounter.java index 7e5652fc..30df6693 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/InstanceCounter.java +++ b/src/main/java/teetime/stage/InstanceCounter.java @@ -1,7 +1,7 @@ -package teetime.variant.methodcallWithPorts.stage; +package teetime.stage; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; public class InstanceCounter<T, C extends T> extends ConsumerStage<T> { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/InstanceOfFilter.java b/src/main/java/teetime/stage/InstanceOfFilter.java similarity index 81% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/InstanceOfFilter.java rename to src/main/java/teetime/stage/InstanceOfFilter.java index 79596765..042febae 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/InstanceOfFilter.java +++ b/src/main/java/teetime/stage/InstanceOfFilter.java @@ -1,7 +1,7 @@ -package teetime.variant.methodcallWithPorts.stage; +package teetime.stage; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; /** * @author Jan Waller, Nils Christian Ehmke, Christian Wulf diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/NoopFilter.java b/src/main/java/teetime/stage/NoopFilter.java similarity index 85% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/NoopFilter.java rename to src/main/java/teetime/stage/NoopFilter.java index 385e4cbf..4a721152 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/NoopFilter.java +++ b/src/main/java/teetime/stage/NoopFilter.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage; +package teetime.stage; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; /** * @author Christian Wulf diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/ObjectProducer.java b/src/main/java/teetime/stage/ObjectProducer.java similarity index 93% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/ObjectProducer.java rename to src/main/java/teetime/stage/ObjectProducer.java index 663c83ec..f3787ac6 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/ObjectProducer.java +++ b/src/main/java/teetime/stage/ObjectProducer.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage; +package teetime.stage; +import teetime.framework.ProducerStage; import teetime.util.ConstructorClosure; -import teetime.variant.methodcallWithPorts.framework.core.ProducerStage; /** * @author Christian Wulf diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/PortTypeConfiguration.java b/src/main/java/teetime/stage/PortTypeConfiguration.java similarity index 79% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/PortTypeConfiguration.java rename to src/main/java/teetime/stage/PortTypeConfiguration.java index 59790ddd..00b9cad4 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/PortTypeConfiguration.java +++ b/src/main/java/teetime/stage/PortTypeConfiguration.java @@ -1,6 +1,6 @@ -package teetime.variant.methodcallWithPorts.stage; +package teetime.stage; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; +import teetime.util.TimestampObject; public class PortTypeConfiguration { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/Relay.java b/src/main/java/teetime/stage/Relay.java similarity index 64% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/Relay.java rename to src/main/java/teetime/stage/Relay.java index b40d4628..144b34ea 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/Relay.java +++ b/src/main/java/teetime/stage/Relay.java @@ -1,9 +1,9 @@ -package teetime.variant.methodcallWithPorts.stage; +package teetime.stage; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.ProducerStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.InterThreadPipe; -import teetime.variant.methodcallWithPorts.framework.core.signal.TerminatingSignal; +import teetime.framework.InputPort; +import teetime.framework.ProducerStage; +import teetime.framework.pipe.InterThreadPipe; +import teetime.framework.signal.TerminatingSignal; public class Relay<T> extends ProducerStage<T> { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/StartTimestampFilter.java b/src/main/java/teetime/stage/StartTimestampFilter.java similarity index 81% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/StartTimestampFilter.java rename to src/main/java/teetime/stage/StartTimestampFilter.java index 0ba688d7..b3ecfe3c 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/StartTimestampFilter.java +++ b/src/main/java/teetime/stage/StartTimestampFilter.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage; +package teetime.stage; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; +import teetime.util.TimestampObject; /** * @author Christian Wulf diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/StopTimestampFilter.java b/src/main/java/teetime/stage/StopTimestampFilter.java similarity index 81% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/StopTimestampFilter.java rename to src/main/java/teetime/stage/StopTimestampFilter.java index c8454c2f..9dff2cf0 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/StopTimestampFilter.java +++ b/src/main/java/teetime/stage/StopTimestampFilter.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage; +package teetime.stage; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; +import teetime.util.TimestampObject; /** * @author Christian Wulf diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/Delay.java b/src/main/java/teetime/stage/basic/Delay.java similarity index 81% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/basic/Delay.java rename to src/main/java/teetime/stage/basic/Delay.java index 55ee676c..1804def3 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/Delay.java +++ b/src/main/java/teetime/stage/basic/Delay.java @@ -1,8 +1,8 @@ -package teetime.variant.methodcallWithPorts.stage.basic; +package teetime.stage.basic; -import teetime.variant.methodcallWithPorts.framework.core.AbstractStage; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.AbstractStage; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; public class Delay<T> extends AbstractStage { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/Sink.java b/src/main/java/teetime/stage/basic/Sink.java similarity index 67% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/basic/Sink.java rename to src/main/java/teetime/stage/basic/Sink.java index b9e0bca2..e5c5d722 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/Sink.java +++ b/src/main/java/teetime/stage/basic/Sink.java @@ -1,6 +1,6 @@ -package teetime.variant.methodcallWithPorts.stage.basic; +package teetime.stage.basic; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; +import teetime.framework.ConsumerStage; public class Sink<T> extends ConsumerStage<T> { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/distributor/CloneStrategy.java b/src/main/java/teetime/stage/basic/distributor/CloneStrategy.java similarity index 88% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/basic/distributor/CloneStrategy.java rename to src/main/java/teetime/stage/basic/distributor/CloneStrategy.java index 5ad9ab05..9512aad0 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/distributor/CloneStrategy.java +++ b/src/main/java/teetime/stage/basic/distributor/CloneStrategy.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.basic.distributor; +package teetime.stage.basic.distributor; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.OutputPort; /** * @author Nils Christian Ehmke diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/distributor/CopyByReferenceStrategy.java b/src/main/java/teetime/stage/basic/distributor/CopyByReferenceStrategy.java similarity index 88% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/basic/distributor/CopyByReferenceStrategy.java rename to src/main/java/teetime/stage/basic/distributor/CopyByReferenceStrategy.java index 9445ae97..d5f26972 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/distributor/CopyByReferenceStrategy.java +++ b/src/main/java/teetime/stage/basic/distributor/CopyByReferenceStrategy.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.basic.distributor; +package teetime.stage.basic.distributor; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.OutputPort; /** * @author Nils Christian Ehmke diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/distributor/Distributor.java b/src/main/java/teetime/stage/basic/distributor/Distributor.java similarity index 88% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/basic/distributor/Distributor.java rename to src/main/java/teetime/stage/basic/distributor/Distributor.java index 10c74c11..f2120ce2 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/distributor/Distributor.java +++ b/src/main/java/teetime/stage/basic/distributor/Distributor.java @@ -14,10 +14,10 @@ * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.basic.distributor; +package teetime.stage.basic.distributor; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; /** * @author Christian Wulf diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/distributor/IDistributorStrategy.java b/src/main/java/teetime/stage/basic/distributor/IDistributorStrategy.java similarity index 87% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/basic/distributor/IDistributorStrategy.java rename to src/main/java/teetime/stage/basic/distributor/IDistributorStrategy.java index fae7a25b..69e53787 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/distributor/IDistributorStrategy.java +++ b/src/main/java/teetime/stage/basic/distributor/IDistributorStrategy.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.basic.distributor; +package teetime.stage.basic.distributor; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.OutputPort; /** * @author Nils Christian Ehmke diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/distributor/RoundRobinStrategy.java b/src/main/java/teetime/stage/basic/distributor/RoundRobinStrategy.java similarity index 90% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/basic/distributor/RoundRobinStrategy.java rename to src/main/java/teetime/stage/basic/distributor/RoundRobinStrategy.java index e8b9279a..64bf90f0 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/distributor/RoundRobinStrategy.java +++ b/src/main/java/teetime/stage/basic/distributor/RoundRobinStrategy.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.basic.distributor; +package teetime.stage.basic.distributor; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.OutputPort; /** * @author Nils Christian Ehmke diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/merger/IMergerStrategy.java b/src/main/java/teetime/stage/basic/merger/IMergerStrategy.java similarity index 93% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/basic/merger/IMergerStrategy.java rename to src/main/java/teetime/stage/basic/merger/IMergerStrategy.java index 09754083..0114cf9b 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/merger/IMergerStrategy.java +++ b/src/main/java/teetime/stage/basic/merger/IMergerStrategy.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.basic.merger; +package teetime.stage.basic.merger; /** * @author Nils Christian Ehmke diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/merger/Merger.java b/src/main/java/teetime/stage/basic/merger/Merger.java similarity index 86% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/basic/merger/Merger.java rename to src/main/java/teetime/stage/basic/merger/Merger.java index d46369c9..eb4c9e31 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/merger/Merger.java +++ b/src/main/java/teetime/stage/basic/merger/Merger.java @@ -14,12 +14,12 @@ * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.basic.merger; +package teetime.stage.basic.merger; -import teetime.variant.methodcallWithPorts.framework.core.AbstractStage; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.signal.ISignal; +import teetime.framework.AbstractStage; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; +import teetime.framework.signal.ISignal; /** * diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/merger/RoundRobinStrategy.java b/src/main/java/teetime/stage/basic/merger/RoundRobinStrategy.java similarity index 92% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/basic/merger/RoundRobinStrategy.java rename to src/main/java/teetime/stage/basic/merger/RoundRobinStrategy.java index bacfaa7a..3edb0478 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/basic/merger/RoundRobinStrategy.java +++ b/src/main/java/teetime/stage/basic/merger/RoundRobinStrategy.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.basic.merger; +package teetime.stage.basic.merger; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; +import teetime.framework.InputPort; /** * @author Nils Christian Ehmke diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/explorviz/KiekerRecordTcpReader.java b/src/main/java/teetime/stage/explorviz/KiekerRecordTcpReader.java similarity index 98% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/explorviz/KiekerRecordTcpReader.java rename to src/main/java/teetime/stage/explorviz/KiekerRecordTcpReader.java index ecbef3d5..cd0aa516 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/explorviz/KiekerRecordTcpReader.java +++ b/src/main/java/teetime/stage/explorviz/KiekerRecordTcpReader.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.stage.explorviz; +package teetime.stage.explorviz; import java.io.IOException; import java.net.InetSocketAddress; @@ -9,7 +9,7 @@ import java.nio.channels.SocketChannel; import java.util.ArrayList; import java.util.List; -import teetime.variant.methodcallWithPorts.framework.core.ProducerStage; +import teetime.framework.ProducerStage; import kieker.common.record.IMonitoringRecord; import kieker.common.record.flow.trace.operation.AfterOperationEvent; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/io/DbReader.java b/src/main/java/teetime/stage/io/DbReader.java similarity index 92% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/io/DbReader.java rename to src/main/java/teetime/stage/io/DbReader.java index 497daeab..82ced4e9 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/io/DbReader.java +++ b/src/main/java/teetime/stage/io/DbReader.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.io; +package teetime.stage.io; import java.sql.Connection; import java.sql.DriverManager; @@ -22,8 +22,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; -import teetime.variant.explicitScheduling.framework.core.Description; -import teetime.variant.methodcallWithPorts.framework.core.ProducerStage; +import teetime.framework.ProducerStage; import kieker.common.exception.MonitoringRecordException; import kieker.common.record.AbstractMonitoringRecord; @@ -31,19 +30,27 @@ import kieker.common.record.IMonitoringRecord; /** * A very simple database reader that probably only works for small data sets. - * + * * @author Jan Waller, Nils Christian Ehmke - * + * * @since 1.10 */ -@Description("A reader which reads records from a database") +// @Description("A reader which reads records from a database") public class DbReader extends ProducerStage<IMonitoringRecord> { - @Description("The classname of the driver used for the connection.") + /** + * The classname of the driver used for the connection. + */ private String driverClassname = "org.apache.derby.jdbc.EmbeddedDrive"; - @Description("The connection string used to establish the connection.") + + /** + * The connection string used to establish the connection. + */ private String connectionString = "jdbc:derby:tmp/KIEKER;user=DBUSER;password=DBPASS"; - @Description("The prefix of the used table within the database.") + + /** + * The prefix of the used table within the database. + */ private String tablePrefix = "kieker"; private volatile boolean running = true; @@ -135,7 +142,7 @@ public class DbReader extends ProducerStage<IMonitoringRecord> { /** * This method uses the given table to read records and sends them to the output port. - * + * * @param connection * The connection to the database which will be used. * @param tablename diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/io/Directory2FilesFilter.java b/src/main/java/teetime/stage/io/Directory2FilesFilter.java similarity index 92% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/io/Directory2FilesFilter.java rename to src/main/java/teetime/stage/io/Directory2FilesFilter.java index 1107e605..cd45fc7b 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/io/Directory2FilesFilter.java +++ b/src/main/java/teetime/stage/io/Directory2FilesFilter.java @@ -14,15 +14,15 @@ * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.io; +package teetime.stage.io; import java.io.File; import java.io.FileFilter; import java.util.Arrays; import java.util.Comparator; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; /** * @author Christian Wulf diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/io/File2TextLinesFilter.java b/src/main/java/teetime/stage/io/File2TextLinesFilter.java similarity index 88% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/io/File2TextLinesFilter.java rename to src/main/java/teetime/stage/io/File2TextLinesFilter.java index 67fbc6a2..c4795559 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/io/File2TextLinesFilter.java +++ b/src/main/java/teetime/stage/io/File2TextLinesFilter.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.io; +package teetime.stage.io; import java.io.BufferedReader; import java.io.File; @@ -23,13 +23,13 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; -import teetime.variant.explicitScheduling.stage.util.TextLine; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; +import teetime.stage.util.TextLine; /** * @author Christian Wulf - * + * * @since 1.10 */ public class File2TextLinesFilter extends ConsumerStage<File> { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/io/IRecordFactoryMethod.java b/src/main/java/teetime/stage/io/IRecordFactoryMethod.java similarity index 81% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/io/IRecordFactoryMethod.java rename to src/main/java/teetime/stage/io/IRecordFactoryMethod.java index d1d997c2..10849cd4 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/io/IRecordFactoryMethod.java +++ b/src/main/java/teetime/stage/io/IRecordFactoryMethod.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.stage.io; +package teetime.stage.io; import java.nio.ByteBuffer; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/io/Printer.java b/src/main/java/teetime/stage/io/Printer.java similarity index 93% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/io/Printer.java rename to src/main/java/teetime/stage/io/Printer.java index 3bed4e2b..40ee69ee 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/io/Printer.java +++ b/src/main/java/teetime/stage/io/Printer.java @@ -13,22 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.io; +package teetime.stage.io; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.PrintStream; import java.io.UnsupportedEncodingException; -import teetime.variant.explicitScheduling.framework.core.Description; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; +import teetime.framework.ConsumerStage; /** + * A filter to print objects to a configured stream + * * @author Matthias Rohr, Jan Waller, Nils Christian Ehmke * * @since 1.10 */ -@Description("A filter to print objects to a configured stream") public class Printer<T> extends ConsumerStage<T> { public static final String STREAM_STDOUT = "STDOUT"; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/io/RecordFactory.java b/src/main/java/teetime/stage/io/RecordFactory.java similarity index 95% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/io/RecordFactory.java rename to src/main/java/teetime/stage/io/RecordFactory.java index 9e46798f..0d012dbc 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/io/RecordFactory.java +++ b/src/main/java/teetime/stage/io/RecordFactory.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.stage.io; +package teetime.stage.io; import java.nio.ByteBuffer; import java.util.HashMap; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/io/TCPReader.java b/src/main/java/teetime/stage/io/TCPReader.java similarity index 98% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/io/TCPReader.java rename to src/main/java/teetime/stage/io/TCPReader.java index 3e09b862..ee2d8d5b 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/io/TCPReader.java +++ b/src/main/java/teetime/stage/io/TCPReader.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.io; +package teetime.stage.io; import java.io.IOException; import java.net.InetSocketAddress; @@ -23,7 +23,7 @@ import java.nio.channels.ClosedByInterruptException; import java.nio.channels.ServerSocketChannel; import java.nio.channels.SocketChannel; -import teetime.variant.methodcallWithPorts.framework.core.ProducerStage; +import teetime.framework.ProducerStage; import kieker.common.exception.MonitoringRecordException; import kieker.common.logging.Log; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/Dir2RecordsFilter.java b/src/main/java/teetime/stage/kieker/Dir2RecordsFilter.java similarity index 77% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/Dir2RecordsFilter.java rename to src/main/java/teetime/stage/kieker/Dir2RecordsFilter.java index 689d3265..eaf453f8 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/Dir2RecordsFilter.java +++ b/src/main/java/teetime/stage/kieker/Dir2RecordsFilter.java @@ -13,25 +13,25 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.kieker; +package teetime.stage.kieker; import java.io.File; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.Pipeline; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.PipeOrdering; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.ThreadCommunication; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SingleElementPipe; -import teetime.variant.methodcallWithPorts.stage.FileExtensionSwitch; -import teetime.variant.methodcallWithPorts.stage.basic.merger.Merger; -import teetime.variant.methodcallWithPorts.stage.io.Directory2FilesFilter; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistryCreationFilter; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistryRepository; -import teetime.variant.methodcallWithPorts.stage.kieker.fileToRecord.BinaryFile2RecordFilter; -import teetime.variant.methodcallWithPorts.stage.kieker.fileToRecord.DatFile2RecordFilter; -import teetime.variant.methodcallWithPorts.stage.kieker.fileToRecord.ZipFile2RecordFilter; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; +import teetime.framework.Pipeline; +import teetime.framework.pipe.PipeFactory; +import teetime.framework.pipe.SingleElementPipe; +import teetime.framework.pipe.PipeFactory.PipeOrdering; +import teetime.framework.pipe.PipeFactory.ThreadCommunication; +import teetime.stage.FileExtensionSwitch; +import teetime.stage.basic.merger.Merger; +import teetime.stage.io.Directory2FilesFilter; +import teetime.stage.kieker.className.ClassNameRegistryCreationFilter; +import teetime.stage.kieker.className.ClassNameRegistryRepository; +import teetime.stage.kieker.fileToRecord.BinaryFile2RecordFilter; +import teetime.stage.kieker.fileToRecord.DatFile2RecordFilter; +import teetime.stage.kieker.fileToRecord.ZipFile2RecordFilter; import kieker.common.record.IMonitoringRecord; import kieker.common.util.filesystem.BinaryCompressionMethod; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/DirWithBin2RecordFilter.java b/src/main/java/teetime/stage/kieker/DirWithBin2RecordFilter.java similarity index 69% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/DirWithBin2RecordFilter.java rename to src/main/java/teetime/stage/kieker/DirWithBin2RecordFilter.java index 86e015aa..37d67230 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/DirWithBin2RecordFilter.java +++ b/src/main/java/teetime/stage/kieker/DirWithBin2RecordFilter.java @@ -1,14 +1,14 @@ -package teetime.variant.methodcallWithPorts.stage.kieker; +package teetime.stage.kieker; import java.io.File; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.Pipeline; -import teetime.variant.methodcallWithPorts.stage.io.Directory2FilesFilter; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistryCreationFilter; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistryRepository; -import teetime.variant.methodcallWithPorts.stage.kieker.fileToRecord.BinaryFile2RecordFilter; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; +import teetime.framework.Pipeline; +import teetime.stage.io.Directory2FilesFilter; +import teetime.stage.kieker.className.ClassNameRegistryCreationFilter; +import teetime.stage.kieker.className.ClassNameRegistryRepository; +import teetime.stage.kieker.fileToRecord.BinaryFile2RecordFilter; import kieker.common.record.IMonitoringRecord; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/DirWithDat2RecordFilter.java b/src/main/java/teetime/stage/kieker/DirWithDat2RecordFilter.java similarity index 69% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/DirWithDat2RecordFilter.java rename to src/main/java/teetime/stage/kieker/DirWithDat2RecordFilter.java index d636a07d..f663ba25 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/DirWithDat2RecordFilter.java +++ b/src/main/java/teetime/stage/kieker/DirWithDat2RecordFilter.java @@ -1,14 +1,14 @@ -package teetime.variant.methodcallWithPorts.stage.kieker; +package teetime.stage.kieker; import java.io.File; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.Pipeline; -import teetime.variant.methodcallWithPorts.stage.io.Directory2FilesFilter; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistryCreationFilter; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistryRepository; -import teetime.variant.methodcallWithPorts.stage.kieker.fileToRecord.DatFile2RecordFilter; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; +import teetime.framework.Pipeline; +import teetime.stage.io.Directory2FilesFilter; +import teetime.stage.kieker.className.ClassNameRegistryCreationFilter; +import teetime.stage.kieker.className.ClassNameRegistryRepository; +import teetime.stage.kieker.fileToRecord.DatFile2RecordFilter; import kieker.common.record.IMonitoringRecord; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/TCPReaderSink.java b/src/main/java/teetime/stage/kieker/TCPReaderSink.java similarity index 98% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/TCPReaderSink.java rename to src/main/java/teetime/stage/kieker/TCPReaderSink.java index 4bd7ef0a..f61dbdd5 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/TCPReaderSink.java +++ b/src/main/java/teetime/stage/kieker/TCPReaderSink.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.kieker; +package teetime.stage.kieker; import java.io.IOException; import java.net.InetSocketAddress; @@ -26,7 +26,7 @@ import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import teetime.variant.methodcallWithPorts.framework.core.ProducerStage; +import teetime.framework.ProducerStage; import kieker.common.exception.MonitoringRecordException; import kieker.common.logging.Log; diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/className/ClassNameRegistry.java b/src/main/java/teetime/stage/kieker/className/ClassNameRegistry.java similarity index 93% rename from src/main/java/teetime/variant/explicitScheduling/stage/kieker/className/ClassNameRegistry.java rename to src/main/java/teetime/stage/kieker/className/ClassNameRegistry.java index 9a8f1656..15e300ed 100644 --- a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/className/ClassNameRegistry.java +++ b/src/main/java/teetime/stage/kieker/className/ClassNameRegistry.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.kieker.className; +package teetime.stage.kieker.className; import java.util.HashMap; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/className/ClassNameRegistryCreationFilter.java b/src/main/java/teetime/stage/kieker/className/ClassNameRegistryCreationFilter.java similarity index 92% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/className/ClassNameRegistryCreationFilter.java rename to src/main/java/teetime/stage/kieker/className/ClassNameRegistryCreationFilter.java index 1142c22b..4171c34a 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/className/ClassNameRegistryCreationFilter.java +++ b/src/main/java/teetime/stage/kieker/className/ClassNameRegistryCreationFilter.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.kieker.className; +package teetime.stage.kieker.className; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; /** * @author Christian Wulf diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/className/ClassNameRegistryRepository.java b/src/main/java/teetime/stage/kieker/className/ClassNameRegistryRepository.java similarity index 96% rename from src/main/java/teetime/variant/explicitScheduling/stage/kieker/className/ClassNameRegistryRepository.java rename to src/main/java/teetime/stage/kieker/className/ClassNameRegistryRepository.java index fecda93a..bbbd7911 100644 --- a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/className/ClassNameRegistryRepository.java +++ b/src/main/java/teetime/stage/kieker/className/ClassNameRegistryRepository.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.kieker.className; +package teetime.stage.kieker.className; import java.io.File; import java.util.concurrent.ConcurrentHashMap; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/className/MappingFileParser.java b/src/main/java/teetime/stage/kieker/className/MappingFileParser.java similarity index 98% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/className/MappingFileParser.java rename to src/main/java/teetime/stage/kieker/className/MappingFileParser.java index 107f7233..a428056a 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/className/MappingFileParser.java +++ b/src/main/java/teetime/stage/kieker/className/MappingFileParser.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.kieker.className; +package teetime.stage.kieker.className; import java.io.BufferedReader; import java.io.File; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/BinaryFile2RecordFilter.java b/src/main/java/teetime/stage/kieker/fileToRecord/BinaryFile2RecordFilter.java similarity index 91% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/BinaryFile2RecordFilter.java rename to src/main/java/teetime/stage/kieker/fileToRecord/BinaryFile2RecordFilter.java index 6e9769c6..c25ebe89 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/BinaryFile2RecordFilter.java +++ b/src/main/java/teetime/stage/kieker/fileToRecord/BinaryFile2RecordFilter.java @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.kieker.fileToRecord; +package teetime.stage.kieker.fileToRecord; import java.io.DataInputStream; import java.io.File; import java.io.IOException; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistryRepository; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; +import teetime.stage.kieker.className.ClassNameRegistryRepository; import kieker.common.exception.MonitoringRecordException; import kieker.common.record.IMonitoringRecord; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/DatFile2RecordFilter.java b/src/main/java/teetime/stage/kieker/fileToRecord/DatFile2RecordFilter.java similarity index 73% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/DatFile2RecordFilter.java rename to src/main/java/teetime/stage/kieker/fileToRecord/DatFile2RecordFilter.java index 704ceffa..8058dacc 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/DatFile2RecordFilter.java +++ b/src/main/java/teetime/stage/kieker/fileToRecord/DatFile2RecordFilter.java @@ -13,17 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.kieker.fileToRecord; +package teetime.stage.kieker.fileToRecord; import java.io.File; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.Pipeline; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SingleElementPipe; -import teetime.variant.methodcallWithPorts.stage.io.File2TextLinesFilter; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistryRepository; -import teetime.variant.methodcallWithPorts.stage.kieker.fileToRecord.textLine.TextLine2RecordFilter; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; +import teetime.framework.Pipeline; +import teetime.framework.pipe.SingleElementPipe; +import teetime.stage.io.File2TextLinesFilter; +import teetime.stage.kieker.className.ClassNameRegistryRepository; +import teetime.stage.kieker.fileToRecord.textLine.TextLine2RecordFilter; import kieker.common.record.IMonitoringRecord; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/RecordFromBinaryFileCreator.java b/src/main/java/teetime/stage/kieker/fileToRecord/RecordFromBinaryFileCreator.java similarity index 94% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/RecordFromBinaryFileCreator.java rename to src/main/java/teetime/stage/kieker/fileToRecord/RecordFromBinaryFileCreator.java index ad01b5d4..17700c2a 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/RecordFromBinaryFileCreator.java +++ b/src/main/java/teetime/stage/kieker/fileToRecord/RecordFromBinaryFileCreator.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.kieker.fileToRecord; +package teetime.stage.kieker.fileToRecord; import java.io.DataInputStream; import java.io.EOFException; @@ -22,8 +22,8 @@ import java.io.IOException; import org.slf4j.Logger; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistry; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistryRepository; +import teetime.stage.kieker.className.ClassNameRegistry; +import teetime.stage.kieker.className.ClassNameRegistryRepository; import kieker.common.exception.MonitoringRecordException; import kieker.common.record.AbstractMonitoringRecord; diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/RecordFromTextLineCreator.java b/src/main/java/teetime/stage/kieker/fileToRecord/RecordFromTextLineCreator.java similarity index 93% rename from src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/RecordFromTextLineCreator.java rename to src/main/java/teetime/stage/kieker/fileToRecord/RecordFromTextLineCreator.java index cffcb48e..118fec75 100644 --- a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/RecordFromTextLineCreator.java +++ b/src/main/java/teetime/stage/kieker/fileToRecord/RecordFromTextLineCreator.java @@ -13,10 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.kieker.fileToRecord; +package teetime.stage.kieker.fileToRecord; import java.io.File; +import teetime.stage.kieker.className.ClassNameRegistry; +import teetime.stage.kieker.className.ClassNameRegistryRepository; +import teetime.stage.util.MappingException; + import kieker.common.exception.IllegalRecordFormatException; import kieker.common.exception.MonitoringRecordException; import kieker.common.exception.UnknownRecordTypeException; @@ -24,10 +28,6 @@ import kieker.common.record.AbstractMonitoringRecord; import kieker.common.record.IMonitoringRecord; import kieker.common.record.controlflow.OperationExecutionRecord; -import teetime.variant.explicitScheduling.stage.MappingException; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistry; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistryRepository; - /** * @author Christian Wulf * diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/ZipFile2RecordFilter.java b/src/main/java/teetime/stage/kieker/fileToRecord/ZipFile2RecordFilter.java similarity index 91% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/ZipFile2RecordFilter.java rename to src/main/java/teetime/stage/kieker/fileToRecord/ZipFile2RecordFilter.java index a1ecb038..e9686124 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/ZipFile2RecordFilter.java +++ b/src/main/java/teetime/stage/kieker/fileToRecord/ZipFile2RecordFilter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.kieker.fileToRecord; +package teetime.stage.kieker.fileToRecord; import java.io.BufferedInputStream; import java.io.BufferedReader; @@ -28,10 +28,10 @@ import java.io.UnsupportedEncodingException; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistry; -import teetime.variant.methodcallWithPorts.stage.kieker.className.MappingFileParser; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; +import teetime.stage.kieker.className.ClassNameRegistry; +import teetime.stage.kieker.className.MappingFileParser; import kieker.common.record.IMonitoringRecord; import kieker.common.util.filesystem.FSUtil; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/textLine/TextLine2MappingRegistryFilter.java b/src/main/java/teetime/stage/kieker/fileToRecord/textLine/TextLine2MappingRegistryFilter.java similarity index 93% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/textLine/TextLine2MappingRegistryFilter.java rename to src/main/java/teetime/stage/kieker/fileToRecord/textLine/TextLine2MappingRegistryFilter.java index 68f2cc72..e15f352f 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/textLine/TextLine2MappingRegistryFilter.java +++ b/src/main/java/teetime/stage/kieker/fileToRecord/textLine/TextLine2MappingRegistryFilter.java @@ -14,11 +14,11 @@ * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.kieker.fileToRecord.textLine; +package teetime.stage.kieker.fileToRecord.textLine; import java.util.Map; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; +import teetime.framework.ConsumerStage; import kieker.common.util.filesystem.FSUtil; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/textLine/TextLine2RecordFilter.java b/src/main/java/teetime/stage/kieker/fileToRecord/textLine/TextLine2RecordFilter.java similarity index 86% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/textLine/TextLine2RecordFilter.java rename to src/main/java/teetime/stage/kieker/fileToRecord/textLine/TextLine2RecordFilter.java index 6bc76669..b730d2d5 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/textLine/TextLine2RecordFilter.java +++ b/src/main/java/teetime/stage/kieker/fileToRecord/textLine/TextLine2RecordFilter.java @@ -14,17 +14,17 @@ * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.kieker.fileToRecord.textLine; +package teetime.stage.kieker.fileToRecord.textLine; import java.util.HashSet; import java.util.Set; -import teetime.variant.explicitScheduling.stage.MappingException; -import teetime.variant.explicitScheduling.stage.util.TextLine; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistryRepository; -import teetime.variant.methodcallWithPorts.stage.kieker.fileToRecord.RecordFromTextLineCreator; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; +import teetime.stage.kieker.className.ClassNameRegistryRepository; +import teetime.stage.kieker.fileToRecord.RecordFromTextLineCreator; +import teetime.stage.util.MappingException; +import teetime.stage.util.TextLine; import kieker.common.exception.IllegalRecordFormatException; import kieker.common.exception.MonitoringRecordException; @@ -33,7 +33,7 @@ import kieker.common.record.IMonitoringRecord; /** * @author Christian Wulf - * + * * @since 1.10 */ public class TextLine2RecordFilter extends ConsumerStage<TextLine> { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/traceReconstruction/TraceReconstructionFilter.java b/src/main/java/teetime/stage/kieker/traceReconstruction/TraceReconstructionFilter.java similarity index 95% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/traceReconstruction/TraceReconstructionFilter.java rename to src/main/java/teetime/stage/kieker/traceReconstruction/TraceReconstructionFilter.java index 4693eea8..9453af86 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/traceReconstruction/TraceReconstructionFilter.java +++ b/src/main/java/teetime/stage/kieker/traceReconstruction/TraceReconstructionFilter.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.kieker.traceReconstruction; +package teetime.stage.kieker.traceReconstruction; import java.util.concurrent.TimeUnit; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; import teetime.util.concurrent.hashmap.ConcurrentHashMapWithDefault; import teetime.util.concurrent.hashmap.TraceBuffer; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; import kieker.analysis.plugin.filter.flow.TraceEventRecords; import kieker.common.record.flow.IFlowRecord; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/traceReduction/TraceAggregationBuffer.java b/src/main/java/teetime/stage/kieker/traceReduction/TraceAggregationBuffer.java similarity index 92% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/traceReduction/TraceAggregationBuffer.java rename to src/main/java/teetime/stage/kieker/traceReduction/TraceAggregationBuffer.java index 80dca610..56b1c257 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/traceReduction/TraceAggregationBuffer.java +++ b/src/main/java/teetime/stage/kieker/traceReduction/TraceAggregationBuffer.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.stage.kieker.traceReduction; +package teetime.stage.kieker.traceReduction; import kieker.analysis.plugin.filter.flow.TraceEventRecords; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/traceReduction/TraceComperator.java b/src/main/java/teetime/stage/kieker/traceReduction/TraceComperator.java similarity index 96% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/traceReduction/TraceComperator.java rename to src/main/java/teetime/stage/kieker/traceReduction/TraceComperator.java index d1a5b770..b1fadaeb 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/traceReduction/TraceComperator.java +++ b/src/main/java/teetime/stage/kieker/traceReduction/TraceComperator.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.stage.kieker.traceReduction; +package teetime.stage.kieker.traceReduction; import java.io.Serializable; import java.util.Comparator; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/traceReduction/TraceReductionFilter.java b/src/main/java/teetime/stage/kieker/traceReduction/TraceReductionFilter.java similarity index 93% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/traceReduction/TraceReductionFilter.java rename to src/main/java/teetime/stage/kieker/traceReduction/TraceReductionFilter.java index 6c3baa21..0a66326b 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/traceReduction/TraceReductionFilter.java +++ b/src/main/java/teetime/stage/kieker/traceReduction/TraceReductionFilter.java @@ -14,15 +14,15 @@ * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.kieker.traceReduction; +package teetime.stage.kieker.traceReduction; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; +import teetime.framework.ConsumerStage; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; import kieker.analysis.plugin.filter.flow.TraceEventRecords; diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/StringBufferFilter.java b/src/main/java/teetime/stage/stringBuffer/StringBufferFilter.java similarity index 86% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/StringBufferFilter.java rename to src/main/java/teetime/stage/stringBuffer/StringBufferFilter.java index a566f7a5..2cefc39d 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/StringBufferFilter.java +++ b/src/main/java/teetime/stage/stringBuffer/StringBufferFilter.java @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.stringBuffer; +package teetime.stage.stringBuffer; import java.util.Collection; import java.util.LinkedList; -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.stage.stringBuffer.handler.AbstractDataTypeHandler; -import teetime.variant.methodcallWithPorts.stage.stringBuffer.util.KiekerHashMap; +import teetime.framework.ConsumerStage; +import teetime.framework.OutputPort; +import teetime.stage.stringBuffer.handler.AbstractDataTypeHandler; +import teetime.stage.stringBuffer.util.KiekerHashMap; /** * @author Christian Wulf diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/handler/AbstractDataTypeHandler.java b/src/main/java/teetime/stage/stringBuffer/handler/AbstractDataTypeHandler.java similarity index 89% rename from src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/handler/AbstractDataTypeHandler.java rename to src/main/java/teetime/stage/stringBuffer/handler/AbstractDataTypeHandler.java index 353662ee..f58688df 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/handler/AbstractDataTypeHandler.java +++ b/src/main/java/teetime/stage/stringBuffer/handler/AbstractDataTypeHandler.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.stringBuffer.handler; +package teetime.stage.stringBuffer.handler; import org.slf4j.Logger; -import teetime.variant.methodcallWithPorts.stage.stringBuffer.util.KiekerHashMap; +import teetime.stage.stringBuffer.util.KiekerHashMap; /** * @author Christian Wulf diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/handler/IMonitoringRecordHandler.java b/src/main/java/teetime/stage/stringBuffer/handler/IMonitoringRecordHandler.java similarity index 96% rename from src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/handler/IMonitoringRecordHandler.java rename to src/main/java/teetime/stage/stringBuffer/handler/IMonitoringRecordHandler.java index 6d6f4e5c..ee345747 100644 --- a/src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/handler/IMonitoringRecordHandler.java +++ b/src/main/java/teetime/stage/stringBuffer/handler/IMonitoringRecordHandler.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.stringBuffer.handler; +package teetime.stage.stringBuffer.handler; import kieker.common.exception.MonitoringRecordException; import kieker.common.record.AbstractMonitoringRecord; diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/handler/StringHandler.java b/src/main/java/teetime/stage/stringBuffer/handler/StringHandler.java similarity index 93% rename from src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/handler/StringHandler.java rename to src/main/java/teetime/stage/stringBuffer/handler/StringHandler.java index eac8f68a..82c356fa 100644 --- a/src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/handler/StringHandler.java +++ b/src/main/java/teetime/stage/stringBuffer/handler/StringHandler.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.stringBuffer.handler; +package teetime.stage.stringBuffer.handler; /** * @author Christian Wulf diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/util/KiekerHashMap.java b/src/main/java/teetime/stage/stringBuffer/util/KiekerHashMap.java similarity index 99% rename from src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/util/KiekerHashMap.java rename to src/main/java/teetime/stage/stringBuffer/util/KiekerHashMap.java index 0121ad50..22542a58 100644 --- a/src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/util/KiekerHashMap.java +++ b/src/main/java/teetime/stage/stringBuffer/util/KiekerHashMap.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.stringBuffer.util; +package teetime.stage.stringBuffer.util; import java.lang.ref.SoftReference; import java.util.concurrent.locks.ReentrantLock; diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/MappingException.java b/src/main/java/teetime/stage/util/MappingException.java similarity index 94% rename from src/main/java/teetime/variant/explicitScheduling/stage/MappingException.java rename to src/main/java/teetime/stage/util/MappingException.java index a718972a..40a83811 100644 --- a/src/main/java/teetime/variant/explicitScheduling/stage/MappingException.java +++ b/src/main/java/teetime/stage/util/MappingException.java @@ -14,11 +14,11 @@ * limitations under the License. ***************************************************************************/ -package teetime.variant.explicitScheduling.stage; +package teetime.stage.util; /** * @author Christian Wulf - * + * * @since 1.10 */ public class MappingException extends Exception { diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/util/TextLine.java b/src/main/java/teetime/stage/util/TextLine.java similarity index 95% rename from src/main/java/teetime/variant/explicitScheduling/stage/util/TextLine.java rename to src/main/java/teetime/stage/util/TextLine.java index 016463d9..deb5ed8a 100644 --- a/src/main/java/teetime/variant/explicitScheduling/stage/util/TextLine.java +++ b/src/main/java/teetime/stage/util/TextLine.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.util; +package teetime.stage.util; import java.io.File; /** * @author Christian Wulf - * + * * @since 1.10 */ public class TextLine { diff --git a/src/main/java/teetime/variant/explicitScheduling/examples/throughput/TimestampObject.java b/src/main/java/teetime/util/TimestampObject.java similarity index 95% rename from src/main/java/teetime/variant/explicitScheduling/examples/throughput/TimestampObject.java rename to src/main/java/teetime/util/TimestampObject.java index 6e875bd9..d47cf229 100644 --- a/src/main/java/teetime/variant/explicitScheduling/examples/throughput/TimestampObject.java +++ b/src/main/java/teetime/util/TimestampObject.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.explicitScheduling.examples.throughput; +package teetime.util; /** * Object for performance evaluation - * + * * @author Christian Wulf - * + * * @since 1.10 */ public final class TimestampObject { diff --git a/src/main/java/teetime/variant/explicitScheduling/examples/countWords/ConcurrentCountWordsAnalysis.java b/src/main/java/teetime/variant/explicitScheduling/examples/countWords/ConcurrentCountWordsAnalysis.java deleted file mode 100644 index 5ebe8aff..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/examples/countWords/ConcurrentCountWordsAnalysis.java +++ /dev/null @@ -1,292 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.examples.countWords; - -import java.io.File; -import java.util.LinkedList; -import java.util.List; - -import teetime.util.Pair; -import teetime.variant.explicitScheduling.framework.concurrent.ConcurrentWorkStealingPipe; -import teetime.variant.explicitScheduling.framework.concurrent.ConcurrentWorkStealingPipeFactory; -import teetime.variant.explicitScheduling.framework.concurrent.SingleProducerSingleConsumerPipe; -import teetime.variant.explicitScheduling.framework.concurrent.StageTerminationPolicy; -import teetime.variant.explicitScheduling.framework.concurrent.WorkerThread; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.framework.core.IPipeline; -import teetime.variant.explicitScheduling.framework.core.ISink; -import teetime.variant.explicitScheduling.framework.core.ISource; -import teetime.variant.explicitScheduling.framework.core.IStage; -import teetime.variant.explicitScheduling.framework.core.Pipeline; -import teetime.variant.explicitScheduling.framework.core.IInputPort.PortState; -import teetime.variant.explicitScheduling.framework.sequential.MethodCallPipe; -import teetime.variant.explicitScheduling.framework.sequential.QueuePipe; -import teetime.variant.explicitScheduling.stage.basic.RepeaterSource; -import teetime.variant.explicitScheduling.stage.basic.distributor.Distributor; -import teetime.variant.explicitScheduling.stage.basic.merger.Merger; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class ConcurrentCountWordsAnalysis extends Analysis { - - private static final int NUM_TOKENS_TO_REPEAT = 1000; - private static final String START_DIRECTORY_NAME = "."; - private static final int SECONDS = 1000; - - private static final int MAX_NUM_THREADS = 2; // 1:2150, 2:1400, 3:~1400, 4:~1400 - - private WorkerThread[] ioThreads; - private WorkerThread[] nonIoThreads; - - ConcurrentWorkStealingPipeFactory<?>[] pipeFactories; - - @Override - public void init() { - super.init(); - - this.ioThreads = new WorkerThread[2]; - - final IPipeline readerThreadPipeline = this.readerThreadPipeline(); - @SuppressWarnings("unchecked") - final Distributor<File> distributor = (Distributor<File>) readerThreadPipeline.getStages().get(readerThreadPipeline.getStages().size() - 1); - this.ioThreads[0] = new WorkerThread(readerThreadPipeline, 1); - this.ioThreads[0].setName("startThread"); - this.ioThreads[0].setTerminationPolicy(StageTerminationPolicy.TERMINATE_STAGE_AFTER_UNSUCCESSFUL_EXECUTION); - - final IPipeline printingThreadPipeline = this.printingThreadPipeline(); - @SuppressWarnings("unchecked") - final Merger<Pair<File, Integer>> merger = (Merger<Pair<File, Integer>>) printingThreadPipeline.getStages().get(0); - this.ioThreads[1] = new WorkerThread(printingThreadPipeline, 2); - this.ioThreads[1].setName("printingThread"); - this.ioThreads[1].setTerminationPolicy(StageTerminationPolicy.TERMINATE_STAGE_AFTER_UNSUCCESSFUL_EXECUTION); - - this.createPipeFactories(); - - int numThreads = Runtime.getRuntime().availableProcessors(); - numThreads = Math.min(MAX_NUM_THREADS, numThreads); // only for testing purposes - System.out.println("Using " + numThreads + " Threads."); - - this.nonIoThreads = new WorkerThread[numThreads]; - for (int i = 0; i < this.nonIoThreads.length; i++) { - final IPipeline pipeline = this.buildNonIoPipeline(distributor, merger); - this.nonIoThreads[i] = new WorkerThread(pipeline, 0); - this.nonIoThreads[i].setTerminationPolicy(StageTerminationPolicy.TERMINATE_STAGE_AFTER_UNSUCCESSFUL_EXECUTION); - } - } - - @Override - public void start() { - super.start(); - - for (final WorkerThread thread : this.ioThreads) { - thread.start(); - } - - for (final WorkerThread thread : this.nonIoThreads) { - thread.start(); - } - - System.out.println("Waiting for the non I/O worker threads to terminate..."); // NOPMD (Just for example purposes) - for (final WorkerThread thread : this.nonIoThreads) { - try { - thread.join(60 * SECONDS); - } catch (final InterruptedException e) { - throw new IllegalStateException(); - } - } - - System.out.println("Waiting for the I/O worker threads to terminate..."); // NOPMD (Just for example purposes) - for (final WorkerThread thread : this.ioThreads) { - try { - thread.join(60 * SECONDS); - } catch (final InterruptedException e) { - throw new IllegalStateException(); - } - } - - System.out.println("Analysis finished."); // NOPMD (Just for example purposes) - } - - private void createPipeFactories() { - this.pipeFactories = new ConcurrentWorkStealingPipeFactory[4]; - this.pipeFactories[0] = new ConcurrentWorkStealingPipeFactory<File>(); - this.pipeFactories[1] = new ConcurrentWorkStealingPipeFactory<File>(); - this.pipeFactories[2] = new ConcurrentWorkStealingPipeFactory<Pair<File, Integer>>(); - this.pipeFactories[3] = new ConcurrentWorkStealingPipeFactory<Pair<File, Integer>>(); - } - - private IPipeline readerThreadPipeline() { - // create stages - final RepeaterSource<String> repeaterSource = RepeaterSource.create(START_DIRECTORY_NAME, NUM_TOKENS_TO_REPEAT); - repeaterSource.setAccessesDeviceId(1); - final DirectoryName2Files directoryName2Files = new DirectoryName2Files(); - directoryName2Files.setAccessesDeviceId(1); - final Distributor<File> distributor = new Distributor<File>(); - distributor.setAccessesDeviceId(1); - - // add each stage to a stage list - final List<IStage> startStages = new LinkedList<IStage>(); - startStages.add(repeaterSource); - - final List<IStage> stages = new LinkedList<IStage>(); - stages.add(repeaterSource); - stages.add(directoryName2Files); - stages.add(distributor); - - // connect stages by pipes - QueuePipe.connect(repeaterSource.OUTPUT, directoryName2Files.DIRECTORY_NAME); - QueuePipe.connect(directoryName2Files.fileOutputPort, distributor.genericInputPort); - - repeaterSource.START.setAssociatedPipe(new MethodCallPipe<Boolean>(Boolean.TRUE)); - repeaterSource.START.setState(PortState.CLOSED); - - final Pipeline pipeline = new Pipeline(); - pipeline.setStartStages(startStages); - pipeline.setStages(stages); - return pipeline; - } - - private IPipeline buildNonIoPipeline(final Distributor<File> readerDistributor, final Merger<Pair<File, Integer>> printingMerger) { - // create stages - final Distributor<File> distributor = new Distributor<File>(); - final CountWordsStage countWordsStage0 = new CountWordsStage(); - final CountWordsStage countWordsStage1 = new CountWordsStage(); - final Merger<Pair<File, Integer>> merger = new Merger<Pair<File, Integer>>(); - - // add each stage to a stage list - final List<IStage> startStages = new LinkedList<IStage>(); - startStages.add(distributor); - - final List<IStage> stages = new LinkedList<IStage>(); - stages.add(distributor); - stages.add(countWordsStage0); - stages.add(countWordsStage1); - stages.add(merger); - - // connect stages by pipes - SingleProducerSingleConsumerPipe.connect(readerDistributor.getNewOutputPort(), distributor.genericInputPort); - - this.connectWithStealAwarePipe(this.pipeFactories[0], distributor.getNewOutputPort(), countWordsStage0.FILE); - this.connectWithStealAwarePipe(this.pipeFactories[1], distributor.getNewOutputPort(), countWordsStage1.FILE); - this.connectWithStealAwarePipe(this.pipeFactories[2], countWordsStage0.WORDSCOUNT, merger.getNewInputPort()); - this.connectWithStealAwarePipe(this.pipeFactories[3], countWordsStage1.WORDSCOUNT, merger.getNewInputPort()); - - SingleProducerSingleConsumerPipe.connect(merger.outputPort, printingMerger.getNewInputPort()); - - final Pipeline pipeline = new Pipeline(); - pipeline.setStartStages(startStages); - pipeline.setStages(stages); - return pipeline; - } - - private IPipeline printingThreadPipeline() { - // create stages - final Merger<Pair<File, Integer>> merger = new Merger<Pair<File, Integer>>(); - merger.setAccessesDeviceId(2); - final OutputWordsCountSink outputWordsCountStage = new OutputWordsCountSink(); - outputWordsCountStage.setAccessesDeviceId(2); - - // add each stage to a stage list - final List<IStage> startStages = new LinkedList<IStage>(); - startStages.add(merger); - - final List<IStage> stages = new LinkedList<IStage>(); - stages.add(merger); - stages.add(outputWordsCountStage); - - // connect stages by pipes - QueuePipe.connect(merger.outputPort, outputWordsCountStage.fileWordcountTupleInputPort); - - final Pipeline pipeline = new Pipeline(); - pipeline.setStartStages(startStages); - pipeline.setStages(stages); - return pipeline; - } - - private <A extends ISource, B extends ISink<B>, T> void connectWithStealAwarePipe(final ConcurrentWorkStealingPipeFactory<?> pipeFactory, - final IOutputPort<A, T> sourcePort, final IInputPort<B, T> targetPort) { - @SuppressWarnings("unchecked") - final ConcurrentWorkStealingPipe<T> pipe = (ConcurrentWorkStealingPipe<T>) pipeFactory.create(); - pipe.setSourcePort(sourcePort); - pipe.setTargetPort(targetPort); - } - - /** - * @since 1.10 - */ - public static void main(final String[] args) { - final ConcurrentCountWordsAnalysis analysis = new ConcurrentCountWordsAnalysis(); - analysis.init(); - final long start = System.currentTimeMillis(); - analysis.start(); - final long end = System.currentTimeMillis(); - // analysis.terminate(); - final long duration = end - start; - System.out.println("duration: " + duration + " ms"); // NOPMD (Just for example purposes) - - analysis.analyzeThreads(); - } - - private void analyzeThreads() { - long maxDuration = -1; - WorkerThread maxThread = null; - - // FIXME resolve bug; see analysis results below; - // - // --- Thread[startThread,5,] --- - // {RepeaterSource: numPushedElements={numPushedElements=1000, numTakenElements=1}} - // {DirectoryName2Files: numPushedElements={numPushedElements=16000, numTakenElements=1000}} - // {Distributor: numPushedElements={numPushedElements=16000, numTakenElements=16000}} - // --- Thread[Thread-2,5,] --- - // {Distributor: numPushedElements={numPushedElements=16008, numTakenElements=16008}} - // - // cause: the non-io distributor is executed faster than the io distributor - - for (final WorkerThread thread : this.ioThreads) { - System.out.println("--- " + thread + " ---"); // NOPMD (Just for example purposes) - for (final IStage stage : thread.getPipeline().getStages()) { - System.out.println(stage); // NOPMD (Just for example purposes) - } - - // final long durationInNs = thread.getDurationInNs(); - // System.out.println(thread + " takes " + TimeUnit.NANOSECONDS.toMillis(durationInNs) + " ms"); - } - - for (final WorkerThread thread : this.nonIoThreads) { - System.out.println("--- " + thread + " ---"); // NOPMD (Just for example purposes) - for (final IStage stage : thread.getPipeline().getStages()) { - System.out.println(stage); // NOPMD (Just for example purposes) - } - - // final long durationInNs = thread.getDurationInNs(); - // System.out.println(thread + " takes " + TimeUnit.NANOSECONDS.toMillis(durationInNs) + " ms"); - - // if (durationInNs > maxDuration) { - // maxDuration = durationInNs; - // maxThread = thread; - // } - } - - // System.out.println("maxThread: " + maxThread.toString() + " takes " + TimeUnit.NANOSECONDS.toMillis(maxDuration) + " ms"); // NOPMD (Just for example - // purposes) - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/examples/countWords/CountWordsAnalysis.java b/src/main/java/teetime/variant/explicitScheduling/examples/countWords/CountWordsAnalysis.java deleted file mode 100644 index feba3ab0..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/examples/countWords/CountWordsAnalysis.java +++ /dev/null @@ -1,135 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.examples.countWords; - -import java.io.File; -import java.util.LinkedList; -import java.util.List; - -import teetime.util.Pair; -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.explicitScheduling.framework.core.IPipeline; -import teetime.variant.explicitScheduling.framework.core.IStage; -import teetime.variant.explicitScheduling.framework.core.Pipeline; -import teetime.variant.explicitScheduling.framework.core.IInputPort.PortState; -import teetime.variant.explicitScheduling.framework.sequential.MethodCallPipe; -import teetime.variant.explicitScheduling.stage.basic.RepeaterSource; -import teetime.variant.explicitScheduling.stage.basic.distributor.Distributor; -import teetime.variant.explicitScheduling.stage.basic.merger.Merger; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class CountWordsAnalysis extends Analysis { - - private static final int NUM_TOKENS_TO_REPEAT = 1000; - private static final String START_DIRECTORY_NAME = "."; - - private IPipeline pipeline; - - @Override - public void init() { - super.init(); - - this.pipeline = this.buildNonIoPipeline(); - } - - @Override - public void start() { - super.start(); - try { - this.pipeline.fireStartNotification(); - } catch (final Exception e) { - e.printStackTrace(); - } - - this.pipeline.getStartStages().get(0).execute(); - - try { - this.pipeline.fireStopNotification(); - } catch (final Exception e) { - e.printStackTrace(); - } - } - - private IPipeline buildNonIoPipeline() { - // create stages - final RepeaterSource<String> repeaterSource = RepeaterSource.create(START_DIRECTORY_NAME, NUM_TOKENS_TO_REPEAT); - final DirectoryName2Files findFilesStage = new DirectoryName2Files(); - final Distributor<File> distributor = new Distributor<File>(); - final CountWordsStage countWordsStage0 = new CountWordsStage(); - final CountWordsStage countWordsStage1 = new CountWordsStage(); - final Merger<Pair<File, Integer>> merger = new Merger<Pair<File, Integer>>(); - final OutputWordsCountSink outputWordsCountStage = new OutputWordsCountSink(); - - // add each stage to a stage list - final List<IStage> startStages = new LinkedList<IStage>(); - startStages.add(repeaterSource); - - final List<IStage> stages = new LinkedList<IStage>(); - stages.add(repeaterSource); - stages.add(findFilesStage); - stages.add(distributor); - stages.add(countWordsStage0); - stages.add(countWordsStage1); - stages.add(merger); - stages.add(outputWordsCountStage); - - // connect stages by pipes - MethodCallPipe.connect(repeaterSource.OUTPUT, findFilesStage.DIRECTORY_NAME); - MethodCallPipe.connect(findFilesStage.fileOutputPort, distributor.genericInputPort); - MethodCallPipe.connect(distributor.getNewOutputPort(), countWordsStage0.FILE); - MethodCallPipe.connect(distributor.getNewOutputPort(), countWordsStage1.FILE); - MethodCallPipe.connect(countWordsStage0.WORDSCOUNT, merger.getNewInputPort()); - MethodCallPipe.connect(countWordsStage1.WORDSCOUNT, merger.getNewInputPort()); - MethodCallPipe.connect(merger.outputPort, outputWordsCountStage.fileWordcountTupleInputPort); - - repeaterSource.START.setAssociatedPipe(new MethodCallPipe<Boolean>(Boolean.TRUE)); - repeaterSource.START.setState(PortState.CLOSED); - - final Pipeline pipeline = new Pipeline(); - pipeline.setStartStages(startStages); - pipeline.setStages(stages); - return pipeline; - } - - public static void main(final String[] args) { - final CountWordsAnalysis analysis = new CountWordsAnalysis(); - analysis.init(); - final long start = System.currentTimeMillis(); - analysis.start(); - final long end = System.currentTimeMillis(); - // analysis.terminate(); - final long duration = end - start; - System.out.println("duration: " + duration + " ms"); // NOPMD (Just for example purposes) - - for (final IStage stage : analysis.pipeline.getStages()) { - if (stage instanceof AbstractFilter<?>) { -// System.out.println(stage.getClass().getName() + ": " + ((AbstractFilter<?>) stage).getOverallDurationInNs()); // NOPMD (Just for example purposes) - } - } - - final DirectoryName2Files findFilesStage = (DirectoryName2Files) analysis.pipeline.getStages().get(1); - System.out.println("findFilesStage: " + findFilesStage.getNumFiles()); // NOPMD (Just for example purposes) - - final OutputWordsCountSink outputWordsCountStage = (OutputWordsCountSink) analysis.pipeline.getStages().get(6); - System.out.println("outputWordsCountStage: " + outputWordsCountStage.getNumFiles()); // NOPMD (Just for example purposes) - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/examples/countWords/CountWordsStage.java b/src/main/java/teetime/variant/explicitScheduling/examples/countWords/CountWordsStage.java deleted file mode 100644 index 33e8f9c2..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/examples/countWords/CountWordsStage.java +++ /dev/null @@ -1,80 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.examples.countWords; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.regex.Pattern; - -import teetime.util.Pair; -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class CountWordsStage extends AbstractFilter<CountWordsStage> { - - public final IInputPort<CountWordsStage, File> FILE = this.createInputPort(); - - public final IOutputPort<CountWordsStage, Exception> EXCEPTION = this.createOutputPort(); - public final IOutputPort<CountWordsStage, Pair<File, Integer>> WORDSCOUNT = this.createOutputPort(); - - private final Pattern pattern = Pattern.compile("[^\\p{Graph}]"); - - @Override - protected boolean execute(final Context<CountWordsStage> context) { - final File file = context.tryTake(this.FILE); - if (file == null) { - return false; - } - - int wordsCount = 0; - try { - final BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8")); - try { - String line; - while ((line = reader.readLine()) != null) { - line = line.trim(); - if (line.length() > 0) { - final String[] words = this.pattern.split(line); - // System.out.println("" + Arrays.toString(words)); - wordsCount += words.length; - } - } - } finally { - reader.close(); - } - context.put(this.WORDSCOUNT, Pair.of(file, wordsCount)); - } catch (final FileNotFoundException e) { - context.put(this.EXCEPTION, e); - } catch (final IOException e) { - context.put(this.EXCEPTION, e); - } - - return true; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/examples/countWords/DirectoryName2Files.java b/src/main/java/teetime/variant/explicitScheduling/examples/countWords/DirectoryName2Files.java deleted file mode 100644 index 54f422be..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/examples/countWords/DirectoryName2Files.java +++ /dev/null @@ -1,66 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.examples.countWords; - -import java.io.File; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class DirectoryName2Files extends AbstractFilter<DirectoryName2Files> { - - public final IInputPort<DirectoryName2Files, String> DIRECTORY_NAME = this.createInputPort(); - - public final IOutputPort<DirectoryName2Files, File> fileOutputPort = this.createOutputPort(); - - private int numFiles = 0; - - public DirectoryName2Files() { - // this.setAccessesDeviceId(1); - } - - @Override - protected boolean execute(final Context<DirectoryName2Files> context) { - final String inputDir = context.tryTake(this.DIRECTORY_NAME); - if (inputDir == null) { - return false; - } - - final File[] availableFiles = new File(inputDir).listFiles(); - for (final File file : availableFiles) { - if (file.isFile()) { - // this.logger.info("Sending " + file); - context.put(this.fileOutputPort, file); - this.numFiles++; - } - } - - return true; - } - - public int getNumFiles() { - return this.numFiles; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/examples/countWords/OutputWordsCountSink.java b/src/main/java/teetime/variant/explicitScheduling/examples/countWords/OutputWordsCountSink.java deleted file mode 100644 index 8ac5dfe5..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/examples/countWords/OutputWordsCountSink.java +++ /dev/null @@ -1,69 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.examples.countWords; - -import java.io.File; - -import teetime.util.Pair; -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class OutputWordsCountSink extends AbstractFilter<OutputWordsCountSink> { - - public final IInputPort<OutputWordsCountSink, Pair<File, Integer>> fileWordcountTupleInputPort = this.createInputPort(); - - private int numFiles = 0; - - public OutputWordsCountSink() { - // this.setAccessesDeviceId(2); - } - - @Override - protected boolean execute(final Context<OutputWordsCountSink> context) { - final Pair<File, Integer> pair = context.tryTake(this.fileWordcountTupleInputPort); - if (pair == null) { - return false; - } - - // final File file = pair.getFirst(); - // final Number wordsCount = pair.getSecond(); - // System.out.println(wordsCount + " words in file '" + file.getAbsolutePath() + "'"); // NOPMD (Just for example purposes) - this.numFiles++; - - return true; - } - - /** - * @since 1.10 - * @return - */ - public int getNumFiles() { - return this.numFiles; - } - - @Override - public String toString() { - return super.toString() + ", numFiles = " + this.numFiles; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/examples/countWords/QueuedCountWordsAnalysis.java b/src/main/java/teetime/variant/explicitScheduling/examples/countWords/QueuedCountWordsAnalysis.java deleted file mode 100644 index e77ac45f..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/examples/countWords/QueuedCountWordsAnalysis.java +++ /dev/null @@ -1,143 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.examples.countWords; - -import java.io.File; -import java.util.LinkedList; -import java.util.List; - -import teetime.util.Pair; -import teetime.variant.explicitScheduling.framework.concurrent.StageTerminationPolicy; -import teetime.variant.explicitScheduling.framework.concurrent.WorkerThread; -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.explicitScheduling.framework.core.IPipeline; -import teetime.variant.explicitScheduling.framework.core.IStage; -import teetime.variant.explicitScheduling.framework.core.Pipeline; -import teetime.variant.explicitScheduling.framework.core.IInputPort.PortState; -import teetime.variant.explicitScheduling.framework.sequential.MethodCallPipe; -import teetime.variant.explicitScheduling.framework.sequential.QueuePipe; -import teetime.variant.explicitScheduling.stage.basic.RepeaterSource; -import teetime.variant.explicitScheduling.stage.basic.distributor.Distributor; -import teetime.variant.explicitScheduling.stage.basic.merger.Merger; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class QueuedCountWordsAnalysis extends Analysis { - - private static final int NUM_TOKENS_TO_REPEAT = 1000; - private static final String START_DIRECTORY_NAME = "."; - private static final int SECONDS = 1000; - - private WorkerThread workerThread; - - @Override - public void init() { - super.init(); - - final IPipeline pipeline = this.buildNonIoPipeline(); - - this.workerThread = new WorkerThread(pipeline, 0); - } - - @Override - public void start() { - super.start(); - - this.workerThread.setTerminationPolicy(StageTerminationPolicy.TERMINATE_STAGE_AFTER_UNSUCCESSFUL_EXECUTION); - - this.workerThread.start(); - try { - this.workerThread.join(60 * SECONDS); - } catch (final InterruptedException e) { - e.printStackTrace(); - } - } - - private IPipeline buildNonIoPipeline() { - // create stages - final RepeaterSource<String> repeaterSource = RepeaterSource.create(START_DIRECTORY_NAME, NUM_TOKENS_TO_REPEAT); - final DirectoryName2Files findFilesStage = new DirectoryName2Files(); - final Distributor<File> distributor = new Distributor<File>(); - final CountWordsStage countWordsStage0 = new CountWordsStage(); - final CountWordsStage countWordsStage1 = new CountWordsStage(); - final Merger<Pair<File, Integer>> merger = new Merger<Pair<File, Integer>>(); - final OutputWordsCountSink outputWordsCountStage = new OutputWordsCountSink(); - - // add each stage to a stage list - final List<IStage> startStages = new LinkedList<IStage>(); - startStages.add(repeaterSource); - - final List<IStage> stages = new LinkedList<IStage>(); - stages.add(repeaterSource); - stages.add(findFilesStage); - stages.add(distributor); - stages.add(countWordsStage0); - stages.add(countWordsStage1); - stages.add(merger); - stages.add(outputWordsCountStage); - - // connect stages by pipes - QueuePipe.connect(repeaterSource.OUTPUT, findFilesStage.DIRECTORY_NAME); - QueuePipe.connect(findFilesStage.fileOutputPort, distributor.genericInputPort); - QueuePipe.connect(distributor.getNewOutputPort(), countWordsStage0.FILE); - QueuePipe.connect(distributor.getNewOutputPort(), countWordsStage1.FILE); - QueuePipe.connect(countWordsStage0.WORDSCOUNT, merger.getNewInputPort()); - QueuePipe.connect(countWordsStage1.WORDSCOUNT, merger.getNewInputPort()); - QueuePipe.connect(merger.outputPort, outputWordsCountStage.fileWordcountTupleInputPort); - - repeaterSource.START.setAssociatedPipe(new MethodCallPipe<Boolean>(Boolean.TRUE)); - repeaterSource.START.setState(PortState.CLOSED); - - final Pipeline pipeline = new Pipeline(); - pipeline.setStartStages(startStages); - pipeline.setStages(stages); - return pipeline; - } - - WorkerThread getWorkerThread() { - return this.workerThread; - } - - public static void main(final String[] args) { - final QueuedCountWordsAnalysis analysis = new QueuedCountWordsAnalysis(); - analysis.init(); - final long start = System.currentTimeMillis(); - analysis.start(); - final long end = System.currentTimeMillis(); - // analysis.terminate(); - final long duration = end - start; - System.out.println("duration: " + duration + " ms"); // NOPMD (Just for example purposes) - - final IPipeline pipeline = analysis.workerThread.getPipeline(); - - for (final IStage stage : pipeline.getStages()) { - if (stage instanceof AbstractFilter<?>) { - // System.out.println(stage.getClass().getName() + ": " + ((AbstractFilter<?>) stage).getOverallDurationInNs()); // NOPMD (Just for example purposes) - } - } - - final DirectoryName2Files findFilesStage = (DirectoryName2Files) pipeline.getStages().get(1); - System.out.println("findFilesStage: " + findFilesStage.getNumFiles()); // NOPMD (Just for example purposes) - - final OutputWordsCountSink outputWordsCountStage = (OutputWordsCountSink) pipeline.getStages().get(6); - System.out.println("outputWordsCountStage: " + outputWordsCountStage.getNumFiles()); // NOPMD (Just for example purposes) - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/examples/countingObjects/CountingObjectsAnalysis.java b/src/main/java/teetime/variant/explicitScheduling/examples/countingObjects/CountingObjectsAnalysis.java deleted file mode 100644 index 4e91a737..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/examples/countingObjects/CountingObjectsAnalysis.java +++ /dev/null @@ -1,142 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.examples.countingObjects; - -import java.io.File; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; - -import teetime.variant.explicitScheduling.examples.countWords.DirectoryName2Files; -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.explicitScheduling.framework.core.IPipeline; -import teetime.variant.explicitScheduling.framework.core.IStage; -import teetime.variant.explicitScheduling.framework.sequential.MethodCallPipe; -import teetime.variant.explicitScheduling.stage.TypeLoggerFilter; -import teetime.variant.explicitScheduling.stage.basic.RepeaterSource; -import teetime.variant.explicitScheduling.stage.composite.CycledCountingFilter; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class CountingObjectsAnalysis extends Analysis { - - private IPipeline pipeline; - - @Override - public void init() { - super.init(); - - this.pipeline = this.buildNonIoPipeline(); - } - - private IPipeline buildNonIoPipeline() { - // create stages - final RepeaterSource<String> repeaterSource = RepeaterSource.create(".", 1); - final DirectoryName2Files findFilesStage = new DirectoryName2Files(); - final CycledCountingFilter<File> cycledCountingFilter = CycledCountingFilter.create(new MethodCallPipe<Long>(0L)); - final TypeLoggerFilter<File> typeLoggerFilter = TypeLoggerFilter.create(); - - // add each stage to a stage list - final List<IStage> stages = new LinkedList<IStage>(); - stages.add(repeaterSource); - stages.add(findFilesStage); - stages.add(cycledCountingFilter); - stages.add(typeLoggerFilter); - - // connect stages by pipes - MethodCallPipe.connect(repeaterSource.OUTPUT, findFilesStage.DIRECTORY_NAME); - MethodCallPipe.connect(findFilesStage.fileOutputPort, cycledCountingFilter.INPUT_OBJECT); - MethodCallPipe.connect(cycledCountingFilter.RELAYED_OBJECT, typeLoggerFilter.INPUT_OBJECT); - - repeaterSource.START.setAssociatedPipe(new MethodCallPipe<Boolean>(Boolean.TRUE)); - - final IPipeline pipeline = new IPipeline() { - @Override - @SuppressWarnings("unchecked") - public List<? extends IStage> getStartStages() { - return Arrays.asList(repeaterSource); - } - - @Override - public List<IStage> getStages() { - return stages; - } - - @Override - public void fireStartNotification() throws Exception { - for (final IStage stage : this.getStartStages()) { - stage.notifyPipelineStarts(); - } - } - - @Override - public void fireStopNotification() { - for (final IStage stage : this.getStartStages()) { - stage.notifyPipelineStops(); - } - } - }; - return pipeline; - } - - @Override - public void start() { - super.start(); - try { - this.pipeline.fireStartNotification(); - } catch (final Exception e) { - e.printStackTrace(); - } - - this.pipeline.getStartStages().get(0).execute(); - - try { - this.pipeline.fireStopNotification(); - } catch (final Exception e) { - e.printStackTrace(); - } - } - - /** - * @since 1.10 - * @param args - */ - public static void main(final String[] args) { - final CountingObjectsAnalysis analysis = new CountingObjectsAnalysis(); - analysis.init(); - final long start = System.currentTimeMillis(); - analysis.start(); - final long end = System.currentTimeMillis(); - // analysis.terminate(); - final long duration = end - start; - System.out.println("duration: " + duration + " ms"); // NOPMD (Just for example purposes) - - for (final IStage stage : analysis.pipeline.getStages()) { - if (stage instanceof AbstractFilter<?>) { -// System.out.println(stage.getClass().getName() + ": " + ((AbstractFilter<?>) stage).getOverallDurationInNs()); // NOPMD (Just for example purposes) - } - } - - @SuppressWarnings("unchecked") - final CycledCountingFilter<File> cycledCountingFilter = (CycledCountingFilter<File>) analysis.pipeline.getStages().get(2); - System.out.println("count: " + cycledCountingFilter.getCurrentCount()); // NOPMD (Just for example purposes) - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/examples/recordReader/RecordReaderAnalysis.java b/src/main/java/teetime/variant/explicitScheduling/examples/recordReader/RecordReaderAnalysis.java deleted file mode 100644 index 670aca57..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/examples/recordReader/RecordReaderAnalysis.java +++ /dev/null @@ -1,169 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.examples.recordReader; - -import java.io.File; -import java.util.LinkedList; -import java.util.List; - -import teetime.variant.explicitScheduling.framework.concurrent.StageTerminationPolicy; -import teetime.variant.explicitScheduling.framework.concurrent.WorkerThread; -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.framework.core.IPipe; -import teetime.variant.explicitScheduling.framework.core.IPipeline; -import teetime.variant.explicitScheduling.framework.core.ISink; -import teetime.variant.explicitScheduling.framework.core.ISource; -import teetime.variant.explicitScheduling.framework.core.IStage; -import teetime.variant.explicitScheduling.framework.sequential.MethodCallPipe; -import teetime.variant.explicitScheduling.framework.sequential.QueuePipe; -import teetime.variant.explicitScheduling.framework.util.BaseStage2StageExtractor; -import teetime.variant.explicitScheduling.stage.CollectorSink; -import teetime.variant.explicitScheduling.stage.kieker.File2RecordFilter; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistryRepository; - -import kieker.common.record.IMonitoringRecord; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class RecordReaderAnalysis extends Analysis { - - private static final int SECONDS = 1000; - - private WorkerThread workerThread; - - private File2RecordFilter file2RecordFilter; - private CollectorSink<IMonitoringRecord> collector; - - private ClassNameRegistryRepository classNameRegistryRepository; - - @Override - public void init() { - super.init(); - final IPipeline pipeline = this.buildPipeline(); - this.workerThread = new WorkerThread(pipeline, 0); - } - - @Override - public void start() { - super.start(); - - this.workerThread.setTerminationPolicy(StageTerminationPolicy.TERMINATE_STAGE_AFTER_UNSUCCESSFUL_EXECUTION); - - this.workerThread.start(); - try { - this.workerThread.join(60 * SECONDS); - } catch (final InterruptedException e) { - e.printStackTrace(); - } - } - - void setInputFile(final File file) { - this.file2RecordFilter.fileInputPort.setAssociatedPipe(new MethodCallPipe<File>(file)); - } - - private IPipeline buildPipeline() { - final BaseStage2StageExtractor baseStage2StageExtractor = new BaseStage2StageExtractor(); - - this.classNameRegistryRepository = new ClassNameRegistryRepository(); - // create stages - this.file2RecordFilter = new File2RecordFilter(this.classNameRegistryRepository); - this.collector = new CollectorSink<IMonitoringRecord>(); - - // add each stage to a stage list - final List<IStage> stages = new LinkedList<IStage>(); - stages.addAll(baseStage2StageExtractor.extract(this.file2RecordFilter)); - stages.add(this.collector); - - // connect stages by pipes - final List<IPipe<?>> pipes = new LinkedList<IPipe<?>>(); - pipes.add(this.connectWithSequentialPipe(this.file2RecordFilter.recordOutputPort, this.collector.objectInputPort)); - - final IPipeline pipeline = new IPipeline() { - @Override - @SuppressWarnings("unchecked") - public List<? extends IStage> getStartStages() { - return baseStage2StageExtractor.extract(RecordReaderAnalysis.this.file2RecordFilter); - } - - @Override - public List<IStage> getStages() { - return stages; - } - - @Override - public void fireStartNotification() throws Exception { - for (final IStage stage : this.getStartStages()) { - stage.notifyPipelineStarts(); - } - } - - @Override - public void fireStopNotification() { - for (final IStage stage : this.getStartStages()) { - stage.notifyPipelineStops(); - } - } - }; - - return pipeline; - } - - private <A extends ISource, B extends ISink<B>, T> IPipe<T> connectWithSequentialPipe(final IOutputPort<A, T> sourcePort, - final IInputPort<B, T> targetPort) { - final IPipe<T> pipe = new QueuePipe<T>(); - pipe.setSourcePort(sourcePort); - pipe.setTargetPort(targetPort); - return pipe; - } - - WorkerThread getWorkerThread() { - return this.workerThread; - } - - public static void main(final String[] args) { - final RecordReaderAnalysis analysis = new RecordReaderAnalysis(); - analysis.init(); - final long start = System.currentTimeMillis(); - analysis.start(); - final long end = System.currentTimeMillis(); - // analysis.terminate(); - final long duration = end - start; - System.out.println("duration: " + duration + " ms"); // NOPMD (Just for example purposes) - - final IPipeline pipeline = analysis.workerThread.getPipeline(); - - for (final IStage stage : pipeline.getStages()) { - if (stage instanceof AbstractFilter<?>) { - // System.out.println(stage.getClass().getName() + ": " + ((AbstractFilter<?>) stage).getOverallDurationInNs()); // NOPMD (Just for example purposes) - } - } - } - - void setOutputRecordList(final List<IMonitoringRecord> records) { - this.collector.setObjects(records); - } - - public ClassNameRegistryRepository getClassNameRegistryRepository() { - return this.classNameRegistryRepository; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputAnalysis.java b/src/main/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputAnalysis.java deleted file mode 100644 index 796ba92d..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputAnalysis.java +++ /dev/null @@ -1,120 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.examples.throughput; - -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.Callable; - -import teetime.variant.explicitScheduling.framework.concurrent.StageTerminationPolicy; -import teetime.variant.explicitScheduling.framework.concurrent.WorkerThread; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.explicitScheduling.framework.core.IPipeline; -import teetime.variant.explicitScheduling.framework.core.IStage; -import teetime.variant.explicitScheduling.framework.core.Pipeline; -import teetime.variant.explicitScheduling.framework.sequential.QueuePipe; -import teetime.variant.explicitScheduling.stage.NoopFilter; -import teetime.variant.explicitScheduling.stage.basic.ObjectProducer; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class ThroughputAnalysis<T> extends Analysis { - - private static final int SECONDS = 1000; - - private WorkerThread workerThread; - - private int numNoopFilters; - - private int numInputObjects; - - private Callable<T> inputObjectCreator; - - @Override - public void init() { - super.init(); - final IPipeline pipeline = this.buildPipeline(this.numNoopFilters); - - this.workerThread = new WorkerThread(pipeline, 0); - this.workerThread.setTerminationPolicy(StageTerminationPolicy.TERMINATE_STAGE_AFTER_UNSUCCESSFUL_EXECUTION); - } - - /** - * @param numNoopFilters - * @since 1.10 - */ - private IPipeline buildPipeline(final int numNoopFilters) { - @SuppressWarnings("unchecked") - final NoopFilter<T>[] noopFilters = new NoopFilter[numNoopFilters]; - // create stages - final ObjectProducer<T> objectProducer = new ObjectProducer<T>(this.numInputObjects, this.inputObjectCreator); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<T>(); - } - - // add each stage to a stage list - final List<IStage> startStages = new LinkedList<IStage>(); - startStages.add(objectProducer); - - final List<IStage> stages = new LinkedList<IStage>(); - stages.add(objectProducer); - stages.addAll(Arrays.asList(noopFilters)); - - // connect stages by pipes - QueuePipe.connect(objectProducer.outputPort, noopFilters[0].inputPort); - for (int i = 1; i < noopFilters.length; i++) { - QueuePipe.connect(noopFilters[i - 1].outputPort, noopFilters[i].inputPort); - } - - final Pipeline pipeline = new Pipeline(); - pipeline.setStartStages(startStages); - pipeline.setStages(stages); - return pipeline; - } - - @Override - public void start() { - super.start(); - - this.workerThread.start(); - try { - this.workerThread.join(60 * SECONDS); - } catch (final InterruptedException e) { - e.printStackTrace(); - } - - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public void setNumNoopFilters(final int numNoopFilters) { - this.numNoopFilters = numNoopFilters; - } - - /** - * @since 1.10 - */ - public void setInput(final int numInputObjects, final Callable<T> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputTimestampAnalysis.java b/src/main/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputTimestampAnalysis.java deleted file mode 100644 index ff70703f..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputTimestampAnalysis.java +++ /dev/null @@ -1,191 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.examples.throughput; - -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.Callable; -import java.util.concurrent.TimeUnit; - -import teetime.variant.explicitScheduling.framework.concurrent.StageTerminationPolicy; -import teetime.variant.explicitScheduling.framework.concurrent.WorkerThread; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.explicitScheduling.framework.core.IPipeline; -import teetime.variant.explicitScheduling.framework.core.IStage; -import teetime.variant.explicitScheduling.framework.core.Pipeline; -import teetime.variant.explicitScheduling.framework.sequential.MethodCallPipe; -import teetime.variant.explicitScheduling.framework.sequential.ReservableQueuePipe; -import teetime.variant.explicitScheduling.stage.CollectorSink; -import teetime.variant.explicitScheduling.stage.NoopFilter; -import teetime.variant.explicitScheduling.stage.StartTimestampFilter; -import teetime.variant.explicitScheduling.stage.StopTimestampFilter; -import teetime.variant.explicitScheduling.stage.basic.ObjectProducer; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class ThroughputTimestampAnalysis extends Analysis { - - private static final int SECONDS = 1000; - - private WorkerThread workerThread; - - private int numNoopFilters; - - private int numInputObjects; - - private Callable<TimestampObject> inputObjectCreator; - - private Collection<TimestampObject> timestampObjects; - - private boolean shouldUseQueue; - - @Override - public void init() { - super.init(); - final IPipeline pipeline = this.buildPipeline(this.numNoopFilters); - - this.workerThread = new WorkerThread(pipeline, 0); - this.workerThread.setTerminationPolicy(StageTerminationPolicy.TERMINATE_STAGE_AFTER_UNSUCCESSFUL_EXECUTION); - } - - /** - * @param numNoopFilters - * @since 1.10 - */ - private IPipeline buildPipeline(final int numNoopFilters) { - @SuppressWarnings("unchecked") - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[numNoopFilters]; - // create stages - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>( - this.numInputObjects, this.inputObjectCreator); - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - - // add each stage to a stage list - final List<IStage> startStages = new LinkedList<IStage>(); - startStages.add(objectProducer); - - final List<IStage> stages = new LinkedList<IStage>(); - stages.add(objectProducer); - stages.add(startTimestampFilter); - stages.addAll(Arrays.asList(noopFilters)); - stages.add(stopTimestampFilter); - stages.add(collectorSink); - - if (this.shouldUseQueue) { - // connect stages by pipes - ReservableQueuePipe.connect(objectProducer.outputPort, startTimestampFilter.inputPort); - ReservableQueuePipe.connect(startTimestampFilter.outputPort, noopFilters[0].inputPort); - for (int i = 1; i < noopFilters.length; i++) { - ReservableQueuePipe.connect(noopFilters[i - 1].outputPort, noopFilters[i].inputPort); - } - ReservableQueuePipe.connect(noopFilters[noopFilters.length - 1].outputPort, stopTimestampFilter.inputPort); - ReservableQueuePipe.connect(stopTimestampFilter.outputPort, collectorSink.objectInputPort); - } else { - startTimestampFilter.setSchedulable(false); - for (NoopFilter<TimestampObject> noopFilter : noopFilters) { - noopFilter.setSchedulable(false); - } - stopTimestampFilter.setSchedulable(false); - collectorSink.setSchedulable(false); - // connect stages by pipes - MethodCallPipe.connect(objectProducer.outputPort, startTimestampFilter.inputPort); - MethodCallPipe.connect(startTimestampFilter.outputPort, noopFilters[0].inputPort); - for (int i = 1; i < noopFilters.length; i++) { - MethodCallPipe.connect(noopFilters[i - 1].outputPort, noopFilters[i].inputPort); - } - MethodCallPipe.connect(noopFilters[noopFilters.length - 1].outputPort, stopTimestampFilter.inputPort); - MethodCallPipe.connect(stopTimestampFilter.outputPort, collectorSink.objectInputPort); - } - - final Pipeline pipeline = new Pipeline(); - pipeline.setStartStages(startStages); - pipeline.setStages(stages); - return pipeline; - } - - @Override - public void start() { - super.start(); - - this.workerThread.start(); - try { - this.workerThread.join(60 * SECONDS); - } catch (final InterruptedException e) { - e.printStackTrace(); - } - - List<Long> durationPer10000IterationsInNs = this.workerThread.getDurationPer10000IterationsInNs(); - - long overallSumInNs = 0; - for (int i = 0; i < durationPer10000IterationsInNs.size(); i++) { - overallSumInNs += durationPer10000IterationsInNs.get(i); - } - - long sumInNs = 0; - for (int i = durationPer10000IterationsInNs.size() / 2; i < durationPer10000IterationsInNs.size(); i++) { - sumInNs += durationPer10000IterationsInNs.get(i); - } - - System.out.println("Thread iterations: " + this.workerThread.getIterations() + " times"); - System.out.println("Thread execution time: " + TimeUnit.NANOSECONDS.toMillis(overallSumInNs) + " ms"); - System.out.println("Thread half duration/iterations: " + sumInNs / (this.workerThread.getIterations() / 2) - + " ns/iteration"); - System.out.println("Thread unsuccessfully executed stages: " + this.workerThread.getExecutedUnsuccessfullyCount() - + " times"); - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public void setNumNoopFilters(final int numNoopFilters) { - this.numNoopFilters = numNoopFilters; - } - - /** - * @since 1.10 - */ - public void setInput(final int numInputObjects, final Callable<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public Collection<TimestampObject> getTimestampObjects() { - return this.timestampObjects; - } - - public void setTimestampObjects(final Collection<TimestampObject> timestampObjects) { - this.timestampObjects = timestampObjects; - } - - public boolean isShouldUseQueue() { - return this.shouldUseQueue; - } - - public void setShouldUseQueue(final boolean shouldUseQueue) { - this.shouldUseQueue = shouldUseQueue; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/examples/traceReconstruction/TraceAnalysis.java b/src/main/java/teetime/variant/explicitScheduling/examples/traceReconstruction/TraceAnalysis.java deleted file mode 100644 index c54039f7..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/examples/traceReconstruction/TraceAnalysis.java +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.examples.traceReconstruction; - -import kieker.common.util.filesystem.FSUtil; - -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.explicitScheduling.stage.predicate.FileExtensionPredicate; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class TraceAnalysis extends Analysis { - - public static void main(final String[] args) { - // FSReader reader - // StringBufferFilter stringBufferFilter - // TimestampFilter timestampFilter - // TraceIdFilter traceIdFilter - // ExecutionRecordTransformationFilter execRecTransformer - // TraceReconstructionFilter mtReconstrFilter - // EventRecordTraceReconstructionFilter eventTraceReconstructionFilter - // EventRecordTraceCounter eventRecordTraceCounter - // TraceEventRecords2ExecutionAndMessageTraceFilter traceEvents2ExecutionAndMessageTraceFilter - - new FileExtensionPredicate(FSUtil.NORMAL_FILE_EXTENSION); - - // reader -> stringBufferFilter - - // stringBufferFilter -> timestampFilter.INPUT_PORT_NAME_EXECUTION - // stringBufferFilter -> timestampFilter.INPUT_PORT_NAME_FLOW - // timestampFilter -> traceIdFilter - - // traceIdFilter -> execRecTransformer - // execRecTransformer -> SYSTEM_ENTITY_FACTORY - - // mtReconstrFilter -> SYSTEM_ENTITY_FACTORY - // execRecTransformer -> mtReconstrFilter - - // traceIdFilter -> eventTraceReconstructionFilter - // eventTraceReconstructionFilter -> eventRecordTraceCounter.INPUT_PORT_NAME_VALID - // eventTraceReconstructionFilter -> eventRecordTraceCounter.INPUT_PORT_NAME_INVALID - - // eventTraceReconstructionFilter -> traceEvents2ExecutionAndMessageTraceFilter - // traceEvents2ExecutionAndMessageTraceFilter -> SYSTEM_ENTITY_FACTORY - } - - @Override - public void init() { - // TODO - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/examples/traceReconstruction/TraceReconstructionAnalysis.java b/src/main/java/teetime/variant/explicitScheduling/examples/traceReconstruction/TraceReconstructionAnalysis.java deleted file mode 100644 index bd24e17e..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/examples/traceReconstruction/TraceReconstructionAnalysis.java +++ /dev/null @@ -1,111 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.examples.traceReconstruction; - -import java.util.LinkedList; -import java.util.List; - -import teetime.variant.explicitScheduling.framework.concurrent.StageTerminationPolicy; -import teetime.variant.explicitScheduling.framework.concurrent.WorkerThread; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.explicitScheduling.framework.core.IPipeline; -import teetime.variant.explicitScheduling.framework.core.IStage; -import teetime.variant.explicitScheduling.stage.FileExtensionFilter; -import teetime.variant.explicitScheduling.stage.io.File2TextLinesFilter; -import teetime.variant.explicitScheduling.stage.kieker.MonitoringLogDirectory2Files; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistryCreationFilter; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistryRepository; -import teetime.variant.explicitScheduling.stage.kieker.fileToRecord.textLine.TextLine2RecordFilter; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class TraceReconstructionAnalysis extends Analysis { - private static final int SECONDS = 1000; - - private WorkerThread workerThread; - - private ClassNameRegistryRepository classNameRegistryRepository; - - @Override - public void init() { - super.init(); - final IPipeline pipeline = this.buildPipeline(); - this.workerThread = new WorkerThread(pipeline, 0); - } - - /** - * @since 1.10 - */ - private IPipeline buildPipeline() { - final ClassNameRegistryCreationFilter classNameRegistryCreationFilter = new ClassNameRegistryCreationFilter(this.classNameRegistryRepository); - final MonitoringLogDirectory2Files directory2FilesFilter = new MonitoringLogDirectory2Files(); - final FileExtensionFilter fileExtensionFilter = new FileExtensionFilter(); - final File2TextLinesFilter file2TextLinesFilter = new File2TextLinesFilter(); - final TextLine2RecordFilter textLine2RecordFilter = new TextLine2RecordFilter(this.classNameRegistryRepository); - - // TODO Auto-generated method stub - - // add each stage to a stage list - final LinkedList<IStage> startStages = new LinkedList<IStage>(); - - final List<IStage> stages = new LinkedList<IStage>(); - - final IPipeline pipeline = new IPipeline() { - @Override - public List<? extends IStage> getStartStages() { - return startStages; - } - - @Override - public List<IStage> getStages() { - return stages; - } - - @Override - public void fireStartNotification() throws Exception { - for (final IStage stage : this.getStartStages()) { - stage.notifyPipelineStarts(); - } - } - - @Override - public void fireStopNotification() { - for (final IStage stage : this.getStartStages()) { - stage.notifyPipelineStops(); - } - } - }; - - return pipeline; - } - - @Override - public void start() { - super.start(); - - this.workerThread.setTerminationPolicy(StageTerminationPolicy.TERMINATE_STAGE_AFTER_UNSUCCESSFUL_EXECUTION); - - this.workerThread.start(); - try { - this.workerThread.join(60 * SECONDS); - } catch (final InterruptedException e) { - e.printStackTrace(); - } - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/examples/traceReconstruction/TraceReconstructionAnalysis2.java b/src/main/java/teetime/variant/explicitScheduling/examples/traceReconstruction/TraceReconstructionAnalysis2.java deleted file mode 100644 index 8ae9a9ef..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/examples/traceReconstruction/TraceReconstructionAnalysis2.java +++ /dev/null @@ -1,163 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.examples.traceReconstruction; - -import java.util.LinkedList; -import java.util.List; - -import teetime.variant.explicitScheduling.framework.concurrent.StageTerminationPolicy; -import teetime.variant.explicitScheduling.framework.concurrent.WorkerThread; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.explicitScheduling.framework.core.IPipeline; -import teetime.variant.explicitScheduling.framework.core.IStage; -import teetime.variant.explicitScheduling.framework.core.Pipeline; -import teetime.variant.explicitScheduling.framework.sequential.QueuePipe; -import teetime.variant.explicitScheduling.stage.Cache; -import teetime.variant.explicitScheduling.stage.CountingFilter; -import teetime.variant.explicitScheduling.stage.InstanceOfFilter; -import teetime.variant.explicitScheduling.stage.io.File2TextLinesFilter; -import teetime.variant.explicitScheduling.stage.kieker.MonitoringLogDirectory2Files; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistryCreationFilter; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistryRepository; -import teetime.variant.explicitScheduling.stage.kieker.fileToRecord.textLine.TextLine2RecordFilter; -import teetime.variant.explicitScheduling.stage.kieker.traceReconstruction.TraceReconstructionFilter; -import teetime.variant.explicitScheduling.stage.predicate.IsIMonitoringRecordInRange; -import teetime.variant.explicitScheduling.stage.predicate.IsOperationExecutionRecordTraceIdPredicate; -import teetime.variant.explicitScheduling.stage.predicate.PredicateFilter; -import teetime.variant.explicitScheduling.stage.stringBuffer.StringBufferFilter; -import teetime.variant.explicitScheduling.stage.stringBuffer.handler.IMonitoringRecordHandler; -import teetime.variant.explicitScheduling.stage.stringBuffer.handler.StringHandler; -import teetime.variant.explicitScheduling.stage.util.TextLine; - -import kieker.analysis.plugin.filter.flow.TraceEventRecords; -import kieker.common.record.IMonitoringRecord; -import kieker.common.record.controlflow.OperationExecutionRecord; -import kieker.common.record.flow.IFlowRecord; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class TraceReconstructionAnalysis2 extends Analysis { - private static final int SECONDS = 1000; - - private WorkerThread workerThread; - - private ClassNameRegistryRepository classNameRegistryRepository; - - @Override - public void init() { - super.init(); - // IPipeline clockPipeline = buildClockPipeline(); - // this.clockThread = new WorkerThread(clockPipeline, 1); - // Clock clockStage=(Clock) clockPipeline.getStartStages().get(0); - - final IPipeline pipeline = this.buildPipeline(); - this.workerThread = new WorkerThread(pipeline, 0); - } - - /** - * @param clockStage - * @since 1.10 - */ - private IPipeline buildPipeline() { - // predicates TODO - final IsIMonitoringRecordInRange isIMonitoringRecordInRange = new IsIMonitoringRecordInRange(0, 1000); - final IsOperationExecutionRecordTraceIdPredicate isOperationExecutionRecordTraceIdPredicate = new IsOperationExecutionRecordTraceIdPredicate( - false, null); - - final ClassNameRegistryCreationFilter classNameRegistryCreationFilter = new ClassNameRegistryCreationFilter( - this.classNameRegistryRepository); - final MonitoringLogDirectory2Files directory2FilesFilter = new MonitoringLogDirectory2Files(); - final File2TextLinesFilter file2TextLinesFilter = new File2TextLinesFilter(); - final Cache<TextLine> cache = new Cache<TextLine>(); - - final TextLine2RecordFilter textLine2RecordFilter = new TextLine2RecordFilter(this.classNameRegistryRepository); - final StringBufferFilter<IMonitoringRecord> stringBufferFilter = new StringBufferFilter<IMonitoringRecord>(); - final PredicateFilter<IMonitoringRecord> timestampFilter = new PredicateFilter<IMonitoringRecord>( - isIMonitoringRecordInRange); - final PredicateFilter<OperationExecutionRecord> traceIdFilter = new PredicateFilter<OperationExecutionRecord>( - isOperationExecutionRecordTraceIdPredicate); - final InstanceOfFilter<IMonitoringRecord, IFlowRecord> instanceOfFilter = new InstanceOfFilter<IMonitoringRecord, IFlowRecord>( - IFlowRecord.class); - final TraceReconstructionFilter traceReconstructionFilter = new TraceReconstructionFilter(); - final CountingFilter<TraceEventRecords> countingFilter = new CountingFilter<TraceEventRecords>(); - - // configure stages - stringBufferFilter.getDataTypeHandlers().add(new IMonitoringRecordHandler()); - stringBufferFilter.getDataTypeHandlers().add(new StringHandler()); - - // add each stage to a stage list - final LinkedList<IStage> startStages = new LinkedList<IStage>(); - startStages.add(classNameRegistryCreationFilter); - - final List<IStage> stages = new LinkedList<IStage>(); - stages.add(classNameRegistryCreationFilter); - stages.add(directory2FilesFilter); - stages.add(file2TextLinesFilter); - stages.add(cache); - - stages.add(textLine2RecordFilter); - stages.add(stringBufferFilter); - stages.add(timestampFilter); - stages.add(traceIdFilter); - stages.add(instanceOfFilter); - stages.add(traceReconstructionFilter); - stages.add(countingFilter); - - // connect pipes - QueuePipe.connect(classNameRegistryCreationFilter.filePrefixOutputPort, - directory2FilesFilter.filePrefixInputPort); - QueuePipe.connect(classNameRegistryCreationFilter.relayDirectoryOutputPort, - directory2FilesFilter.directoryInputPort); - QueuePipe.connect(directory2FilesFilter.fileOutputPort, file2TextLinesFilter.fileInputPort); - QueuePipe.connect(file2TextLinesFilter.textLineOutputPort, cache.objectInputPort); - // QueuePipe.connect(XXX, cache.sendInputPort); - QueuePipe.connect(cache.objectOutputPort, textLine2RecordFilter.textLineInputPort); - QueuePipe.connect(textLine2RecordFilter.recordOutputPort, stringBufferFilter.objectInputPort); - QueuePipe.connect(stringBufferFilter.objectOutputPort, timestampFilter.inputPort); - // QueuePipe.connect(timestampFilter.matchingOutputPort, traceIdFilter.inputPort); - // QueuePipe.connect(timestampFilter.mismatchingOutputPort, YYY); // ignore this case - QueuePipe.connect(traceIdFilter.matchingOutputPort, instanceOfFilter.inputPort); - // QueuePipe.connect(traceIdFilter.mismatchingOutputPort, traceIdFilter.inputPort); // ignore this case - // QueuePipe.connect(clockStage.timestampOutputPort, traceReconstructionFilter.timestampInputPort); // ignore - // this case - QueuePipe.connect(instanceOfFilter.matchingOutputPort, traceReconstructionFilter.recordInputPort); - // QueuePipe.connect(instanceOfFilter.mismatchingOutputPort, instanceOfFilter.inputPort); // ignore this case - QueuePipe.connect(traceReconstructionFilter.traceValidOutputPort, countingFilter.INPUT_OBJECT); - // QueuePipe.connect(traceReconstructionFilter.traceInvalidOutputPort, ); // ignore this case - - final Pipeline pipeline = new Pipeline(); - pipeline.setStartStages(startStages); - pipeline.setStages(stages); - return pipeline; - } - - @Override - public void start() { - super.start(); - - this.workerThread.setTerminationPolicy(StageTerminationPolicy.TERMINATE_STAGE_AFTER_UNSUCCESSFUL_EXECUTION); - - this.workerThread.start(); - try { - this.workerThread.join(60 * SECONDS); - } catch (final InterruptedException e) { - e.printStackTrace(); - } - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/ConcurrentPipeline.java.todo b/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/ConcurrentPipeline.java.todo deleted file mode 100644 index 07cbd64e..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/ConcurrentPipeline.java.todo +++ /dev/null @@ -1,157 +0,0 @@ -package kieker.panalysis.framework.concurrent; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import kieker.panalysis.framework.core.IInputPort; -import kieker.panalysis.framework.core.IOutputPort; -import kieker.panalysis.framework.core.IPipe; -import kieker.panalysis.framework.core.ISink; -import kieker.panalysis.framework.core.ISource; -import kieker.panalysis.framework.core.IStage; - -public class ConcurrentPipeline { - - private final Map<IOutputPort<?, ?>, IInputPort<?, ?>> connections = new HashMap<IOutputPort<?, ?>, IInputPort<?, ?>>(); - private final Set<IStage> ioStages = new HashSet<IStage>(); - private final Map<IStage, List<IStage>> standardStages = new HashMap<IStage, List<IStage>>(); - - private final int numCores = Runtime.getRuntime().availableProcessors(); - private int defaultBundleSize = 64; - - public <T> void connect(final IOutputPort<?, T> sourcePort, final IInputPort<?, T> targetPort, final int bundleSize) { - this.connections.put(sourcePort, targetPort); - this.addStage(sourcePort.getOwningStage()); - this.addStage(targetPort.getOwningStage()); - } - - /** - * Connects to ports using the default bundle size - * - * @param sourcePort - * @param targetPort - */ - public <T> void connect(final IOutputPort<?, T> sourcePort, final IInputPort<?, T> targetPort) { - this.connect(sourcePort, targetPort, this.defaultBundleSize); - } - - private void addStage(final IStage owningStage) { - if (owningStage instanceof IoStage) { - this.ioStages.add(owningStage); - } else { - this.standardStages.put(owningStage, null); - } - } - - public void start() { - this.cloneNonIoStages(); - this.connectConcurrentStages(); - this.instantiatePipes(); - } - - private void cloneNonIoStages() { - for (final Entry<IStage, List<IStage>> entry : this.standardStages.entrySet()) { - final List<IStage> concurrentStages = this.createConcurrentStages(entry.getKey()); - entry.setValue(concurrentStages); - } - } - - private List<IStage> createConcurrentStages(final IStage stage) { - final List<IStage> concurrentStages = new LinkedList<IStage>(); - for (int i = 0; i < this.numCores; i++) { - final Class<? extends IStage> stageClazz = stage.getClass(); - // final Constructor<? extends IStage> constructor = stageClazz.getConstructor(Configuration.class); - // final IStage copiedStage = constructor.newInstance(stage.getConfiguration()); // copy by reference since the configuration is read-only - - IStage copiedStage; - try { - copiedStage = stageClazz.newInstance(); - } catch (final InstantiationException e) { - throw new IllegalStateException("The stage to be copied requires a constructor without any parameters.", e); - } catch (final IllegalAccessException e) { - throw new IllegalStateException("The stage to be copied requires a constructor without any parameters.", e); - } - copiedStage.copyAttributes(stage); - concurrentStages.add(copiedStage); - } - return concurrentStages; - } - - private void connectConcurrentStages() { - for (final Entry<IOutputPort<?, ?>, IInputPort<?, ?>> entry : this.connections.entrySet()) { - final IOutputPort<?, ?> sourcePort = entry.getKey(); - final IInputPort<?, ?> targetPort = entry.getValue(); - - final boolean isSourceIoStage = sourcePort.getOwningStage() instanceof IoStage; - final boolean isTargetIoStage = targetPort.getOwningStage() instanceof IoStage; - - if (isSourceIoStage && !isTargetIoStage) { - final List<IStage> concurrentStages = this.standardStages.get(targetPort.getOwningStage()); - final IStage owningSourceStage = sourcePort.getOwningStage(); - for (final IStage concurrentTargetStage : concurrentStages) { - this.connections.put(owningSourceStage.getNewOutputPort(), concurrentTargetStage.getInputPortByIndex(targetPort.getIndex())); - } - } else if (!isSourceIoStage && isTargetIoStage) { - final List<IStage> concurrentStages = this.standardStages.get(sourcePort.getOwningStage()); - final IStage owningTargetStage = targetPort.getOwningStage(); - for (final IStage s : concurrentStages) { - this.connections.put(s.getOutputPortByIndex(sourcePort.getIndex()), owningTargetStage.getNewInputPort()); - } - } else { - final List<IStage> concurrentSourceStages = this.standardStages.get(sourcePort.getOwningStage()); - final List<IStage> concurrentTargetStages = this.standardStages.get(targetPort.getOwningStage()); - for (int i = 0; i < concurrentSourceStages.size(); i++) { - final IStage sourceStage = concurrentSourceStages.get(i); - final IOutputPort<?, ?> otherSourcePort = sourceStage.getOutputPortByIndex(sourcePort.getIndex()); - - final IStage targetStage = concurrentTargetStages.get(i); - final IInputPort<?, ?> otherTargetPort = targetStage.getInputPortByIndex(targetPort.getIndex()); - - this.connections.put(otherSourcePort, otherTargetPort); - } - } - } - } - - @SuppressWarnings("unchecked") - private <T, S0 extends ISource, S1 extends ISink<S1>> void instantiatePipes() { - for (final Entry<IOutputPort<?, ?>, IInputPort<?, ?>> entry : this.connections.entrySet()) { - final IOutputPort<S0, T> sourcePort = (IOutputPort<S0, T>) entry.getKey(); - final IInputPort<S1, T> targetPort = (IInputPort<S1, T>) entry.getValue(); - this.instantiatePipe(sourcePort, targetPort); - } - } - - private <T, P extends IPipe<T>, S0 extends ISource, S1 extends ISink<S1>> - void instantiatePipe(final IOutputPort<S0, T> sourcePort, final IInputPort<S1, T> targetPort) { - final boolean isSourceIoStage = sourcePort.getOwningStage() instanceof IoStage; - final boolean isTargetIoStage = targetPort.getOwningStage() instanceof IoStage; - - IPipe<T> pipe; - if (isSourceIoStage && !isTargetIoStage) { - pipe = new ConcurrentWorkStealingPipe<T>(); - } else if (!isSourceIoStage && isTargetIoStage) { - pipe = new SingleProducerSingleConsumerPipe<T>(); - } else if (isSourceIoStage && isTargetIoStage) { - throw new IllegalStateException("It is not allowed to connect two I/O stages."); - } else { - pipe = new ConcurrentWorkStealingPipe<T>(); - } - - pipe.setSourcePort(sourcePort); - pipe.setTargetPort(targetPort); - } - - public void setDefaultBundleSize(final int defaultBundleSize) { - this.defaultBundleSize = defaultBundleSize; - } - - public int getDefaultBundleSize() { - return this.defaultBundleSize; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/ConcurrentWorkStealingPipe.java b/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/ConcurrentWorkStealingPipe.java deleted file mode 100644 index 587d2990..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/ConcurrentWorkStealingPipe.java +++ /dev/null @@ -1,145 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.framework.concurrent; - -import java.util.LinkedList; -import java.util.List; - -import teetime.util.concurrent.workstealing.CircularWorkStealingDeque; -import teetime.variant.explicitScheduling.framework.concurrent.steal.IStealStrategy; -import teetime.variant.explicitScheduling.framework.core.AbstractPipe; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.framework.core.ISink; -import teetime.variant.explicitScheduling.framework.core.ISource; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class ConcurrentWorkStealingPipe<T> extends AbstractPipe<T> { - - private final CircularWorkStealingDeque<T> circularWorkStealingDeque = new CircularWorkStealingDeque<T>(); - private final IStealStrategy<T> stealStrategy; - - // BETTER use a prioritized list that considers - // <ul> - // <li>the size of each deque to minimize steals - // <li>the core's locality to improve cache access performance - // </ul> - - private List<ConcurrentWorkStealingPipe<T>> pipesToStealFrom; - private int numTakenElements = 0; - - ConcurrentWorkStealingPipe(final IStealStrategy<T> stealStrategy) { - this.stealStrategy = stealStrategy; - } - - public <S0 extends ISource, S1 extends ISink<S1>> void connect(final IOutputPort<S0, T> sourcePort, final IInputPort<S1, T> targetPort) { - this.setSourcePort(sourcePort); - this.setTargetPort(targetPort); - } - - @Override - protected void putInternal(final T token) { - this.circularWorkStealingDeque.pushBottom(token); - } - - public void putMultiple(final List<T> elements) { - this.circularWorkStealingDeque.pushBottomMultiple(elements); - } - - @Override - protected T tryTakeInternal() { - T record = this.circularWorkStealingDeque.popBottom(); - if (record == null) { - record = this.stealStrategy.steal(this.getTargetPort(), this.pipesToStealFrom); - if (record == null) { - return null; - } - System.out.println("stolen (" + Thread.currentThread() + "): " + record); - } - this.numTakenElements++; - return record; - } - - public T take() { - T record = this.circularWorkStealingDeque.popBottomEx(); - if (record == null) { - record = this.stealStrategy.steal(this.getTargetPort(), this.pipesToStealFrom); - if (record == null) { - return null; - } - } - this.numTakenElements++; - return record; - } - - public List<T> tryTakeMultiple(final int maxItemsToTake) { - // TODO Auto-generated method stub - // BETTER find a way to take multiple elements directly without a loop - return null; - } - - public T read() { - final T record = this.circularWorkStealingDeque.readBottom(); - return record; - } - - public boolean isEmpty() { - return this.circularWorkStealingDeque.isEmpty(); - } - - public T steal() { - return this.circularWorkStealingDeque.steal(); - } - - public List<T> stealMultiple(final int maxItemsToSteal) { - int maxItemsToStealCounter = maxItemsToSteal; - final List<T> stolenElements = new LinkedList<T>(); - while (maxItemsToStealCounter-- > 0) { - final T stolenElement = this.steal(); - if (stolenElement == null) { - break; - } - stolenElements.add(stolenElement); - } - // BETTER find a way to steal multiple elements directly without a loop - return stolenElements; - } - - public List<ConcurrentWorkStealingPipe<T>> getPipesToStealFrom() { - return this.pipesToStealFrom; - } - - public void setPipesToStealFrom(final List<ConcurrentWorkStealingPipe<T>> pipesToStealFrom) { - this.pipesToStealFrom = pipesToStealFrom; - } - - @Override - public void onPipelineStarts() { - this.pipesToStealFrom = new LinkedList<ConcurrentWorkStealingPipe<T>>(this.pipesToStealFrom); - this.pipesToStealFrom.remove(this); - } - - @Override - public String toString() { - return this.getClass().getSimpleName() + "={" + "numTakenElements=" + this.numTakenElements + "}"; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/ConcurrentWorkStealingPipeFactory.java b/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/ConcurrentWorkStealingPipeFactory.java deleted file mode 100644 index 8251942c..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/ConcurrentWorkStealingPipeFactory.java +++ /dev/null @@ -1,46 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.concurrent; - -import java.util.LinkedList; -import java.util.List; - -import teetime.variant.explicitScheduling.framework.concurrent.steal.IStealStrategy; -import teetime.variant.explicitScheduling.framework.concurrent.steal.StealIfEmptyStrategy; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class ConcurrentWorkStealingPipeFactory<T> { - - private final List<ConcurrentWorkStealingPipe<T>> pipes = new LinkedList<ConcurrentWorkStealingPipe<T>>(); - private final IStealStrategy<T> stealStrategy = new StealIfEmptyStrategy<T>(); - - public ConcurrentWorkStealingPipe<T> create() { - final ConcurrentWorkStealingPipe<T> pipe = new ConcurrentWorkStealingPipe<T>(this.stealStrategy); - pipe.setPipesToStealFrom(this.pipes); - - this.pipes.add(pipe); - - return pipe; - } - - public List<ConcurrentWorkStealingPipe<T>> getPipes() { - return this.pipes; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/IStageScheduler.java b/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/IStageScheduler.java deleted file mode 100644 index cfbb5e80..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/IStageScheduler.java +++ /dev/null @@ -1,35 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.concurrent; - -import teetime.variant.explicitScheduling.framework.core.IStage; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public interface IStageScheduler { - - public abstract IStage get(); - - public abstract boolean isAnyStageActive(); - - public abstract void disable(IStage stage); - - public abstract void determineNextStage(IStage stage, boolean executedSuccessfully); - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/IStageWorkList.java b/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/IStageWorkList.java deleted file mode 100644 index d0d1fc1e..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/IStageWorkList.java +++ /dev/null @@ -1,40 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.concurrent; - -import java.util.Collection; - -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.framework.core.IStage; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public interface IStageWorkList { - - public abstract void pushAll(Collection<? extends IStage> stages); - - public abstract void pushAll(IOutputPort<?, ?>[] outputPorts); - - public abstract IStage pop(); - - public abstract IStage read(); - - public abstract boolean isEmpty(); - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/SingleProducerSingleConsumerPipe.java b/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/SingleProducerSingleConsumerPipe.java deleted file mode 100644 index b3a43f38..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/SingleProducerSingleConsumerPipe.java +++ /dev/null @@ -1,84 +0,0 @@ -package teetime.variant.explicitScheduling.framework.concurrent; - -import java.util.List; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.Callable; -import java.util.concurrent.LinkedBlockingDeque; - -import teetime.util.concurrent.workstealing.CircularWorkStealingDeque; -import teetime.variant.explicitScheduling.framework.core.AbstractPipe; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.framework.core.ISink; -import teetime.variant.explicitScheduling.framework.core.ISource; - -public class SingleProducerSingleConsumerPipe<T> extends AbstractPipe<T> { - - // BETTER use a cache-aware queue (see the corresponding paper) - final BlockingQueue<T> queue = new LinkedBlockingDeque<T>(); - - private final Callable<T> blockingTake = new Callable<T>() { - public T call() throws Exception { - return SingleProducerSingleConsumerPipe.this.queue.take(); - } - }; - private final Callable<T> nonBlockingTake = new Callable<T>() { - public T call() throws Exception { - return SingleProducerSingleConsumerPipe.this.queue.poll(); - } - }; - private volatile Callable<T> take = this.blockingTake; - - public static <S0 extends ISource, S1 extends ISink<S1>, T> void connect(final IOutputPort<S0, T> sourcePort, final IInputPort<S1, T> targetPort) { - final SingleProducerSingleConsumerPipe<T> pipe = new SingleProducerSingleConsumerPipe<T>(); - pipe.setSourcePort(sourcePort); - pipe.setTargetPort(targetPort); - } - - public void putMultiple(final List<T> elements) { - this.queue.addAll(elements); - } - - public T read() { - return this.queue.peek(); - } - - public List<?> tryTakeMultiple(final int numElementsToTake) { - // TODO Auto-generated method stub - return null; - } - - @Override - protected void putInternal(final T token) { - this.queue.add(token); - } - - @Override - protected T tryTakeInternal() { - try { - return this.take.call(); - } catch (final Exception e) { - return null; - } - } - - public T take() { - final T token = this.tryTake(); - if (token == null) { - throw CircularWorkStealingDeque.DEQUE_IS_EMPTY_EXCEPTION; - } - return token; - } - - public boolean isEmpty() { - return this.queue.isEmpty(); - } - - @Override - public void close() { - this.take = this.nonBlockingTake; - super.close(); - this.getTargetPort().getOwningStage().getOwningThread().interrupt(); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/StageTerminationPolicy.java b/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/StageTerminationPolicy.java deleted file mode 100644 index 2a14fd8e..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/StageTerminationPolicy.java +++ /dev/null @@ -1,30 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.framework.concurrent; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public enum StageTerminationPolicy { - - TERMINATE_STAGE_NOW, - TERMINATE_STAGE_AFTER_NEXT_EXECUTION, - TERMINATE_STAGE_AFTER_UNSUCCESSFUL_EXECUTION, - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/StageWorkArrayList.java b/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/StageWorkArrayList.java deleted file mode 100644 index a8b48e2a..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/StageWorkArrayList.java +++ /dev/null @@ -1,124 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.concurrent; - -import java.util.Collection; - -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.framework.core.IPipeline; -import teetime.variant.explicitScheduling.framework.core.IStage; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class StageWorkArrayList implements IStageWorkList { - - private static class SchedulableStage { - public SchedulableStage() {} - - public IStage stage; - public int numToBeExecuted; - } - - private final int accessesDeviceId; - - /** sorted array where the last stage has highest priority */ - private final SchedulableStage[] stages; - private int firstIndex = Integer.MAX_VALUE; - private int lastIndex = -1; - - /** - * @since 1.10 - */ - public StageWorkArrayList(final IPipeline pipeline, final int accessesDeviceId) { - this.accessesDeviceId = accessesDeviceId; - - this.stages = new SchedulableStage[pipeline.getStages().size()]; - for (IStage stage : pipeline.getStages()) { - final SchedulableStage schedulableStage = new SchedulableStage(); - schedulableStage.stage = stage; - schedulableStage.numToBeExecuted = 0; - this.stages[stage.getSchedulingIndex()] = schedulableStage; - } - } - - @Override - public void pushAll(final Collection<? extends IStage> stages) { - for (final IStage stage : stages) { - this.push(stage); - } - } - - @Override - public void pushAll(final IOutputPort<?, ?>[] outputPorts) { - for (final IOutputPort<?, ?> outputPort : outputPorts) { - if (outputPort != null) { - final IStage targetStage = outputPort.getAssociatedPipe().getTargetPort().getOwningStage(); - this.push(targetStage); - } - } - } - - private void push(final IStage stage) { - if (stage.isSchedulable() && this.isValid(stage)) { - this.firstIndex = Math.min(stage.getSchedulingIndex(), this.firstIndex); - this.lastIndex = Math.max(stage.getSchedulingIndex(), this.lastIndex); - this.stages[stage.getSchedulingIndex()].numToBeExecuted++; - } - } - - private boolean isValid(final IStage stage) { - final boolean isValid = (stage.getAccessesDeviceId() == this.accessesDeviceId); - if (!isValid) { - // LOG.warn("Invalid stage: stage.accessesDeviceId = " + stage.getAccessesDeviceId() + ", accessesDeviceId = " + this.accessesDeviceId + ", stage = " + - // stage); - } - return isValid; - } - - @Override - public IStage pop() { - final SchedulableStage schedulableStage = this.stages[this.lastIndex]; - // schedulableStage.numToBeExecuted--; - schedulableStage.numToBeExecuted = 0; - cond: if (schedulableStage.numToBeExecuted == 0) - { - for (int i = this.lastIndex - 1; i >= this.firstIndex; i--) { - if (this.stages[i].numToBeExecuted > 0) { - this.lastIndex = i; - break cond; - } - } - this.firstIndex = Integer.MAX_VALUE; - this.lastIndex = -1; - } - return schedulableStage.stage; - } - - @Override - public IStage read() { - final SchedulableStage schedulableStage = this.stages[this.lastIndex]; - return schedulableStage.stage; - } - - @Override - public boolean isEmpty() { - return this.lastIndex == -1; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/StageWorkList.java b/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/StageWorkList.java deleted file mode 100644 index 34d46197..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/StageWorkList.java +++ /dev/null @@ -1,83 +0,0 @@ -package teetime.variant.explicitScheduling.framework.concurrent; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.framework.core.IStage; - -@Deprecated -public class StageWorkList implements IStageWorkList { - - // private static final Log LOG = LogFactory.getLog(StageWorkList.class); - - private final List<IStage> workList; - private final int accessesDeviceId; - - public StageWorkList(final int accessesDeviceId, final int initialCapacity) { - this.accessesDeviceId = accessesDeviceId; - this.workList = new ArrayList<IStage>(initialCapacity); - } - - @Override - public void pushAll(final Collection<? extends IStage> stages) { - this.addAll(0, stages); - } - - @Override - public IStage pop() { - return this.workList.remove(0); - } - - @Override - public IStage read() { - return this.workList.get(0); - } - - @Override - public boolean isEmpty() { - return this.workList.isEmpty(); - } - - private boolean isValid(final IStage stage) { - final boolean isValid = (stage.getAccessesDeviceId() == this.accessesDeviceId); - if (!isValid) { - // LOG.warn("Invalid stage: stage.accessesDeviceId = " + stage.getAccessesDeviceId() + ", accessesDeviceId = " + this.accessesDeviceId + ", stage = " + - // stage); - } - return isValid; - } - - private boolean addAll(final int index, final Collection<? extends IStage> collection) { - final Collection<IStage> filteredCollection = new ArrayList<IStage>(collection.size()); - for (final IStage stage : collection) { - this.push(filteredCollection, stage); - } - return this.workList.addAll(index, filteredCollection); - } - - private void push(final Collection<IStage> filteredCollection, final IStage stage) { - if (this.isValid(stage)) { - filteredCollection.add(stage); - } - } - - @Override - public String toString() { - return this.workList.toString(); - } - - @Override - public void pushAll(final IOutputPort<?, ?>[] outputPorts) { - final Collection<IStage> filteredCollection = new ArrayList<IStage>(outputPorts.length); - for (final IOutputPort<?, ?> outputPort : outputPorts) { - if (outputPort != null) { - final IStage targetStage = outputPort.getAssociatedPipe().getTargetPort().getOwningStage(); - this.push(filteredCollection, targetStage); - } - } - this.workList.addAll(0, filteredCollection); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/TokenBundle.java b/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/TokenBundle.java deleted file mode 100644 index 16014598..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/TokenBundle.java +++ /dev/null @@ -1,16 +0,0 @@ -package teetime.variant.explicitScheduling.framework.concurrent; - -import java.util.List; - -public class TokenBundle<T> { - - private final List<T> tokens; - - public TokenBundle(final List<T> tokens) { - this.tokens = tokens; - } - - public List<T> getTokens() { - return this.tokens; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/WorkerThread.java b/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/WorkerThread.java deleted file mode 100644 index 56860132..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/WorkerThread.java +++ /dev/null @@ -1,281 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.framework.concurrent; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.LinkedList; -import java.util.List; - -import teetime.util.StopWatch; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IPipe; -import teetime.variant.explicitScheduling.framework.core.IPipeCommand; -import teetime.variant.explicitScheduling.framework.core.IPipeline; -import teetime.variant.explicitScheduling.framework.core.IStage; -import teetime.variant.explicitScheduling.framework.core.IInputPort.PortState; -import teetime.variant.explicitScheduling.framework.scheduling.NextStageScheduler; -import teetime.variant.explicitScheduling.framework.scheduling.StageStateManager; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class WorkerThread extends Thread { - - private static final int NUM_ITERATIONS_TO_MEASURE = 100000; - - private final IPipeline pipeline; - private IStageScheduler stageScheduler; - private StageStateManager stageStateManager; - - private StageTerminationPolicy terminationPolicy; - private boolean shouldTerminate = false; - private final int accessesDeviceId; - private int executedUnsuccessfullyCount; - - // statistics - private final StopWatch stopWatch = new StopWatch(); - private final List<Long> durationPerXIterationsInNs = new LinkedList<Long>(); - private int iterations; - - private final StopWatch afterStageExecutionStopWatch = new StopWatch(); - - private final List<Long> afterStageExecutions = new LinkedList<Long>(); - - public WorkerThread(final IPipeline pipeline, final int accessesDeviceId) { - this.pipeline = pipeline; - this.accessesDeviceId = accessesDeviceId; - } - - private void initStages(final IPipeline pipeline) { - for (final IStage stage : pipeline.getStages()) { - stage.setOwningThread(this); - } - - this.setDepthForEachStage(pipeline); - this.setSchedulingIndexForEachhStage(pipeline); - } - - private void setDepthForEachStage(final IPipeline pipeline) { - final IPipeCommand setDepthCommand = new IPipeCommand() { - @Override - public void execute(final IPipe<?> pipe) throws Exception { - final IStage sourceStage = pipe.getSourcePort().getOwningStage(); - final IStage owningStage = pipe.getTargetPort().getOwningStage(); - if (owningStage.getDepth() == IStage.DEPTH_NOT_SET) { - owningStage.setDepth(sourceStage.getDepth() + 1); - owningStage.notifyOutputPipes(this); - } - } - }; - - for (final IStage startStage : pipeline.getStartStages()) { - startStage.setDepth(0); - } - - for (final IStage startStage : pipeline.getStartStages()) { - try { - startStage.notifyOutputPipes(setDepthCommand); - } catch (final Exception e) { - throw new IllegalStateException("may not happen", e); - } - } - } - - private List<IStage> setSchedulingIndexForEachhStage(final IPipeline pipeline) { - final List<IStage> stageList = new ArrayList<IStage>(pipeline.getStages()); - - final Comparator<? super IStage> depthComparator = new Comparator<IStage>() { - @Override - public int compare(final IStage o1, final IStage o2) { - if (o1.getDepth() == o2.getDepth()) { - return 0; - } else if (o1.getDepth() < o2.getDepth()) { - return -1; - } else { - return 1; - } - } - }; - - Collections.sort(stageList, depthComparator); - - for (int i = 0; i < stageList.size(); i++) { - stageList.get(i).setSchedulingIndex(i); - } - - return stageList; - } - - @Override - public void run() { - try { - this.initDatastructures(); - } catch (final Exception e) { - throw new IllegalStateException(e); - } - - this.iterations = 0; - this.stopWatch.start(); - - while (this.stageScheduler.isAnyStageActive()) { - this.iterations++; - // this.iterationStopWatch.start(); - - // beforeStageExecutionStopWatch.start(); - - final IStage stage = this.stageScheduler.get(); - - // beforeStageExecutionStopWatch.end(); - - this.startStageExecution(stage); - // stageExecutionStopWatch.start(); - final boolean executedSuccessfully = stage.execute(); - // stageExecutionStopWatch.end(); - this.finishStageExecution(stage, executedSuccessfully); - - // this.afterStageExecutionStopWatch.start(); - - if (this.shouldTerminate) { - this.executeTerminationPolicy(stage, executedSuccessfully); - } - this.stageScheduler.determineNextStage(stage, executedSuccessfully); - - // this.afterStageExecutionStopWatch.end(); - - // this.iterationStopWatch.end(); - - // all stop watches are activated - // final long schedulingOverhead = this.iterationStopWatch.getDurationInNs() - - // stageExecutionStopWatch.getDurationInNs(); //4952 - - // 6268 -> 5350 (w/o after) -> 4450 (w/o before) -> 3800 (w/o stage) - // final long schedulingOverhead = this.iterationStopWatch.getDurationInNs(); - // final long schedulingOverhead = beforeStageExecutionStopWatch.getDurationInNs(); //327 - // final long schedulingOverhead = stageExecutionStopWatch.getDurationInNs(); //1416 - // final long schedulingOverhead = this.afterStageExecutionStopWatch.getDurationInNs(); // 2450 - - // if (this.iterations > 50000 && this.iterations % 1000 == 0) - // this.afterStageExecutions.add(this.afterStageExecutionStopWatch.getDurationInNs()); - - // rest: ~2000 (measurement overhead?) - if ((this.iterations % NUM_ITERATIONS_TO_MEASURE) == 0) { - this.stopWatch.end(); - this.durationPerXIterationsInNs.add(this.stopWatch.getDurationInNs()); - this.stopWatch.start(); - } - } - - this.stopWatch.end(); - this.durationPerXIterationsInNs.add(this.stopWatch.getDurationInNs()); - - // System.out.println("avg: " + StatisticsUtil.calculateAverage(this.afterStageExecutions) + " ns"); - - this.cleanUpDatastructures(); - } - - private void executeTerminationPolicy(final IStage executedStage, final boolean executedSuccessfully) { - // System.out.println("executeTerminationPolicy executedStage=" + executedStage + ", executedSuccessfully=" + executedSuccessfully); - // System.out.println("executeTerminationPolicy areAllInputPortsClosed(executedStage)=" + this.stageStateManager.areAllInputPortsClosed(executedStage)); - - switch (this.terminationPolicy) { - case TERMINATE_STAGE_AFTER_NEXT_EXECUTION: - if (this.stageStateManager.areAllInputPortsClosed(executedStage)) { - this.stageScheduler.disable(executedStage); - } - break; - case TERMINATE_STAGE_AFTER_UNSUCCESSFUL_EXECUTION: - if (!executedSuccessfully) { - if (this.stageStateManager.areAllInputPortsClosed(executedStage)) { - this.stageScheduler.disable(executedStage); - } - } - break; - case TERMINATE_STAGE_NOW: - for (final IStage stage : this.pipeline.getStages()) { - this.stageScheduler.disable(stage); - } - break; - default: - break; - } - } - - private void initDatastructures() throws Exception { - // stages need to be initialized here, because in a concurrent context some stages (e.g., a merger) is executed after its pipeline has been created. - this.initStages(this.pipeline); - this.stageStateManager = new StageStateManager(this.pipeline); - this.stageScheduler = new NextStageScheduler(this.pipeline, this.accessesDeviceId, this.stageStateManager); - - for (final IStage startStage : this.pipeline.getStartStages()) { - for (IInputPort<IStage, ?> inputPort : startStage.getInputPorts()) { - if (inputPort.getState() == PortState.CLOSED) { - inputPort.close(); - } - } - } - - this.pipeline.fireStartNotification(); - } - - private final void startStageExecution(final IStage stage) { - // System.out.println("Executing stage: " + stage); - } - - private final void finishStageExecution(final IStage stage, final boolean executedSuccessfully) { - if (!executedSuccessfully) { // statistics - this.executedUnsuccessfullyCount++; - } - } - - private void cleanUpDatastructures() { - this.pipeline.fireStopNotification(); - } - - public IPipeline getPipeline() { - return this.pipeline; - } - - /** - * If not set, this thread will run infinitely. - * - * @param terminationPolicyToUse - */ - public void setTerminationPolicy(final StageTerminationPolicy terminationPolicyToUse) { - this.terminationPolicy = terminationPolicyToUse; - this.shouldTerminate = true; - } - - public int getExecutedUnsuccessfullyCount() { - return this.executedUnsuccessfullyCount; - } - - public List<Long> getDurationPer10000IterationsInNs() { - return this.durationPerXIterationsInNs; - } - - /** - * @since 1.10 - */ - public int getIterations() { - return this.iterations; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/steal/IStealStrategy.java b/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/steal/IStealStrategy.java deleted file mode 100644 index 378b693f..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/steal/IStealStrategy.java +++ /dev/null @@ -1,33 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.concurrent.steal; - -import java.util.Collection; - -import teetime.variant.explicitScheduling.framework.concurrent.ConcurrentWorkStealingPipe; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IStage; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public interface IStealStrategy<T> { - - <S extends IStage> T steal(IInputPort<S, T> inputPort, Collection<ConcurrentWorkStealingPipe<T>> pipesToStealFrom); - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/steal/StealIfEmptyStrategy.java b/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/steal/StealIfEmptyStrategy.java deleted file mode 100644 index adc15630..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/concurrent/steal/StealIfEmptyStrategy.java +++ /dev/null @@ -1,42 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.concurrent.steal; - -import java.util.Collection; - -import teetime.variant.explicitScheduling.framework.concurrent.ConcurrentWorkStealingPipe; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IStage; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class StealIfEmptyStrategy<T> implements IStealStrategy<T> { - - public <S extends IStage> T steal(final IInputPort<S, T> inputPort, final Collection<ConcurrentWorkStealingPipe<T>> pipesToStealFrom) { - for (final ConcurrentWorkStealingPipe<T> pipe : pipesToStealFrom) { - final T stolenElement = pipe.steal(); - if (stolenElement != null) { - return stolenElement; - } - } - // BETTER improve stealing efficiency by stealing multiple elements at once - return null; // do not expose internal impl details (here: CircularWorkStealingDeque); instead return null - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractFilter.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractFilter.java deleted file mode 100644 index 27b78d51..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractFilter.java +++ /dev/null @@ -1,285 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.framework.core; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; - -import teetime.util.concurrent.workstealing.exception.DequePopException; - -/** - * - * @author Christian Wulf - * - * @since 1.10 - * - * @param <S> - * the extending stage - * - */ -public abstract class AbstractFilter<S extends IStage> extends AbstractStage implements ISink<S>, ISource { - - /** - * @author Christian Wulf - * - * @since 1.10 - */ - public enum StageState { - UNINITIALIZED, PIPELINE_STARTED, PIPELINE_STOPPED - } - - /** - * Indicates whether this stage has (already) been initialized.<br> - * <i>This attribute prevents this stage to be initialized more than once.</i> - */ - private StageState state = StageState.UNINITIALIZED; - - private int depth = IStage.DEPTH_NOT_SET; - private int schedulingIndex; - private boolean schedulable = true; - - private final List<IInputPort<S, ?>> inputPorts = new ArrayList<IInputPort<S, ?>>(); - private final List<IInputPort<S, ?>> readOnlyInputPorts = Collections.unmodifiableList(this.inputPorts); - - private final List<IOutputPort<S, ?>> outputPorts = new ArrayList<IOutputPort<S, ?>>(); - private final List<IOutputPort<S, ?>> readOnlyOutputPorts = Collections.unmodifiableList(this.outputPorts); - - private Context<S> context; - - private final IPipeCommand closeCommand = new IPipeCommand() { - @Override - public void execute(final IPipe<?> pipe) throws Exception { - pipe.close(); - } - }; - - private final IPipeCommand pipelineStartsCommand = new IPipeCommand() { - @Override - public void execute(final IPipe<?> pipe) throws Exception { - pipe.notifyPipelineStarts(); - } - }; - - /** - * 0=in-memory, x>0=disk0, disk1, display0, display1, socket0, socket1 etc. - */ - private int accessesDeviceId = 0; - - @Override - public int getAccessesDeviceId() { - return this.accessesDeviceId; - } - - @Override - public void setAccessesDeviceId(final int accessesDeviceId) { - this.accessesDeviceId = accessesDeviceId; - } - - // BETTER return a limited context that allows "read" only - @Override - public Context<S> getContext() { - return this.context; - } - - /** - * @since 1.10 - */ - @Override - public final boolean execute() { - boolean success = false; - try { - success = this.execute(this.context); - if (success) { // deprecated boolean return value - this.context.commit(); - } else { - this.context.rollback(); - } - } catch (final DequePopException e) { - this.context.rollback(); - } catch (final Exception e) { - this.logger.error("Error in stage execution", e); - throw new IllegalStateException(e); - } - return success; - } - - protected abstract boolean execute(Context<S> context); - - @Override - public final void notifyPipelineStarts() throws Exception { - if (this.state == StageState.UNINITIALIZED) { - this.state = StageState.PIPELINE_STARTED; - this.onPipelineStarts(); - this.notifyOutputPipes(this.pipelineStartsCommand); - } - } - - /** - * This method is called exactly once iff the pipeline is started. - * - * @throws Exception - * @since 1.10 - */ - public void onPipelineStarts() throws Exception { - this.context = new Context<S>(this, this.readOnlyInputPorts); - } - - /** - * @since 1.10 - */ - @Override - public void notifyOutputPipes(final IPipeCommand pipeCommand) throws Exception { - for (final IOutputPort<S, ?> outputPort : this.readOnlyOutputPorts) { - final IPipe<?> associatedPipe = outputPort.getAssociatedPipe(); - if (associatedPipe != null) { - pipeCommand.execute(associatedPipe); - } // else: ignore unconnected port - } - } - - @Override - public final void notifyPipelineStops() { - if (this.state != StageState.PIPELINE_STOPPED) { - this.state = StageState.PIPELINE_STOPPED; - this.onPipelineStops(); - } - } - - /** - * This method is called exactly once iff the pipeline is stopped. - * - * @since 1.10 - */ - public void onPipelineStops() { - // default empty implementation - } - - /** - * @since 1.10 - */ - @Override - public void fireSignalClosingToAllOutputPorts() { - try { - this.notifyOutputPipes(this.closeCommand); - } catch (final Exception e) { - throw new IllegalStateException("may not happen", e); - } - } - - @Override - public String toString() { - final String s = super.toString(); - return "{" + s + ": " + "numPushedElements=" + this.context + "}"; - // return s; - } - - /** - * @since 1.10 - * @return a new input port that accepts elements of the particular type that is specified in the variable declaration. - */ - protected <T> IInputPort<S, T> createInputPort() { - @SuppressWarnings("unchecked") - final InputPortImpl<S, T> inputPort = new InputPortImpl<S, T>((S) this); - inputPort.setIndex(this.inputPorts.size()); - this.inputPorts.add(inputPort); - return inputPort; - } - - /** - * @since 1.10 - * @return a new output port that accepts elements of the particular type that is specified in the variable declaration. - */ - protected <T> IOutputPort<S, T> createOutputPort() { - @SuppressWarnings("unchecked") - final OutputPortImpl<S, T> outputPort = new OutputPortImpl<S, T>((S) this); - outputPort.setIndex(this.outputPorts.size()); - this.outputPorts.add(outputPort); - return outputPort; - } - - /** - * @since 1.10 - */ - @Override - @SuppressWarnings("unchecked") - public List<IInputPort<S, ?>> getInputPorts() { - return this.readOnlyInputPorts; - } - - /** - * @since 1.10 - */ - @Override - @SuppressWarnings("unchecked") - public List<IOutputPort<S, ?>> getOutputPorts() { - return this.readOnlyOutputPorts; - } - - @Override - public Collection<? extends IStage> getAllOutputStages() { - final Collection<IStage> outputStages = new LinkedList<IStage>(); - for (final IOutputPort<S, ?> outputPort : this.readOnlyOutputPorts) { - final IPipe<?> associatedPipe = outputPort.getAssociatedPipe(); - if (associatedPipe != null) { - outputStages.add(associatedPipe.getTargetPort().getOwningStage()); - } - } - return outputStages; - } - - @Override - public IInputPort<?, ?> getInputPortByIndex(final int index) { - return this.readOnlyInputPorts.get(index); - } - - @Override - public IOutputPort<?, ?> getOutputPortByIndex(final int index) { - return this.readOnlyOutputPorts.get(index); - } - - @Override - public int getDepth() { - return this.depth; - } - - @Override - public void setDepth(final int depth) { - this.depth = depth; - } - - @Override - public int getSchedulingIndex() { - return this.schedulingIndex; - } - - @Override - public void setSchedulingIndex(final int schedulingIndex) { - this.schedulingIndex = schedulingIndex; - } - - @Override - public boolean isSchedulable() { - return this.schedulable; - } - - public void setSchedulable(final boolean schedulable) { - this.schedulable = schedulable; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractMultiPort.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractMultiPort.java deleted file mode 100644 index 06930008..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractMultiPort.java +++ /dev/null @@ -1,49 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.core; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -abstract class AbstractMultiPort<S extends IStage, T> { - - private final Set<IPipe<T>> associatedPipes = new HashSet<IPipe<T>>(); - private final Set<IPipe<T>> readOnlyAssociatedPipes = Collections.unmodifiableSet(this.associatedPipes); - - private S owningStage; - - public void addAssociatedPipe(final IPipe<T> associatedPipe) { - this.associatedPipes.add(associatedPipe); - } - - public Set<IPipe<T>> getAssociatedPipes() { - return this.readOnlyAssociatedPipes; - } - - public S getOwningStage() { - return this.owningStage; - } - - public void setOwningStage(final S owningStage) { - this.owningStage = owningStage; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractPipe.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractPipe.java deleted file mode 100644 index 262e23e6..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractPipe.java +++ /dev/null @@ -1,126 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.framework.core; - -/** - * @author Christian Wulf - * - * @since 1.10 - * - * @param <T> - * The type of the pipe - * @param <P> - * the extending pipe - */ -public abstract class AbstractPipe<T> implements IPipe<T> { - - public static final Object EMPTY_OBJECT = null; - - /** - * @author Christian Wulf - * - * @since 1.10 - */ - public enum PipeState { - UNINITIALIZED, PIPELINE_STARTED, PIPELINE_STOPPED - } - - private PipeState state = PipeState.UNINITIALIZED; - - private IOutputPort<?, ? extends T> sourcePort; - private IInputPort<?, T> targetPort; - - @Override - public IOutputPort<?, ? extends T> getSourcePort() { - return this.sourcePort; - } - - @Override - public IInputPort<?, T> getTargetPort() { - return this.targetPort; - } - - @Override - public <S extends ISource, A extends T> void setSourcePort(final IOutputPort<S, A> sourcePort) { - sourcePort.setAssociatedPipe(this); - this.sourcePort = sourcePort; - } - - @Override - public <S extends ISink<S>, A extends T> void setTargetPort(final IInputPort<S, T> targetPort) { - targetPort.setAssociatedPipe(this); - this.targetPort = targetPort; - } - - // BETTER remove if it does not add any new functionality - protected abstract void putInternal(T token); - - @Override - public void put(final T token) { - this.putInternal(token); - } - - // BETTER remove if it does not add any new functionality - protected abstract T tryTakeInternal(); - - @Override - public final T tryTake() { - return this.tryTakeInternal(); - } - - @Override - public final void notifyPipelineStarts() throws Exception { - if (this.state == PipeState.UNINITIALIZED) { - this.state = PipeState.PIPELINE_STARTED; - this.onPipelineStarts(); - this.getTargetPort().getOwningStage().notifyPipelineStarts(); - } - } - - /** - * This method is called exactly once iff the pipeline is started. - * - * @since 1.10 - */ - public void onPipelineStarts() { - // empty default implementation - } - - @Override - public final void notifyPipelineStops() { - if (this.state != PipeState.PIPELINE_STOPPED) { - this.state = PipeState.PIPELINE_STOPPED; - this.onPipelineStops(); - this.getTargetPort().getOwningStage().notifyPipelineStops(); - } - } - - /** - * This method is called exactly once iff the pipeline is stopped. - * - * @since 1.10 - */ - public void onPipelineStops() { - // empty default implementation - } - - @Override - public void close() { - this.targetPort.close(); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractPort.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractPort.java deleted file mode 100644 index 834e3b20..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractPort.java +++ /dev/null @@ -1,37 +0,0 @@ -package teetime.variant.explicitScheduling.framework.core; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -abstract class AbstractPort<S extends IStage, T> implements IPort<S, T> { - - private IPipe<? super T> associatedPipe; - private S owningStage; - private int index; - - public <A extends T> void setAssociatedPipe(final IPipe<? super T> associatedPipe) { - this.associatedPipe = associatedPipe; - } - - public IPipe<? super T> getAssociatedPipe() { - return this.associatedPipe; - } - - public S getOwningStage() { - return this.owningStage; - } - - public void setOwningStage(final S owningStage) { - this.owningStage = owningStage; - } - - public int getIndex() { - return this.index; - } - - void setIndex(final int index) { - this.index = index; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractStage.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractStage.java deleted file mode 100644 index 9fb4c027..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/AbstractStage.java +++ /dev/null @@ -1,71 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.framework.core; - -import java.util.UUID; - -import kieker.common.logging.Log; -import kieker.common.logging.LogFactory; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public abstract class AbstractStage implements IStage { - - private final String id; - /** - * A unique logger instance per stage instance - */ - protected Log logger; - private IPipeline owningPipeline; - - private Thread owningThread; - - public AbstractStage() { - this.id = UUID.randomUUID().toString(); // the id should only be represented by a UUID, not additionally by the class name - this.logger = LogFactory.getLog(this.id); - } - - public String getId() { - return this.id; - } - - public IPipeline getOwningPipeline() { - return this.owningPipeline; - } - - public void setOwningPipeline(final IPipeline owningPipeline) { - this.owningPipeline = owningPipeline; - } - - @Override - public Thread getOwningThread() { - return this.owningThread; - } - - public void setOwningThread(final Thread owningThread) { - this.owningThread = owningThread; - } - - @Override - public String toString() { - // return "{" + "class=" + this.getClass().getSimpleName() + ", id=" + this.id + "}"; - return this.getClass().getSimpleName() + "(" + Thread.currentThread() + ")"; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/CompositeFilter.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/CompositeFilter.java deleted file mode 100644 index 262d124a..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/CompositeFilter.java +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.core; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public abstract class CompositeFilter implements IBaseStage { - - protected final List<IBaseStage> schedulableStages = new ArrayList<IBaseStage>(); - - private final Map<IOutputPort<?, ?>, IInputPort<?, ?>> connections = new HashMap<IOutputPort<?, ?>, IInputPort<?, ?>>(); - - public List<IBaseStage> getSchedulableStages() { - return this.schedulableStages; - } - - protected <T, S1 extends ISink<S1>, S0 extends ISource> void connectWithPipe(final IOutputPort<S0, T> sourcePort, final IInputPort<S1, T> targetPort) { - this.connections.put(sourcePort, targetPort); - } - - public Map<IOutputPort<?, ?>, IInputPort<?, ?>> getConnections() { - return this.connections; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/Context.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/Context.java deleted file mode 100644 index 3935b162..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/Context.java +++ /dev/null @@ -1,187 +0,0 @@ -package teetime.variant.explicitScheduling.framework.core; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class Context<S extends IStage> { - - /** - * @author Christian Wulf - * - * @since 1.10 - */ - private static class InputPortContainer { - public final List<Object> takenElements = new ArrayList<Object>(); - public IPipe<Object> pipe; - - public InputPortContainer() {} - } - - private final InputPortContainer[] inputPortContainers; - private final IOutputPort<S, ?>[] outputPorts; - - // statistics values - private long numPushedElements = 0; - private long numTakenElements = 0; - - private long numTakenElementsInCurrentTransaction = 0; - - @SuppressWarnings("unchecked") - public Context(final IStage owningStage, final List<IInputPort<S, ?>> allTargetPorts) { - this.inputPortContainers = this.createInputPortLists(owningStage.getInputPorts()); - this.outputPorts = new IOutputPort[owningStage.getOutputPorts().size()]; - } - - @SuppressWarnings("unchecked") - private InputPortContainer[] createInputPortLists(final List<IInputPort<IStage, ?>> inputPorts) { - final InputPortContainer[] inputPortContainers = new InputPortContainer[inputPorts.size()]; - for (int i = 0; i < inputPorts.size(); i++) { - inputPortContainers[i] = new InputPortContainer(); - inputPortContainers[i].pipe = (IPipe<Object>) inputPorts.get(i).getAssociatedPipe(); - } - return inputPortContainers; - } - - /** - * @since 1.10 - */ - public <T> void put(final IOutputPort<S, T> port, final T object) { - final IPipe<? super T> associatedPipe = port.getAssociatedPipe(); - if (associatedPipe == null) { - return; // ignore unconnected port - // BETTER return a NullObject rather than checking for null - } - associatedPipe.put(object); - - this.outputPorts[port.getIndex()] = port; - this.numPushedElements++; - } - - /** - * - * @param inputPort - * @return - * @since 1.10 - */ - public <T> T tryTake(final IInputPort<S, T> inputPort) { - final IPipe<? super T> associatedPipe = inputPort.getAssociatedPipe(); - final T token = associatedPipe.tryTake(); - if (token != null) { - this.logTransaction(inputPort, token); - } - return token; - } - - /** - * - * @param inputPort - * @return - * @since 1.10 - */ - public <T> T take(final IInputPort<S, T> inputPort) { - final IPipe<? super T> associatedPipe = inputPort.getAssociatedPipe(); - final T token = associatedPipe.take(); - if (token != null) { - this.logTransaction(inputPort, token); - } - return token; - } - - private final <T> void logTransaction(final IInputPort<S, T> inputPort, final T token) { - // final InputPortContainer inputPortContainer = this.inputPortContainers[inputPort.getIndex()]; - // inputPortContainer.takenElements.add(token); - - this.numTakenElementsInCurrentTransaction++; - } - - /** - * - * @param inputPort - * @return - * - * @since 1.10 - */ - public <T> T read(final IInputPort<S, T> inputPort) { - final IPipe<? super T> associatedPipe = inputPort.getAssociatedPipe(); - return associatedPipe.read(); - } - - void commit() { - // for (final List<Object> takenElements : this.pipesTakenFrom.values()) { - for (final InputPortContainer inputPortContainer : this.inputPortContainers) { - // inputPortContainer.takenElements.clear(); - - IReservablePipe<Object> reservablePipe = (IReservablePipe<Object>) inputPortContainer.pipe; - reservablePipe.commit(); - } - - this.numTakenElements += this.numTakenElementsInCurrentTransaction; - this.numTakenElementsInCurrentTransaction = 0; - - for (final IOutputPort<S, ?> outputPort : this.outputPorts) { - if (outputPort != null) { - @SuppressWarnings("unchecked") - IReservablePipe<Object> reservablePipe = (IReservablePipe<Object>) outputPort.getAssociatedPipe(); - reservablePipe.commit(); - } - } - } - - void rollback() { - for (final InputPortContainer inputPortContainer : this.inputPortContainers) { - // for (int k = inputPortContainer.takenElements.size() - 1; k >= 0; k--) { - // final Object element = inputPortContainer.takenElements.get(k); - // inputPortContainer.pipe.put(element); - // } - IReservablePipe<Object> reservablePipe = (IReservablePipe<Object>) inputPortContainer.pipe; - reservablePipe.rollback(); - } - - for (final IOutputPort<S, ?> outputPort : this.outputPorts) { - if (outputPort != null) { - @SuppressWarnings("unchecked") - IReservablePipe<Object> reservablePipe = (IReservablePipe<Object>) outputPort.getAssociatedPipe(); - reservablePipe.rollback(); - } - } - } - - @Override - public String toString() { - return "{" + "numTakenElements=" + this.numTakenElements + ", " + "numPushedElements=" + this.numPushedElements + "}"; - } - - /** - * @return <code>true</code> iff all input ports are empty, otherwise <code>false</code>. - */ - public boolean inputPortsAreEmpty() { - for (final InputPortContainer inputPortContainer : this.inputPortContainers) { - if (!inputPortContainer.pipe.isEmpty()) { - return false; - } - } - return true; - } - - /** - * @since 1.10 - */ - public void clearSucessors() { - for (int i = 0; i < this.outputPorts.length; i++) { - this.outputPorts[i] = null; - } - } - - /** - * @return - * @since 1.10 - */ - public IOutputPort<S, ?>[] getOutputPorts() { - return this.outputPorts; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/Description.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/Description.java deleted file mode 100644 index ade2e166..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/Description.java +++ /dev/null @@ -1,34 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.core; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @author Nils Christian Ehmke - * - * @since 1.10 - */ -@Retention(RetentionPolicy.RUNTIME) -@Target({ ElementType.TYPE, ElementType.FIELD }) -public @interface Description { - - String value(); - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/IBaseStage.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/IBaseStage.java deleted file mode 100644 index 965793c4..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/IBaseStage.java +++ /dev/null @@ -1,25 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.core; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public interface IBaseStage { - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/IInputPort.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/IInputPort.java deleted file mode 100644 index 254d2628..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/IInputPort.java +++ /dev/null @@ -1,40 +0,0 @@ -package teetime.variant.explicitScheduling.framework.core; - -/** - * - * @author Christian Wulf - * - * @param <S> - * the stage, this port belongs to<br> - * <i>(used for ensuring type safety)</i> - * @param <T> - */ -public interface IInputPort<S extends IStage, T> extends IPort<S, T> { - - /** - * @since 1.10 - */ - public enum PortState { - OPENED, CLOSED - } - - /** - * @since 1.10 - */ - public abstract PortState getState(); - - /** - * @since 1.10 - */ - public abstract void setState(final PortState state); - - /** - * @since 1.10 - */ - public abstract void setPortListener(final IPortListener portListener); - - /** - * @since 1.10 - */ - public void close(); -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/IOutputPort.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/IOutputPort.java deleted file mode 100644 index c0671827..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/IOutputPort.java +++ /dev/null @@ -1,14 +0,0 @@ -package teetime.variant.explicitScheduling.framework.core; - -/** - * - * @author Christian Wulf - * - * @param <S> - * the stage, this port belongs to<br> - * <i>(used for ensuring type safety)</i> - * @param <T> - */ -public interface IOutputPort<S extends IStage, T> extends IPort<S, T> { - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/IPipe.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/IPipe.java deleted file mode 100644 index a14ba0c1..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/IPipe.java +++ /dev/null @@ -1,123 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.framework.core; - -import java.util.List; - -import teetime.util.concurrent.workstealing.exception.DequePopException; - -/** - * - * @author Christian Wulf - * - * @since 1.10 - * - * @param <T> - * the type of elements this pipe may contain - * @param <P> - */ -public interface IPipe<T> { - - /** - * @since 1.10 - */ - void put(T element); - - /** - * @since 1.10 - */ - void putMultiple(List<T> elements); - - // Let this uncommented for documentation purpose:<br> - // Since the concurrent execution does not base on locks, it is difficult to define a blocking take. Since there is no definition of blocking in the sequential - // execution, we do not define a blocking take in this interface - // /** - // * @since 1.10 - // */ - // @Deprecated - // T take(); - - /** - * @return and removes the next element if the pipe is not empty, otherwise <code>null</code> - * - * @since 1.10 - */ - <A extends T> A tryTake(); - - /** - * - * @return and removes the next element if the pipe is not empty, otherwise it throws a <code>DequePopException</code> - * - * @throws DequePopException - */ - <A extends T> A take(); - - /** - * @since 1.10 - * @return but does not removes the next element if the pipe is not empty, otherwise <code>null</code> - */ - <A extends T> A read(); - - /** - * @since 1.10 - */ - List<?> tryTakeMultiple(int numElementsToTake); - - /** - * <i>Attention: Checking for emptiness is rarely appropriate, since the state from EMPTY to NON-EMPTY can change between check and access (stale state).</i> - * - * @return <code>true</code> if this pipe is empty in this special point in time, otherwise <code>false</code>. - */ - boolean isEmpty(); - - /** - * @since 1.10 - */ - <S extends ISource, A extends T> void setSourcePort(final IOutputPort<S, A> sourcePort); - - /** - * @since 1.10 - */ - <S extends ISink<S>, A extends T> void setTargetPort(final IInputPort<S, T> targetPort); - - /** - * @since 1.10 - */ - IOutputPort<?, ? extends T> getSourcePort(); - - /** - * @since 1.10 - */ - IInputPort<?, T> getTargetPort(); - - /** - * @throws Exception - * @since 1.10 - */ - void notifyPipelineStarts() throws Exception; - - /** - * @since 1.10 - */ - void notifyPipelineStops(); - - /** - * @since 1.10 - */ - void close(); - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/IPipeCommand.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/IPipeCommand.java deleted file mode 100644 index e6eb0bc7..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/IPipeCommand.java +++ /dev/null @@ -1,26 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.core; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public interface IPipeCommand { - - void execute(IPipe<?> pipe) throws Exception; -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/IPipeline.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/IPipeline.java deleted file mode 100644 index 0b0d86b6..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/IPipeline.java +++ /dev/null @@ -1,34 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.core; - -import java.util.List; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public interface IPipeline { - - List<? extends IStage> getStages(); - - List<? extends IStage> getStartStages(); - - void fireStartNotification() throws Exception; - - void fireStopNotification(); -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/IPort.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/IPort.java deleted file mode 100644 index 0e6432ed..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/IPort.java +++ /dev/null @@ -1,22 +0,0 @@ -package teetime.variant.explicitScheduling.framework.core; - -/** - * - * @author Christian Wulf - * - * @since 1.10 - * - * @param <T> - * the type of elements this port accepts - */ -interface IPort<S extends IStage, T> { - - IPipe<? super T> getAssociatedPipe(); - - <A extends T> void setAssociatedPipe(final IPipe<? super T> associatedPipe); - - S getOwningStage(); - - int getIndex(); - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/IPortListener.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/IPortListener.java deleted file mode 100644 index 23e66be6..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/IPortListener.java +++ /dev/null @@ -1,26 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.core; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public interface IPortListener { - - void onPortIsClosed(IInputPort<?, ?> inputPort); -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/IReservablePipe.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/IReservablePipe.java deleted file mode 100644 index 3c1ef86e..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/IReservablePipe.java +++ /dev/null @@ -1,10 +0,0 @@ -package teetime.variant.explicitScheduling.framework.core; - -public interface IReservablePipe<T> extends IPipe<T> { - - // void reserve(T element); - - void commit(); - - void rollback(); -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/ISink.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/ISink.java deleted file mode 100644 index 9e33b6bc..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/ISink.java +++ /dev/null @@ -1,30 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.framework.core; - -/** - * - * @author Christian Wulf - * - * @since 1.10 - * - * @param <S> - */ -public interface ISink<S extends IStage> extends IStage { - - // BETTER remove the type parameter -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/ISource.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/ISource.java deleted file mode 100644 index 75e3ca48..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/ISource.java +++ /dev/null @@ -1,27 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.framework.core; - -/** - * @author Christian Wulf - * - * @since 1.10 - * - */ -public interface ISource extends IStage { - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/IStage.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/IStage.java deleted file mode 100644 index bcadf66d..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/IStage.java +++ /dev/null @@ -1,165 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.framework.core; - -import java.util.Collection; -import java.util.List; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public interface IStage extends IBaseStage { - - public final static int DEPTH_NOT_SET = -1; - - /** - * @since 1.10 - */ - public String getId(); - - /** - * @return <code>true</code> if the execution took enough tokens from the input ports so that the stage made progress due to this execution, <code>false</code> - * otherwise. The definition of <i>progress</i> depends on the semantics of the particular stage. - * - * <p> - * Example usage: - * </p> - * - * <pre> - * <code> - * boolean execute() { - * final Tuple token = this.tryTake(FILE_WORDCOUNT_TUPLE); - * if (token == null) { - * return false; - * } - * ... - * return true; - * } - * </code> - * </pre> - * - * @since 1.10 - */ - boolean execute(); - - // Let the method uncommented for documentation purpose:<br> - // Since the execution can dependent on the state of one, a subset, or all input queues,<br> - // an overloaded version with one input port is useless. - // void execute(InputPort inputPort); - // - // - // Let the method uncommented for documentation purpose:<br> - // Since the execution can dependent on one, a subset, or all input queues,<br> - // an overloaded version with a task bundle of one single input port is useless. - // void execute(TaskBundle taskBundle); - - /** - * @since 1.10 - */ - void fireSignalClosingToAllOutputPorts(); - - /** - * @since 1.10 - */ - void notifyPipelineStarts() throws Exception; - - /** - * @since 1.10 - */ - void notifyPipelineStops(); - - /** - * <i>Hint: Used by the scheduler</i> - * - * @since 1.10 - */ - Context<?> getContext(); - - /** - * @since 1.10 - */ - IOutputPort<?, ?> getOutputPortByIndex(int index); - - /** - * @since 1.10 - */ - IInputPort<?, ?> getInputPortByIndex(int index); - - /** - * @since 1.10 - */ - int getAccessesDeviceId(); - - /** - * @since 1.10 - */ - void setAccessesDeviceId(final int accessesDeviceId); - - /** - * <i>Hint: Only needed by stage schedulers.</i> - * - * @return - */ - public Collection<? extends IStage> getAllOutputStages(); - - /** - * @since 1.10 - */ - public <S extends IStage> List<IInputPort<S, ?>> getInputPorts(); - - /** - * @since 1.10 - */ - public <S extends IStage> List<IOutputPort<S, ?>> getOutputPorts(); - - Thread getOwningThread(); - - void setOwningThread(Thread owningThread); - - /** - * @since 1.10 - */ - void notifyOutputPipes(IPipeCommand pipeCommand) throws Exception; - - /** - * @since 1.10 - */ - public int getDepth(); - - /** - * @since 1.10 - */ - public void setDepth(int depth); - - /** - * @since 1.10 - */ - public int getSchedulingIndex(); - - /** - * @since 1.10 - */ - public void setSchedulingIndex(int schedulingIndex); - - /** - * @since 1.10 - */ - public boolean isSchedulable(); - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/InputPortImpl.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/InputPortImpl.java deleted file mode 100644 index 2a61afff..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/InputPortImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.framework.core; - -class InputPortImpl<S extends IStage, T> extends AbstractPort<S, T> implements IInputPort<S, T> { - - private volatile PortState state = PortState.OPENED; - - private IPortListener portListener; - - public InputPortImpl(final S owningStage) { - this.setOwningStage(owningStage); - } - - @Override - public void setState(final PortState state) { - this.state = state; - } - - @Override - public PortState getState() { - return this.state; - } - - @Override - public void setPortListener(final IPortListener portListener) { - this.portListener = portListener; - } - - @Override - public void close() { - if (this.portListener == null) { - throw new NullPointerException("stage: "+this.getOwningStage().getClass().getName()+", port="+this.getIndex()); - } - this.portListener.onPortIsClosed(this); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/OutputPortImpl.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/OutputPortImpl.java deleted file mode 100644 index 946b2ec3..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/OutputPortImpl.java +++ /dev/null @@ -1,10 +0,0 @@ -package teetime.variant.explicitScheduling.framework.core; - - -public class OutputPortImpl<S extends IStage, T> extends AbstractPort<S, T> implements IOutputPort<S, T> { - - public OutputPortImpl(final S owningStage) { - this.setOwningStage(owningStage); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/Pipeline.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/Pipeline.java deleted file mode 100644 index 5526b9b9..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/Pipeline.java +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.core; - -import java.util.List; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class Pipeline implements IPipeline { - - private List<? extends IStage> startStages; - private List<IStage> stages; - - public List<? extends IStage> getStartStages() { - return this.startStages; - } - - public List<IStage> getStages() { - return this.stages; - } - - public void fireStartNotification() throws Exception { - for (final IStage stage : this.getStartStages()) { - stage.notifyPipelineStarts(); - } - } - - public void fireStopNotification() { - for (final IStage stage : this.getStartStages()) { - stage.notifyPipelineStops(); - } - } - - public void setStartStages(final List<? extends IStage> startStages) { - this.startStages = startStages; - } - - public void setStages(final List<IStage> stages) { - this.stages = stages; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/core/ReservableContext.java b/src/main/java/teetime/variant/explicitScheduling/framework/core/ReservableContext.java deleted file mode 100644 index 37b8f527..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/core/ReservableContext.java +++ /dev/null @@ -1,5 +0,0 @@ -package teetime.variant.explicitScheduling.framework.core; - -public class ReservableContext { - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/scheduling/NextStageScheduler.java b/src/main/java/teetime/variant/explicitScheduling/framework/scheduling/NextStageScheduler.java deleted file mode 100644 index becf8180..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/scheduling/NextStageScheduler.java +++ /dev/null @@ -1,106 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.framework.scheduling; - -import java.util.LinkedHashSet; -import java.util.Set; - -import teetime.variant.explicitScheduling.framework.concurrent.IStageScheduler; -import teetime.variant.explicitScheduling.framework.concurrent.IStageWorkList; -import teetime.variant.explicitScheduling.framework.concurrent.StageWorkArrayList; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.framework.core.IPipeline; -import teetime.variant.explicitScheduling.framework.core.IStage; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public final class NextStageScheduler implements IStageScheduler { - - private final Set<IStage> highestPrioritizedEnabledStages = new LinkedHashSet<IStage>(); - private final IStageWorkList workList; - private final StageStateManager stageStateManager; - - public NextStageScheduler(final IPipeline pipeline, final int accessesDeviceId, final StageStateManager stageStateManager) { - this.stageStateManager = stageStateManager; - // this.workList = new StageWorkList(accessesDeviceId, pipeline.getStages().size()); - this.workList = new StageWorkArrayList(pipeline, accessesDeviceId); // faster implementation - - this.highestPrioritizedEnabledStages.addAll(pipeline.getStartStages()); - - this.workList.pushAll(this.highestPrioritizedEnabledStages); - // System.out.println("Initial work list: " + this.workList); - // this.workList.addAll(pipeline.getStages()); - } - - @Override - public final IStage get() { - return this.workList.read(); - } - - @Override - public final boolean isAnyStageActive() { - return !this.workList.isEmpty(); - } - - @Override - public final void disable(final IStage stage) { - this.stageStateManager.disable(stage); - - if (this.highestPrioritizedEnabledStages.contains(stage)) { - this.highestPrioritizedEnabledStages.remove(stage); - for (final IStage outputStage : stage.getAllOutputStages()) { - if (this.stageStateManager.isStageEnabled(outputStage)) { - this.highestPrioritizedEnabledStages.add(outputStage); - } - } - } - - // System.out.println("highestPrioritizedEnabledStages: "+this.highestPrioritizedEnabledStages); - stage.fireSignalClosingToAllOutputPorts(); - } - - @Override - public final void determineNextStage(final IStage stage, final boolean executedSuccessfully) { - // final Collection<? extends IStage> outputStages = stage.getContext().getOutputStages(); - final IOutputPort<?, ?>[] outputPorts = stage.getContext().getOutputPorts(); - if (outputPorts.length > 0) { - final boolean inputPortsAreEmpty = stage.getContext().inputPortsAreEmpty(); - if (inputPortsAreEmpty) { - this.workList.pop(); - } - - // TODO consider to not add the stage again if it has a cyclic pipe - // TODO or prioritize non-self stages - // while (outputStages.remove(stage)) { - // } - - this.workList.pushAll(outputPorts); - - stage.getContext().clearSucessors(); - } else { - this.workList.pop(); - } - - if (this.workList.isEmpty()) { - this.workList.pushAll(this.highestPrioritizedEnabledStages); - } - - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/scheduling/StageStateContainer.java b/src/main/java/teetime/variant/explicitScheduling/framework/scheduling/StageStateContainer.java deleted file mode 100644 index fdc8241c..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/scheduling/StageStateContainer.java +++ /dev/null @@ -1,25 +0,0 @@ -package teetime.variant.explicitScheduling.framework.scheduling; - -import teetime.variant.explicitScheduling.framework.core.IStage; - -public abstract class StageStateContainer { - - public static enum StageState { - ENABLED, ALL_INPUT_PORTS_CLOSED, DISABLED - } - - protected final IStage stage; - protected volatile StageState stageState; - - public StageStateContainer(final IStage stage) { - this.stage = stage; - this.stageState = stage.getInputPorts().size() > 0 ? StageState.ENABLED : StageState.ALL_INPUT_PORTS_CLOSED; -// System.out.println("stage=" + stage + ", stageState=" + this.stageState); - } - - /** - * - * @return the new value - */ - public abstract int decNumOpenedPorts(); -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/scheduling/StageStateManager.java b/src/main/java/teetime/variant/explicitScheduling/framework/scheduling/StageStateManager.java deleted file mode 100644 index 04b0d51a..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/scheduling/StageStateManager.java +++ /dev/null @@ -1,84 +0,0 @@ -package teetime.variant.explicitScheduling.framework.scheduling; - -import java.util.Arrays; - -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IPipeline; -import teetime.variant.explicitScheduling.framework.core.IPortListener; -import teetime.variant.explicitScheduling.framework.core.IStage; -import teetime.variant.explicitScheduling.framework.scheduling.StageStateContainer.StageState; - -public final class StageStateManager implements IPortListener { - - private final StageStateContainer[] stageStateContainers; - - public StageStateManager(final IPipeline pipeline) { - this.stageStateContainers = this.initStageStateContainers(pipeline); - this.registerAtAllInputPorts(pipeline); - } - - private void registerAtAllInputPorts(final IPipeline pipeline) { - for (IStage stage : pipeline.getStages()) { - for (IInputPort<IStage, ?> inputPort : stage.getInputPorts()) { - inputPort.setPortListener(this); - } - } - } - - private StageStateContainer[] initStageStateContainers(final IPipeline pipeline) { - StageStateContainer[] stageStateContainers = new StageStateContainer[pipeline.getStages().size()]; - for (IStage stage : pipeline.getStages()) { - StageStateContainer stageStateContainer; - if (this.isConnectedWithAnotherThread(stage)) { - stageStateContainer = new SynchronizedStageStateContainer(stage); - } else { - stageStateContainer = new UnsynchronizedStageStateContainer(stage); - } - stageStateContainers[stage.getSchedulingIndex()] = stageStateContainer; - } - return stageStateContainers; - } - - private boolean isConnectedWithAnotherThread(final IStage stage) { - // TODO Auto-generated method stub - return true; - } - - @Override - public void onPortIsClosed(final IInputPort<?, ?> inputPort) { - StageStateContainer stageStateContainer = this.getStageStateContainer(inputPort.getOwningStage()); - - int newNumOpenedPorts = stageStateContainer.decNumOpenedPorts(); - if (newNumOpenedPorts == 0) { - stageStateContainer.stageState = StageState.ALL_INPUT_PORTS_CLOSED; -// System.out.println("Closed stage: " + stageStateContainer.stage); - } else if (newNumOpenedPorts < 0) { - // TODO log warning - // this.logger.warning("Closed port more than once: portIndex=" + inputPort.getIndex() + " for stage " + this); - } - } - - public boolean areAllInputPortsClosed(final IStage stage) { - StageStateContainer stageStateContainer = this.getStageStateContainer(stage); - return stageStateContainer.stageState == StageState.ALL_INPUT_PORTS_CLOSED; - } - - public boolean isStageEnabled(final IStage stage) { - StageStateContainer stageStateContainer = this.getStageStateContainer(stage); - return stageStateContainer.stageState == StageState.ENABLED; - } - - public void disable(final IStage stage) { - StageStateContainer stageStateContainer = this.getStageStateContainer(stage); - stageStateContainer.stageState = StageState.DISABLED; - } - - private StageStateContainer getStageStateContainer(final IStage stage) { - int schedulingIndex = stage.getSchedulingIndex(); - StageStateContainer stageStateContainer = this.stageStateContainers[schedulingIndex]; - if (stageStateContainer == null) { - throw new NullPointerException("No container found for index ="+schedulingIndex+"\n=> stageStateContainers="+Arrays.asList(this.stageStateContainers)); - } - return stageStateContainer; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/scheduling/SynchronizedStageStateContainer.java b/src/main/java/teetime/variant/explicitScheduling/framework/scheduling/SynchronizedStageStateContainer.java deleted file mode 100644 index 9dd69e3a..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/scheduling/SynchronizedStageStateContainer.java +++ /dev/null @@ -1,21 +0,0 @@ -package teetime.variant.explicitScheduling.framework.scheduling; - -import java.util.concurrent.atomic.AtomicInteger; - -import teetime.variant.explicitScheduling.framework.core.IStage; - -public final class SynchronizedStageStateContainer extends StageStateContainer { - - private final AtomicInteger numOpenedPorts = new AtomicInteger(); - - public SynchronizedStageStateContainer(final IStage stage) { - super(stage); - this.numOpenedPorts.set(stage.getInputPorts().size()); - } - - @Override - public int decNumOpenedPorts() { - return this.numOpenedPorts.decrementAndGet(); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/scheduling/UnsynchronizedStageStateContainer.java b/src/main/java/teetime/variant/explicitScheduling/framework/scheduling/UnsynchronizedStageStateContainer.java deleted file mode 100644 index f425d2ba..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/scheduling/UnsynchronizedStageStateContainer.java +++ /dev/null @@ -1,19 +0,0 @@ -package teetime.variant.explicitScheduling.framework.scheduling; - -import teetime.variant.explicitScheduling.framework.core.IStage; - -public final class UnsynchronizedStageStateContainer extends StageStateContainer { - - private int numOpenedInputPorts; - - public UnsynchronizedStageStateContainer(final IStage stage) { - super(stage); - this.numOpenedInputPorts = stage.getInputPorts().size(); - } - - @Override - public int decNumOpenedPorts() { - return --this.numOpenedInputPorts; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/sequential/MethodCallPipe.java b/src/main/java/teetime/variant/explicitScheduling/framework/sequential/MethodCallPipe.java deleted file mode 100644 index 820fb6dc..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/sequential/MethodCallPipe.java +++ /dev/null @@ -1,105 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.framework.sequential; - -import java.util.List; - -import teetime.variant.explicitScheduling.framework.core.AbstractPipe; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.framework.core.IReservablePipe; -import teetime.variant.explicitScheduling.framework.core.ISink; -import teetime.variant.explicitScheduling.framework.core.ISource; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallPipe<T> extends AbstractPipe<T> implements IReservablePipe<T> { - - private T storedToken; - - public MethodCallPipe(final T initialToken) { - this.storedToken = initialToken; - } - - public MethodCallPipe() { - this.storedToken = null; - } - - static public <S0 extends ISource, S1 extends ISink<S1>, T> void connect(final IOutputPort<S0, T> sourcePort, final IInputPort<S1, T> targetPort) { - final MethodCallPipe<T> pipe = new MethodCallPipe<T>(); - pipe.setSourcePort(sourcePort); - pipe.setTargetPort(targetPort); - } - - @Override - protected void putInternal(final T token) { - this.storedToken = token; - this.getTargetPort().getOwningStage().execute(); - } - - @Override - protected T tryTakeInternal() { - final T temp = this.storedToken; - this.storedToken = null; - return temp; - } - - @Override - public T take() { - return this.tryTake(); - } - - @Override - public T read() { - return this.storedToken; - } - - @Override - public void putMultiple(final List<T> items) { - throw new IllegalStateException("Putting more than one element is not possible. You tried to put " + items.size() + " items."); - } - - @Override - public List<?> tryTakeMultiple(final int numElementsToTake) { - throw new IllegalStateException("Taking more than one element is not possible. You tried to take " + numElementsToTake + " items."); - } - - public void copyAllOtherPipes(final List<MethodCallPipe<T>> pipesOfGroup) { - // is not needed in a synchronous execution - } - - @Override - public boolean isEmpty() { - return this.storedToken == null; - } - - @Override - public void commit() { - // TODO Auto-generated method stub - - } - - @Override - public void rollback() { - // TODO Auto-generated method stub - - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/sequential/Pipeline.java.todo b/src/main/java/teetime/variant/explicitScheduling/framework/sequential/Pipeline.java.todo deleted file mode 100644 index 9b95dc19..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/sequential/Pipeline.java.todo +++ /dev/null @@ -1,190 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package kieker.panalysis.framework.sequential; - -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import kieker.panalysis.framework.core.AbstractFilter; -import kieker.panalysis.framework.core.IInputPort; -import kieker.panalysis.framework.core.IOutputPort; -import kieker.panalysis.framework.core.IPipe; -import kieker.panalysis.framework.core.ISink; -import kieker.panalysis.framework.core.ISource; -import kieker.panalysis.framework.core.IStage; - -/** - * @author Christian Wulf - * - * @since 1.10 - * - * @param <P> - * The type of the pipes - */ -public class Pipeline<P extends IPipe<?>> { - - protected final List<IStage> stages = new LinkedList<IStage>(); - private int freeId = 0; - private AbstractFilter<?>[] startStages; - - private P currentPipe; - private final Map<Integer, List<P>> pipeGroups; - private final Map<IOutputPort<?, ?>, IInputPort<?, ?>> connections = new HashMap<IOutputPort<?, ?>, IInputPort<?, ?>>(); - - /** - * The default constructor.<br> - * <i>Public constructors are available via the static method <code>create(..)</code></i> - * - * @see for example, {@link #create(Map)} - * - * @since 1.10 - */ - private Pipeline() { - this(new HashMap<Integer, List<P>>()); - } - - /** - * @since 1.10 - */ - private Pipeline(final Map<Integer, List<P>> pipeGroups) { - this.pipeGroups = pipeGroups; - } - - /** - * @since 1.10 - */ - // this constructor prevents the programmer from repeating the type argument - public static <P extends IPipe<?>> Pipeline<P> create() { - return new Pipeline<P>(); - } - - /** - * - * @param pipeGroups - * a map where its keys represent the group id and its values represent the list of pipes - * @return - */ - // this constructor prevents the programmer from repeating the type argument - public static <P extends IPipe<?>> Pipeline<P> create(final Map<Integer, List<P>> pipeGroups) { - return new Pipeline<P>(pipeGroups); - } - - /** - * <p> - * Adds the given <code>stage</code> to this pipeline and set a unique identifier. - * </p> - * <p> - * Use this method as indicated in the following example: <blockquote> <code>Distributor distributor = pipeline.addStage(new Distributor())</code> </blockquote> - * </p> - * - * @param stage - * @return - */ - public <S extends IStage> S addStage(final S stage) { - stage.setId(this.freeId++); - stage.setOwningPipeline(this); - this.stages.add(stage); - return stage; - } - - /** - * @since 1.10 - */ - public void start() { - this.fireStartEvent(); - - if (this.startStages.length == 0) { - throw new IllegalStateException("You need to define at least one start stage."); - } else if (this.startStages.length == 1) { - // this.startStages.get(0).execute(); - } else { - // TODO create a single distributor stage as start stage - throw new IllegalStateException("Multiple start stages are not yet supported."); - } - } - - /** - * @since 1.10 - */ - private void fireStartEvent() { - for (final IStage stage : this.stages) { - stage.onPipelineStarts(); - } - } - - /** - * @since 1.10 - */ - public List<IStage> getStages() { - return this.stages; - } - - /** - * @since 1.10 - */ - public Pipeline<P> add(final P pipe) { - this.currentPipe = pipe; - return this; - } - - /** - * @since 1.10 - */ - public <S0 extends ISource, S1 extends ISink<S1>, T> void connect(final IOutputPort<S0, T> sourcePort, final IInputPort<S1, T> targetPort) { - this.connections.put(sourcePort, targetPort); - } - - /** - * @since 1.10 - */ - public void toGroup(final int pipeGroupIdentifier) { - List<P> pipes = this.pipeGroups.get(pipeGroupIdentifier); - if (pipes == null) { - pipes = new LinkedList<P>(); - this.pipeGroups.put(pipeGroupIdentifier, pipes); - } - pipes.add(this.currentPipe); - } - - /** - * @since 1.10 - */ - // BETTER move this method out of the pipeline - public void connectPipeGroups() { - for (final List<P> samePipes : this.pipeGroups.values()) { - for (final P pipe : samePipes) { - pipe.copyAllOtherPipes(samePipes); - } - } - } - - /** - * @since 1.10 - */ - public void setStartStages(final AbstractFilter<?>... startStages) { - this.startStages = startStages; - } - - /** - * @since 1.10 - */ - public AbstractFilter<?>[] getStartStages() { - return this.startStages; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/sequential/QueuePipe.java b/src/main/java/teetime/variant/explicitScheduling/framework/sequential/QueuePipe.java deleted file mode 100644 index 1a517847..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/sequential/QueuePipe.java +++ /dev/null @@ -1,108 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.sequential; - -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; - -import teetime.util.concurrent.workstealing.CircularWorkStealingDeque; -import teetime.variant.explicitScheduling.framework.core.AbstractPipe; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.framework.core.IReservablePipe; -import teetime.variant.explicitScheduling.framework.core.ISink; -import teetime.variant.explicitScheduling.framework.core.ISource; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class QueuePipe<T> extends AbstractPipe<T> implements IReservablePipe<T> { - - // private final List<T> queue = new ArrayList<T>(10); - private final Queue<T> queue = new LinkedList<T>(); - - // private final List<T> queue = new ReservableArrayList<T>(10); - - // private final ObjectPooledLinkedList<T> queue = new ObjectPooledLinkedList<T>(); - - static public <S0 extends ISource, S1 extends ISink<S1>, T> void connect(final IOutputPort<S0, ? extends T> sourcePort, final IInputPort<S1, T> targetPort) { - final QueuePipe<T> pipe = new QueuePipe<T>(); - pipe.setSourcePort(sourcePort); - pipe.setTargetPort(targetPort); - } - - @Override - public void putInternal(final T element) { - this.queue.add(element); - // this.queue.push(element); - } - - @Override - public void putMultiple(final List<T> elements) { - this.queue.addAll(elements); - throw new IllegalStateException(); - } - - @Override - public T tryTakeInternal() { - return this.queue.poll(); - // return this.queue.remove(this.queue.size() - 1); - // return this.queue.pop(); - } - - @Override - public T take() { - final T element = this.tryTake(); - if (element == null) { - throw CircularWorkStealingDeque.DEQUE_IS_EMPTY_EXCEPTION; - } - return element; - } - - @Override - public T read() { - return this.queue.peek(); - // return this.queue.get(this.queue.size() - 1); - // return this.queue.read(); - } - - @Override - public List<?> tryTakeMultiple(final int numElementsToTake) { - throw new IllegalStateException("Taking more than one element is not possible. You tried to take " + numElementsToTake + " items."); - } - - @Override - public boolean isEmpty() { - return this.queue.isEmpty(); - // return this.queue.size() == 0; - } - - @Override - public void commit() { - // TODO Auto-generated method stub - - } - - @Override - public void rollback() { - // TODO Auto-generated method stub - - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/sequential/ReservableQueuePipe.java b/src/main/java/teetime/variant/explicitScheduling/framework/sequential/ReservableQueuePipe.java deleted file mode 100644 index 3ed9a10d..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/sequential/ReservableQueuePipe.java +++ /dev/null @@ -1,63 +0,0 @@ -package teetime.variant.explicitScheduling.framework.sequential; - -import java.util.List; - -import teetime.util.list.CommittableQueue; -import teetime.util.list.CommittableResizableArrayQueue; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.framework.core.IReservablePipe; -import teetime.variant.explicitScheduling.framework.core.ISink; -import teetime.variant.explicitScheduling.framework.core.ISource; - -public class ReservableQueuePipe<T> extends QueuePipe<T> implements IReservablePipe<T> { - - private final CommittableQueue<T> reservableQueue = new CommittableResizableArrayQueue<T>(EMPTY_OBJECT, 10); - - static public <S0 extends ISource, S1 extends ISink<S1>, T> void connect(final IOutputPort<S0, ? extends T> sourcePort, final IInputPort<S1, T> targetPort) { - final QueuePipe<T> pipe = new ReservableQueuePipe<T>(); - pipe.setSourcePort(sourcePort); - pipe.setTargetPort(targetPort); - } - - @Override - public void commit() { - this.reservableQueue.commit(); - } - - @Override - public void rollback() { - this.reservableQueue.rollback(); - } - - @Override - public void putInternal(final T element) { - this.reservableQueue.addToTailUncommitted(element); - } - - @Override - public T tryTakeInternal() { - return this.reservableQueue.removeFromHeadUncommitted(); - } - - @Override - public T read() { - return this.reservableQueue.getTail(); - } - - @Override - public boolean isEmpty() { - return this.reservableQueue.isEmpty(); - } - - @Override - public void putMultiple(final List<T> elements) { - throw new IllegalStateException(); - } - - @Override - public List<?> tryTakeMultiple(final int numElementsToTake) { - throw new IllegalStateException(); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/util/BaseStage2StageExtractor.java b/src/main/java/teetime/variant/explicitScheduling/framework/util/BaseStage2StageExtractor.java deleted file mode 100644 index 5db91639..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/util/BaseStage2StageExtractor.java +++ /dev/null @@ -1,49 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.util; - -import java.util.LinkedList; -import java.util.List; - -import teetime.variant.explicitScheduling.framework.core.CompositeFilter; -import teetime.variant.explicitScheduling.framework.core.IBaseStage; -import teetime.variant.explicitScheduling.framework.core.IStage; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class BaseStage2StageExtractor { - - public List<? extends IStage> extract(final IBaseStage baseStage) { - final List<IStage> stages = new LinkedList<IStage>(); - this.extractLocally(baseStage, stages); - return stages; - } - - private void extractLocally(final IBaseStage baseStage, final List<IStage> stages) { - if (baseStage instanceof IStage) { - stages.add((IStage) baseStage); - } else if (baseStage instanceof CompositeFilter) { - final List<IBaseStage> schedulableStages = ((CompositeFilter) baseStage).getSchedulableStages(); - for (final IBaseStage childBaseStage : schedulableStages) { - this.extractLocally(childBaseStage, stages); - } - } - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/framework/util/Cloner.java b/src/main/java/teetime/variant/explicitScheduling/framework/util/Cloner.java deleted file mode 100644 index 2fb8acdd..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/framework/util/Cloner.java +++ /dev/null @@ -1,128 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.framework.util; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -/** - * A helper class to clone bean like objects with default constructors, getters, and setters. - * - * @author Nils Christian Ehmke - * - * @since 1.10 - */ -public class Cloner { - - private Cloner() {} - - /** - * Clones the given object by creating a new instance of the class. The method invokes all getter methods on the original and stores the resulting values in the - * clone by invoking the corresponding setter methods. Properties without setter or getter methods are ignored. The resulting clone is always a new instance, - * hence original != clone holds. It is assumed that the given instance provides a default constructor without any parameters. - * - * @param original - * The original instance to clone. - * - * @return A clone of the given instance. - * - * @throws Exception - * If the given instance does not provide a default constructor, the getters or setters are not accessible, the getters and setters are not - * compatible, or any of the methods threw an exception. - */ - @SuppressWarnings("unchecked") - public static <T> T cloneObject(final T original) throws Exception { - // Comment for 1.7: The three exceptions, thrown by this called method, have the same parent exception since 1.7 - final T clone = (T) original.getClass().newInstance(); - - Cloner.cloneAllProperties(original, clone); - - return clone; - } - - private static <T> void cloneAllProperties(final T original, final T clone) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { - final Collection<GetterSetterPair> getterSetterPairs = Cloner.getGetterSetterPairs(original.getClass()); - - for (final GetterSetterPair getterSetterPair : getterSetterPairs) { - final Object value = getterSetterPair.getGetter().invoke(original); - getterSetterPair.getSetter().invoke(clone, value); - } - } - - private static Collection<GetterSetterPair> getGetterSetterPairs(final Class<?> clazz) { - final Collection<GetterSetterPair> properties = new ArrayList<GetterSetterPair>(); - - final Map<String, Method> foundGetters = new HashMap<String, Method>(); - final Map<String, Method> foundSetters = new HashMap<String, Method>(); - - final Method[] methods = clazz.getMethods(); - for (final Method method : methods) { - if (Cloner.isGetter(method)) { - final String propertyName = method.getName().substring(3); - if (foundSetters.containsKey(propertyName)) { - properties.add(new GetterSetterPair(method, foundSetters.remove(propertyName))); - } else { - foundGetters.put(propertyName, method); - } - } else if (Cloner.isSetter(method)) { - final String propertyName = method.getName().substring(3); - if (foundGetters.containsKey(propertyName)) { - properties.add(new GetterSetterPair(foundGetters.remove(propertyName), method)); - } else { - foundSetters.put(propertyName, method); - } - } - } - - return properties; - } - - private static boolean isSetter(final Method method) { - return ((method.getReturnType() == Void.TYPE) && (method.getParameterTypes().length == 1) && (Modifier.isPublic(method.getModifiers())) && method.getName() - .matches("set[A-Z].*")); - } - - private static boolean isGetter(final Method method) { - return ((method.getReturnType() != Void.TYPE) && (method.getParameterTypes().length == 0) && (Modifier.isPublic(method.getModifiers())) && method.getName() - .matches("get[A-Z].*")); - } - - private static class GetterSetterPair { - - private final Method getter; - private final Method setter; - - public GetterSetterPair(final Method getter, final Method setter) { - this.getter = getter; - this.setter = setter; - } - - public Method getGetter() { - return this.getter; - } - - public Method getSetter() { - return this.setter; - } - - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/Cache.java b/src/main/java/teetime/variant/explicitScheduling/stage/Cache.java deleted file mode 100644 index 3b5e9d75..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/Cache.java +++ /dev/null @@ -1,90 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage; - -import java.util.LinkedList; -import java.util.List; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class Cache<T> extends AbstractFilter<Cache<T>> { - - private static enum OperationMode { - CACHING, SENDING - } - - private OperationMode operationMode = OperationMode.CACHING; - - public final IInputPort<Cache<T>, T> objectInputPort = this.createInputPort(); - public final IInputPort<Cache<T>, Boolean> sendInputPort = this.createInputPort(); - - public final IOutputPort<Cache<T>, T> objectOutputPort = this.createOutputPort(); - - private final List<T> cachedObjects = new LinkedList<T>(); - - @Override - protected boolean execute(final Context<Cache<T>> context) { - if (this.operationMode == OperationMode.CACHING) { - final T object = context.tryTake(this.objectInputPort); - if (object == null) { - final Boolean shouldSend = context.tryTake(this.sendInputPort); - if (shouldSend == null) { - return false; - } else { - this.operationMode = OperationMode.SENDING; - } - } else { - this.cache(object); - } - } else { - final boolean sent = this.send(context); - if (!sent) { - this.operationMode = OperationMode.CACHING; - } - } - - return true; - } - - /** - * @since 1.10 - */ - private boolean send(final Context<Cache<T>> context) { - if (this.cachedObjects.size() > 0) { - final T cachedObject = this.cachedObjects.remove(0); - context.put(this.objectOutputPort, cachedObject); - return true; - } else { - return false; - } - } - - /** - * @since 1.10 - */ - private void cache(final T object) { - this.cachedObjects.add(object); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/CollectorSink.java b/src/main/java/teetime/variant/explicitScheduling/stage/CollectorSink.java deleted file mode 100644 index 2ab57eb3..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/CollectorSink.java +++ /dev/null @@ -1,68 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage; - -import java.util.Collection; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class CollectorSink<T> extends AbstractFilter<CollectorSink<T>> { - - private static final int THRESHOLD = 10000; - - public final IInputPort<CollectorSink<T>, T> objectInputPort = this.createInputPort(); - private Collection<T> objects; - - public CollectorSink(final Collection<T> collection) { - this.objects = collection; - } - - public CollectorSink() { - super(); - } - - @Override - protected boolean execute(final Context<CollectorSink<T>> context) { - final T object = context.tryTake(this.objectInputPort); - if (object == null) { - return false; - } - - this.objects.add(object); - - if ((this.objects.size() % THRESHOLD) == 0) { - System.out.println("size: " + this.objects.size()); - } - - return true; - } - - public Collection<T> getObjects() { - return this.objects; - } - - public void setObjects(final Collection<T> objects) { - this.objects = objects; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/CountingFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/CountingFilter.java deleted file mode 100644 index 4cd0b278..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/CountingFilter.java +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.stage; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class CountingFilter<T> extends AbstractFilter<CountingFilter<T>> { - - public final IInputPort<CountingFilter<T>, T> INPUT_OBJECT = this.createInputPort(); - public final IInputPort<CountingFilter<T>, Long> CURRENT_COUNT = this.createInputPort(); - - public final IOutputPort<CountingFilter<T>, T> RELAYED_OBJECT = this.createOutputPort(); - public final IOutputPort<CountingFilter<T>, Long> NEW_COUNT = this.createOutputPort(); - - /** - * @since 1.10 - */ - @Override - protected boolean execute(final Context<CountingFilter<T>> context) { - final T inputObject = context.tryTake(this.INPUT_OBJECT); - if (inputObject == null) { - return false; - } - final Long currentCount = context.tryTake(this.CURRENT_COUNT); - if (currentCount == null) { - return false; - } - - context.put(this.RELAYED_OBJECT, inputObject); - // FIXME using a MethodCallPipe leads to a stackoverflow since the value (currentCount+1) is put and taken infinitely - context.put(this.NEW_COUNT, currentCount + 1); // BETTER support pipes with primitive values to improve performance by avoiding auto-boxing - - return true; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/FileExtensionFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/FileExtensionFilter.java deleted file mode 100644 index 6e058aa4..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/FileExtensionFilter.java +++ /dev/null @@ -1,78 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage; - -import java.io.File; -import java.util.HashMap; -import java.util.regex.Pattern; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class FileExtensionFilter extends AbstractFilter<FileExtensionFilter> { - - public final IInputPort<FileExtensionFilter, File> fileInputPort = this.createInputPort(); - - public final IOutputPort<FileExtensionFilter, File> unknownFileExtensionOutputPort = this.createOutputPort(); - - private final HashMap<String, IOutputPort<FileExtensionFilter, File>> fileExtensionMap = new HashMap<String, IOutputPort<FileExtensionFilter, File>>(); - - private static final Pattern DOT_PATTERN = Pattern.compile("\\."); - - @Override - protected boolean execute(final Context<FileExtensionFilter> context) { - final File file = context.tryTake(this.fileInputPort); - if (file == null) { - return false; - } - - final String[] filenameParts = DOT_PATTERN.split(file.getName()); - final String fileExtension = filenameParts[filenameParts.length - 1]; - final IOutputPort<FileExtensionFilter, File> outputPort = this.fileExtensionMap.get(fileExtension); - if (outputPort != null) { - context.put(outputPort, file); - } else { - context.put(this.unknownFileExtensionOutputPort, file); - } - - return true; - } - - /** - * - * @param fileExtension - * the file extension (<i>a leading dot is removed automatically)</i> - * @return - */ - public IOutputPort<FileExtensionFilter, File> createOutputPortForFileExtension(String fileExtension) { - if (fileExtension.startsWith(".")) { - fileExtension = fileExtension.substring(1); - } - IOutputPort<FileExtensionFilter, File> outputPort = this.fileExtensionMap.get(fileExtension); - if (outputPort == null) { - outputPort = super.createOutputPort(); - this.fileExtensionMap.put(fileExtension, outputPort); - } - return outputPort; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/InstanceOfFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/InstanceOfFilter.java deleted file mode 100644 index aca2e55e..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/InstanceOfFilter.java +++ /dev/null @@ -1,53 +0,0 @@ -package teetime.variant.explicitScheduling.stage; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Jan Waller, Nils Christian Ehmke, Christian Wulf - * - * @since 1.10 - */ -public class InstanceOfFilter<I, O> extends AbstractFilter<InstanceOfFilter<I, O>> { - - public final IInputPort<InstanceOfFilter<I, O>, I> inputPort = this.createInputPort(); - - public final IOutputPort<InstanceOfFilter<I, O>, O> matchingOutputPort = this.createOutputPort(); - public final IOutputPort<InstanceOfFilter<I, O>, I> mismatchingOutputPort = this.createOutputPort(); - - private Class<O> type; - - /** - * @since 1.10 - */ - public InstanceOfFilter(final Class<O> type) { - this.type = type; - } - - @Override - protected boolean execute(final Context<InstanceOfFilter<I, O>> context) { - final I inputObject = context.tryTake(this.inputPort); - if (inputObject == null) { - return false; - } - - if (this.type.isInstance(inputObject)) { - context.put(this.matchingOutputPort, this.type.cast(inputObject)); - } else { - context.put(this.mismatchingOutputPort, inputObject); - } - - return true; - } - - public Class<O> getType() { - return this.type; - } - - public void setType(final Class<O> type) { - this.type = type; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/NoopFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/NoopFilter.java deleted file mode 100644 index 5aebff55..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/NoopFilter.java +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class NoopFilter<T> extends AbstractFilter<NoopFilter<T>> { - - public final IInputPort<NoopFilter<T>, T> inputPort = this.createInputPort(); - public final IOutputPort<NoopFilter<T>, T> outputPort = this.createOutputPort(); - - @Override - protected boolean execute(final Context<NoopFilter<T>> context) { - final T inputElement = context.tryTake(this.inputPort); - if (inputElement == null) { - return false; - } - - context.put(this.outputPort, inputElement); - - return true; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/StartTimestampFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/StartTimestampFilter.java deleted file mode 100644 index 447ca374..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/StartTimestampFilter.java +++ /dev/null @@ -1,48 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage; - -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class StartTimestampFilter extends AbstractFilter<StartTimestampFilter> { - - public final IInputPort<StartTimestampFilter, TimestampObject> inputPort = this.createInputPort(); - public final IOutputPort<StartTimestampFilter, TimestampObject> outputPort = this.createOutputPort(); - - @Override - protected boolean execute(final Context<StartTimestampFilter> context) { - final TimestampObject inputObject = context.tryTake(this.inputPort); - if (inputObject == null) { - return false; - } - - inputObject.setStartTimestamp(System.nanoTime()); - - context.put(this.outputPort, inputObject); - - return true; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/StopTimestampFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/StopTimestampFilter.java deleted file mode 100644 index de80acde..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/StopTimestampFilter.java +++ /dev/null @@ -1,48 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage; - -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class StopTimestampFilter extends AbstractFilter<StopTimestampFilter> { - - public final IInputPort<StopTimestampFilter, TimestampObject> inputPort = this.createInputPort(); - public final IOutputPort<StopTimestampFilter, TimestampObject> outputPort = this.createOutputPort(); - - @Override - protected boolean execute(final Context<StopTimestampFilter> context) { - final TimestampObject inputObject = context.tryTake(this.inputPort); - if (inputObject == null) { - return false; - } - - inputObject.setStopTimestamp(System.nanoTime()); - - context.put(this.outputPort, inputObject); - - return true; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/SuperTypeFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/SuperTypeFilter.java deleted file mode 100644 index 6b3b109a..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/SuperTypeFilter.java +++ /dev/null @@ -1,23 +0,0 @@ -package teetime.variant.explicitScheduling.stage; - -import java.util.Collection; - -import teetime.variant.explicitScheduling.stage.predicate.IsSuperTypePredicate; -import teetime.variant.explicitScheduling.stage.predicate.PredicateFilter; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class SuperTypeFilter<T> extends PredicateFilter<T> { - - /** - * @param acceptedClasses - * @since 1.10 - */ - public SuperTypeFilter(final Collection<Class<?>> acceptedClasses) { - super(new IsSuperTypePredicate<T>(acceptedClasses)); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/TypeLoggerFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/TypeLoggerFilter.java deleted file mode 100644 index 2624e5a6..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/TypeLoggerFilter.java +++ /dev/null @@ -1,71 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.stage; - -import java.io.PrintStream; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Matthias Rohr, Jan Waller, Nils Christian Ehmke, Christian Wulf - * - * @since 1.10 - */ -public class TypeLoggerFilter<T> extends AbstractFilter<TypeLoggerFilter<T>> { - - public final IInputPort<TypeLoggerFilter<T>, T> INPUT_OBJECT = this.createInputPort(); - - public final IOutputPort<TypeLoggerFilter<T>, T> RELAYED_OBJECT = this.createOutputPort(); - - private final PrintStream printStream; - - /** - * @since 1.10 - */ - private TypeLoggerFilter() { - this.printStream = System.out; - } - - /** - * @since 1.10 - */ - public static <T> TypeLoggerFilter<T> create() { - return new TypeLoggerFilter<T>(); - } - - /** - * @since 1.10 - */ - @Override - protected boolean execute(final Context<TypeLoggerFilter<T>> context) { - final T inputObject = context.tryTake(this.INPUT_OBJECT); - if (inputObject == null) { - return false; - } - - final StringBuilder sb = new StringBuilder(128); - sb.append(super.getId()).append('(').append(inputObject.getClass().getSimpleName()).append(") ").append(inputObject.toString()); - this.printStream.println(sb.toString()); - - context.put(this.RELAYED_OBJECT, inputObject); - return true; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/basic/Clock.java b/src/main/java/teetime/variant/explicitScheduling/stage/basic/Clock.java deleted file mode 100644 index d6f7910a..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/basic/Clock.java +++ /dev/null @@ -1,79 +0,0 @@ -package teetime.variant.explicitScheduling.stage.basic; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * - * The stage implements a clock that continuously outputs the current time as timestamp. This stage MUST be owned by an own thread since this stage calls <code>Thread.sleep()</code>. - * - * @author Christian Wulf - * - * @since 1.10 - * - */ -public class Clock extends AbstractFilter<Clock> { - - public final IOutputPort<Clock, Long> timestampOutputPort = this.createOutputPort(); - - private boolean initialDelayExceeded = false; - - private long initialDelayInMs; - private long intervalDelayInMs; - - /** - * @since 1.10 - */ - @Override - protected boolean execute(final Context<Clock> context) { - if (!initialDelayExceeded) { - initialDelayExceeded = true; - sleep(initialDelayInMs); - } else { - sleep(intervalDelayInMs); - } - - context.put(timestampOutputPort, getCurrentTimeInNs()); - - return true; - } - - @Override - public void onPipelineStarts() throws Exception { - if (getOwningPipeline().getStages().size() > 1) { - throw new IllegalArgumentException("The clock stage must be the only stage within its owning pipeline since it must be executed by a separate thread."); - } - super.onPipelineStarts(); - } - - private void sleep(final long delayInMs) { - try { - Thread.sleep(delayInMs); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - private long getCurrentTimeInNs() { - return System.nanoTime(); - } - - public long getInitialDelayInMs() { - return initialDelayInMs; - } - - public void setInitialDelayInMs(final long initialDelayInMs) { - this.initialDelayInMs = initialDelayInMs; - } - - public long getIntervalDelayInMs() { - return intervalDelayInMs; - } - - public void setIntervalDelayInMs(final long intervalDelayInMs) { - this.intervalDelayInMs = intervalDelayInMs; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/basic/Delay.java b/src/main/java/teetime/variant/explicitScheduling/stage/basic/Delay.java deleted file mode 100644 index 22fd17c2..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/basic/Delay.java +++ /dev/null @@ -1,32 +0,0 @@ -package teetime.variant.explicitScheduling.stage.basic; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -public class Delay<T> extends AbstractFilter<Delay<T>> { - - public final IInputPort<Delay<T>, Object> signalInputPort = createInputPort(); - public final IInputPort<Delay<T>, T> objectInputPort = createInputPort(); - - public final IOutputPort<Delay<T>, T> relayOutputPort = createOutputPort(); - - @Override - protected boolean execute(final Context<Delay<T>> context) { - final Object signal = context.tryTake(signalInputPort); - if (signal == null) { - return false; - } - - final T object = context.tryTake(objectInputPort); - if (object == null) { - return false; - } - - context.put(relayOutputPort, object); - - return true; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/basic/ObjectProducer.java b/src/main/java/teetime/variant/explicitScheduling/stage/basic/ObjectProducer.java deleted file mode 100644 index 710ee671..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/basic/ObjectProducer.java +++ /dev/null @@ -1,85 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.basic; - -import java.util.concurrent.Callable; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class ObjectProducer<T> extends AbstractFilter<ObjectProducer<T>> { - - public final IOutputPort<ObjectProducer<T>, T> outputPort = this.createOutputPort(); - - private Callable<T> objectCreator; - private long numObjectsToCreate; - - /** - * @since 1.10 - */ - public ObjectProducer(final long numObjectsToCreate, final Callable<T> objectCreator) { - this.numObjectsToCreate = numObjectsToCreate; - this.objectCreator = objectCreator; - } - - /** - * @since 1.10 - */ - public ObjectProducer() { - super(); - } - - @Override - protected boolean execute(final Context<ObjectProducer<T>> context) { - if (this.numObjectsToCreate == 0) { - return false; - } - - try { - final T newObject = this.objectCreator.call(); - context.put(this.outputPort, newObject); - } catch (final Exception e) { - throw new IllegalStateException(e); - } - - this.numObjectsToCreate--; - - return true; - } - - public Callable<T> getObjectCreator() { - return this.objectCreator; - } - - public void setObjectCreator(final Callable<T> objectCreator) { - this.objectCreator = objectCreator; - } - - public long getNumObjectsToCreate() { - return this.numObjectsToCreate; - } - - public void setNumObjectsToCreate(final long numObjectsToCreate) { - this.numObjectsToCreate = numObjectsToCreate; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/basic/RepeaterSource.java b/src/main/java/teetime/variant/explicitScheduling/stage/basic/RepeaterSource.java deleted file mode 100644 index 28e6783d..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/basic/RepeaterSource.java +++ /dev/null @@ -1,75 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.stage.basic; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class RepeaterSource<T> extends AbstractFilter<RepeaterSource<T>> { - - public final IInputPort<RepeaterSource<T>, Boolean> START = this.createInputPort(); - - public final IOutputPort<RepeaterSource<T>, T> OUTPUT = this.createOutputPort(); - - private final T outputRecord; - private final int num; - - /** - * @since 1.10 - * @param outputRecord - * @param num - */ - private RepeaterSource(final T outputRecord, final int num) { - this.outputRecord = outputRecord; - this.num = num; - } - - /** - * @since 1.10 - * @param outputRecord - * @param num - * @return - */ - // this constructor prevents the programmer from repeating the type argument - public static <T> RepeaterSource<T> create(final T outputRecord, final int num) { - return new RepeaterSource<T>(outputRecord, num); - } - - @Override - protected boolean execute(final Context<RepeaterSource<T>> context) { - final Boolean token = context.tryTake(this.START); - if (token == null) { - return false; - } - - // TODO consider to put only one record per iteration and decrement the num directly - int counter = this.num; - while (counter-- > 0) { - context.put(this.OUTPUT, this.outputRecord); - } - - return true; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/CloneStrategy.java b/src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/CloneStrategy.java deleted file mode 100644 index 92b3228b..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/CloneStrategy.java +++ /dev/null @@ -1,34 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.basic.distributor; - -import java.util.List; - -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Nils Christian Ehmke - * - * @since 1.10 - */ -public final class CloneStrategy<T> implements IDistributorStrategy<T> { - - public <S extends Distributor<T>> boolean distribute(final Context<S> context, final List<IOutputPort<S, ?>> outputPorts, final T input) { - throw new UnsupportedOperationException(); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/CopyByReferenceStrategy.java b/src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/CopyByReferenceStrategy.java deleted file mode 100644 index c6e0b8e2..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/CopyByReferenceStrategy.java +++ /dev/null @@ -1,39 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.basic.distributor; - -import java.util.List; - -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Nils Christian Ehmke - * - * @since 1.10 - */ -public final class CopyByReferenceStrategy<T> implements IDistributorStrategy<T> { - - @SuppressWarnings("unchecked") - public <S extends Distributor<T>> boolean distribute(final Context<S> context, final List<IOutputPort<S, ?>> outputPorts, final T input) { - for (final IOutputPort<S, ?> port : outputPorts) { - context.put((IOutputPort<S, T>) port, input); - } - - return true; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/Distributor.java b/src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/Distributor.java deleted file mode 100644 index 2fceaae6..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/Distributor.java +++ /dev/null @@ -1,60 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.stage.basic.distributor; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - * - * @param T - * the type of the input port and the output ports - */ -public class Distributor<T> extends AbstractFilter<Distributor<T>> { - - public final IInputPort<Distributor<T>, T> genericInputPort = this.createInputPort(); - - private IDistributorStrategy<T> strategy = new RoundRobinStrategy<T>(); - - public IDistributorStrategy<T> getStrategy() { - return this.strategy; - } - - public void setStrategy(final IDistributorStrategy<T> strategy) { - this.strategy = strategy; - } - - @Override - protected boolean execute(final Context<Distributor<T>> context) { - final T object = context.tryTake(this.genericInputPort); - if (object == null) { - return false; - } - - return this.strategy.distribute(context, this.getOutputPorts(), object); - } - - public IOutputPort<Distributor<T>, T> getNewOutputPort() { - final IOutputPort<Distributor<T>, T> newOutputPort = this.createOutputPort(); - return newOutputPort; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/IDistributorStrategy.java b/src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/IDistributorStrategy.java deleted file mode 100644 index fcf4fced..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/IDistributorStrategy.java +++ /dev/null @@ -1,32 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.basic.distributor; - -import java.util.List; - -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Nils Christian Ehmke - * - * @since 1.10 - */ -public interface IDistributorStrategy<T> { - - public <S extends Distributor<T>> boolean distribute(final Context<S> context, final List<IOutputPort<S, ?>> allOutputPorts, final T input); - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/RoundRobinStrategy.java b/src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/RoundRobinStrategy.java deleted file mode 100644 index 75ad77af..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/basic/distributor/RoundRobinStrategy.java +++ /dev/null @@ -1,48 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.basic.distributor; - -import java.util.List; - -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Nils Christian Ehmke - * - * @since 1.10 - */ -public final class RoundRobinStrategy<T> implements IDistributorStrategy<T> { - - private int index = 0; - - public <S extends Distributor<T>> boolean distribute(final Context<S> context, final List<IOutputPort<S, ?>> outputPorts, final T object) { - final IOutputPort<S, T> port = this.getNextPortInRoundRobinOrder(outputPorts); - context.put(port, object); - - return true; - } - - @SuppressWarnings("unchecked") - private <S extends Distributor<T>> IOutputPort<S, T> getNextPortInRoundRobinOrder(final List<IOutputPort<S, ?>> outputPorts) { - final IOutputPort<S, T> port = (IOutputPort<S, T>) outputPorts.get(this.index); - - this.index = (this.index + 1) % outputPorts.size(); - - return port; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/basic/merger/IMergerStrategy.java b/src/main/java/teetime/variant/explicitScheduling/stage/basic/merger/IMergerStrategy.java deleted file mode 100644 index 000afaba..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/basic/merger/IMergerStrategy.java +++ /dev/null @@ -1,32 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.basic.merger; - -import java.util.List; - -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; - -/** - * @author Nils Christian Ehmke - * - * @since 1.10 - */ -public interface IMergerStrategy<T> { - - public <S extends Merger<T>> T getNextInput(final Context<S> context, final List<IInputPort<S, ?>> inputPorts); - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/basic/merger/Merger.java b/src/main/java/teetime/variant/explicitScheduling/stage/basic/merger/Merger.java deleted file mode 100644 index de1effc9..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/basic/merger/Merger.java +++ /dev/null @@ -1,65 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.stage.basic.merger; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.Description; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * - * @author Christian Wulf - * - * @since 1.10 - * - * @param <T> - * the type of the input ports and the output port - */ -@Description("This stage merges data from the input ports, by taking elements according to the chosen merge strategy and by putting them to the output port.") -public class Merger<T> extends AbstractFilter<Merger<T>> { - - public final IOutputPort<Merger<T>, T> outputPort = this.createOutputPort(); - - private IMergerStrategy<T> strategy = new RoundRobinStrategy<T>(); - - public IMergerStrategy<T> getStrategy() { - return this.strategy; - } - - public void setStrategy(final IMergerStrategy<T> strategy) { - this.strategy = strategy; - } - - @Override - protected boolean execute(final Context<Merger<T>> context) { - final T token = this.strategy.getNextInput(context, this.getInputPorts()); - if (token == null) { - return false; - } - - context.put(this.outputPort, token); - return true; - } - - public IInputPort<Merger<T>, T> getNewInputPort() { - final IInputPort<Merger<T>, T> newInputPort = this.createInputPort(); - return newInputPort; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/basic/merger/RoundRobinStrategy.java b/src/main/java/teetime/variant/explicitScheduling/stage/basic/merger/RoundRobinStrategy.java deleted file mode 100644 index bf61492d..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/basic/merger/RoundRobinStrategy.java +++ /dev/null @@ -1,54 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.basic.merger; - -import java.util.List; - -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; - -/** - * @author Nils Christian Ehmke - * - * @since 1.10 - */ -public final class RoundRobinStrategy<T> implements IMergerStrategy<T> { - - private int index = 0; - - public <S extends Merger<T>> T getNextInput(final Context<S> context, final List<IInputPort<S, ?>> inputPorts) { - int size = inputPorts.size(); - // check each port at most once to avoid a potentially infinite loop - while (size-- > 0) { - final IInputPort<S, T> inputPort = this.getNextPortInRoundRobinOrder(inputPorts); - final T token = context.tryTake(inputPort); - if (token != null) { - return token; - } - } - return null; - } - - @SuppressWarnings("unchecked") - private <S extends Merger<T>> IInputPort<S, T> getNextPortInRoundRobinOrder(final List<IInputPort<S, ?>> inputPorts) { - final IInputPort<S, T> port = (IInputPort<S, T>) inputPorts.get(this.index); - - this.index = (this.index + 1) % inputPorts.size(); - - return port; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/composite/CycledCountingFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/composite/CycledCountingFilter.java deleted file mode 100644 index a3cea023..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/composite/CycledCountingFilter.java +++ /dev/null @@ -1,57 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.stage.composite; - -import teetime.variant.explicitScheduling.framework.core.IPipe; -import teetime.variant.explicitScheduling.stage.CountingFilter; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class CycledCountingFilter<T> extends CountingFilter<T> { - - // BETTER hide the internal ports; the following uncommented lines do not work however - // private final IInputPort<CountingFilter<T>, Long> CURRENT_COUNT = this.createInputPort(); - // private final IOutputPort<CountingFilter<T>, Long> NEW_COUNT = this.createOutputPort(); - - /** - * @since 1.10 - * @param countingPipe - */ - // FIXME a non-default constructor is not allowed - private CycledCountingFilter(final IPipe<Long> countingPipe) { - countingPipe.setSourcePort(this.NEW_COUNT); - countingPipe.setTargetPort(this.CURRENT_COUNT); - // FIXME counting pipe needs to be added to a group - } - - // this constructor prevents the programmer from repeating the type argument - public static <T> CycledCountingFilter<T> create(final IPipe<Long> countingPipe) { - return new CycledCountingFilter<T>(countingPipe); - } - - /** - * @since 1.10 - * @return - */ - public Long getCurrentCount() { - return this.getContext().read(this.CURRENT_COUNT); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/composite/ReadRecordFromCsvFileFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/composite/ReadRecordFromCsvFileFilter.java deleted file mode 100644 index 5f8ebdfb..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/composite/ReadRecordFromCsvFileFilter.java +++ /dev/null @@ -1,65 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.stage.composite; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IPipe; -import teetime.variant.explicitScheduling.stage.io.File2TextLinesFilter; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistryRepository; -import teetime.variant.explicitScheduling.stage.kieker.fileToRecord.textLine.TextLine2RecordFilter; -import teetime.variant.explicitScheduling.stage.util.TextLine; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -// FIXME extend from CompositeStage -public class ReadRecordFromCsvFileFilter extends AbstractFilter<File2TextLinesFilter> { - - private final File2TextLinesFilter stage0; - private final TextLine2RecordFilter stage1; - - /** - * @since 1.10 - * @param textLinePipe - */ - public ReadRecordFromCsvFileFilter(final IPipe<TextLine> textLinePipe, final ClassNameRegistryRepository classNameRegistryRepository) { - this.stage0 = new File2TextLinesFilter(); - this.stage1 = new TextLine2RecordFilter(classNameRegistryRepository); - - textLinePipe.setSourcePort(this.stage0.textLineOutputPort); - textLinePipe.setTargetPort(this.stage1.textLineInputPort); - // FIXME textLinePipe needs to be added to a group - - /* - * FIXME a composite filter only serves as a convenient way to connect multiple stages or to realize self-connected queues.<br> - * How should the stage scheduler be aware of these internal stages?<br> - * Should the context not be passed to each of the internal stages? - */ - } - - /** - * @since 1.10 - */ - @Override - protected boolean execute(final Context<File2TextLinesFilter> context) { - return this.stage0.execute(); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/composite/TeeFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/composite/TeeFilter.java deleted file mode 100644 index 6daf7038..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/composite/TeeFilter.java +++ /dev/null @@ -1,56 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.stage.composite; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.framework.core.IPipe; -import teetime.variant.explicitScheduling.framework.sequential.MethodCallPipe; -import teetime.variant.explicitScheduling.stage.basic.distributor.Distributor; -import teetime.variant.explicitScheduling.stage.io.Printer; - -/** - * @author Nils Christian Ehmke - * - * @since 1.10 - */ -public class TeeFilter<T> extends AbstractFilter<TeeFilter<T>> { - - private final Distributor<T> stage0; - private final Printer<T> stage1; - - public TeeFilter(final IPipe<T> pipe) { - this.stage0 = new Distributor<T>(); - this.stage1 = new Printer<T>(); - - final IOutputPort<Distributor<T>, T> outputPort = this.stage0.getNewOutputPort(); - - pipe.setSourcePort(outputPort); - pipe.setTargetPort(this.stage0.genericInputPort); - - final IPipe<T> internalPipeline = new MethodCallPipe<T>(); - internalPipeline.setSourcePort(outputPort); - internalPipeline.setTargetPort(this.stage1.input); - } - - @Override - protected boolean execute(final Context<TeeFilter<T>> context) { - return this.stage0.execute(); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/io/DbReader.java b/src/main/java/teetime/variant/explicitScheduling/stage/io/DbReader.java deleted file mode 100644 index 60809bdb..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/io/DbReader.java +++ /dev/null @@ -1,187 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.stage.io; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import kieker.common.exception.MonitoringRecordException; -import kieker.common.record.AbstractMonitoringRecord; -import kieker.common.record.IMonitoringRecord; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.Description; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * A very simple database reader that probably only works for small data sets. - * - * @author Jan Waller, Nils Christian Ehmke - * - * @since 1.10 - */ -@Description("A reader which reads records from a database") -public class DbReader extends AbstractFilter<DbReader> { - - private final IOutputPort<DbReader, IMonitoringRecord> outputPort = super.createOutputPort(); - - @Description("The classname of the driver used for the connection.") - private String driverClassname = "org.apache.derby.jdbc.EmbeddedDrive"; - @Description("The connection string used to establish the connection.") - private String connectionString = "jdbc:derby:tmp/KIEKER;user=DBUSER;password=DBPASS"; - @Description("The prefix of the used table within the database.") - private String tablePrefix = "kieker"; - - private volatile boolean running = true; - - @Override - public void onPipelineStarts() throws Exception { - super.onPipelineStarts(); - try { - Class.forName(this.driverClassname).newInstance(); - } catch (final Exception ex) { // NOPMD NOCS (IllegalCatchCheck) - throw new Exception("DB driver registration failed. Perhaps the driver jar is missing?", ex); - } - } - - @Override - public void onPipelineStops() { - super.logger.info("Shutdown of DBReader requested."); - this.running = false; - super.onPipelineStops(); - } - - @Override - protected boolean execute(final Context<DbReader> context) { - Connection connection = null; - try { - connection = DriverManager.getConnection(this.connectionString); - Statement getIndexTable = null; - try { - getIndexTable = connection.createStatement(); - ResultSet indexTable = null; - try { // NOCS (nested try) - indexTable = getIndexTable.executeQuery("SELECT * from " + this.tablePrefix); - while (this.running && indexTable.next()) { - final String tablename = indexTable.getString(1); - final String classname = indexTable.getString(2); - try { // NOCS (nested try) - this.table2record(context, connection, tablename, AbstractMonitoringRecord.classForName(classname)); - } catch (final MonitoringRecordException ex) { - // log error but continue with next table - super.logger.error("Failed to load records of type " + classname + " from table " + tablename, ex); - continue; - } - } - } finally { - if (indexTable != null) { - indexTable.close(); - } - } - } finally { - if (getIndexTable != null) { - getIndexTable.close(); - } - } - } catch (final SQLException ex) { - super.logger.error("SQLException with SQLState: '" + ex.getSQLState() + "' and VendorError: '" + ex.getErrorCode() + "'", ex); - return false; - } finally { - if (connection != null) { - try { - connection.close(); - } catch (final SQLException ex) { - super.logger.error("SQLException with SQLState: '" + ex.getSQLState() + "' and VendorError: '" + ex.getErrorCode() + "'", ex); - } - } - } - return true; - } - - public final String getDriverClassname() { - return this.driverClassname; - } - - public final void setDriverClassname(final String driverClassname) { - this.driverClassname = driverClassname; - } - - public final String getConnectionString() { - return this.connectionString; - } - - public final void setConnectionString(final String connectionString) { - this.connectionString = connectionString; - } - - public final String getTablePrefix() { - return this.tablePrefix; - } - - public final void setTablePrefix(final String tablePrefix) { - this.tablePrefix = tablePrefix; - } - - /** - * This method uses the given table to read records and sends them to the output port. - * - * @param connection - * The connection to the database which will be used. - * @param tablename - * The name of the table containing records. - * @param clazz - * The class of the monitoring records. This will be used to convert the array into the record. - * @throws SQLException - * If something went wrong during the database access. - * @throws MonitoringRecordException - * If the data within the table could not be converted into a valid record. - */ - private void table2record(final Context<DbReader> context, final Connection connection, final String tablename, final Class<? extends IMonitoringRecord> clazz) - throws SQLException, MonitoringRecordException { - Statement selectRecord = null; - try { - selectRecord = connection.createStatement(); - ResultSet records = null; - try { - records = selectRecord.executeQuery("SELECT * from " + tablename); - final int size = records.getMetaData().getColumnCount() - 2; // remove index column - while (this.running && records.next()) { - final Object[] recordValues = new Object[size]; - for (int i = 0; i < size; i++) { - recordValues[i] = records.getObject(i + 3); - } - final IMonitoringRecord record = AbstractMonitoringRecord.createFromArray(clazz, recordValues); - record.setLoggingTimestamp(records.getLong(2)); - context.put(this.outputPort, record); - } - } finally { - if (records != null) { - records.close(); - } - } - } finally { - if (selectRecord != null) { - selectRecord.close(); - } - } - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/io/Directory2FilesFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/io/Directory2FilesFilter.java deleted file mode 100644 index 7e781980..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/io/Directory2FilesFilter.java +++ /dev/null @@ -1,116 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.stage.io; - -import java.io.File; -import java.io.FileFilter; -import java.util.Arrays; -import java.util.Comparator; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class Directory2FilesFilter extends AbstractFilter<Directory2FilesFilter> { - - public final IInputPort<Directory2FilesFilter, File> directoryInputPort = this.createInputPort(); - - public final IOutputPort<Directory2FilesFilter, File> fileOutputPort = this.createOutputPort(); - - private FileFilter filter; - private Comparator<File> fileComparator; - - /** - * @since 1.10 - */ - public Directory2FilesFilter(final FileFilter fileFilter) { - this.setFilter(fileFilter); - } - - /** - * @since 1.10 - */ - public Directory2FilesFilter(final Comparator<File> fileComparator) { - this.setFileComparator(fileComparator); - } - - /** - * @since 1.10 - */ - public Directory2FilesFilter(final FileFilter fileFilter, final Comparator<File> fileComparator) { - this.setFilter(fileFilter); - this.setFileComparator(fileComparator); - } - - /** - * @since 1.10 - */ - public Directory2FilesFilter() { - super(); - } - - /** - * @since 1.10 - */ - @Override - protected boolean execute(final Context<Directory2FilesFilter> context) { - final File inputDir = context.tryTake(this.directoryInputPort); - if (inputDir == null) { - return false; - } - - final File[] inputFiles = inputDir.listFiles(this.filter); - - if (inputFiles == null) { - this.logger.error("Directory '" + inputDir + "' does not exist or an I/O error occured."); - return true; - } - - if (this.fileComparator != null) { - Arrays.sort(inputFiles, this.fileComparator); - } - - for (final File file : inputFiles) { - context.put(this.fileOutputPort, file); - } - - return true; - } - - public FileFilter getFilter() { - return this.filter; - } - - public void setFilter(final FileFilter filter) { - this.filter = filter; - } - - public Comparator<File> getFileComparator() { - return this.fileComparator; - } - - public void setFileComparator(final Comparator<File> fileComparator) { - this.fileComparator = fileComparator; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/io/File2TextLinesFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/io/File2TextLinesFilter.java deleted file mode 100644 index 08d479ca..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/io/File2TextLinesFilter.java +++ /dev/null @@ -1,89 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.stage.io; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStreamReader; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.stage.util.TextLine; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class File2TextLinesFilter extends AbstractFilter<File2TextLinesFilter> { - - public final IInputPort<File2TextLinesFilter, File> fileInputPort = this.createInputPort(); - - public final IOutputPort<File2TextLinesFilter, TextLine> textLineOutputPort = this.createOutputPort(); - - private String charset = "UTF-8"; - - /** - * @since 1.10 - */ - @Override - protected boolean execute(final Context<File2TextLinesFilter> context) { - final File textFile = context.tryTake(this.fileInputPort); - if (textFile == null) { - return false; - } - - BufferedReader reader = null; - try { - reader = new BufferedReader(new InputStreamReader(new FileInputStream(textFile), this.charset)); - String line; - while ((line = reader.readLine()) != null) { - line = line.trim(); - if (line.length() != 0) { - context.put(this.textLineOutputPort, new TextLine(textFile, line)); - } // else: ignore empty line - } - } catch (final FileNotFoundException e) { - this.logger.error("", e); - } catch (final IOException e) { - this.logger.error("", e); - } finally { - try { - if (reader != null) { - reader.close(); - } - } catch (final IOException e) { - this.logger.warn("", e); - } - } - return true; - } - - public String getCharset() { - return this.charset; - } - - public void setCharset(final String charset) { - this.charset = charset; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/io/Printer.java b/src/main/java/teetime/variant/explicitScheduling/stage/io/Printer.java deleted file mode 100644 index a47068af..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/io/Printer.java +++ /dev/null @@ -1,144 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.io; - -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.PrintStream; -import java.io.UnsupportedEncodingException; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.Description; -import teetime.variant.explicitScheduling.framework.core.IInputPort; - -/** - * @author Matthias Rohr, Jan Waller, Nils Christian Ehmke - * - * @since 1.10 - */ -@Description("A filter to print objects to a configured stream") -public class Printer<T> extends AbstractFilter<Printer<T>> { - - public static final String STREAM_STDOUT = "STDOUT"; - public static final String STREAM_STDERR = "STDERR"; - public static final String STREAM_STDLOG = "STDlog"; - public static final String STREAM_NULL = "NULL"; - - public static final String ENCODING_UTF8 = "UTF-8"; - - public final IInputPort<Printer<T>, T> input = this.createInputPort(); - - private PrintStream printStream; - private String streamName = STREAM_STDOUT; - private String encoding = ENCODING_UTF8; - private boolean active = true; - private boolean append = true; - - public String getStreamName() { - return this.streamName; - } - - public void setStreamName(final String streamName) { - this.streamName = streamName; - } - - public String getEncoding() { - return this.encoding; - } - - public void setEncoding(final String encoding) { - this.encoding = encoding; - } - - public boolean isAppend() { - return this.append; - } - - public void setAppend(final boolean append) { - this.append = append; - } - - @Override - public void onPipelineStarts() throws Exception { - super.onPipelineStarts(); - this.initializeStream(); - } - - @Override - public void onPipelineStops() { - this.closeStream(); - super.onPipelineStops(); - } - - private void initializeStream() { - if (STREAM_STDOUT.equals(this.streamName)) { - this.printStream = System.out; - this.active = true; - } else if (STREAM_STDERR.equals(this.streamName)) { - this.printStream = System.err; - this.active = true; - } else if (STREAM_STDLOG.equals(this.streamName)) { - this.printStream = null; - this.active = true; - } else if (STREAM_NULL.equals(this.streamName)) { - this.printStream = null; - this.active = false; - } else { - try { - this.printStream = new PrintStream(new FileOutputStream(this.streamName, this.append), false, this.encoding); - this.active = true; - } catch (final FileNotFoundException ex) { - this.active = false; - super.logger.warn("Stream could not be created", ex); - } catch (final UnsupportedEncodingException ex) { - this.active = false; - super.logger.warn("Encoding not supported", ex); - } - } - } - - private void closeStream() { - if ((this.printStream != null) && (this.printStream != System.out) && (this.printStream != System.err)) { - this.printStream.close(); - } - } - - @Override - protected boolean execute(final Context<Printer<T>> context) { - final T object = context.tryTake(this.input); - if (null == object) { - return false; - } - - if (this.active) { - final StringBuilder sb = new StringBuilder(128); - - sb.append(super.getId()); - sb.append('(').append(object.getClass().getSimpleName()).append(") ").append(object.toString()); - - final String msg = sb.toString(); - if (this.printStream != null) { - this.printStream.println(msg); - } else { - super.logger.info(msg); - } - } - - return true; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/io/TCPReader.java b/src/main/java/teetime/variant/explicitScheduling/stage/io/TCPReader.java deleted file mode 100644 index 60dc9bcb..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/io/TCPReader.java +++ /dev/null @@ -1,207 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.io; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.nio.BufferUnderflowException; -import java.nio.ByteBuffer; -import java.nio.channels.ServerSocketChannel; -import java.nio.channels.SocketChannel; - -import kieker.common.exception.MonitoringRecordException; -import kieker.common.logging.Log; -import kieker.common.logging.LogFactory; -import kieker.common.record.AbstractMonitoringRecord; -import kieker.common.record.IMonitoringRecord; -import kieker.common.record.misc.RegistryRecord; -import kieker.common.util.registry.ILookup; -import kieker.common.util.registry.Lookup; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * This is a reader which reads the records from a TCP port. - * - * @author Jan Waller, Nils Christian Ehmke - * - * @since 1.10 - */ -public class TCPReader extends AbstractFilter<TCPReader> { - - private static final int MESSAGE_BUFFER_SIZE = 65535; - - private final IOutputPort<TCPReader, IMonitoringRecord> outputPort = super.createOutputPort(); - - // BETTER use a non thread-safe implementation to increase performance. A thread-safe version is not necessary. - private final ILookup<String> stringRegistry = new Lookup<String>(); - private int port1 = 10133; - private int port2 = 10134; - - @Override - public void onPipelineStarts() throws Exception { - super.onPipelineStarts(); - - // FIXME use the implementation from the thread or from execute(), but not both - final TCPStringReader tcpStringReader = new TCPStringReader(this.port2, this.stringRegistry); - tcpStringReader.start(); - } - - @Override - public void onPipelineStops() { - super.logger.info("Shutdown of TCPReader requested."); - // TODO actually implement terminate! - super.onPipelineStops(); - } - - public final int getPort1() { - return this.port1; - } - - public final void setPort1(final int port1) { - this.port1 = port1; - } - - public final int getPort2() { - return this.port2; - } - - public final void setPort2(final int port2) { - this.port2 = port2; - } - - @Override - protected boolean execute(final Context<TCPReader> context) { - ServerSocketChannel serversocket = null; - try { - serversocket = ServerSocketChannel.open(); - serversocket.socket().bind(new InetSocketAddress(this.port1)); - if (super.logger.isDebugEnabled()) { - super.logger.debug("Listening on port " + this.port1); - } - // BEGIN also loop this one? - final SocketChannel socketChannel = serversocket.accept(); - final ByteBuffer buffer = ByteBuffer.allocateDirect(MESSAGE_BUFFER_SIZE); - while (socketChannel.read(buffer) != -1) { - buffer.flip(); - // System.out.println("Reading, remaining:" + buffer.remaining()); - try { - while (buffer.hasRemaining()) { - buffer.mark(); - final int clazzid = buffer.getInt(); - final long loggingTimestamp = buffer.getLong(); - final IMonitoringRecord record; - try { // NOCS (Nested try-catch) - record = AbstractMonitoringRecord.createFromByteBuffer(clazzid, buffer, this.stringRegistry); - record.setLoggingTimestamp(loggingTimestamp); - context.put(this.outputPort, record); - } catch (final MonitoringRecordException ex) { - super.logger.error("Failed to create record.", ex); - } - } - buffer.clear(); - } catch (final BufferUnderflowException ex) { - buffer.reset(); - // System.out.println("Underflow, remaining:" + buffer.remaining()); - buffer.compact(); - } - } - // System.out.println("Channel closing..."); - socketChannel.close(); - // END also loop this one? - } catch (final IOException ex) { - super.logger.error("Error while reading", ex); - return false; - } finally { - if (null != serversocket) { - try { - serversocket.close(); - } catch (final IOException e) { - if (super.logger.isDebugEnabled()) { - super.logger.debug("Failed to close TCP connection!", e); - } - } - } - } - return true; - } - -} - -/** - * - * @author Jan Waller - * - * @since 1.8 - */ -class TCPStringReader extends Thread { - - private static final int MESSAGE_BUFFER_SIZE = 65535; - - private static final Log LOG = LogFactory.getLog(TCPStringReader.class); - - private final int port; - private final ILookup<String> stringRegistry; - - public TCPStringReader(final int port, final ILookup<String> stringRegistry) { - this.port = port; - this.stringRegistry = stringRegistry; - } - - @Override - public void run() { - ServerSocketChannel serversocket = null; - try { - serversocket = ServerSocketChannel.open(); - serversocket.socket().bind(new InetSocketAddress(this.port)); - if (LOG.isDebugEnabled()) { - LOG.debug("Listening on port " + this.port); - } - // BEGIN also loop this one? - final SocketChannel socketChannel = serversocket.accept(); - final ByteBuffer buffer = ByteBuffer.allocateDirect(MESSAGE_BUFFER_SIZE); - while (socketChannel.read(buffer) != -1) { - buffer.flip(); - try { - while (buffer.hasRemaining()) { - buffer.mark(); - RegistryRecord.registerRecordInRegistry(buffer, this.stringRegistry); - } - buffer.clear(); - } catch (final BufferUnderflowException ex) { - buffer.reset(); - buffer.compact(); - } - } - socketChannel.close(); - // END also loop this one? - } catch (final IOException ex) { - LOG.error("Error while reading", ex); - } finally { - if (null != serversocket) { - try { - serversocket.close(); - } catch (final IOException e) { - if (LOG.isDebugEnabled()) { - LOG.debug("Failed to close TCP connection!", e); - } - } - } - } - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/File2RecordFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/kieker/File2RecordFilter.java deleted file mode 100644 index d2a2193d..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/File2RecordFilter.java +++ /dev/null @@ -1,144 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.kieker; - -import java.io.File; - -import teetime.variant.explicitScheduling.framework.concurrent.ConcurrentWorkStealingPipe; -import teetime.variant.explicitScheduling.framework.concurrent.ConcurrentWorkStealingPipeFactory; -import teetime.variant.explicitScheduling.framework.core.CompositeFilter; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.stage.FileExtensionFilter; -import teetime.variant.explicitScheduling.stage.basic.merger.Merger; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistryCreationFilter; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistryRepository; -import teetime.variant.explicitScheduling.stage.kieker.fileToRecord.BinaryFile2RecordFilter; -import teetime.variant.explicitScheduling.stage.kieker.fileToRecord.DatFile2RecordFilter; -import teetime.variant.explicitScheduling.stage.kieker.fileToRecord.ZipFile2RecordFilter; -import teetime.variant.explicitScheduling.stage.predicate.IsDirectoryPredicate; -import teetime.variant.explicitScheduling.stage.predicate.PredicateFilter; - -import kieker.common.record.IMonitoringRecord; -import kieker.common.util.filesystem.BinaryCompressionMethod; -import kieker.common.util.filesystem.FSUtil; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class File2RecordFilter extends CompositeFilter { - - public final IInputPort<PredicateFilter<File>, File> fileInputPort; - - public final IOutputPort<Merger<IMonitoringRecord>, IMonitoringRecord> recordOutputPort; - - private ClassNameRegistryRepository classNameRegistryRepository; - - /** - * @since 1.10 - */ - public File2RecordFilter(final ClassNameRegistryRepository classNameRegistryRepository) { - this.classNameRegistryRepository = classNameRegistryRepository; - - // FIXME does not yet work with more than one thread due to classNameRegistryRepository (reason not comprehensible) - // create stages - final PredicateFilter<File> isDirectoryFilter = new PredicateFilter<File>(new IsDirectoryPredicate()); - final ClassNameRegistryCreationFilter classNameRegistryCreationFilter = new ClassNameRegistryCreationFilter(this.classNameRegistryRepository); - final MonitoringLogDirectory2Files directory2FilesFilter = new MonitoringLogDirectory2Files(); - final FileExtensionFilter fileExtensionFilter = new FileExtensionFilter(); - final Merger<File> fileMerger = new Merger<File>(); - - final DatFile2RecordFilter datFile2RecordFilter = new DatFile2RecordFilter(this.classNameRegistryRepository); - final BinaryFile2RecordFilter binaryFile2RecordFilter = new BinaryFile2RecordFilter(this.classNameRegistryRepository); - final ZipFile2RecordFilter zipFile2RecordFilter = new ZipFile2RecordFilter(); - - final Merger<IMonitoringRecord> recordMerger = new Merger<IMonitoringRecord>(); - - // store ports due to readability reasons - final IOutputPort<FileExtensionFilter, File> normalFileOutputPort = fileExtensionFilter.createOutputPortForFileExtension(FSUtil.NORMAL_FILE_EXTENSION); - final IOutputPort<FileExtensionFilter, File> binFileOutputPort = fileExtensionFilter.createOutputPortForFileExtension(BinaryCompressionMethod.NONE - .getFileExtension()); - final IOutputPort<FileExtensionFilter, File> zipFileOutputPort = fileExtensionFilter.createOutputPortForFileExtension(FSUtil.ZIP_FILE_EXTENSION); - - // connect ports by pipes - this.connectWithPipe(isDirectoryFilter.matchingOutputPort, classNameRegistryCreationFilter.directoryInputPort); - this.connectWithPipe(isDirectoryFilter.mismatchingOutputPort, fileMerger.getNewInputPort()); // BETTER restructure pipeline - this.connectWithPipe(classNameRegistryCreationFilter.relayDirectoryOutputPort, directory2FilesFilter.directoryInputPort); - this.connectWithPipe(classNameRegistryCreationFilter.filePrefixOutputPort, directory2FilesFilter.filePrefixInputPort); - this.connectWithPipe(directory2FilesFilter.fileOutputPort, fileExtensionFilter.fileInputPort); - this.connectWithPipe(zipFileOutputPort, fileMerger.getNewInputPort()); - - final ConcurrentWorkStealingPipeFactory<File> concurrentWorkStealingPipeFactory0 = new ConcurrentWorkStealingPipeFactory<File>(); - final ConcurrentWorkStealingPipe<File> concurrentWorkStealingPipe0 = concurrentWorkStealingPipeFactory0.create(); - concurrentWorkStealingPipe0.setSourcePort(normalFileOutputPort); - concurrentWorkStealingPipe0.setTargetPort(datFile2RecordFilter.fileInputPort); - - final ConcurrentWorkStealingPipeFactory<File> concurrentWorkStealingPipeFactory1 = new ConcurrentWorkStealingPipeFactory<File>(); - final ConcurrentWorkStealingPipe<File> concurrentWorkStealingPipe1 = concurrentWorkStealingPipeFactory1.create(); - concurrentWorkStealingPipe1.setSourcePort(binFileOutputPort); - concurrentWorkStealingPipe1.setTargetPort(binaryFile2RecordFilter.fileInputPort); - - final ConcurrentWorkStealingPipeFactory<File> concurrentWorkStealingPipeFactory2 = new ConcurrentWorkStealingPipeFactory<File>(); - final ConcurrentWorkStealingPipe<File> concurrentWorkStealingPipe2 = concurrentWorkStealingPipeFactory2.create(); - concurrentWorkStealingPipe2.setSourcePort(fileMerger.outputPort); - concurrentWorkStealingPipe2.setTargetPort(zipFile2RecordFilter.fileInputPort); - - final ConcurrentWorkStealingPipeFactory<IMonitoringRecord> concurrentWorkStealingPipeFactoriesNormal = new ConcurrentWorkStealingPipeFactory<IMonitoringRecord>(); - final ConcurrentWorkStealingPipe<IMonitoringRecord> datPipe = concurrentWorkStealingPipeFactoriesNormal.create(); - datPipe.connect(datFile2RecordFilter.recordOutputPort, recordMerger.getNewInputPort()); - - final ConcurrentWorkStealingPipeFactory<IMonitoringRecord> concurrentWorkStealingPipeFactoriesBinary = new ConcurrentWorkStealingPipeFactory<IMonitoringRecord>(); - final ConcurrentWorkStealingPipe<IMonitoringRecord> binaryPipe = concurrentWorkStealingPipeFactoriesBinary.create(); - binaryPipe.connect(binaryFile2RecordFilter.recordOutputPort, recordMerger.getNewInputPort()); - - final ConcurrentWorkStealingPipeFactory<IMonitoringRecord> concurrentWorkStealingPipeFactoriesZip = new ConcurrentWorkStealingPipeFactory<IMonitoringRecord>(); - final ConcurrentWorkStealingPipe<IMonitoringRecord> zipPipe = concurrentWorkStealingPipeFactoriesZip.create(); - zipPipe.connect(zipFile2RecordFilter.recordOutputPort, recordMerger.getNewInputPort()); - - this.fileInputPort = isDirectoryFilter.inputPort; - this.recordOutputPort = recordMerger.outputPort; - - this.schedulableStages.add(isDirectoryFilter); - - // this.schedulableStages.add(classNameRegistryCreationFilter); - // this.schedulableStages.add(directory2FilesFilter); - // this.schedulableStages.add(fileMerger); - // this.schedulableStages.add(fileExtensionFilter); - - this.schedulableStages.add(datFile2RecordFilter); - this.schedulableStages.add(binaryFile2RecordFilter); - this.schedulableStages.add(zipFile2RecordFilter); - this.schedulableStages.add(recordMerger); - } - - /** - * @since 1.10 - */ - public File2RecordFilter() { - this(null); - } - - public ClassNameRegistryRepository getClassNameRegistryRepository() { - return this.classNameRegistryRepository; - } - - public void setClassNameRegistryRepository(final ClassNameRegistryRepository classNameRegistryRepository) { - this.classNameRegistryRepository = classNameRegistryRepository; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/MonitoringLogDirectory2Files.java b/src/main/java/teetime/variant/explicitScheduling/stage/kieker/MonitoringLogDirectory2Files.java deleted file mode 100644 index 142be117..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/MonitoringLogDirectory2Files.java +++ /dev/null @@ -1,88 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.kieker; - -import java.io.File; -import java.io.FileFilter; -import java.util.Comparator; - -import kieker.common.util.filesystem.BinaryCompressionMethod; -import kieker.common.util.filesystem.FSUtil; - -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.stage.io.Directory2FilesFilter; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MonitoringLogDirectory2Files extends Directory2FilesFilter { - - public final IInputPort<Directory2FilesFilter, String> filePrefixInputPort = this.createInputPort(); - - /** - * @author Christian Wulf - * - * @since 1.10 - */ - static class MonitoringLogFileFilter implements FileFilter { - private String filePrefix; - - @Override - public boolean accept(final File pathname) { - final String name = pathname.getName(); - return pathname.isFile() - && name.startsWith(this.filePrefix) - && (name.endsWith(FSUtil.NORMAL_FILE_EXTENSION) || BinaryCompressionMethod.hasValidFileExtension(name)); - } - - public String getFilePrefix() { - return this.filePrefix; - } - - public void setFilePrefix(final String filePrefix) { - this.filePrefix = filePrefix; - } - } - - private static final Comparator<File> FILE_COMPARATOR = new Comparator<File>() { - @Override - public final int compare(final File f1, final File f2) { - return f1.compareTo(f2); // simplified (we expect no dirs!) - } - }; - - /** - * @since 1.10 - */ - public MonitoringLogDirectory2Files() { - super(new MonitoringLogFileFilter(), FILE_COMPARATOR); - } - - @Override - protected boolean execute(final Context<Directory2FilesFilter> context) { - final String filePrefix = context.tryTake(this.filePrefixInputPort); - if (filePrefix == null) { - return false; - } - - ((MonitoringLogFileFilter) this.getFilter()).setFilePrefix(filePrefix); - - return super.execute(context); - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/className/ClassNameRegistryCreationFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/kieker/className/ClassNameRegistryCreationFilter.java deleted file mode 100644 index 6f4fdf16..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/className/ClassNameRegistryCreationFilter.java +++ /dev/null @@ -1,93 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.kieker.className; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class ClassNameRegistryCreationFilter extends AbstractFilter<ClassNameRegistryCreationFilter> { - - public final IInputPort<ClassNameRegistryCreationFilter, File> directoryInputPort = this.createInputPort(); - - public final IOutputPort<ClassNameRegistryCreationFilter, File> relayDirectoryOutputPort = this.createOutputPort(); - public final IOutputPort<ClassNameRegistryCreationFilter, String> filePrefixOutputPort = this.createOutputPort(); - - private ClassNameRegistryRepository classNameRegistryRepository; - - private final MappingFileParser mappingFileParser; - - /** - * @since 1.10 - */ - public ClassNameRegistryCreationFilter(final ClassNameRegistryRepository classNameRegistryRepository) { - this(); - this.classNameRegistryRepository = classNameRegistryRepository; - } - - /** - * @since 1.10 - */ - public ClassNameRegistryCreationFilter() { - super(); - this.mappingFileParser = new MappingFileParser(this.logger); - } - - @Override - protected boolean execute(final Context<ClassNameRegistryCreationFilter> context) { - final File inputDir = context.tryTake(this.directoryInputPort); - if (inputDir == null) { - return false; - } - - final File mappingFile = this.mappingFileParser.findMappingFile(inputDir); - if (mappingFile == null) { - return true; - } - - try { - final ClassNameRegistry classNameRegistry = this.mappingFileParser.parseFromStream(new FileInputStream(mappingFile)); - this.classNameRegistryRepository.put(inputDir, classNameRegistry); - context.put(this.relayDirectoryOutputPort, inputDir); - - final String filePrefix = this.mappingFileParser.getFilePrefixFromMappingFile(mappingFile); - context.put(this.filePrefixOutputPort, filePrefix); - } catch (final FileNotFoundException e) { - this.logger.error("Mapping file not found.", e); // and skip this directory - } - - return true; - } - - public ClassNameRegistryRepository getClassNameRegistryRepository() { - return this.classNameRegistryRepository; - } - - public void setClassNameRegistryRepository(final ClassNameRegistryRepository classNameRegistryRepository) { - this.classNameRegistryRepository = classNameRegistryRepository; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/className/MappingFileParser.java b/src/main/java/teetime/variant/explicitScheduling/stage/kieker/className/MappingFileParser.java deleted file mode 100644 index 9578f48a..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/className/MappingFileParser.java +++ /dev/null @@ -1,130 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.kieker.className; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.HashMap; -import java.util.Map; - -import kieker.common.logging.Log; -import kieker.common.util.filesystem.FSUtil; - -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistry; - - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MappingFileParser { - - protected Log logger; - - private static final Map<String, String> filePrefixRegistry = new HashMap<String, String>(); - - static { - filePrefixRegistry.put(FSUtil.MAP_FILENAME, FSUtil.FILE_PREFIX); - filePrefixRegistry.put(FSUtil.LEGACY_MAP_FILENAME, FSUtil.LEGACY_FILE_PREFIX); - } - - public MappingFileParser(final Log logger) { - this.logger = logger; - } - - public ClassNameRegistry parseFromStream(final InputStream inputStream) { - final ClassNameRegistry classNameRegistry = new ClassNameRegistry(); - - BufferedReader in = null; - try { - in = new BufferedReader(new InputStreamReader(inputStream, FSUtil.ENCODING)); - String line; - while ((line = in.readLine()) != null) { // NOPMD (assign) - this.parseTextLine(line, classNameRegistry); - } - } catch (final IOException ex) { - this.logger.error("Error reading mapping file", ex); - } finally { - if (in != null) { - try { - in.close(); - } catch (final IOException ex) { - this.logger.error("Exception while closing input stream for mapping file", ex); - } - } - } - - return classNameRegistry; - } - - private void parseTextLine(final String line, final Map<Integer, String> stringRegistry) { - if (line.length() == 0) { - return; // ignore empty lines - } - final int split = line.indexOf('='); - if (split == -1) { - this.logger.error("Failed to find character '=' in line: {" + line + "}. It must consist of a ID=VALUE pair."); - return; // continue on errors - } - final String key = line.substring(0, split); - final String value = FSUtil.decodeNewline(line.substring(split + 1)); - // the leading $ is optional - final Integer id; - try { - id = Integer.valueOf((key.charAt(0) == '$') ? key.substring(1) : key); // NOCS - } catch (final NumberFormatException ex) { - this.logger.error("Error reading mapping file, id must be integer", ex); - return; // continue on errors - } - final String prevVal = stringRegistry.put(id, value); - if (prevVal != null) { - this.logger.error("Found addional entry for id='" + id + "', old value was '" + prevVal + "' new value is '" + value + "'"); - } - } - - /** - * @since 1.10 - */ - public File findMappingFile(final File dirPath) { - File mappingFile = new File(dirPath, FSUtil.MAP_FILENAME); - if (!mappingFile.exists()) { - // No mapping file found. Check whether we find a legacy tpmon.map file! - mappingFile = new File(dirPath, FSUtil.LEGACY_MAP_FILENAME); - if (mappingFile.exists()) { - this.logger.info("Directory '" + dirPath + "' contains no file '" + FSUtil.MAP_FILENAME + "'. Found '" + FSUtil.LEGACY_MAP_FILENAME - + "' ... switching to legacy mode"); - } else { - // no {kieker|tpmon}.map exists. This is valid for very old monitoring logs. Hence, only dump a log.warn - this.logger.warn("No mapping file in directory '" + dirPath.getAbsolutePath() + "'"); - return null; - } - } - - return mappingFile; - } - - /** - * @return <code>null</code> if a file prefix for the given <code>mappingFile</code> is not registered. - * @since 1.10 - */ - public String getFilePrefixFromMappingFile(final File mappingFile) { - return MappingFileParser.filePrefixRegistry.get(mappingFile.getName()); - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/BinaryFile2RecordFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/BinaryFile2RecordFilter.java deleted file mode 100644 index 34cc0e7f..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/BinaryFile2RecordFilter.java +++ /dev/null @@ -1,113 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.kieker.fileToRecord; - -import java.io.DataInputStream; -import java.io.File; -import java.io.IOException; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistryRepository; - -import kieker.common.exception.MonitoringRecordException; -import kieker.common.record.IMonitoringRecord; -import kieker.common.util.filesystem.BinaryCompressionMethod; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class BinaryFile2RecordFilter extends AbstractFilter<BinaryFile2RecordFilter> { - - private static final int MB = 1024 * 1024; - - public final IInputPort<BinaryFile2RecordFilter, File> fileInputPort = this.createInputPort(); - public final IOutputPort<BinaryFile2RecordFilter, IMonitoringRecord> recordOutputPort = this.createOutputPort(); - - private RecordFromBinaryFileCreator recordFromBinaryFileCreator; - - private ClassNameRegistryRepository classNameRegistryRepository; - - /** - * @since 1.10 - */ - public BinaryFile2RecordFilter(final ClassNameRegistryRepository classNameRegistryRepository) { - this(); - this.classNameRegistryRepository = classNameRegistryRepository; - } - - /** - * @since 1.10 - */ - public BinaryFile2RecordFilter() { - super(); - } - - @Override - public void onPipelineStarts() throws Exception { - this.recordFromBinaryFileCreator = new RecordFromBinaryFileCreator(this.logger, this.classNameRegistryRepository); - super.onPipelineStarts(); - } - - @Override - protected boolean execute(final Context<BinaryFile2RecordFilter> context) { - final File binaryFile = context.tryTake(this.fileInputPort); - if (binaryFile == null) { - return false; - } - - try { - final BinaryCompressionMethod method = BinaryCompressionMethod.getByFileExtension(binaryFile.getName()); - final DataInputStream in = method.getDataInputStream(binaryFile, 1 * MB); - try { - IMonitoringRecord record = this.recordFromBinaryFileCreator.createRecordFromBinaryFile(binaryFile, in); - while (record != null) { - context.put(this.recordOutputPort, record); - record = this.recordFromBinaryFileCreator.createRecordFromBinaryFile(binaryFile, in); - } - } catch (final MonitoringRecordException e) { - this.logger.error("Error reading file: " + binaryFile, e); - } finally { - if (in != null) { - try { - in.close(); - } catch (final IOException ex) { - this.logger.error("Exception while closing input stream for processing input file", ex); - } - } - } - } catch (final IOException e) { - this.logger.error("Error reading file: " + binaryFile, e); - } catch (final IllegalArgumentException e) { - this.logger.warn("Unknown file extension for file: " + binaryFile); - } - - return true; - } - - public ClassNameRegistryRepository getClassNameRegistryRepository() { - return this.classNameRegistryRepository; - } - - public void setClassNameRegistryRepository(final ClassNameRegistryRepository classNameRegistryRepository) { - this.classNameRegistryRepository = classNameRegistryRepository; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/DatFile2RecordFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/DatFile2RecordFilter.java deleted file mode 100644 index db67b013..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/DatFile2RecordFilter.java +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.kieker.fileToRecord; - -import java.io.File; - -import kieker.common.record.IMonitoringRecord; - -import teetime.variant.explicitScheduling.framework.concurrent.ConcurrentWorkStealingPipe; -import teetime.variant.explicitScheduling.framework.concurrent.ConcurrentWorkStealingPipeFactory; -import teetime.variant.explicitScheduling.framework.core.CompositeFilter; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.stage.io.File2TextLinesFilter; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistryRepository; -import teetime.variant.explicitScheduling.stage.kieker.fileToRecord.textLine.TextLine2RecordFilter; -import teetime.variant.explicitScheduling.stage.util.TextLine; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class DatFile2RecordFilter extends CompositeFilter { - - public final IInputPort<File2TextLinesFilter, File> fileInputPort; - - public final IOutputPort<TextLine2RecordFilter, IMonitoringRecord> recordOutputPort; - - public DatFile2RecordFilter(final ClassNameRegistryRepository classNameRegistryRepository) { - final File2TextLinesFilter file2TextLinesFilter = new File2TextLinesFilter(); - final TextLine2RecordFilter textLine2RecordFilter = new TextLine2RecordFilter(classNameRegistryRepository); - - // FIXME extract pipe implementation - final ConcurrentWorkStealingPipeFactory<TextLine> concurrentWorkStealingPipeFactory = new ConcurrentWorkStealingPipeFactory<TextLine>(); - final ConcurrentWorkStealingPipe<TextLine> pipe = concurrentWorkStealingPipeFactory.create(); - pipe.connect(file2TextLinesFilter.textLineOutputPort, textLine2RecordFilter.textLineInputPort); - - this.fileInputPort = file2TextLinesFilter.fileInputPort; - this.recordOutputPort = textLine2RecordFilter.recordOutputPort; - - this.schedulableStages.add(file2TextLinesFilter); - this.schedulableStages.add(textLine2RecordFilter); - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/RecordFromBinaryFileCreator.java b/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/RecordFromBinaryFileCreator.java deleted file mode 100644 index c7dd5d19..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/RecordFromBinaryFileCreator.java +++ /dev/null @@ -1,117 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.kieker.fileToRecord; - -import java.io.DataInputStream; -import java.io.EOFException; -import java.io.File; -import java.io.IOException; - -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistry; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistryRepository; - -import kieker.common.exception.MonitoringRecordException; -import kieker.common.logging.Log; -import kieker.common.record.AbstractMonitoringRecord; -import kieker.common.record.IMonitoringRecord; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class RecordFromBinaryFileCreator { - - private final Log logger; - private final ClassNameRegistryRepository classNameRegistryRepository; - - public RecordFromBinaryFileCreator(final Log logger, final ClassNameRegistryRepository classNameRegistryRepository) { - this.logger = logger; - this.classNameRegistryRepository = classNameRegistryRepository; - } - - public IMonitoringRecord createRecordFromBinaryFile(final File binaryFile, final DataInputStream inputStream) throws IOException, MonitoringRecordException { - final ClassNameRegistry classNameRegistry = this.classNameRegistryRepository.get(binaryFile.getParentFile()); - - final Integer id; - try { - id = inputStream.readInt(); - } catch (final EOFException eof) { - return null; // we are finished - } - final String classname = classNameRegistry.get(id); - if (classname == null) { - this.logger.error("Missing classname mapping for record type id " + "'" + id + "'"); - return null; // we can't easily recover on errors - } - - final Class<? extends IMonitoringRecord> clazz = AbstractMonitoringRecord.classForName(classname); - final Class<?>[] typeArray = AbstractMonitoringRecord.typesForClass(clazz); - - // read record - final long loggingTimestamp = inputStream.readLong(); // NOPMD (must be read here!) - final Object[] objectArray = new Object[typeArray.length]; - int idx = -1; - for (final Class<?> type : typeArray) { - idx++; - boolean successful = this.writeToObjectArray(inputStream, classNameRegistry, clazz, objectArray, idx, type); - if (!successful) { - return null; - } - } - final IMonitoringRecord record = AbstractMonitoringRecord.createFromArray(clazz, objectArray); - record.setLoggingTimestamp(loggingTimestamp); - - return record; - } - - private boolean writeToObjectArray(final DataInputStream inputStream, final ClassNameRegistry classNameRegistry, final Class<? extends IMonitoringRecord> clazz, - final Object[] objectArray, final int idx, final Class<?> type) throws IOException { - if (type == String.class) { - final Integer strId = inputStream.readInt(); - final String str = classNameRegistry.get(strId); - if (str == null) { - this.logger.error("No String mapping found for id " + strId.toString()); - objectArray[idx] = ""; - } else { - objectArray[idx] = str; - } - } else if ((type == int.class) || (type == Integer.class)) { - objectArray[idx] = inputStream.readInt(); - } else if ((type == long.class) || (type == Long.class)) { - objectArray[idx] = inputStream.readLong(); - } else if ((type == float.class) || (type == Float.class)) { - objectArray[idx] = inputStream.readFloat(); - } else if ((type == double.class) || (type == Double.class)) { - objectArray[idx] = inputStream.readDouble(); - } else if ((type == byte.class) || (type == Byte.class)) { - objectArray[idx] = inputStream.readByte(); - } else if ((type == short.class) || (type == Short.class)) { // NOPMD (short) - objectArray[idx] = inputStream.readShort(); - } else if ((type == boolean.class) || (type == Boolean.class)) { - objectArray[idx] = inputStream.readBoolean(); - } else { - if (inputStream.readByte() != 0) { - this.logger.error("Unexpected value for unsupported type: " + clazz.getName()); - return false; // breaking error (break would not terminate the correct loop) - } - this.logger.warn("Unsupported type: " + clazz.getName()); - objectArray[idx] = null; - } - - return true; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/ZipFile2RecordFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/ZipFile2RecordFilter.java deleted file mode 100644 index 7c88e034..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/ZipFile2RecordFilter.java +++ /dev/null @@ -1,140 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.kieker.fileToRecord; - -import java.io.BufferedInputStream; -import java.io.DataInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistry; -import teetime.variant.explicitScheduling.stage.kieker.className.MappingFileParser; - -import kieker.common.record.IMonitoringRecord; -import kieker.common.util.filesystem.FSUtil; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class ZipFile2RecordFilter extends AbstractFilter<ZipFile2RecordFilter> { - - public final IInputPort<ZipFile2RecordFilter, File> fileInputPort = this.createInputPort(); - - public final IOutputPort<ZipFile2RecordFilter, IMonitoringRecord> recordOutputPort = this.createOutputPort(); - - private final MappingFileParser mappingFileParser; - - /** - * @since 1.10 - */ - public ZipFile2RecordFilter() { - this.mappingFileParser = new MappingFileParser(this.logger); - } - - @Override - protected boolean execute(final Context<ZipFile2RecordFilter> context) { - final File zipFile = context.tryTake(this.fileInputPort); - if (zipFile == null) { - return false; - } - - final InputStream mappingFileInputStream = this.findMappingFileInputStream(zipFile); - if (mappingFileInputStream == null) { - return true; - } - final ClassNameRegistry classNameRegistry = this.mappingFileParser.parseFromStream(mappingFileInputStream); - - try { - this.createAndSendRecordsFromZipFile(context, zipFile, classNameRegistry); - } catch (final FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - return true; - } - - private void createAndSendRecordsFromZipFile(final Context<ZipFile2RecordFilter> context, final File zipFile, final ClassNameRegistry classNameRegistry) - throws FileNotFoundException { - final ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(zipFile)); - // BufferedReader reader; - // try { - // reader = new BufferedReader(new InputStreamReader(zipInputStream, FSUtil.ENCODING)); - // } catch (final UnsupportedEncodingException e) { - // this.logger.error("This exception should never occur.", e); - // return; - // } finally { - // if (null != reader) { - // try { - // reader.close(); - // } catch (IOException e) { - // throw new IllegalStateException(e); - // } - // } - // } - final DataInputStream input = new DataInputStream(new BufferedInputStream(zipInputStream, 1024 * 1024)); - - ZipEntry zipEntry; - try { - while (null != (zipEntry = zipInputStream.getNextEntry())) { // NOCS NOPMD - final String filename = zipEntry.getName(); - // TODO - } - } catch (final IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - private InputStream findMappingFileInputStream(final File zipFile) { - ZipInputStream zipInputStream = null; - try { - zipInputStream = new ZipInputStream(new FileInputStream(zipFile)); - ZipEntry zipEntry; - while ((null != (zipEntry = zipInputStream.getNextEntry())) && !zipEntry.getName().equals(FSUtil.MAP_FILENAME)) { // NOCS NOPMD - // do nothing, just skip to the map file if present - } - if (null == zipEntry) { - this.logger.error("The zip file does not contain a Kieker log: " + zipFile.toString()); - return null; - } - return zipInputStream; - } catch (final IOException ex) { - this.logger.error("Error accessing ZipInputStream", ex); - } finally { - if (null != zipInputStream) { - try { - zipInputStream.close(); - } catch (final IOException ex) { - this.logger.error("Failed to close ZipInputStream", ex); - } - } - } - - return null; - } -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/textLine/TextLine2MappingRegistryFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/textLine/TextLine2MappingRegistryFilter.java deleted file mode 100644 index 81f0fb3f..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/textLine/TextLine2MappingRegistryFilter.java +++ /dev/null @@ -1,77 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.stage.kieker.fileToRecord.textLine; - -import java.util.Map; - -import kieker.common.util.filesystem.FSUtil; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class TextLine2MappingRegistryFilter extends AbstractFilter<TextLine2MappingRegistryFilter> { - - public final IInputPort<TextLine2MappingRegistryFilter, String> TEXT_LINE = this.createInputPort(); - - private final Map<Integer, String> stringRegistry; - - public TextLine2MappingRegistryFilter(final Map<Integer, String> stringRegistry) { - this.stringRegistry = stringRegistry; - } - - /** - * @since 1.10 - */ - @Override - protected boolean execute(final Context<TextLine2MappingRegistryFilter> context) { - final String textLine = context.tryTake(this.TEXT_LINE); - if (textLine == null) { - return false; - } - - final int split = textLine.indexOf('='); - if (split == -1) { - this.logger.error("Failed to find character '=' in line: {" + textLine + "}. It must consist of a ID=VALUE pair."); - return true; - } - final String key = textLine.substring(0, split); - // BETTER execute split instead of checking it before with multiple string operations - final String value = FSUtil.decodeNewline(textLine.substring(split + 1)); - // the leading $ is optional - final Integer id; - try { - id = Integer.valueOf((key.charAt(0) == '$') ? key.substring(1) : key); // NOCS - } catch (final NumberFormatException ex) { - this.logger.error("Error reading mapping file, id must be integer", ex); - return true; // continue on errors - } - final String prevVal = this.stringRegistry.put(id, value); - if (prevVal != null) { - this.logger.error("Found additional entry for id='" + id + "', old value was '" + prevVal + "' new value is '" + value + "'"); - return true; - } - - return true; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/textLine/TextLine2RecordFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/textLine/TextLine2RecordFilter.java deleted file mode 100644 index d48b7768..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/fileToRecord/textLine/TextLine2RecordFilter.java +++ /dev/null @@ -1,118 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.stage.kieker.fileToRecord.textLine; - -import java.util.HashSet; -import java.util.Set; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.stage.MappingException; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistryRepository; -import teetime.variant.explicitScheduling.stage.kieker.fileToRecord.RecordFromTextLineCreator; -import teetime.variant.explicitScheduling.stage.util.TextLine; - -import kieker.common.exception.IllegalRecordFormatException; -import kieker.common.exception.MonitoringRecordException; -import kieker.common.exception.UnknownRecordTypeException; -import kieker.common.record.IMonitoringRecord; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class TextLine2RecordFilter extends AbstractFilter<TextLine2RecordFilter> { - - public final IInputPort<TextLine2RecordFilter, TextLine> textLineInputPort = this.createInputPort(); - - public final IOutputPort<TextLine2RecordFilter, IMonitoringRecord> recordOutputPort = this.createOutputPort(); - - private final Set<String> unknownTypesObserved = new HashSet<String>(); - - private boolean ignoreUnknownRecordTypes; - - private boolean abortDueToUnknownRecordType; - - private RecordFromTextLineCreator recordFromTextLineCreator; - - /** - * @since 1.10 - */ - public TextLine2RecordFilter(final ClassNameRegistryRepository classNameRegistryRepository) { - this.recordFromTextLineCreator = new RecordFromTextLineCreator(classNameRegistryRepository); - } - - /** - * @since 1.10 - */ - public TextLine2RecordFilter() { - super(); - } - - /** - * @since 1.10 - */ - @Override - protected boolean execute(final Context<TextLine2RecordFilter> context) { - final TextLine textLine = context.tryTake(this.textLineInputPort); - if (textLine == null) { - return false; - } - - try { - final IMonitoringRecord record = this.recordFromTextLineCreator.createRecordFromLine(textLine.getTextFile(), textLine.getTextLine()); - context.put(this.recordOutputPort, record); - } catch (final MonitoringRecordException e) { - this.logger.error("Could not create record from text line: '" + textLine + "'", e); - } catch (final IllegalRecordFormatException e) { - this.logger.error("Illegal record format: " + textLine, e); - } catch (final MappingException e) { - this.logger.error("", e); - } catch (final UnknownRecordTypeException e) { - final String classname = e.getClassName(); - if (!this.ignoreUnknownRecordTypes) { - this.abortDueToUnknownRecordType = true; - this.logger.error("Failed to load record type " + classname, e); - } else if (!this.unknownTypesObserved.contains(classname)) { - this.unknownTypesObserved.add(classname); - this.logger.error("Failed to load record type " + classname, e); // log once for this type - } - } - - return true; - } - - public boolean isIgnoreUnknownRecordTypes() { - return this.ignoreUnknownRecordTypes; - } - - public void setIgnoreUnknownRecordTypes(final boolean ignoreUnknownRecordTypes) { - this.ignoreUnknownRecordTypes = ignoreUnknownRecordTypes; - } - - public RecordFromTextLineCreator getRecordFromTextLineCreator() { - return this.recordFromTextLineCreator; - } - - public void setRecordFromTextLineCreator(final RecordFromTextLineCreator recordFromTextLineCreator) { - this.recordFromTextLineCreator = recordFromTextLineCreator; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/traceReconstruction/TraceReconstructionFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/kieker/traceReconstruction/TraceReconstructionFilter.java deleted file mode 100644 index daf35265..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/kieker/traceReconstruction/TraceReconstructionFilter.java +++ /dev/null @@ -1,192 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.kieker.traceReconstruction; - -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; -import java.util.concurrent.TimeUnit; - -import teetime.util.concurrent.hashmap.ConcurrentHashMapWithDefault; -import teetime.util.concurrent.hashmap.TraceBuffer; -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -import kieker.analysis.plugin.filter.flow.TraceEventRecords; -import kieker.common.record.flow.IFlowRecord; -import kieker.common.record.flow.trace.AbstractTraceEvent; -import kieker.common.record.flow.trace.TraceMetadata; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class TraceReconstructionFilter extends AbstractFilter<TraceReconstructionFilter> { - - public final IInputPort<TraceReconstructionFilter, Long> timestampInputPort = this.createInputPort(); - public final IInputPort<TraceReconstructionFilter, IFlowRecord> recordInputPort = this.createInputPort(); - - public final IOutputPort<TraceReconstructionFilter, TraceEventRecords> traceInvalidOutputPort = this.createOutputPort(); - public final IOutputPort<TraceReconstructionFilter, TraceEventRecords> traceValidOutputPort = this.createOutputPort(); - - private TimeUnit timeunit; - private long maxTraceDuration; - private long maxTraceTimeout; - private boolean timeout; - private long maxEncounteredLoggingTimestamp = -1; - - private static final Map<Long, TraceBuffer> traceId2trace = new ConcurrentHashMapWithDefault<Long, TraceBuffer>(new TraceBuffer()); - - @Override - protected boolean execute(final Context<TraceReconstructionFilter> context) { - final Long timestamp = context.tryTake(this.timestampInputPort); - if (timestamp != null) { - if (this.timeout) { - this.processTimeoutQueue(timestamp, context); - } - return true; - } - - final IFlowRecord record = context.tryTake(this.recordInputPort); - if (record != null) { - final Long traceId = this.reconstructTrace(record); - if (traceId != null) { - this.putIfFinished(traceId, context); - this.processTimestamp(record, context); - } - return true; - } - - return false; - } - - private void processTimestamp(final IFlowRecord record, final Context<TraceReconstructionFilter> context) { - if (this.timeout) { - synchronized (this) { - final long loggingTimestamp = this.getTimestamp(record); - // can we assume a rough order of logging timestamps? (yes, except with DB reader) - if (loggingTimestamp > this.maxEncounteredLoggingTimestamp) { - this.maxEncounteredLoggingTimestamp = loggingTimestamp; - } - this.processTimeoutQueue(this.maxEncounteredLoggingTimestamp, context); - } - } - } - - private long getTimestamp(final IFlowRecord record) { - if (record instanceof AbstractTraceEvent) { - return ((AbstractTraceEvent) record).getTimestamp(); - } - return -1; - } - - private void putIfFinished(final Long traceId, final Context<TraceReconstructionFilter> context) { - final TraceBuffer traceBuffer = TraceReconstructionFilter.traceId2trace.get(traceId); - if (traceBuffer.isFinished()) { - synchronized (this) { // has to be synchronized because of timeout cleanup - TraceReconstructionFilter.traceId2trace.remove(traceId); - } - this.put(traceBuffer, context); - } - } - - private Long reconstructTrace(final IFlowRecord record) { - Long traceId = null; - if (record instanceof TraceMetadata) { - traceId = ((TraceMetadata) record).getTraceId(); - final TraceBuffer traceBuffer = TraceReconstructionFilter.traceId2trace.get(traceId); - - traceBuffer.setTrace((TraceMetadata) record); - } else if (record instanceof AbstractTraceEvent) { - traceId = ((AbstractTraceEvent) record).getTraceId(); - final TraceBuffer traceBuffer = TraceReconstructionFilter.traceId2trace.get(traceId); - - traceBuffer.insertEvent((AbstractTraceEvent) record); - } - - return traceId; - } - - @Override - public void onPipelineStarts() throws Exception { - this.timeout = !((this.maxTraceTimeout == Long.MAX_VALUE) && (this.maxTraceDuration == Long.MAX_VALUE)); - super.onPipelineStarts(); - } - - private void processTimeoutQueue(final long timestamp, final Context<TraceReconstructionFilter> context) { - final long duration = timestamp - this.maxTraceDuration; - final long traceTimeout = timestamp - this.maxTraceTimeout; - - for (final Iterator<Entry<Long, TraceBuffer>> iterator = TraceReconstructionFilter.traceId2trace.entrySet().iterator(); iterator.hasNext();) { - final TraceBuffer traceBuffer = iterator.next().getValue(); - if ((traceBuffer.getMaxLoggingTimestamp() <= traceTimeout) // long time no see - || (traceBuffer.getMinLoggingTimestamp() <= duration)) { // max duration is gone - this.put(traceBuffer, context); - iterator.remove(); - } - } - } - - private void put(final TraceBuffer traceBuffer, final Context<TraceReconstructionFilter> context) { - final IOutputPort<TraceReconstructionFilter, TraceEventRecords> outputPort = - (traceBuffer.isInvalid()) ? this.traceInvalidOutputPort : this.traceValidOutputPort; - context.put(outputPort, traceBuffer.toTraceEvents()); - } - - public TimeUnit getTimeunit() { - return this.timeunit; - } - - public void setTimeunit(final TimeUnit timeunit) { - this.timeunit = timeunit; - } - - public long getMaxTraceDuration() { - return this.maxTraceDuration; - } - - public void setMaxTraceDuration(final long maxTraceDuration) { - this.maxTraceDuration = maxTraceDuration; - } - - public long getMaxTraceTimeout() { - return this.maxTraceTimeout; - } - - public void setMaxTraceTimeout(final long maxTraceTimeout) { - this.maxTraceTimeout = maxTraceTimeout; - } - - public long getMaxEncounteredLoggingTimestamp() { - return this.maxEncounteredLoggingTimestamp; - } - - public void setMaxEncounteredLoggingTimestamp(final long maxEncounteredLoggingTimestamp) { - this.maxEncounteredLoggingTimestamp = maxEncounteredLoggingTimestamp; - } - - // public Map<Long, TraceBuffer> getTraceId2trace() { - // return TraceReconstructionFilter.traceId2trace; - // } - // - // public void setTraceId2trace(final Map<Long, TraceBuffer> traceId2trace) { - // TraceReconstructionFilter.traceId2trace = traceId2trace; - // } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/FileExtensionPredicate.java b/src/main/java/teetime/variant/explicitScheduling/stage/predicate/FileExtensionPredicate.java deleted file mode 100644 index 6ce007d3..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/FileExtensionPredicate.java +++ /dev/null @@ -1,39 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.predicate; - -import java.io.File; - -import com.google.common.base.Predicate; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class FileExtensionPredicate implements Predicate<File> { - - private final String fileExtension; - - public FileExtensionPredicate(final String fileExtension) { - this.fileExtension = fileExtension; - } - - public boolean apply(final File file) { - return file.getName().endsWith(this.fileExtension); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsDirectoryPredicate.java b/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsDirectoryPredicate.java deleted file mode 100644 index fbb7b817..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsDirectoryPredicate.java +++ /dev/null @@ -1,33 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.predicate; - -import java.io.File; - -import com.google.common.base.Predicate; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class IsDirectoryPredicate implements Predicate<File> { - - public boolean apply(final File file) { - return file.isDirectory(); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsIMonitoringRecordInRange.java b/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsIMonitoringRecordInRange.java deleted file mode 100644 index b7f6f464..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsIMonitoringRecordInRange.java +++ /dev/null @@ -1,40 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.predicate; - -import kieker.common.record.IMonitoringRecord; - - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class IsIMonitoringRecordInRange extends IsTimestampInRange<IMonitoringRecord> { - - /** - * @since 1.10 - */ - public IsIMonitoringRecordInRange(final long min, final long max) { - super(min, max); - } - - public boolean apply(final IMonitoringRecord record) { - final long timestamp = record.getLoggingTimestamp(); - return this.isInRange(timestamp); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsInstanceOfPredicate.java b/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsInstanceOfPredicate.java deleted file mode 100644 index 828591d4..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsInstanceOfPredicate.java +++ /dev/null @@ -1,47 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.predicate; - -import java.util.Collection; - -import com.google.common.base.Predicate; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class IsInstanceOfPredicate<T> implements Predicate<T> { - - private final Collection<Class<?>> acceptedClasses; - - /** - * @since 1.10 - */ - public IsInstanceOfPredicate(final Collection<Class<?>> acceptedClasses) { - this.acceptedClasses = acceptedClasses; - } - - public boolean apply(final T object) { - for (final Class<?> acceptedClazz : this.acceptedClasses) { - if (acceptedClazz.isInstance(object)) { - return true; - } - } - return false; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsOperationExecutionRecordInRange.java b/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsOperationExecutionRecordInRange.java deleted file mode 100644 index 06d6a2b5..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsOperationExecutionRecordInRange.java +++ /dev/null @@ -1,43 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.predicate; - -import kieker.common.record.controlflow.OperationExecutionRecord; - - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class IsOperationExecutionRecordInRange extends IsTimestampInRange<OperationExecutionRecord> { - - /** - * @since 1.10 - */ - public IsOperationExecutionRecordInRange(final long min, final long max) { - super(min, max); - } - - public boolean apply(final OperationExecutionRecord record) { - final long tinTimestamp = record.getTin(); - final boolean isTinInRange = this.isInRange(tinTimestamp); - final long toutTimestamp = record.getTout(); - final boolean isToutInRange = this.isInRange(toutTimestamp); - return isTinInRange && isToutInRange; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsOperationExecutionRecordTraceIdPredicate.java b/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsOperationExecutionRecordTraceIdPredicate.java deleted file mode 100644 index f2b60961..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsOperationExecutionRecordTraceIdPredicate.java +++ /dev/null @@ -1,42 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.predicate; - -import java.util.Set; - -import kieker.common.record.controlflow.OperationExecutionRecord; - - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class IsOperationExecutionRecordTraceIdPredicate extends IsTraceIdPredicate<OperationExecutionRecord> { - - /** - * @since 1.10 - */ - public IsOperationExecutionRecordTraceIdPredicate(final boolean acceptAllTraces, final Set<Long> selectedTraceIds) { - super(acceptAllTraces, selectedTraceIds); - } - - public boolean apply(final OperationExecutionRecord record) { - final Long traceId = record.getTraceId(); - return this.acceptId(traceId); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsSuperTypePredicate.java b/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsSuperTypePredicate.java deleted file mode 100644 index 3be61c14..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsSuperTypePredicate.java +++ /dev/null @@ -1,47 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.predicate; - -import java.util.Collection; - -import com.google.common.base.Predicate; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class IsSuperTypePredicate<T> implements Predicate<T> { - - private final Collection<Class<?>> acceptedClasses; - - /** - * @since 1.10 - */ - public IsSuperTypePredicate(final Collection<Class<?>> acceptedClasses) { - this.acceptedClasses = acceptedClasses; - } - - public boolean apply(final T object) { - for (final Class<?> acceptedClazz : this.acceptedClasses) { - if (acceptedClazz.isAssignableFrom(object.getClass())) { - return true; - } - } - return false; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsTimestampInRange.java b/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsTimestampInRange.java deleted file mode 100644 index 53d715ad..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsTimestampInRange.java +++ /dev/null @@ -1,42 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.predicate; - -import com.google.common.base.Predicate; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public abstract class IsTimestampInRange<T> implements Predicate<T> { - - private final long min; - private final long max; - - /** - * @since 1.10 - */ - public IsTimestampInRange(final long min, final long max) { - this.min = min; - this.max = max; - } - - protected boolean isInRange(final long timestamp) { - return (timestamp >= this.min) && (timestamp <= this.max); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsTraceIdPredicate.java b/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsTraceIdPredicate.java deleted file mode 100644 index 48f6f8c4..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/IsTraceIdPredicate.java +++ /dev/null @@ -1,44 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.predicate; - -import java.util.Set; - -import com.google.common.base.Predicate; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public abstract class IsTraceIdPredicate<T> implements Predicate<T> { - - private final boolean acceptAllTraces; - private final Set<Long> selectedTraceIds; - - /** - * @since 1.10 - */ - public IsTraceIdPredicate(final boolean acceptAllTraces, final Set<Long> selectedTraceIds) { - this.acceptAllTraces = acceptAllTraces; - this.selectedTraceIds = selectedTraceIds; - } - - protected final boolean acceptId(final Long traceId) { - return (this.acceptAllTraces || this.selectedTraceIds.contains(traceId)); - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/PredicateFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/predicate/PredicateFilter.java deleted file mode 100644 index 370bdc24..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/predicate/PredicateFilter.java +++ /dev/null @@ -1,72 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.predicate; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -import com.google.common.base.Predicate; - -/** - * @author Nils Christian Ehmke - * @param <T> - * - * @since 1.10 - */ -public class PredicateFilter<T> extends AbstractFilter<PredicateFilter<T>> { - - public final IInputPort<PredicateFilter<T>, T> inputPort = this.createInputPort(); - - public final IOutputPort<PredicateFilter<T>, T> matchingOutputPort = this.createOutputPort(); - public final IOutputPort<PredicateFilter<T>, T> mismatchingOutputPort = this.createOutputPort(); - - private Predicate<T> predicate; - - public PredicateFilter(final Predicate<T> predicate) { - this.setPredicate(predicate); - } - - public PredicateFilter() { - super(); - } - - public Predicate<T> getPredicate() { - return this.predicate; - } - - public void setPredicate(final Predicate<T> predicate) { - this.predicate = predicate; - } - - @Override - protected boolean execute(final Context<PredicateFilter<T>> context) { - final T inputObject = context.tryTake(this.inputPort); - if (inputObject == null) { - return false; - } - - if (this.predicate.apply(inputObject)) { - context.put(this.matchingOutputPort, inputObject); - } else { - context.put(this.mismatchingOutputPort, inputObject); - } - - return true; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/StringBufferFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/StringBufferFilter.java deleted file mode 100644 index 426de753..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/StringBufferFilter.java +++ /dev/null @@ -1,93 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.stringBuffer; - -import java.util.Collection; -import java.util.LinkedList; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; -import teetime.variant.explicitScheduling.stage.stringBuffer.handler.AbstractDataTypeHandler; -import teetime.variant.explicitScheduling.stage.stringBuffer.util.KiekerHashMap; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class StringBufferFilter<T> extends AbstractFilter<StringBufferFilter<T>> { - - public final IInputPort<StringBufferFilter<T>, T> objectInputPort = this.createInputPort(); - - public final IOutputPort<StringBufferFilter<T>, T> objectOutputPort = this.createOutputPort(); - - // BETTER use a non shared data structure to avoid synchronization between threads - private KiekerHashMap kiekerHashMap = new KiekerHashMap(); - - private Collection<AbstractDataTypeHandler<?>> dataTypeHandlers = new LinkedList<AbstractDataTypeHandler<?>>(); - - @Override - protected boolean execute(final Context<StringBufferFilter<T>> context) { - final T object = context.tryTake(this.objectInputPort); - if (object == null) { - return false; - } - - final T returnedObject = this.handle(object); - context.put(this.objectOutputPort, returnedObject); - - return true; - } - - @Override - public void onPipelineStarts() throws Exception { - for (final AbstractDataTypeHandler<?> handler : this.dataTypeHandlers) { - handler.setLogger(this.logger); - handler.setStringRepository(this.kiekerHashMap); - } - super.onPipelineStarts(); - } - - private T handle(final T object) { - for (final AbstractDataTypeHandler<?> handler : this.dataTypeHandlers) { - if (handler.canHandle(object)) { - @SuppressWarnings("unchecked") - final T returnedObject = ((AbstractDataTypeHandler<T>) handler).handle(object); - return returnedObject; - } - } - return object; // else relay given object - } - - public KiekerHashMap getKiekerHashMap() { - return this.kiekerHashMap; - } - - public void setKiekerHashMap(final KiekerHashMap kiekerHashMap) { - this.kiekerHashMap = kiekerHashMap; - } - - public Collection<AbstractDataTypeHandler<?>> getDataTypeHandlers() { - return this.dataTypeHandlers; - } - - public void setDataTypeHandlers(final Collection<AbstractDataTypeHandler<?>> dataTypeHandlers) { - this.dataTypeHandlers = dataTypeHandlers; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/handler/AbstractDataTypeHandler.java b/src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/handler/AbstractDataTypeHandler.java deleted file mode 100644 index bb0c2140..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/stringBuffer/handler/AbstractDataTypeHandler.java +++ /dev/null @@ -1,57 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.stringBuffer.handler; - -import teetime.variant.explicitScheduling.stage.stringBuffer.util.KiekerHashMap; - -import kieker.common.logging.Log; - - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public abstract class AbstractDataTypeHandler<T> { - - protected Log logger; - protected KiekerHashMap stringRepository; - - /** - * @since 1.10 - */ - public abstract boolean canHandle(Object object); - - /** - * @since 1.10 - */ - public abstract T handle(T object); - - /** - * @since 1.10 - */ - public void setLogger(final Log logger) { - this.logger = logger; - } - - /** - * @since 1.10 - */ - public void setStringRepository(final KiekerHashMap stringRepository) { - this.stringRepository = stringRepository; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/throughput/AnalysisThroughputFilter.java b/src/main/java/teetime/variant/explicitScheduling/stage/throughput/AnalysisThroughputFilter.java deleted file mode 100644 index 5d3b6629..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/throughput/AnalysisThroughputFilter.java +++ /dev/null @@ -1,60 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.throughput; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.framework.core.IOutputPort; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class AnalysisThroughputFilter<T> extends AbstractFilter<AnalysisThroughputFilter<T>> { - - public final IInputPort<AnalysisThroughputFilter<T>, T> objectInputPort = this.createInputPort(); - public final IInputPort<AnalysisThroughputFilter<T>, Long> timestampInputPort = this.createInputPort(); - - public final IOutputPort<AnalysisThroughputFilter<T>, T> objectOutputPort = this.createOutputPort(); - public final IOutputPort<AnalysisThroughputFilter<T>, ThroughputAnalysisResult> analysisOutputPort = this.createOutputPort(); - - private long lastTimestampInNs; - private int numObjectsPassed; - - @Override - protected boolean execute(final Context<AnalysisThroughputFilter<T>> context) { - final Long timestampInNs = context.tryTake(this.timestampInputPort); - if (timestampInNs == null) { - final T object = context.tryTake(this.objectInputPort); - context.put(this.objectOutputPort, object); - this.numObjectsPassed++; - } else { - final long durationInNs = timestampInNs - this.lastTimestampInNs; - context.put(this.analysisOutputPort, new ThroughputAnalysisResult(durationInNs, this.numObjectsPassed)); - this.reset(timestampInNs); - } - - return true; - } - - private void reset(final Long timestampInNs) { - this.numObjectsPassed = 0; - this.lastTimestampInNs = timestampInNs; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/throughput/ThroughputAnalysisResult.java b/src/main/java/teetime/variant/explicitScheduling/stage/throughput/ThroughputAnalysisResult.java deleted file mode 100644 index 147aec0c..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/throughput/ThroughputAnalysisResult.java +++ /dev/null @@ -1,44 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.stage.throughput; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class ThroughputAnalysisResult { - - private final long durationInNs; - private final int numObjectsPassed; - - /** - * @since 1.10 - */ - public ThroughputAnalysisResult(final long durationInNs, final int numObjectsPassed) { - this.durationInNs = durationInNs; - this.numObjectsPassed = numObjectsPassed; - } - - public long getDurationInNs() { - return durationInNs; - } - - public int getNumObjectsPassed() { - return numObjectsPassed; - } - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/visualization/IWebVisualizationSink.java b/src/main/java/teetime/variant/explicitScheduling/stage/visualization/IWebVisualizationSink.java deleted file mode 100644 index fe1fad49..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/visualization/IWebVisualizationSink.java +++ /dev/null @@ -1,35 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.stage.visualization; - -/** - * @author Nils Christian Ehmke - * - * @since 1.10 - * - * @param <I> - * The type of the input ports - */ -public interface IWebVisualizationSink { - - public String getHeader(); - - public String getInitialContent(); - - public String getUpdatedContent(); - -} diff --git a/src/main/java/teetime/variant/explicitScheduling/stage/visualization/PlainTextWebVisualizationSink.java b/src/main/java/teetime/variant/explicitScheduling/stage/visualization/PlainTextWebVisualizationSink.java deleted file mode 100644 index dea77fb4..00000000 --- a/src/main/java/teetime/variant/explicitScheduling/stage/visualization/PlainTextWebVisualizationSink.java +++ /dev/null @@ -1,73 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ - -package teetime.variant.explicitScheduling.stage.visualization; - -import teetime.variant.explicitScheduling.framework.core.AbstractFilter; -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; - -/** - * @author Nils Christian Ehmke, Christian Wulf - * - * @since 1.10 - * - * @param <I> - * The type of the input ports - */ -public class PlainTextWebVisualizationSink<T> extends AbstractFilter<PlainTextWebVisualizationSink<T>> implements IWebVisualizationSink { - - public final IInputPort<PlainTextWebVisualizationSink<T>, T> INPUT_OBJECT = this.createInputPort(); - - private Object currentObject = "N/A"; - - /** - * @since 1.10 - */ - public String getHeader() { - return ""; - } - - /** - * @since 1.10 - */ - public String getInitialContent() { - return this.currentObject.toString(); - } - - /** - * @since 1.10 - */ - public String getUpdatedContent() { - return this.currentObject.toString(); - } - - /** - * @since 1.10 - */ - @Override - protected boolean execute(final Context<PlainTextWebVisualizationSink<T>> context) { - final T object = context.tryTake(this.INPUT_OBJECT); - if (object == null) { - return false; - } - - this.currentObject = object; - - return true; - } - -} diff --git a/src/main/java/teetime/variant/methodcall/framework/core/AbstractStage.java b/src/main/java/teetime/variant/methodcall/framework/core/AbstractStage.java deleted file mode 100644 index 1d55b0ba..00000000 --- a/src/main/java/teetime/variant/methodcall/framework/core/AbstractStage.java +++ /dev/null @@ -1,96 +0,0 @@ -package teetime.variant.methodcall.framework.core; - -import teetime.util.list.CommittableQueue; -import teetime.util.list.CommittableResizableArrayQueue; - -public abstract class AbstractStage<I, O> implements Stage<I, O> { - - protected final CommittableQueue<O> outputElements = new CommittableResizableArrayQueue<O>(null, 4); - - private Stage<?, ?> parentStage; - - private Stage<?, ?> successor; - - private boolean reschedulable; - - @Override - public Object executeRecursively(final Object element) { - O result = this.execute(element); - if (result == null) { - return null; - } - Stage<?, ?> next = this.next(); - // if (next != null) { - // return next.executeRecursively(result); - // } else { - // return result; - // } - return next.executeRecursively(result); - } - - @Override - public CommittableQueue<O> execute2(final CommittableQueue<I> elements) { - // pass through the end signal - // InputPort<I> port = this.getInputPort(); - // if (elements != null) { - // // I element = port.read(); - // // I element = elements.getTail(); - // // if (element == END_SIGNAL) { - // // this.send((O) END_SIGNAL); - // // } else { - // // // elements = this.getInputPort().pipe.getElements(); - // // } - // - // this.execute4(elements); - // } else { - // throw new IllegalStateException(); - // } - - this.execute4(elements); - - this.outputElements.commit(); - - return this.outputElements; - } - - protected abstract void execute4(CommittableQueue<I> elements); - - protected void send(final O element) { - this.outputElements.addToTailUncommitted(element); - } - - @Override - public void onStart() { - // empty default implementation - } - - @Override - public Stage<?, ?> getParentStage() { - return this.parentStage; - } - - @Override - public void setParentStage(final Stage<?, ?> parentStage, final int index) { - this.parentStage = parentStage; - } - - @Override - public Stage<?, ?> next() { - return this.successor; - } - - @Override - public void setSuccessor(final Stage<? super O, ?> successor) { - this.successor = successor; - } - - @Override - public boolean isReschedulable() { - return this.reschedulable; - } - - public void setReschedulable(final boolean reschedulable) { - this.reschedulable = reschedulable; - } - -} diff --git a/src/main/java/teetime/variant/methodcall/framework/core/ConsumerStage.java b/src/main/java/teetime/variant/methodcall/framework/core/ConsumerStage.java deleted file mode 100644 index 2ea5b659..00000000 --- a/src/main/java/teetime/variant/methodcall/framework/core/ConsumerStage.java +++ /dev/null @@ -1,26 +0,0 @@ -package teetime.variant.methodcall.framework.core; - -import teetime.util.list.CommittableQueue; - -public abstract class ConsumerStage<I, O> extends AbstractStage<I, O> { - - @Override - public CommittableQueue<O> execute2(final CommittableQueue<I> elements) { - // the following code block does not harm the performance - // boolean inputIsEmpty = elements.isEmpty(); - // if (inputIsEmpty) { - // this.disable(); - // return this.outputElements; - // } - - CommittableQueue<O> output = super.execute2(elements); - this.setReschedulable(!elements.isEmpty()); // costs ~1200 ns on chw-work (not reproducible) - return output; - } - - @Override - public void onIsPipelineHead() { - // do nothing - } - -} diff --git a/src/main/java/teetime/variant/methodcall/framework/core/Pipeline.java b/src/main/java/teetime/variant/methodcall/framework/core/Pipeline.java deleted file mode 100644 index 6934bf29..00000000 --- a/src/main/java/teetime/variant/methodcall/framework/core/Pipeline.java +++ /dev/null @@ -1,160 +0,0 @@ -package teetime.variant.methodcall.framework.core; - -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; - -import teetime.util.list.CommittableQueue; -import teetime.variant.methodcall.stage.EndStage; - -public class Pipeline<I, O> implements Stage<I, O> { - - private Stage<I, ?> firstStage; - private final List<Stage<?, ?>> intermediateStages = new LinkedList<Stage<?, ?>>(); - private Stage<?, O> lastStage; - - private Stage<?, ?>[] stages; - private Stage<?, ?> parentStage; - private int index; - - private boolean reschedulable; - - public void setFirstStage(final Stage<I, ?> stage) { - this.firstStage = stage; - } - - public void addIntermediateStages(final Stage<?, ?>... stages) { - this.intermediateStages.addAll(Arrays.asList(stages)); - } - - public void addIntermediateStage(final Stage<?, ?> stage) { - this.intermediateStages.add(stage); - } - - public void setLastStage(final Stage<?, O> stage) { - this.lastStage = stage; - } - - @SuppressWarnings("unchecked") - @Override - public CommittableQueue<O> execute2(final CommittableQueue<I> elements) { - // CommittableQueue queue = this.firstStage.execute2(elements); - // for (Stage<?, ?> stage : this.intermediateStages) { - // queue = stage.execute2(queue); - // } - // return this.lastStage.execute2(queue); - - // below is faster than above (probably because of the instantiation of a list iterator in each (!) execution) - @SuppressWarnings("rawtypes") - CommittableQueue queue = elements; - - for (int i = 0; i < this.stages.length; i++) { - Stage<?, ?> stage = this.stages[i]; - queue = stage.execute2(queue); - if (queue.isEmpty()) { - break; - } - } - - // queue = this.firstStage.execute2(elements); - - this.setReschedulable(this.firstStage.isReschedulable()); - - return queue; - } - - @Override - public void onIsPipelineHead() { - // do nothing - } - - @Override - public Object executeRecursively(final Object element) { - return this.firstStage.executeRecursively(element); - } - - @Override - public void onStart() { - // Pipe pipe = new Pipe(); - // this.outputPort.pipe = pipe; - // this.firstStage.getInputPort().pipe = pipe; - - // Pipe pipe = new Pipe(); - // this.firstStage.getOutputPort().pipe = pipe; - // this.intermediateStages.get(0).getInputPort().pipe = pipe; - // - // for (int i = 0; i < this.intermediateStages.size() - 1; i++) { - // Stage left = this.intermediateStages.get(i); - // Stage right = this.intermediateStages.get(i + 1); - // - // pipe = new Pipe(); - // left.getOutputPort().pipe = pipe; - // right.getInputPort().pipe = pipe; - // } - // - // pipe = new Pipe(); - // this.intermediateStages.get(this.intermediateStages.size() - 1).getOutputPort().pipe = pipe; - // this.lastStage.getInputPort().pipe = pipe; - - int size = 1 + this.intermediateStages.size() + 1; - this.stages = new Stage[size]; - this.stages[0] = this.firstStage; - for (int i = 0; i < this.intermediateStages.size(); i++) { - Stage<?, ?> stage = this.intermediateStages.get(i); - this.stages[1 + i] = stage; - } - this.stages[this.stages.length - 1] = this.lastStage; - - for (int i = 0; i < this.stages.length; i++) { - // Stage<?, ?> stage = this.stages[i]; - // stage.setParentStage(this, i); - // stage.setListener(this); - } - - for (int i = 0; i < this.stages.length - 1; i++) { - Stage stage = this.stages[i]; - stage.setSuccessor(this.stages[i + 1]); - } - this.stages[this.stages.length - 1].setSuccessor(new EndStage<Object>()); - - for (Stage<?, ?> stage : this.stages) { - stage.onStart(); - } - } - - @Override - public Stage<?, ?> getParentStage() { - return this.parentStage; - } - - @Override - public void setParentStage(final Stage<?, ?> parentStage, final int index) { - this.index = index; - this.parentStage = parentStage; - } - - @Override - public O execute(final Object element) { - throw new IllegalStateException(); - } - - @Override - public Stage next() { - throw new IllegalStateException(); - } - - @Override - public void setSuccessor(final Stage<? super O, ?> successor) { - throw new IllegalStateException(); - } - - public void setReschedulable(final boolean reschedulable) { - this.reschedulable = reschedulable; - } - - @Override - public boolean isReschedulable() { - return this.reschedulable; - } - -} diff --git a/src/main/java/teetime/variant/methodcall/framework/core/ProducerStage.java b/src/main/java/teetime/variant/methodcall/framework/core/ProducerStage.java deleted file mode 100644 index bd7707be..00000000 --- a/src/main/java/teetime/variant/methodcall/framework/core/ProducerStage.java +++ /dev/null @@ -1,28 +0,0 @@ -package teetime.variant.methodcall.framework.core; - -import teetime.util.list.CommittableQueue; - -public abstract class ProducerStage<I, O> extends AbstractStage<I, O> { - - public ProducerStage() { - this.setReschedulable(true); - } - - @Override - public CommittableQueue<O> execute2(final CommittableQueue<I> elements) { - CommittableQueue<O> outputElements = super.execute2(elements); - - boolean outputIsEmpty = outputElements.isEmpty(); - if (outputIsEmpty) { - // this.getOutputPort().getPipe().close(); - } - - return outputElements; - } - - @Override - public void onIsPipelineHead() { - // do nothing - } - -} diff --git a/src/main/java/teetime/variant/methodcall/framework/core/Stage.java b/src/main/java/teetime/variant/methodcall/framework/core/Stage.java deleted file mode 100644 index 2ab689b1..00000000 --- a/src/main/java/teetime/variant/methodcall/framework/core/Stage.java +++ /dev/null @@ -1,38 +0,0 @@ -package teetime.variant.methodcall.framework.core; - -import teetime.util.list.CommittableQueue; - -public interface Stage<I, O> { - - Object executeRecursively(Object element); - - O execute(Object element); - - // CommittableQueue<O> execute2(); - - CommittableQueue<O> execute2(CommittableQueue<I> elements); - - // SchedulingInformation getSchedulingInformation(); - - Stage<?, ?> getParentStage(); - - void setParentStage(Stage<?, ?> parentStage, int index); - - // void setListener(OnDisableListener listener); - - Stage<?, ?> next(); - - void setSuccessor(Stage<? super O, ?> successor); - - /** - * Used for execute4() (experiment02) - * - * @return - */ - boolean isReschedulable(); - - void onIsPipelineHead(); - - void onStart(); - -} diff --git a/src/main/java/teetime/variant/methodcall/stage/CollectorSink.java b/src/main/java/teetime/variant/methodcall/stage/CollectorSink.java deleted file mode 100644 index 1b2a8d3f..00000000 --- a/src/main/java/teetime/variant/methodcall/stage/CollectorSink.java +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.stage; - -import java.util.List; - -import teetime.util.list.CommittableQueue; -import teetime.variant.methodcall.framework.core.ConsumerStage; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class CollectorSink<T> extends ConsumerStage<T, Object> { - - private static final int THRESHOLD = 10000; - private static final Object continueSignal = new Object(); - - private final List<T> elements; - - public CollectorSink(final List<T> list) { - this.elements = list; - } - - @SuppressWarnings("unchecked") - @Override - public Object execute(final Object element) { - this.elements.add((T) element); - if ((this.elements.size() % THRESHOLD) == 0) { - System.out.println("size: " + this.elements.size()); - } - return continueSignal; - } - - @Override - public void onIsPipelineHead() { - System.out.println("size: " + this.elements.size()); - } - - @Override - protected void execute4(final CommittableQueue<T> elements) { - T element = elements.removeFromHead(); - this.elements.add(element); - if ((this.elements.size() % THRESHOLD) == 0) { - System.out.println("size: " + this.elements.size()); - } - } - -} diff --git a/src/main/java/teetime/variant/methodcall/stage/EndStage.java b/src/main/java/teetime/variant/methodcall/stage/EndStage.java deleted file mode 100644 index eccd922a..00000000 --- a/src/main/java/teetime/variant/methodcall/stage/EndStage.java +++ /dev/null @@ -1,71 +0,0 @@ -package teetime.variant.methodcall.stage; - -import java.util.LinkedList; -import java.util.List; - -import teetime.util.ConstructorClosure; -import teetime.util.list.CommittableQueue; -import teetime.variant.methodcall.framework.core.Stage; - -public class EndStage<T> implements Stage<T, T> { - - public int count; - public ConstructorClosure<?> closure; - public List<Object> list = new LinkedList<Object>(); - - @Override - public T execute(final Object element) { - throw new IllegalStateException(); - } - - @Override - public void onIsPipelineHead() { - // do nothing - } - - @Override - public CommittableQueue<T> execute2(final CommittableQueue<T> elements) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Stage getParentStage() { - // TODO Auto-generated method stub - return null; - } - - @Override - public void setParentStage(final Stage<?, ?> parentStage, final int index) { - // TODO Auto-generated method stub - - } - - @Override - public Stage next() { - return null; - } - - @Override - public void setSuccessor(final Stage<? super T, ?> successor) { - // TODO Auto-generated method stub - - } - - @Override - public void onStart() { - // TODO Auto-generated method stub - - } - - @Override - public Object executeRecursively(final Object element) { - return element; - } - - @Override - public boolean isReschedulable() { - return false; - } - -} diff --git a/src/main/java/teetime/variant/methodcall/stage/NoopFilter.java b/src/main/java/teetime/variant/methodcall/stage/NoopFilter.java deleted file mode 100644 index 5907267c..00000000 --- a/src/main/java/teetime/variant/methodcall/stage/NoopFilter.java +++ /dev/null @@ -1,40 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.stage; - -import teetime.util.list.CommittableQueue; -import teetime.variant.methodcall.framework.core.ConsumerStage; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class NoopFilter<T> extends ConsumerStage<T, T> { - - @SuppressWarnings("unchecked") - @Override - public T execute(final Object obj) { - return (T) obj; - } - - @Override - protected void execute4(final CommittableQueue<T> elements) { - T element = elements.removeFromHead(); - this.send(element); // TODO ? "send" calls the next stage and so on - } - -} diff --git a/src/main/java/teetime/variant/methodcall/stage/ObjectProducer.java b/src/main/java/teetime/variant/methodcall/stage/ObjectProducer.java deleted file mode 100644 index 1d580d36..00000000 --- a/src/main/java/teetime/variant/methodcall/stage/ObjectProducer.java +++ /dev/null @@ -1,90 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.stage; - -import teetime.util.ConstructorClosure; -import teetime.util.list.CommittableQueue; -import teetime.variant.methodcall.framework.core.ProducerStage; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class ObjectProducer<T> extends ProducerStage<Void, T> { - - private long numInputObjects; - private ConstructorClosure<T> inputObjectCreator; - - /** - * @since 1.10 - */ - public ObjectProducer(final long numInputObjects, final ConstructorClosure<T> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - @Override - public T execute(final Object element) { - if (this.numInputObjects == 0) { - return null; - } - - try { - final T newObject = this.inputObjectCreator.create(); - // final T newObject = null; - this.numInputObjects--; - - return newObject; - } catch (final Exception e) { - throw new IllegalStateException(e); - } - } - - public long getNumInputObjects() { - return this.numInputObjects; - } - - public void setNumInputObjects(final long numInputObjects) { - this.numInputObjects = numInputObjects; - } - - public ConstructorClosure<T> getInputObjectCreator() { - return this.inputObjectCreator; - } - - public void setInputObjectCreator(final ConstructorClosure<T> inputObjectCreator) { - this.inputObjectCreator = inputObjectCreator; - } - - @Override - protected void execute4(final CommittableQueue<Void> elements) { - if (this.numInputObjects == 0) { - this.setReschedulable(false); - // this.getOutputPort().pipe.close(); - return; - } - - T newObject = null; - newObject = this.inputObjectCreator.create(); - this.numInputObjects--; - - // System.out.println(this.getClass().getSimpleName() + ": sending " + this.numInputObjects); - this.send(newObject); - // throw new IllegalStateException(); - } - -} diff --git a/src/main/java/teetime/variant/methodcall/stage/StartTimestampFilter.java b/src/main/java/teetime/variant/methodcall/stage/StartTimestampFilter.java deleted file mode 100644 index a83d1655..00000000 --- a/src/main/java/teetime/variant/methodcall/stage/StartTimestampFilter.java +++ /dev/null @@ -1,42 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.stage; - -import teetime.util.list.CommittableQueue; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.methodcall.framework.core.ConsumerStage; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class StartTimestampFilter extends ConsumerStage<TimestampObject, TimestampObject> { - - @Override - public TimestampObject execute(final Object obj) { - TimestampObject timestampObject = (TimestampObject) obj; - timestampObject.setStartTimestamp(System.nanoTime()); - return timestampObject; - } - - @Override - protected void execute4(final CommittableQueue<TimestampObject> elements) { - TimestampObject element = elements.removeFromHead(); - element.setStartTimestamp(System.nanoTime()); - this.send(element); - } -} diff --git a/src/main/java/teetime/variant/methodcall/stage/StopTimestampFilter.java b/src/main/java/teetime/variant/methodcall/stage/StopTimestampFilter.java deleted file mode 100644 index 1e36f533..00000000 --- a/src/main/java/teetime/variant/methodcall/stage/StopTimestampFilter.java +++ /dev/null @@ -1,43 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.stage; - -import teetime.util.list.CommittableQueue; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.methodcall.framework.core.ConsumerStage; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class StopTimestampFilter extends ConsumerStage<TimestampObject, TimestampObject> { - - @Override - public TimestampObject execute(final Object obj) { - TimestampObject timestampObject = (TimestampObject) obj; - timestampObject.setStopTimestamp(System.nanoTime()); - return timestampObject; - } - - @Override - protected void execute4(final CommittableQueue<TimestampObject> elements) { - TimestampObject element = elements.removeFromHead(); - element.setStopTimestamp(System.nanoTime()); - this.send(element); - } - -} diff --git a/src/main/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/SysOutFilter.java b/src/main/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/SysOutFilter.java deleted file mode 100644 index 7b97e682..00000000 --- a/src/main/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/SysOutFilter.java +++ /dev/null @@ -1,33 +0,0 @@ -package teetime.variant.methodcallWithPorts.examples.traceReconstructionWithThreads; - -import teetime.variant.methodcallWithPorts.framework.core.ConsumerStage; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.pipe.IPipe; - -public class SysOutFilter<T> extends ConsumerStage<T> { - - private final InputPort<Long> triggerInputPort = this.createInputPort(); - private final OutputPort<T> outputPort = this.createOutputPort(); - - private final IPipe pipe; - - public SysOutFilter(final IPipe pipe) { - this.pipe = pipe; - } - - @Override - protected void execute(final T element) { - Long timestamp = this.triggerInputPort.receive(); - if (timestamp != null) { - // this.logger.info("pipe.size: " + this.pipe.size()); - System.out.println("pipe.size: " + this.pipe.size()); - } - this.send(this.outputPort, element); - } - - public InputPort<Long> getTriggerInputPort() { - return this.triggerInputPort; - } - -} diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/IPipeFactory.java b/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/IPipeFactory.java deleted file mode 100644 index da4bbd44..00000000 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/pipe/IPipeFactory.java +++ /dev/null @@ -1,23 +0,0 @@ -package teetime.variant.methodcallWithPorts.framework.core.pipe; - -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.PipeOrdering; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.ThreadCommunication; - -public interface IPipeFactory { - - @Deprecated - IPipe create(int capacity); - - <T> IPipe create(OutputPort<? extends T> sourcePort, InputPort<T> targetPort); - - <T> IPipe create(OutputPort<? extends T> sourcePort, InputPort<T> targetPort, int capacity); - - ThreadCommunication getThreadCommunication(); - - PipeOrdering getOrdering(); - - boolean isGrowable(); - -} diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/signal/ISignal.java b/src/main/java/teetime/variant/methodcallWithPorts/framework/core/signal/ISignal.java deleted file mode 100644 index 13e15dbf..00000000 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/signal/ISignal.java +++ /dev/null @@ -1,8 +0,0 @@ -package teetime.variant.methodcallWithPorts.framework.core.signal; - -import teetime.variant.methodcallWithPorts.framework.core.AbstractStage; - -public interface ISignal { - - void trigger(AbstractStage stage); -} diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/MonitoringLogDirectory2Files.java b/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/MonitoringLogDirectory2Files.java deleted file mode 100644 index d420b145..00000000 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/MonitoringLogDirectory2Files.java +++ /dev/null @@ -1,88 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.kieker; - -import java.io.File; -import java.io.FileFilter; -import java.util.Comparator; - -import kieker.common.util.filesystem.BinaryCompressionMethod; -import kieker.common.util.filesystem.FSUtil; - -import teetime.variant.explicitScheduling.framework.core.Context; -import teetime.variant.explicitScheduling.framework.core.IInputPort; -import teetime.variant.explicitScheduling.stage.io.Directory2FilesFilter; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MonitoringLogDirectory2Files extends Directory2FilesFilter { - - public final IInputPort<Directory2FilesFilter, String> filePrefixInputPort = this.createInputPort(); - - /** - * @author Christian Wulf - * - * @since 1.10 - */ - static class MonitoringLogFileFilter implements FileFilter { - private String filePrefix; - - @Override - public boolean accept(final File pathname) { - final String name = pathname.getName(); - return pathname.isFile() - && name.startsWith(this.filePrefix) - && (name.endsWith(FSUtil.NORMAL_FILE_EXTENSION) || BinaryCompressionMethod.hasValidFileExtension(name)); - } - - public String getFilePrefix() { - return this.filePrefix; - } - - public void setFilePrefix(final String filePrefix) { - this.filePrefix = filePrefix; - } - } - - private static final Comparator<File> FILE_COMPARATOR = new Comparator<File>() { - @Override - public final int compare(final File f1, final File f2) { - return f1.compareTo(f2); // simplified (we expect no dirs!) - } - }; - - /** - * @since 1.10 - */ - public MonitoringLogDirectory2Files() { - super(new MonitoringLogFileFilter(), FILE_COMPARATOR); - } - - @Override - protected boolean execute(final Context<Directory2FilesFilter> context) { - final String filePrefix = context.tryTake(this.filePrefixInputPort); - if (filePrefix == null) { - return false; - } - - ((MonitoringLogFileFilter) this.getFilter()).setFilePrefix(filePrefix); - - return super.execute(context); - } -} diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/className/ClassNameRegistry.java b/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/className/ClassNameRegistry.java deleted file mode 100644 index 3afc8cb8..00000000 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/className/ClassNameRegistry.java +++ /dev/null @@ -1,29 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.kieker.className; - -import java.util.HashMap; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class ClassNameRegistry extends HashMap<Integer, String> { - - private static final long serialVersionUID = -7254550212115937463L; - -} diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/className/ClassNameRegistryRepository.java b/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/className/ClassNameRegistryRepository.java deleted file mode 100644 index e916721a..00000000 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/className/ClassNameRegistryRepository.java +++ /dev/null @@ -1,61 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.kieker.className; - -import java.io.File; -import java.util.concurrent.ConcurrentHashMap; - -/** - * This class represents a wrapper for a Map<String, ClassNameRegistry> ensuring that keys are - * <ul> - * <li>of the type <code>java.io.File</code> and - * <li>passed as absolute file paths. - * </ul> - * - * @author Christian Wulf - * - * @since 1.10 - */ -public class ClassNameRegistryRepository { - - private final ConcurrentHashMap<String, ClassNameRegistry> classNameRegistryRepository = new ConcurrentHashMap<String, ClassNameRegistry>(); - - /** - * @since 1.10 - */ - public ClassNameRegistry get(final File directory) { - return this.classNameRegistryRepository.get(directory.getAbsolutePath()); - } - - /** - * @since 1.10 - */ - public void put(final File directory, final ClassNameRegistry classNameRegistry) { - this.classNameRegistryRepository.put(directory.getAbsolutePath(), classNameRegistry); - } - - /** - * @since 1.10 - */ - public int size() { - return this.classNameRegistryRepository.size(); - } - - @Override - public String toString() { - return this.classNameRegistryRepository.toString(); - } -} diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/RecordFromTextLineCreator.java b/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/RecordFromTextLineCreator.java deleted file mode 100644 index 476a7537..00000000 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/kieker/fileToRecord/RecordFromTextLineCreator.java +++ /dev/null @@ -1,116 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.kieker.fileToRecord; - -import java.io.File; - -import teetime.variant.explicitScheduling.stage.MappingException; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistry; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistryRepository; - -import kieker.common.exception.IllegalRecordFormatException; -import kieker.common.exception.MonitoringRecordException; -import kieker.common.exception.UnknownRecordTypeException; -import kieker.common.record.AbstractMonitoringRecord; -import kieker.common.record.IMonitoringRecord; -import kieker.common.record.controlflow.OperationExecutionRecord; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class RecordFromTextLineCreator { - - private static final String CSV_SEPARATOR_CHARACTER = ";"; - - private static final IllegalRecordFormatException ILLEGAL_RECORD_FORMAT_EXCEPTION = new IllegalRecordFormatException(); - - private final ClassNameRegistryRepository classNameRegistryRepository; - - public RecordFromTextLineCreator(final ClassNameRegistryRepository classNameRegistryRepository) { - this.classNameRegistryRepository = classNameRegistryRepository; - } - - /** - * @since 1.10 - */ - public IMonitoringRecord createRecordFromLine(final File textFile, final String line) throws MonitoringRecordException, IllegalRecordFormatException, - MappingException, - UnknownRecordTypeException { - final String[] recordFields = line.split(CSV_SEPARATOR_CHARACTER); - - if (recordFields.length < 2) { - throw ILLEGAL_RECORD_FORMAT_EXCEPTION; - } - - final boolean isModernRecord = recordFields[0].charAt(0) == '$'; - if (isModernRecord) { - return this.createModernRecordFromRecordFields(textFile, recordFields); - } else { - return this.createLegacyRecordFromRecordFiels(recordFields); - } - } - - private IMonitoringRecord createModernRecordFromRecordFields(final File textFile, final String[] recordFields) throws MonitoringRecordException, - MappingException, - UnknownRecordTypeException { - final ClassNameRegistry classNameRegistry = this.classNameRegistryRepository.get(textFile.getParentFile()); - final Integer id = Integer.valueOf(recordFields[0].substring(1)); - final String classname = classNameRegistry.get(id); - if (classname == null) { - throw new MappingException("Missing classname mapping for record type id " + "'" + id + "'"); - } - final Class<? extends IMonitoringRecord> clazz = this.getClassByName(classname); - final long loggingTimestamp = Long.parseLong(recordFields[1]); - final int skipValues; - // check for Kieker < 1.6 OperationExecutionRecords - if ((recordFields.length == 11) && clazz.equals(OperationExecutionRecord.class)) { - skipValues = 3; - } else { - skipValues = 2; - } - // Java 1.5 compatibility - final String[] recordFieldsReduced = new String[recordFields.length - skipValues]; - System.arraycopy(recordFields, skipValues, recordFieldsReduced, 0, recordFields.length - skipValues); - // in Java 1.6 this could be simplified to - // recordFieldsReduced = Arrays.copyOfRange(recordFields, skipValues, recordFields.length); - - final IMonitoringRecord record = AbstractMonitoringRecord.createFromStringArray(clazz, recordFieldsReduced); - record.setLoggingTimestamp(loggingTimestamp); - return record; - } - - /** - * @since 1.10 - */ - private Class<? extends IMonitoringRecord> getClassByName(final String classname) throws MonitoringRecordException, UnknownRecordTypeException { - try { - return AbstractMonitoringRecord.classForName(classname); - } catch (final MonitoringRecordException ex) { - throw new UnknownRecordTypeException("Failed to load record type " + classname, classname, ex); - } - } - - /** - * @since 1.10 - */ - private IMonitoringRecord createLegacyRecordFromRecordFiels(final String[] recordFields) throws MonitoringRecordException { - final String[] recordFieldsReduced = new String[recordFields.length - 1]; - System.arraycopy(recordFields, 1, recordFieldsReduced, 0, recordFields.length - 1); - return AbstractMonitoringRecord.createFromStringArray(OperationExecutionRecord.class, recordFieldsReduced); - } -} diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/handler/IMonitoringRecordHandler.java b/src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/handler/IMonitoringRecordHandler.java deleted file mode 100644 index 554268dd..00000000 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/handler/IMonitoringRecordHandler.java +++ /dev/null @@ -1,60 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.stringBuffer.handler; - -import kieker.common.exception.MonitoringRecordException; -import kieker.common.record.AbstractMonitoringRecord; -import kieker.common.record.IMonitoringRecord; - - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class IMonitoringRecordHandler extends AbstractDataTypeHandler<IMonitoringRecord> { - - @Override - public boolean canHandle(final Object object) { - return object instanceof IMonitoringRecord; - } - - @Override - public IMonitoringRecord handle(final IMonitoringRecord monitoringRecord) { - final Object[] objects = monitoringRecord.toArray(); - - boolean stringBuffered = false; - for (int i = 0; i < objects.length; i++) { - if (objects[i] instanceof String) { - objects[i] = this.stringRepository.get((String) objects[i]); - stringBuffered = true; - } - } - - if (stringBuffered) { - try { - final IMonitoringRecord newRecord = AbstractMonitoringRecord.createFromArray(monitoringRecord.getClass(), objects); - newRecord.setLoggingTimestamp(monitoringRecord.getLoggingTimestamp()); - return newRecord; - } catch (final MonitoringRecordException ex) { - this.logger.warn("Failed to recreate buffered monitoring record: " + monitoringRecord.toString(), ex); - } - } - - return monitoringRecord; - } - -} diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/handler/StringHandler.java b/src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/handler/StringHandler.java deleted file mode 100644 index 54d133ab..00000000 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/handler/StringHandler.java +++ /dev/null @@ -1,35 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.stringBuffer.handler; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class StringHandler extends AbstractDataTypeHandler<String> { - - @Override - public boolean canHandle(final Object object) { - return object instanceof String; - } - - @Override - public String handle(final String object) { - return this.stringRepository.get(object); - } - -} diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/util/KiekerHashMap.java b/src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/util/KiekerHashMap.java deleted file mode 100644 index 76f79756..00000000 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/stringBuffer/util/KiekerHashMap.java +++ /dev/null @@ -1,291 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcallWithPorts.stage.stringBuffer.util; - -import java.lang.ref.SoftReference; -import java.util.concurrent.locks.ReentrantLock; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class KiekerHashMap { - - private static final int INITIAL_CAPACITY = 16; - private static final double LOAD_FACTOR = 0.75d; - private static final int CONCURRENCY_LEVEL = 16; - private static final int MAXIMUM_CAPACITY = 1 << 30; - - /** - * Mask value for indexing into segments. The upper bits of a key's hash code are used to choose the segment. - */ - private final int segmentMask; - - /** - * Shift value for indexing within segments. - */ - private final int segmentShift; - - /** - * The segments, each of which is a specialized hash table. - */ - private final Segment[] segments; - - /** - * @since 1.10 - */ - public KiekerHashMap() { - // Find power-of-two sizes best matching arguments - int sshift = 0; - int ssize = 1; - while (ssize < CONCURRENCY_LEVEL) { - ++sshift; - ssize <<= 1; - } - this.segmentShift = 32 - sshift; - this.segmentMask = ssize - 1; - this.segments = new Segment[ssize]; - int c = INITIAL_CAPACITY / ssize; - if ((c * ssize) < INITIAL_CAPACITY) { - ++c; - } - int cap = 1; - while (cap < c) { - cap <<= 1; - } - for (int i = 0; i < this.segments.length; ++i) { - this.segments[i] = new Segment(cap, LOAD_FACTOR); - } - } - - /** - * Applies a supplemental hash function to a given hashCode, which defends against poor quality hash functions. This is critical because ConcurrentHashMap uses - * power-of-two length hash tables, that otherwise encounter collisions for hashCodes that do not differ in lower or upper bits. - */ - private static final int hash(final String value) { - // Spread bits to regularize both segment and index locations, using variant of single-word Wang/Jenkins hash. - int h = value.hashCode(); - h += (h << 15) ^ 0xffffcd7d; - h ^= h >>> 10; - h += h << 3; - h ^= h >>> 6; - h += (h << 2) + (h << 14); - return h ^ (h >>> 16); - } - - public final String get(final String value) { - final int hash = KiekerHashMap.hash(value); - Segment segment = this.segments[(hash >>> this.segmentShift) & this.segmentMask]; - return segment.get(value, hash); - } - - // ---------------- Inner Classes -------------- - - /** - * StringBuffer entry. - */ - private static final class HashEntry extends SoftReference<String> { - final int hash; // NOPMD NOCS (package visible for inner class) - final HashEntry next; // NOPMD NOCS (package visible for inner class) - - protected HashEntry(final String value, final int hash, final HashEntry next) { - super(value); - this.hash = hash; - this.next = next; - } - } - - /** - * Segments are specialized versions of hash tables. This subclasses from ReentrantLock opportunistically, just to simplify some locking and avoid separate - * construction. - * - * Segments maintain a table of entry lists that are ALWAYS kept in a consistent state, so can be read without locking. Next fields of nodes are immutable - * (final). All list additions are performed at the front of each bin. This makes it easy to check changes, and also fast to traverse. When nodes would - * otherwise be changed, new nodes are created to replace them. This works well for hash tables since the bin lists tend to be short. (The average length is - * less than two for the default load factor threshold.) - * - * Read operations can thus proceed without locking, but rely on selected uses of volatiles to ensure that completed write operations performed by other - * threads are noticed. For most purposes, the "count" field, tracking the number of elements, serves as that volatile variable ensuring visibility. This is - * convenient because this field needs to be read in many read operations anyway: - * - * - All (unsynchronized) read operations must first read the "count" field, and should not look at table entries if it is 0. - * - * - All (synchronized) write operations should write to the "count" field after structurally changing any bin. The operations must not take any action that - * could even momentarily cause a concurrent read operation to see inconsistent data. This is made easier by the nature of the read operations in Map. For - * example, no operation can reveal that the table has grown but the threshold has not yet been updated, so there are no atomicity requirements for this with - * respect to reads. - * - * As a guide, all critical volatile reads and writes to the count field are marked in code comments. - */ - private static final class Segment extends ReentrantLock { - - private static final long serialVersionUID = 1L; - - /** - * The number of elements in this segment's region. - */ - private volatile int count; - - /** - * The per-segment table. - */ - private HashEntry[] table; - - /** - * The table is rehashed when its size exceeds this threshold. (The value of this field is always <tt>(int)(capacity * loadFactor)</tt>.) - */ - private int threshold; - - protected Segment(final int initialCapacity, final double lf) { - this.table = new HashEntry[initialCapacity]; - this.threshold = (int) (initialCapacity * lf); - this.count = 0; - } - - protected final String get(final String value, final int hash) { - HashEntry e = null; - String cachedString; - if (this.count != 0) { // volatile read! search for entry without locking - final HashEntry[] tab = this.table; - final int index = hash & (tab.length - 1); - final HashEntry first = tab[index]; - e = first; - while (e != null) { - if (e.hash == hash) { - cachedString = e.get(); - if (value.equals(cachedString)) { - return cachedString; - } - } - e = e.next; - } - } - this.lock(); - try { - final int c = this.count + 1; - if (c >= this.threshold) { - this.cleanup(); - if (c >= this.threshold) { // if still full - this.rehash(); - } - this.count = c; // write volatile - } - final HashEntry[] tab = this.table; - final int index = hash & (tab.length - 1); - final HashEntry first = tab[index]; // the bin the value may be inside - e = first; - while (e != null) { - if (e.hash == hash) { - cachedString = e.get(); - if (value.equals(cachedString)) { - return cachedString; - } - } - e = e.next; - } - tab[index] = new HashEntry(value, hash, first); - this.count = c; // write-volatile - return value; // return now cached string - } finally { - this.unlock(); - } - } - - private final void cleanup() { - int c = this.count; - final HashEntry[] tab = this.table; - for (int index = 0; index < tab.length; index++) { - // find first remaining entry - HashEntry e = tab[index]; - while ((e != null) && (e.get() == null)) { - e = e.next; - c--; - } - if (e == null) { - tab[index] = null; - } else { - // find more existing entries and enqueue before this one - HashEntry first = new HashEntry(e.get(), e.hash, null); - e = e.next; - while (e != null) { - final String s = e.get(); - if (s != null) { - first = new HashEntry(s, e.hash, first); - } else { - c--; - } - e = e.next; - } - tab[index] = first; - } - } - c--; - this.count = c; // write-volatile - } - - /** - * Reclassify nodes in each list to new Map. Because we are using power-of-two expansion, the elements from each bin must either stay at same index, or - * move with a power of two offset. We eliminate unnecessary node creation by catching cases where old nodes can be reused because their next fields - * won't change. Statistically, at the default threshold, only about one-sixth of them need cloning when a table doubles. The nodes they replace will be - * garbage collectable as soon as they are no longer referenced by any reader thread that may be in the midst of traversing table right now. - */ - private final void rehash() { - final HashEntry[] oldTable = this.table; - final int oldCapacity = oldTable.length; - if (oldCapacity >= MAXIMUM_CAPACITY) { - return; - } - final HashEntry[] newTable = new HashEntry[oldCapacity << 1]; - this.threshold = (int) (newTable.length * LOAD_FACTOR); - final int sizeMask = newTable.length - 1; - for (int i = 0; i < oldCapacity; i++) { - // We need to guarantee that any existing reads of old Map can proceed. So we cannot yet null out each bin. - final HashEntry e = oldTable[i]; - - if (e != null) { - final HashEntry next = e.next; - final int idx = e.hash & sizeMask; - - // Single node on list - if (next == null) { - newTable[idx] = e; - } else { - // Reuse trailing consecutive sequence at same slot - HashEntry lastRun = e; - int lastIdx = idx; - for (HashEntry last = next; last != null; last = last.next) { // find end of bin - final int k = last.hash & sizeMask; - if (k != lastIdx) { // NOCS (nested if) - lastIdx = k; - lastRun = last; - } - } - newTable[lastIdx] = lastRun; - - // Clone all remaining nodes - for (HashEntry p = e; p != lastRun; p = p.next) { // NOPMD (no equals meant here) - final int k = p.hash & sizeMask; - final HashEntry n = newTable[k]; - newTable[k] = new HashEntry(p.get(), p.hash, n); - } - } - } - } - this.table = newTable; - } - } -} diff --git a/src/main/java/util/KiekerLoadDriver.java b/src/main/java/util/KiekerLoadDriver.java index 99a25051..65795567 100644 --- a/src/main/java/util/KiekerLoadDriver.java +++ b/src/main/java/util/KiekerLoadDriver.java @@ -14,14 +14,14 @@ import java.util.Collection; import java.util.LinkedList; import java.util.List; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.HeadStage; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SingleElementPipe; -import teetime.variant.methodcallWithPorts.stage.CollectorSink; -import teetime.variant.methodcallWithPorts.stage.InitialElementProducer; -import teetime.variant.methodcallWithPorts.stage.kieker.Dir2RecordsFilter; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistryRepository; +import teetime.framework.HeadPipeline; +import teetime.framework.HeadStage; +import teetime.framework.RunnableStage; +import teetime.framework.pipe.SingleElementPipe; +import teetime.stage.CollectorSink; +import teetime.stage.InitialElementProducer; +import teetime.stage.kieker.Dir2RecordsFilter; +import teetime.stage.kieker.className.ClassNameRegistryRepository; import kieker.common.record.IMonitoringRecord; import kieker.common.record.flow.trace.TraceMetadata; diff --git a/src/main/java/util/PerformanceTest.java b/src/main/java/util/PerformanceTest.java index 7438d476..cc672d50 100644 --- a/src/main/java/util/PerformanceTest.java +++ b/src/main/java/util/PerformanceTest.java @@ -13,7 +13,7 @@ import org.junit.rules.TestWatcher; import org.junit.runner.Description; import teetime.util.StopWatch; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; +import teetime.util.TimestampObject; public abstract class PerformanceTest { diff --git a/src/main/java/util/StatisticsUtil.java b/src/main/java/util/StatisticsUtil.java index de3fd567..62d0d0e7 100644 --- a/src/main/java/util/StatisticsUtil.java +++ b/src/main/java/util/StatisticsUtil.java @@ -25,11 +25,11 @@ import java.util.Map.Entry; import java.util.concurrent.TimeUnit; import teetime.util.MathUtil; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; +import teetime.util.TimestampObject; /** * @author Christian Wulf - * + * * @since 1.10 */ public class StatisticsUtil { diff --git a/src/test/java/kieker/analysis/examples/throughput/ThroughputTimestampAnalysisTest.java b/src/test/java/kieker/analysis/examples/throughput/ThroughputTimestampAnalysisTest.java index 3bbd1bb9..95d173d6 100644 --- a/src/test/java/kieker/analysis/examples/throughput/ThroughputTimestampAnalysisTest.java +++ b/src/test/java/kieker/analysis/examples/throughput/ThroughputTimestampAnalysisTest.java @@ -22,7 +22,7 @@ import java.util.concurrent.Callable; import org.junit.Test; import teetime.util.StopWatch; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; +import teetime.util.TimestampObject; import util.PerformanceTest; import util.StatisticsUtil; @@ -31,7 +31,7 @@ import kieker.analysis.exception.AnalysisConfigurationException; /** * @author Nils Christian Ehmke - * + * * @since 1.10 */ public class ThroughputTimestampAnalysisTest extends PerformanceTest { diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/ChwHomeComparisonMethodcallWithPorts.java b/src/test/java/teetime/examples/ChwHomeComparisonMethodcallWithPorts.java similarity index 99% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/ChwHomeComparisonMethodcallWithPorts.java rename to src/test/java/teetime/examples/ChwHomeComparisonMethodcallWithPorts.java index 65aba3de..9f08e6a5 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/ChwHomeComparisonMethodcallWithPorts.java +++ b/src/test/java/teetime/examples/ChwHomeComparisonMethodcallWithPorts.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.examples; +package teetime.examples; import static org.junit.Assert.assertEquals; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/ChwWorkComparisonMethodcallWithPorts.java b/src/test/java/teetime/examples/ChwWorkComparisonMethodcallWithPorts.java similarity index 99% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/ChwWorkComparisonMethodcallWithPorts.java rename to src/test/java/teetime/examples/ChwWorkComparisonMethodcallWithPorts.java index e8c6d799..38d93b56 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/ChwWorkComparisonMethodcallWithPorts.java +++ b/src/test/java/teetime/examples/ChwWorkComparisonMethodcallWithPorts.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.examples; +package teetime.examples; import static org.junit.Assert.assertEquals; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/ComparisonMethodcallWithPorts.java b/src/test/java/teetime/examples/ComparisonMethodcallWithPorts.java similarity index 58% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/ComparisonMethodcallWithPorts.java rename to src/test/java/teetime/examples/ComparisonMethodcallWithPorts.java index c06482ba..2d9876f4 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/ComparisonMethodcallWithPorts.java +++ b/src/test/java/teetime/examples/ComparisonMethodcallWithPorts.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.examples; +package teetime.examples; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -6,21 +6,20 @@ import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; -import teetime.variant.methodcall.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test; -import teetime.variant.methodcallWithPorts.examples.experiment09.MethodCallThoughputTimestampAnalysis9Test; -import teetime.variant.methodcallWithPorts.examples.experiment10.MethodCallThoughputTimestampAnalysis10Test; -import teetime.variant.methodcallWithPorts.examples.experiment11.MethodCallThoughputTimestampAnalysis11Test; -import teetime.variant.methodcallWithPorts.examples.experiment14.MethodCallThoughputTimestampAnalysis14Test; -import teetime.variant.methodcallWithPorts.examples.experiment15.MethodCallThoughputTimestampAnalysis15Test; -import teetime.variant.methodcallWithPorts.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test; -import teetime.variant.methodcallWithPorts.examples.experiment17.MethodCallThoughputTimestampAnalysis17Test; -import teetime.variant.methodcallWithPorts.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test; +import teetime.examples.experiment09.MethodCallThoughputTimestampAnalysis9Test; +import teetime.examples.experiment10.MethodCallThoughputTimestampAnalysis10Test; +import teetime.examples.experiment11.MethodCallThoughputTimestampAnalysis11Test; +import teetime.examples.experiment14.MethodCallThoughputTimestampAnalysis14Test; +import teetime.examples.experiment15.MethodCallThoughputTimestampAnalysis15Test; +import teetime.examples.experiment16.MethodCallThoughputTimestampAnalysis16Test; +import teetime.examples.experiment17.MethodCallThoughputTimestampAnalysis17Test; +import teetime.examples.experiment19.MethodCallThoughputTimestampAnalysis19Test; import util.PerformanceCheckProfile; import util.PerformanceCheckProfileRepository; @RunWith(Suite.class) @SuiteClasses({ - MethodCallThoughputTimestampAnalysis1Test.class, + // MethodCallThoughputTimestampAnalysis1Test.class, MethodCallThoughputTimestampAnalysis9Test.class, MethodCallThoughputTimestampAnalysis10Test.class, MethodCallThoughputTimestampAnalysis11Test.class, diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/NieWorkComparisonMethodcallWithPorts.java b/src/test/java/teetime/examples/NieWorkComparisonMethodcallWithPorts.java similarity index 98% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/NieWorkComparisonMethodcallWithPorts.java rename to src/test/java/teetime/examples/NieWorkComparisonMethodcallWithPorts.java index 73472fee..e3d61d88 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/NieWorkComparisonMethodcallWithPorts.java +++ b/src/test/java/teetime/examples/NieWorkComparisonMethodcallWithPorts.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.examples; +package teetime.examples; import static org.junit.Assert.assertEquals; diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment01/ChwHomePerformanceCheck.java b/src/test/java/teetime/examples/experiment01/ChwHomePerformanceCheck.java similarity index 91% rename from src/test/java/teetime/variant/methodcall/examples/experiment01/ChwHomePerformanceCheck.java rename to src/test/java/teetime/examples/experiment01/ChwHomePerformanceCheck.java index aeab2733..46a7a238 100644 --- a/src/test/java/teetime/variant/methodcall/examples/experiment01/ChwHomePerformanceCheck.java +++ b/src/test/java/teetime/examples/experiment01/ChwHomePerformanceCheck.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcall.examples.experiment01; +package teetime.examples.experiment01; import static org.junit.Assert.assertEquals; import util.PerformanceCheckProfile; diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment01/ChwWorkPerformanceCheck.java b/src/test/java/teetime/examples/experiment01/ChwWorkPerformanceCheck.java similarity index 91% rename from src/test/java/teetime/variant/methodcall/examples/experiment01/ChwWorkPerformanceCheck.java rename to src/test/java/teetime/examples/experiment01/ChwWorkPerformanceCheck.java index 44fa5ff7..eb2f4fdf 100644 --- a/src/test/java/teetime/variant/methodcall/examples/experiment01/ChwWorkPerformanceCheck.java +++ b/src/test/java/teetime/examples/experiment01/ChwWorkPerformanceCheck.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcall.examples.experiment01; +package teetime.examples.experiment01; import static org.junit.Assert.assertEquals; import util.PerformanceCheckProfile; diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java b/src/test/java/teetime/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java similarity index 92% rename from src/test/java/teetime/variant/methodcall/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java rename to src/test/java/teetime/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java index e40923d0..b6ded549 100644 --- a/src/test/java/teetime/variant/methodcall/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java +++ b/src/test/java/teetime/examples/experiment01/MethodCallThoughputTimestampAnalysis1Test.java @@ -13,14 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment01; +package teetime.examples.experiment01; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; +import teetime.examples.experiment16.ChwHomePerformanceCheck; +import teetime.examples.experiment16.ChwWorkPerformanceCheck; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; +import teetime.util.TimestampObject; import util.PerformanceCheckProfile; import util.PerformanceCheckProfileRepository; import util.PerformanceTest; diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment01/MethodCallThroughputAnalysis1.java b/src/test/java/teetime/examples/experiment01/MethodCallThroughputAnalysis1.java similarity index 51% rename from src/test/java/teetime/variant/methodcall/examples/experiment01/MethodCallThroughputAnalysis1.java rename to src/test/java/teetime/examples/experiment01/MethodCallThroughputAnalysis1.java index aac7fca2..f84be673 100644 --- a/src/test/java/teetime/variant/methodcall/examples/experiment01/MethodCallThroughputAnalysis1.java +++ b/src/test/java/teetime/examples/experiment01/MethodCallThroughputAnalysis1.java @@ -13,25 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment01; +package teetime.examples.experiment01; import java.util.List; +import teetime.framework.OldAnalysis; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcall.stage.CollectorSink; -import teetime.variant.methodcall.stage.NoopFilter; -import teetime.variant.methodcall.stage.ObjectProducer; -import teetime.variant.methodcall.stage.StartTimestampFilter; -import teetime.variant.methodcall.stage.StopTimestampFilter; +import teetime.util.TimestampObject; /** * @author Christian Wulf - * + * * @since 1.10 */ -public class MethodCallThroughputAnalysis1 extends Analysis { +public class MethodCallThroughputAnalysis1 extends OldAnalysis { private long numInputObjects; private ConstructorClosure<TimestampObject> inputObjectCreator; @@ -42,45 +37,45 @@ public class MethodCallThroughputAnalysis1 extends Analysis { @Override public void init() { super.init(); - this.runnable = this.buildPipeline(); + // this.runnable = this.buildPipeline(); } /** * @param numNoopFilters * @since 1.10 */ - private Runnable buildPipeline() { - @SuppressWarnings("unchecked") - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // create stages - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - - final Runnable runnable = new Runnable() { - @Override - public void run() { - while (true) { - TimestampObject object = objectProducer.execute(null); - if (object == null) { - return; - } - - object = startTimestampFilter.execute(object); - for (final NoopFilter<TimestampObject> noopFilter : noopFilters) { - object = noopFilter.execute(object); - } - object = stopTimestampFilter.execute(object); - collectorSink.execute(object); - } - } - }; - return runnable; - } + // private Runnable buildPipeline() { + // @SuppressWarnings("unchecked") + // final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; + // // create stages + // final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); + // final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); + // for (int i = 0; i < noopFilters.length; i++) { + // noopFilters[i] = new NoopFilter<TimestampObject>(); + // } + // final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); + // final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); + // + // final Runnable runnable = new Runnable() { + // @Override + // public void run() { + // while (true) { + // TimestampObject object = objectProducer.execute(null); + // if (object == null) { + // return; + // } + // + // object = startTimestampFilter.execute(object); + // for (final NoopFilter<TimestampObject> noopFilter : noopFilters) { + // object = noopFilter.execute(object); + // } + // object = stopTimestampFilter.execute(object); + // collectorSink.execute(object); + // } + // } + // }; + // return runnable; + // } @Override public void start() { diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment09/MethodCallThoughputTimestampAnalysis9Test.java b/src/test/java/teetime/examples/experiment09/MethodCallThoughputTimestampAnalysis9Test.java similarity index 91% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment09/MethodCallThoughputTimestampAnalysis9Test.java rename to src/test/java/teetime/examples/experiment09/MethodCallThoughputTimestampAnalysis9Test.java index b6f0f532..bd5d52fa 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment09/MethodCallThoughputTimestampAnalysis9Test.java +++ b/src/test/java/teetime/examples/experiment09/MethodCallThoughputTimestampAnalysis9Test.java @@ -13,17 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment09; +package teetime.examples.experiment09; import org.junit.Test; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; +import teetime.util.TimestampObject; import util.PerformanceTest; /** * @author Christian Wulf - * + * * @since 1.10 */ public class MethodCallThoughputTimestampAnalysis9Test extends PerformanceTest { diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment09/MethodCallThroughputAnalysis9.java b/src/test/java/teetime/examples/experiment09/MethodCallThroughputAnalysis9.java similarity index 79% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment09/MethodCallThroughputAnalysis9.java rename to src/test/java/teetime/examples/experiment09/MethodCallThroughputAnalysis9.java index 117954b8..5ffed1c1 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment09/MethodCallThroughputAnalysis9.java +++ b/src/test/java/teetime/examples/experiment09/MethodCallThroughputAnalysis9.java @@ -13,29 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment09; +package teetime.examples.experiment09; import java.util.List; +import teetime.framework.HeadPipeline; +import teetime.framework.HeadStage; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.framework.pipe.CommittablePipe; +import teetime.stage.CollectorSink; +import teetime.stage.NoopFilter; +import teetime.stage.ObjectProducer; +import teetime.stage.StartTimestampFilter; +import teetime.stage.StopTimestampFilter; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.HeadStage; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.CommittablePipe; -import teetime.variant.methodcallWithPorts.stage.CollectorSink; -import teetime.variant.methodcallWithPorts.stage.NoopFilter; -import teetime.variant.methodcallWithPorts.stage.ObjectProducer; -import teetime.variant.methodcallWithPorts.stage.StartTimestampFilter; -import teetime.variant.methodcallWithPorts.stage.StopTimestampFilter; +import teetime.util.TimestampObject; /** * @author Christian Wulf * * @since 1.10 */ -public class MethodCallThroughputAnalysis9 extends Analysis { +public class MethodCallThroughputAnalysis9 extends OldAnalysis { private int numInputObjects; private ConstructorClosure<TimestampObject> inputObjectCreator; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment10/MethodCallThoughputTimestampAnalysis10Test.java b/src/test/java/teetime/examples/experiment10/MethodCallThoughputTimestampAnalysis10Test.java similarity index 92% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment10/MethodCallThoughputTimestampAnalysis10Test.java rename to src/test/java/teetime/examples/experiment10/MethodCallThoughputTimestampAnalysis10Test.java index 14858bc3..d8b87203 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment10/MethodCallThoughputTimestampAnalysis10Test.java +++ b/src/test/java/teetime/examples/experiment10/MethodCallThoughputTimestampAnalysis10Test.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment10; +package teetime.examples.experiment10; import org.junit.Test; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; +import teetime.util.TimestampObject; import util.PerformanceTest; /** diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment10/MethodCallThroughputAnalysis10.java b/src/test/java/teetime/examples/experiment10/MethodCallThroughputAnalysis10.java similarity index 80% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment10/MethodCallThroughputAnalysis10.java rename to src/test/java/teetime/examples/experiment10/MethodCallThroughputAnalysis10.java index 3267dc93..4cc544f9 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment10/MethodCallThroughputAnalysis10.java +++ b/src/test/java/teetime/examples/experiment10/MethodCallThroughputAnalysis10.java @@ -13,28 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment10; +package teetime.examples.experiment10; import java.util.List; +import teetime.framework.HeadPipeline; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.framework.pipe.SingleElementPipe; +import teetime.stage.CollectorSink; +import teetime.stage.NoopFilter; +import teetime.stage.ObjectProducer; +import teetime.stage.StartTimestampFilter; +import teetime.stage.StopTimestampFilter; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SingleElementPipe; -import teetime.variant.methodcallWithPorts.stage.CollectorSink; -import teetime.variant.methodcallWithPorts.stage.NoopFilter; -import teetime.variant.methodcallWithPorts.stage.ObjectProducer; -import teetime.variant.methodcallWithPorts.stage.StartTimestampFilter; -import teetime.variant.methodcallWithPorts.stage.StopTimestampFilter; +import teetime.util.TimestampObject; /** * @author Christian Wulf * * @since 1.10 */ -public class MethodCallThroughputAnalysis10 extends Analysis { +public class MethodCallThroughputAnalysis10 extends OldAnalysis { private long numInputObjects; private ConstructorClosure<TimestampObject> inputObjectCreator; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java b/src/test/java/teetime/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java similarity index 92% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java rename to src/test/java/teetime/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java index 1b225360..a6149b9a 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java +++ b/src/test/java/teetime/examples/experiment11/MethodCallThoughputTimestampAnalysis11Test.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment11; +package teetime.examples.experiment11; import org.junit.Test; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; +import teetime.util.TimestampObject; import util.PerformanceTest; /** diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment11/MethodCallThroughputAnalysis11.java b/src/test/java/teetime/examples/experiment11/MethodCallThroughputAnalysis11.java similarity index 81% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment11/MethodCallThroughputAnalysis11.java rename to src/test/java/teetime/examples/experiment11/MethodCallThroughputAnalysis11.java index f7cba876..76dc925e 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment11/MethodCallThroughputAnalysis11.java +++ b/src/test/java/teetime/examples/experiment11/MethodCallThroughputAnalysis11.java @@ -13,29 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment11; +package teetime.examples.experiment11; import java.util.List; +import teetime.framework.HeadPipeline; +import teetime.framework.HeadStage; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.framework.pipe.UnorderedGrowablePipe; +import teetime.stage.CollectorSink; +import teetime.stage.NoopFilter; +import teetime.stage.ObjectProducer; +import teetime.stage.StartTimestampFilter; +import teetime.stage.StopTimestampFilter; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.HeadStage; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.UnorderedGrowablePipe; -import teetime.variant.methodcallWithPorts.stage.CollectorSink; -import teetime.variant.methodcallWithPorts.stage.NoopFilter; -import teetime.variant.methodcallWithPorts.stage.ObjectProducer; -import teetime.variant.methodcallWithPorts.stage.StartTimestampFilter; -import teetime.variant.methodcallWithPorts.stage.StopTimestampFilter; +import teetime.util.TimestampObject; /** * @author Christian Wulf * * @since 1.10 */ -public class MethodCallThroughputAnalysis11 extends Analysis { +public class MethodCallThroughputAnalysis11 extends OldAnalysis { private long numInputObjects; private ConstructorClosure<TimestampObject> inputObjectCreator; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment14/MethodCallThoughputTimestampAnalysis14Test.java b/src/test/java/teetime/examples/experiment14/MethodCallThoughputTimestampAnalysis14Test.java similarity index 92% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment14/MethodCallThoughputTimestampAnalysis14Test.java rename to src/test/java/teetime/examples/experiment14/MethodCallThoughputTimestampAnalysis14Test.java index e32ecf51..1f87c070 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment14/MethodCallThoughputTimestampAnalysis14Test.java +++ b/src/test/java/teetime/examples/experiment14/MethodCallThoughputTimestampAnalysis14Test.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment14; +package teetime.examples.experiment14; import org.junit.Test; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; +import teetime.util.TimestampObject; import util.PerformanceTest; /** diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment14/MethodCallThroughputAnalysis14.java b/src/test/java/teetime/examples/experiment14/MethodCallThroughputAnalysis14.java similarity index 78% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment14/MethodCallThroughputAnalysis14.java rename to src/test/java/teetime/examples/experiment14/MethodCallThroughputAnalysis14.java index 04a3c5b4..f2bfdf35 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment14/MethodCallThroughputAnalysis14.java +++ b/src/test/java/teetime/examples/experiment14/MethodCallThroughputAnalysis14.java @@ -13,31 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment14; +package teetime.examples.experiment14; import java.util.List; +import teetime.framework.HeadPipeline; +import teetime.framework.HeadStage; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.framework.pipe.IPipe; +import teetime.framework.pipe.PipeFactory; +import teetime.framework.pipe.PipeFactory.ThreadCommunication; +import teetime.stage.CollectorSink; +import teetime.stage.NoopFilter; +import teetime.stage.ObjectProducer; +import teetime.stage.StartTimestampFilter; +import teetime.stage.StopTimestampFilter; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.HeadStage; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.IPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.ThreadCommunication; -import teetime.variant.methodcallWithPorts.stage.CollectorSink; -import teetime.variant.methodcallWithPorts.stage.NoopFilter; -import teetime.variant.methodcallWithPorts.stage.ObjectProducer; -import teetime.variant.methodcallWithPorts.stage.StartTimestampFilter; -import teetime.variant.methodcallWithPorts.stage.StopTimestampFilter; +import teetime.util.TimestampObject; /** * @author Christian Wulf * * @since 1.10 */ -public class MethodCallThroughputAnalysis14 extends Analysis { +public class MethodCallThroughputAnalysis14 extends OldAnalysis { private long numInputObjects; private ConstructorClosure<TimestampObject> inputObjectCreator; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java b/src/test/java/teetime/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java similarity index 92% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java rename to src/test/java/teetime/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java index bf350f0c..91faf509 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java +++ b/src/test/java/teetime/examples/experiment15/MethodCallThoughputTimestampAnalysis15Test.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment15; +package teetime.examples.experiment15; import org.junit.Test; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; +import teetime.util.TimestampObject; import util.PerformanceTest; /** diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment15/MethodCallThroughputAnalysis15.java b/src/test/java/teetime/examples/experiment15/MethodCallThroughputAnalysis15.java similarity index 78% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment15/MethodCallThroughputAnalysis15.java rename to src/test/java/teetime/examples/experiment15/MethodCallThroughputAnalysis15.java index ba2ade3a..acadf1ed 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment15/MethodCallThroughputAnalysis15.java +++ b/src/test/java/teetime/examples/experiment15/MethodCallThroughputAnalysis15.java @@ -13,34 +13,34 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment15; +package teetime.examples.experiment15; import java.util.List; +import teetime.framework.HeadPipeline; +import teetime.framework.HeadStage; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.framework.pipe.OrderedGrowableArrayPipe; +import teetime.framework.pipe.SingleElementPipe; +import teetime.framework.pipe.SpScPipe; +import teetime.stage.Clock; +import teetime.stage.CollectorSink; +import teetime.stage.NoopFilter; +import teetime.stage.ObjectProducer; +import teetime.stage.StartTimestampFilter; +import teetime.stage.StopTimestampFilter; +import teetime.stage.basic.Delay; +import teetime.stage.basic.Sink; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.HeadStage; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.OrderedGrowableArrayPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SingleElementPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe; -import teetime.variant.methodcallWithPorts.stage.Clock; -import teetime.variant.methodcallWithPorts.stage.CollectorSink; -import teetime.variant.methodcallWithPorts.stage.NoopFilter; -import teetime.variant.methodcallWithPorts.stage.ObjectProducer; -import teetime.variant.methodcallWithPorts.stage.StartTimestampFilter; -import teetime.variant.methodcallWithPorts.stage.StopTimestampFilter; -import teetime.variant.methodcallWithPorts.stage.basic.Delay; -import teetime.variant.methodcallWithPorts.stage.basic.Sink; +import teetime.util.TimestampObject; /** * @author Christian Wulf * * @since 1.10 */ -public class MethodCallThroughputAnalysis15 extends Analysis { +public class MethodCallThroughputAnalysis15 extends OldAnalysis { // FIXME this analysis sometimes runs infinitely private static final int SPSC_INITIAL_CAPACITY = 4; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/ChwHomePerformanceCheck.java b/src/test/java/teetime/examples/experiment16/ChwHomePerformanceCheck.java similarity index 95% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/ChwHomePerformanceCheck.java rename to src/test/java/teetime/examples/experiment16/ChwHomePerformanceCheck.java index 8e3fe93b..5aaaeb73 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/ChwHomePerformanceCheck.java +++ b/src/test/java/teetime/examples/experiment16/ChwHomePerformanceCheck.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.examples.experiment16; +package teetime.examples.experiment16; import static org.junit.Assert.assertEquals; import util.PerformanceCheckProfile; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/ChwWorkPerformanceCheck.java b/src/test/java/teetime/examples/experiment16/ChwWorkPerformanceCheck.java similarity index 95% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/ChwWorkPerformanceCheck.java rename to src/test/java/teetime/examples/experiment16/ChwWorkPerformanceCheck.java index c60b6262..d0613861 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/ChwWorkPerformanceCheck.java +++ b/src/test/java/teetime/examples/experiment16/ChwWorkPerformanceCheck.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.examples.experiment16; +package teetime.examples.experiment16; import static org.junit.Assert.assertEquals; import util.PerformanceCheckProfile; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java b/src/test/java/teetime/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java similarity index 95% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java rename to src/test/java/teetime/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java index 46147ec3..86bb46fb 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java +++ b/src/test/java/teetime/examples/experiment16/MethodCallThoughputTimestampAnalysis16Test.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment16; +package teetime.examples.experiment16; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -23,7 +23,7 @@ import org.junit.runners.MethodSorters; import teetime.util.ConstructorClosure; import teetime.util.ListUtil; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; +import teetime.util.TimestampObject; import util.PerformanceCheckProfile; import util.PerformanceCheckProfileRepository; import util.PerformanceTest; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/MethodCallThroughputAnalysis16.java b/src/test/java/teetime/examples/experiment16/MethodCallThroughputAnalysis16.java similarity index 85% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/MethodCallThroughputAnalysis16.java rename to src/test/java/teetime/examples/experiment16/MethodCallThroughputAnalysis16.java index 1230451f..426d108c 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment16/MethodCallThroughputAnalysis16.java +++ b/src/test/java/teetime/examples/experiment16/MethodCallThroughputAnalysis16.java @@ -13,33 +13,33 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment16; +package teetime.examples.experiment16; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; +import teetime.framework.HeadPipeline; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.framework.pipe.SingleElementPipe; +import teetime.framework.pipe.SpScPipe; +import teetime.stage.CollectorSink; +import teetime.stage.NoopFilter; +import teetime.stage.ObjectProducer; +import teetime.stage.Relay; +import teetime.stage.StartTimestampFilter; +import teetime.stage.StopTimestampFilter; +import teetime.stage.basic.distributor.Distributor; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SingleElementPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe; -import teetime.variant.methodcallWithPorts.stage.CollectorSink; -import teetime.variant.methodcallWithPorts.stage.NoopFilter; -import teetime.variant.methodcallWithPorts.stage.ObjectProducer; -import teetime.variant.methodcallWithPorts.stage.Relay; -import teetime.variant.methodcallWithPorts.stage.StartTimestampFilter; -import teetime.variant.methodcallWithPorts.stage.StopTimestampFilter; -import teetime.variant.methodcallWithPorts.stage.basic.distributor.Distributor; +import teetime.util.TimestampObject; /** * @author Christian Wulf * * @since 1.10 */ -public class MethodCallThroughputAnalysis16 extends Analysis { +public class MethodCallThroughputAnalysis16 extends OldAnalysis { private static final int SPSC_INITIAL_CAPACITY = 100100; private static final int NUM_WORKER_THREADS = Runtime.getRuntime().availableProcessors(); diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment17/MethodCallThoughputTimestampAnalysis17Test.java b/src/test/java/teetime/examples/experiment17/MethodCallThoughputTimestampAnalysis17Test.java similarity index 92% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment17/MethodCallThoughputTimestampAnalysis17Test.java rename to src/test/java/teetime/examples/experiment17/MethodCallThoughputTimestampAnalysis17Test.java index 804a930d..69137f74 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment17/MethodCallThoughputTimestampAnalysis17Test.java +++ b/src/test/java/teetime/examples/experiment17/MethodCallThoughputTimestampAnalysis17Test.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment17; +package teetime.examples.experiment17; import org.junit.Test; import teetime.util.ConstructorClosure; import teetime.util.ListUtil; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; +import teetime.util.TimestampObject; import util.PerformanceTest; /** diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment17/MethodCallThroughputAnalysis17.java b/src/test/java/teetime/examples/experiment17/MethodCallThroughputAnalysis17.java similarity index 82% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment17/MethodCallThroughputAnalysis17.java rename to src/test/java/teetime/examples/experiment17/MethodCallThroughputAnalysis17.java index df4fd029..c1954504 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment17/MethodCallThroughputAnalysis17.java +++ b/src/test/java/teetime/examples/experiment17/MethodCallThroughputAnalysis17.java @@ -13,39 +13,39 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment17; +package teetime.examples.experiment17; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; +import teetime.framework.HeadPipeline; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.framework.StageWithPort; +import teetime.framework.pipe.DummyPipe; +import teetime.framework.pipe.IPipe; +import teetime.framework.pipe.PipeFactory; +import teetime.framework.pipe.RelayTestPipe; +import teetime.framework.pipe.UnorderedGrowablePipe; +import teetime.framework.signal.TerminatingSignal; +import teetime.stage.CollectorSink; +import teetime.stage.NoopFilter; +import teetime.stage.ObjectProducer; +import teetime.stage.Relay; +import teetime.stage.StartTimestampFilter; +import teetime.stage.StopTimestampFilter; +import teetime.stage.basic.Sink; +import teetime.stage.basic.distributor.Distributor; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.StageWithPort; -import teetime.variant.methodcallWithPorts.framework.core.pipe.DummyPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.IPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory; -import teetime.variant.methodcallWithPorts.framework.core.pipe.RelayTestPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.UnorderedGrowablePipe; -import teetime.variant.methodcallWithPorts.framework.core.signal.TerminatingSignal; -import teetime.variant.methodcallWithPorts.stage.CollectorSink; -import teetime.variant.methodcallWithPorts.stage.NoopFilter; -import teetime.variant.methodcallWithPorts.stage.ObjectProducer; -import teetime.variant.methodcallWithPorts.stage.Relay; -import teetime.variant.methodcallWithPorts.stage.StartTimestampFilter; -import teetime.variant.methodcallWithPorts.stage.StopTimestampFilter; -import teetime.variant.methodcallWithPorts.stage.basic.Sink; -import teetime.variant.methodcallWithPorts.stage.basic.distributor.Distributor; +import teetime.util.TimestampObject; /** * @author Christian Wulf * * @since 1.10 */ -public class MethodCallThroughputAnalysis17 extends Analysis { +public class MethodCallThroughputAnalysis17 extends OldAnalysis { private static final int SPSC_INITIAL_CAPACITY = 100100; private static final int NUM_WORKER_THREADS = Runtime.getRuntime().availableProcessors(); diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment18/MethodCallThroughputAnalysis18.java b/src/test/java/teetime/examples/experiment18/MethodCallThroughputAnalysis18.java similarity index 84% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment18/MethodCallThroughputAnalysis18.java rename to src/test/java/teetime/examples/experiment18/MethodCallThroughputAnalysis18.java index 6a264973..e36abb3b 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment18/MethodCallThroughputAnalysis18.java +++ b/src/test/java/teetime/examples/experiment18/MethodCallThroughputAnalysis18.java @@ -13,33 +13,33 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment18; +package teetime.examples.experiment18; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; +import teetime.framework.HeadPipeline; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.framework.pipe.SpScPipe; +import teetime.framework.pipe.UnorderedGrowablePipe; +import teetime.stage.CollectorSink; +import teetime.stage.NoopFilter; +import teetime.stage.ObjectProducer; +import teetime.stage.Relay; +import teetime.stage.StartTimestampFilter; +import teetime.stage.StopTimestampFilter; +import teetime.stage.basic.distributor.Distributor; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.UnorderedGrowablePipe; -import teetime.variant.methodcallWithPorts.stage.CollectorSink; -import teetime.variant.methodcallWithPorts.stage.NoopFilter; -import teetime.variant.methodcallWithPorts.stage.ObjectProducer; -import teetime.variant.methodcallWithPorts.stage.Relay; -import teetime.variant.methodcallWithPorts.stage.StartTimestampFilter; -import teetime.variant.methodcallWithPorts.stage.StopTimestampFilter; -import teetime.variant.methodcallWithPorts.stage.basic.distributor.Distributor; +import teetime.util.TimestampObject; /** * @author Christian Wulf * * @since 1.10 */ -public class MethodCallThroughputAnalysis18 extends Analysis { +public class MethodCallThroughputAnalysis18 extends OldAnalysis { private static final int SPSC_INITIAL_CAPACITY = 4; private static final int NUM_WORKER_THREADS = Runtime.getRuntime().availableProcessors(); diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java b/src/test/java/teetime/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java similarity index 95% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java rename to src/test/java/teetime/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java index 03951f82..50e2ac91 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java +++ b/src/test/java/teetime/examples/experiment19/MethodCallThoughputTimestampAnalysis19Test.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment19; +package teetime.examples.experiment19; import org.junit.FixMethodOrder; import org.junit.Test; @@ -21,7 +21,7 @@ import org.junit.runners.MethodSorters; import teetime.util.ConstructorClosure; import teetime.util.ListUtil; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; +import teetime.util.TimestampObject; import util.PerformanceTest; /** diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment19/MethodCallThroughputAnalysis19.java b/src/test/java/teetime/examples/experiment19/MethodCallThroughputAnalysis19.java similarity index 84% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/experiment19/MethodCallThroughputAnalysis19.java rename to src/test/java/teetime/examples/experiment19/MethodCallThroughputAnalysis19.java index b7e01fe0..9f6f95c1 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/experiment19/MethodCallThroughputAnalysis19.java +++ b/src/test/java/teetime/examples/experiment19/MethodCallThroughputAnalysis19.java @@ -13,33 +13,33 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.experiment19; +package teetime.examples.experiment19; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; +import teetime.framework.HeadPipeline; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.framework.pipe.OrderedGrowableArrayPipe; +import teetime.framework.pipe.SpScPipe; +import teetime.stage.CollectorSink; +import teetime.stage.NoopFilter; +import teetime.stage.ObjectProducer; +import teetime.stage.Relay; +import teetime.stage.StartTimestampFilter; +import teetime.stage.StopTimestampFilter; +import teetime.stage.basic.distributor.Distributor; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.OrderedGrowableArrayPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe; -import teetime.variant.methodcallWithPorts.stage.CollectorSink; -import teetime.variant.methodcallWithPorts.stage.NoopFilter; -import teetime.variant.methodcallWithPorts.stage.ObjectProducer; -import teetime.variant.methodcallWithPorts.stage.Relay; -import teetime.variant.methodcallWithPorts.stage.StartTimestampFilter; -import teetime.variant.methodcallWithPorts.stage.StopTimestampFilter; -import teetime.variant.methodcallWithPorts.stage.basic.distributor.Distributor; +import teetime.util.TimestampObject; /** * @author Christian Wulf * * @since 1.10 */ -public class MethodCallThroughputAnalysis19 extends Analysis { +public class MethodCallThroughputAnalysis19 extends OldAnalysis { private static final int SPSC_INITIAL_CAPACITY = 100100; private static final int NUM_WORKER_THREADS = Runtime.getRuntime().availableProcessors(); diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/kiekerdays/TcpTraceLogging.java b/src/test/java/teetime/examples/kiekerdays/TcpTraceLogging.java similarity index 66% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/kiekerdays/TcpTraceLogging.java rename to src/test/java/teetime/examples/kiekerdays/TcpTraceLogging.java index 97d4d868..0f8fce8e 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/kiekerdays/TcpTraceLogging.java +++ b/src/test/java/teetime/examples/kiekerdays/TcpTraceLogging.java @@ -1,11 +1,11 @@ -package teetime.variant.methodcallWithPorts.examples.kiekerdays; +package teetime.examples.kiekerdays; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadStage; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.stage.io.TCPReader; +import teetime.framework.HeadStage; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.stage.io.TCPReader; -public class TcpTraceLogging extends Analysis { +public class TcpTraceLogging extends OldAnalysis { private Thread tcpThread; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/kiekerdays/TcpTraceLoggingExplorviz.java b/src/test/java/teetime/examples/kiekerdays/TcpTraceLoggingExplorviz.java similarity index 65% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/kiekerdays/TcpTraceLoggingExplorviz.java rename to src/test/java/teetime/examples/kiekerdays/TcpTraceLoggingExplorviz.java index d81ab05b..08975c93 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/kiekerdays/TcpTraceLoggingExplorviz.java +++ b/src/test/java/teetime/examples/kiekerdays/TcpTraceLoggingExplorviz.java @@ -1,16 +1,16 @@ -package teetime.variant.methodcallWithPorts.examples.kiekerdays; +package teetime.examples.kiekerdays; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.HeadStage; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SingleElementPipe; -import teetime.variant.methodcallWithPorts.stage.basic.Sink; -import teetime.variant.methodcallWithPorts.stage.explorviz.KiekerRecordTcpReader; +import teetime.framework.HeadPipeline; +import teetime.framework.HeadStage; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.framework.pipe.SingleElementPipe; +import teetime.stage.basic.Sink; +import teetime.stage.explorviz.KiekerRecordTcpReader; import kieker.common.record.IMonitoringRecord; -public class TcpTraceLoggingExplorviz extends Analysis { +public class TcpTraceLoggingExplorviz extends OldAnalysis { private Thread tcpThread; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/kiekerdays/TcpTraceReconstruction.java b/src/test/java/teetime/examples/kiekerdays/TcpTraceReconstruction.java similarity index 82% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/kiekerdays/TcpTraceReconstruction.java rename to src/test/java/teetime/examples/kiekerdays/TcpTraceReconstruction.java index 016514cf..e1fa8409 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/kiekerdays/TcpTraceReconstruction.java +++ b/src/test/java/teetime/examples/kiekerdays/TcpTraceReconstruction.java @@ -1,29 +1,29 @@ -package teetime.variant.methodcallWithPorts.examples.kiekerdays; +package teetime.examples.kiekerdays; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; +import teetime.framework.HeadPipeline; +import teetime.framework.HeadStage; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.framework.pipe.SingleElementPipe; +import teetime.framework.pipe.SpScPipe; +import teetime.stage.InstanceOfFilter; +import teetime.stage.Relay; +import teetime.stage.basic.Sink; +import teetime.stage.basic.distributor.Distributor; +import teetime.stage.io.TCPReader; +import teetime.stage.kieker.traceReconstruction.TraceReconstructionFilter; import teetime.util.concurrent.hashmap.ConcurrentHashMapWithDefault; import teetime.util.concurrent.hashmap.TraceBuffer; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.HeadStage; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SingleElementPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe; -import teetime.variant.methodcallWithPorts.stage.InstanceOfFilter; -import teetime.variant.methodcallWithPorts.stage.Relay; -import teetime.variant.methodcallWithPorts.stage.basic.Sink; -import teetime.variant.methodcallWithPorts.stage.basic.distributor.Distributor; -import teetime.variant.methodcallWithPorts.stage.io.TCPReader; -import teetime.variant.methodcallWithPorts.stage.kieker.traceReconstruction.TraceReconstructionFilter; import kieker.analysis.plugin.filter.flow.TraceEventRecords; import kieker.common.record.IMonitoringRecord; import kieker.common.record.flow.IFlowRecord; -public class TcpTraceReconstruction extends Analysis { +public class TcpTraceReconstruction extends OldAnalysis { private static final int NUM_VIRTUAL_CORES = Runtime.getRuntime().availableProcessors(); private static final int MIO = 1000000; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/kiekerdays/TcpTraceReduction.java b/src/test/java/teetime/examples/kiekerdays/TcpTraceReduction.java similarity index 81% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/kiekerdays/TcpTraceReduction.java rename to src/test/java/teetime/examples/kiekerdays/TcpTraceReduction.java index 82f80ee6..6950e522 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/kiekerdays/TcpTraceReduction.java +++ b/src/test/java/teetime/examples/kiekerdays/TcpTraceReduction.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.examples.kiekerdays; +package teetime.examples.kiekerdays; import java.util.ArrayList; import java.util.LinkedList; @@ -6,30 +6,30 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; +import teetime.framework.HeadPipeline; +import teetime.framework.HeadStage; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.framework.pipe.SingleElementPipe; +import teetime.framework.pipe.SpScPipe; +import teetime.stage.Clock; +import teetime.stage.InstanceOfFilter; +import teetime.stage.Relay; +import teetime.stage.basic.Sink; +import teetime.stage.basic.distributor.Distributor; +import teetime.stage.io.TCPReader; +import teetime.stage.kieker.traceReconstruction.TraceReconstructionFilter; +import teetime.stage.kieker.traceReduction.TraceAggregationBuffer; +import teetime.stage.kieker.traceReduction.TraceComperator; +import teetime.stage.kieker.traceReduction.TraceReductionFilter; import teetime.util.concurrent.hashmap.ConcurrentHashMapWithDefault; import teetime.util.concurrent.hashmap.TraceBuffer; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.HeadStage; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SingleElementPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe; -import teetime.variant.methodcallWithPorts.stage.Clock; -import teetime.variant.methodcallWithPorts.stage.InstanceOfFilter; -import teetime.variant.methodcallWithPorts.stage.Relay; -import teetime.variant.methodcallWithPorts.stage.basic.Sink; -import teetime.variant.methodcallWithPorts.stage.basic.distributor.Distributor; -import teetime.variant.methodcallWithPorts.stage.io.TCPReader; -import teetime.variant.methodcallWithPorts.stage.kieker.traceReconstruction.TraceReconstructionFilter; -import teetime.variant.methodcallWithPorts.stage.kieker.traceReduction.TraceAggregationBuffer; -import teetime.variant.methodcallWithPorts.stage.kieker.traceReduction.TraceComperator; -import teetime.variant.methodcallWithPorts.stage.kieker.traceReduction.TraceReductionFilter; import kieker.analysis.plugin.filter.flow.TraceEventRecords; import kieker.common.record.IMonitoringRecord; import kieker.common.record.flow.IFlowRecord; -public class TcpTraceReduction extends Analysis { +public class TcpTraceReduction extends OldAnalysis { private static final int NUM_VIRTUAL_CORES = Runtime.getRuntime().availableProcessors(); private static final int MIO = 1000000; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/loopStage/Countdown.java b/src/test/java/teetime/examples/loopStage/Countdown.java similarity index 77% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/loopStage/Countdown.java rename to src/test/java/teetime/examples/loopStage/Countdown.java index cc7dbed6..f70e3eb6 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/loopStage/Countdown.java +++ b/src/test/java/teetime/examples/loopStage/Countdown.java @@ -1,8 +1,8 @@ -package teetime.variant.methodcallWithPorts.examples.loopStage; +package teetime.examples.loopStage; -import teetime.variant.methodcallWithPorts.framework.core.InputPort; -import teetime.variant.methodcallWithPorts.framework.core.OutputPort; -import teetime.variant.methodcallWithPorts.framework.core.ProducerStage; +import teetime.framework.InputPort; +import teetime.framework.OutputPort; +import teetime.framework.ProducerStage; public class Countdown extends ProducerStage<Void> { diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/loopStage/FiniteSignalPassingTest.java b/src/test/java/teetime/examples/loopStage/FiniteSignalPassingTest.java similarity index 82% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/loopStage/FiniteSignalPassingTest.java rename to src/test/java/teetime/examples/loopStage/FiniteSignalPassingTest.java index f972c021..ffcef1df 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/loopStage/FiniteSignalPassingTest.java +++ b/src/test/java/teetime/examples/loopStage/FiniteSignalPassingTest.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.examples.loopStage; +package teetime.examples.loopStage; import static org.junit.Assert.assertEquals; @@ -6,8 +6,8 @@ import java.util.Collection; import org.junit.Test; +import teetime.framework.Analysis; import teetime.util.Pair; -import teetime.variant.methodcallWithPorts.framework.core.Analysis; public class FiniteSignalPassingTest { diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/loopStage/LoopStageAnalysisConfiguration.java b/src/test/java/teetime/examples/loopStage/LoopStageAnalysisConfiguration.java similarity index 53% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/loopStage/LoopStageAnalysisConfiguration.java rename to src/test/java/teetime/examples/loopStage/LoopStageAnalysisConfiguration.java index 8fd8a5ad..6f577b41 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/loopStage/LoopStageAnalysisConfiguration.java +++ b/src/test/java/teetime/examples/loopStage/LoopStageAnalysisConfiguration.java @@ -1,8 +1,8 @@ -package teetime.variant.methodcallWithPorts.examples.loopStage; +package teetime.examples.loopStage; -import teetime.variant.methodcallWithPorts.framework.core.AnalysisConfiguration; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.ThreadCommunication; +import teetime.framework.AnalysisConfiguration; +import teetime.framework.pipe.PipeFactory; +import teetime.framework.pipe.PipeFactory.ThreadCommunication; public class LoopStageAnalysisConfiguration extends AnalysisConfiguration { diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/recordReader/RecordReaderAnalysisTest.java b/src/test/java/teetime/examples/recordReader/RecordReaderAnalysisTest.java similarity index 95% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/recordReader/RecordReaderAnalysisTest.java rename to src/test/java/teetime/examples/recordReader/RecordReaderAnalysisTest.java index 94776b9f..6a49e229 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/recordReader/RecordReaderAnalysisTest.java +++ b/src/test/java/teetime/examples/recordReader/RecordReaderAnalysisTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.recordReader; +package teetime.examples.recordReader; import static org.junit.Assert.assertEquals; @@ -23,8 +23,8 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; +import teetime.framework.Analysis; import teetime.util.StopWatch; -import teetime.variant.methodcallWithPorts.framework.core.Analysis; import kieker.common.record.IMonitoringRecord; import kieker.common.record.controlflow.OperationExecutionRecord; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/recordReader/RecordReaderConfiguration.java b/src/test/java/teetime/examples/recordReader/RecordReaderConfiguration.java similarity index 75% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/recordReader/RecordReaderConfiguration.java rename to src/test/java/teetime/examples/recordReader/RecordReaderConfiguration.java index 39a18b2e..cbcae8ca 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/recordReader/RecordReaderConfiguration.java +++ b/src/test/java/teetime/examples/recordReader/RecordReaderConfiguration.java @@ -13,21 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.recordReader; +package teetime.examples.recordReader; import java.io.File; import java.util.LinkedList; import java.util.List; -import teetime.variant.methodcallWithPorts.framework.core.AnalysisConfiguration; -import teetime.variant.methodcallWithPorts.framework.core.HeadStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.PipeOrdering; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.ThreadCommunication; -import teetime.variant.methodcallWithPorts.stage.CollectorSink; -import teetime.variant.methodcallWithPorts.stage.InitialElementProducer; -import teetime.variant.methodcallWithPorts.stage.kieker.Dir2RecordsFilter; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistryRepository; +import teetime.framework.AnalysisConfiguration; +import teetime.framework.HeadStage; +import teetime.framework.pipe.PipeFactory; +import teetime.framework.pipe.PipeFactory.PipeOrdering; +import teetime.framework.pipe.PipeFactory.ThreadCommunication; +import teetime.stage.CollectorSink; +import teetime.stage.InitialElementProducer; +import teetime.stage.kieker.Dir2RecordsFilter; +import teetime.stage.kieker.className.ClassNameRegistryRepository; import kieker.common.record.IMonitoringRecord; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReading/ChwHomeTcpTraceReadingTest.java b/src/test/java/teetime/examples/traceReading/ChwHomeTcpTraceReadingTest.java similarity index 97% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/traceReading/ChwHomeTcpTraceReadingTest.java rename to src/test/java/teetime/examples/traceReading/ChwHomeTcpTraceReadingTest.java index b0b1a7b4..04f8c1cb 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReading/ChwHomeTcpTraceReadingTest.java +++ b/src/test/java/teetime/examples/traceReading/ChwHomeTcpTraceReadingTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.traceReading; +package teetime.examples.traceReading; import static org.hamcrest.Matchers.both; import static org.hamcrest.Matchers.greaterThan; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReading/TcpTraceLoggingExtAnalysis.java b/src/test/java/teetime/examples/traceReading/TcpTraceLoggingExtAnalysis.java similarity index 75% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/traceReading/TcpTraceLoggingExtAnalysis.java rename to src/test/java/teetime/examples/traceReading/TcpTraceLoggingExtAnalysis.java index 580cc59f..134eb645 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReading/TcpTraceLoggingExtAnalysis.java +++ b/src/test/java/teetime/examples/traceReading/TcpTraceLoggingExtAnalysis.java @@ -1,22 +1,22 @@ -package teetime.variant.methodcallWithPorts.examples.traceReading; +package teetime.examples.traceReading; import java.util.List; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SingleElementPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe; -import teetime.variant.methodcallWithPorts.stage.Clock; -import teetime.variant.methodcallWithPorts.stage.Counter; -import teetime.variant.methodcallWithPorts.stage.ElementThroughputMeasuringStage; -import teetime.variant.methodcallWithPorts.stage.basic.Sink; -import teetime.variant.methodcallWithPorts.stage.basic.distributor.Distributor; -import teetime.variant.methodcallWithPorts.stage.io.TCPReader; +import teetime.framework.HeadPipeline; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.framework.pipe.SingleElementPipe; +import teetime.framework.pipe.SpScPipe; +import teetime.stage.Clock; +import teetime.stage.Counter; +import teetime.stage.ElementThroughputMeasuringStage; +import teetime.stage.basic.Sink; +import teetime.stage.basic.distributor.Distributor; +import teetime.stage.io.TCPReader; import kieker.common.record.IMonitoringRecord; -public class TcpTraceLoggingExtAnalysis extends Analysis { +public class TcpTraceLoggingExtAnalysis extends OldAnalysis { private Thread clockThread; private Thread tcpThread; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwHomeTcpTraceReconstructionAnalysisTest.java b/src/test/java/teetime/examples/traceReconstruction/ChwHomeTcpTraceReconstructionAnalysisTest.java similarity index 97% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwHomeTcpTraceReconstructionAnalysisTest.java rename to src/test/java/teetime/examples/traceReconstruction/ChwHomeTcpTraceReconstructionAnalysisTest.java index f78436fc..e5f30380 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwHomeTcpTraceReconstructionAnalysisTest.java +++ b/src/test/java/teetime/examples/traceReconstruction/ChwHomeTcpTraceReconstructionAnalysisTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.traceReconstruction; +package teetime.examples.traceReconstruction; import static org.hamcrest.Matchers.both; import static org.hamcrest.Matchers.greaterThan; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwHomeTraceReconstructionAnalysisTest.java b/src/test/java/teetime/examples/traceReconstruction/ChwHomeTraceReconstructionAnalysisTest.java similarity index 98% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwHomeTraceReconstructionAnalysisTest.java rename to src/test/java/teetime/examples/traceReconstruction/ChwHomeTraceReconstructionAnalysisTest.java index cd365a6d..149c134d 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwHomeTraceReconstructionAnalysisTest.java +++ b/src/test/java/teetime/examples/traceReconstruction/ChwHomeTraceReconstructionAnalysisTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.traceReconstruction; +package teetime.examples.traceReconstruction; import static org.hamcrest.Matchers.both; import static org.hamcrest.Matchers.greaterThan; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwWorkTcpTraceReconstructionAnalysisTest.java b/src/test/java/teetime/examples/traceReconstruction/ChwWorkTcpTraceReconstructionAnalysisTest.java similarity index 97% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwWorkTcpTraceReconstructionAnalysisTest.java rename to src/test/java/teetime/examples/traceReconstruction/ChwWorkTcpTraceReconstructionAnalysisTest.java index 48658d2f..8f99ad31 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwWorkTcpTraceReconstructionAnalysisTest.java +++ b/src/test/java/teetime/examples/traceReconstruction/ChwWorkTcpTraceReconstructionAnalysisTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.traceReconstruction; +package teetime.examples.traceReconstruction; import static org.junit.Assert.assertEquals; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwWorkTraceReconstructionAnalysisTest.java b/src/test/java/teetime/examples/traceReconstruction/ChwWorkTraceReconstructionAnalysisTest.java similarity index 98% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwWorkTraceReconstructionAnalysisTest.java rename to src/test/java/teetime/examples/traceReconstruction/ChwWorkTraceReconstructionAnalysisTest.java index 1d1b403a..3c0604ae 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/ChwWorkTraceReconstructionAnalysisTest.java +++ b/src/test/java/teetime/examples/traceReconstruction/ChwWorkTraceReconstructionAnalysisTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.traceReconstruction; +package teetime.examples.traceReconstruction; import static org.hamcrest.Matchers.both; import static org.hamcrest.Matchers.greaterThan; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/KiekerTraceReconstructionAnalysis.java b/src/test/java/teetime/examples/traceReconstruction/KiekerTraceReconstructionAnalysis.java similarity index 96% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/KiekerTraceReconstructionAnalysis.java rename to src/test/java/teetime/examples/traceReconstruction/KiekerTraceReconstructionAnalysis.java index 8bd6ea90..9e45c3b6 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/KiekerTraceReconstructionAnalysis.java +++ b/src/test/java/teetime/examples/traceReconstruction/KiekerTraceReconstructionAnalysis.java @@ -1,10 +1,10 @@ -package teetime.variant.methodcallWithPorts.examples.traceReconstruction; +package teetime.examples.traceReconstruction; import java.io.File; import java.util.LinkedList; import java.util.List; -import teetime.variant.explicitScheduling.framework.core.Analysis; +import teetime.framework.OldAnalysis; import kieker.analysis.AnalysisController; import kieker.analysis.IAnalysisController; @@ -25,7 +25,7 @@ import kieker.analysis.stage.TimeReader; import kieker.common.configuration.Configuration; import kieker.common.record.flow.IFlowRecord; -public class KiekerTraceReconstructionAnalysis extends Analysis { +public class KiekerTraceReconstructionAnalysis extends OldAnalysis { private final IAnalysisController analysisController = new AnalysisController(); diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/NieWorkKiekerTraceReconstructionAnalysisTest.java b/src/test/java/teetime/examples/traceReconstruction/NieWorkKiekerTraceReconstructionAnalysisTest.java similarity index 98% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/NieWorkKiekerTraceReconstructionAnalysisTest.java rename to src/test/java/teetime/examples/traceReconstruction/NieWorkKiekerTraceReconstructionAnalysisTest.java index dd4c3064..41a7926b 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/NieWorkKiekerTraceReconstructionAnalysisTest.java +++ b/src/test/java/teetime/examples/traceReconstruction/NieWorkKiekerTraceReconstructionAnalysisTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.traceReconstruction; +package teetime.examples.traceReconstruction; import static org.hamcrest.Matchers.both; import static org.hamcrest.Matchers.greaterThan; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/TcpTraceReconstructionAnalysis.java b/src/test/java/teetime/examples/traceReconstruction/TcpTraceReconstructionAnalysis.java similarity index 82% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/TcpTraceReconstructionAnalysis.java rename to src/test/java/teetime/examples/traceReconstruction/TcpTraceReconstructionAnalysis.java index 6ba339ac..e503a3d4 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/TcpTraceReconstructionAnalysis.java +++ b/src/test/java/teetime/examples/traceReconstruction/TcpTraceReconstructionAnalysis.java @@ -1,29 +1,29 @@ -package teetime.variant.methodcallWithPorts.examples.traceReconstruction; +package teetime.examples.traceReconstruction; import java.util.LinkedList; import java.util.List; +import teetime.framework.HeadPipeline; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.framework.pipe.SingleElementPipe; +import teetime.framework.pipe.SpScPipe; +import teetime.stage.Clock; +import teetime.stage.Counter; +import teetime.stage.ElementThroughputMeasuringStage; +import teetime.stage.InstanceOfFilter; +import teetime.stage.basic.Sink; +import teetime.stage.basic.distributor.Distributor; +import teetime.stage.io.TCPReader; +import teetime.stage.kieker.traceReconstruction.TraceReconstructionFilter; import teetime.util.concurrent.hashmap.ConcurrentHashMapWithDefault; import teetime.util.concurrent.hashmap.TraceBuffer; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SingleElementPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe; -import teetime.variant.methodcallWithPorts.stage.Clock; -import teetime.variant.methodcallWithPorts.stage.Counter; -import teetime.variant.methodcallWithPorts.stage.ElementThroughputMeasuringStage; -import teetime.variant.methodcallWithPorts.stage.InstanceOfFilter; -import teetime.variant.methodcallWithPorts.stage.basic.Sink; -import teetime.variant.methodcallWithPorts.stage.basic.distributor.Distributor; -import teetime.variant.methodcallWithPorts.stage.io.TCPReader; -import teetime.variant.methodcallWithPorts.stage.kieker.traceReconstruction.TraceReconstructionFilter; import kieker.analysis.plugin.filter.flow.TraceEventRecords; import kieker.common.record.IMonitoringRecord; import kieker.common.record.flow.IFlowRecord; -public class TcpTraceReconstructionAnalysis extends Analysis { +public class TcpTraceReconstructionAnalysis extends OldAnalysis { private static final int MIO = 1000000; private static final int TCP_RELAY_MAX_SIZE = 2 * MIO; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/TraceReconstructionAnalysis.java b/src/test/java/teetime/examples/traceReconstruction/TraceReconstructionAnalysis.java similarity index 76% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/TraceReconstructionAnalysis.java rename to src/test/java/teetime/examples/traceReconstruction/TraceReconstructionAnalysis.java index d51eec21..68708496 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstruction/TraceReconstructionAnalysis.java +++ b/src/test/java/teetime/examples/traceReconstruction/TraceReconstructionAnalysis.java @@ -1,36 +1,36 @@ -package teetime.variant.methodcallWithPorts.examples.traceReconstruction; +package teetime.examples.traceReconstruction; import java.io.File; import java.util.LinkedList; import java.util.List; +import teetime.framework.HeadPipeline; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.framework.pipe.SingleElementPipe; +import teetime.framework.pipe.SpScPipe; +import teetime.stage.Cache; +import teetime.stage.Clock; +import teetime.stage.CollectorSink; +import teetime.stage.Counter; +import teetime.stage.ElementThroughputMeasuringStage; +import teetime.stage.InitialElementProducer; +import teetime.stage.InstanceOfFilter; +import teetime.stage.basic.merger.Merger; +import teetime.stage.kieker.Dir2RecordsFilter; +import teetime.stage.kieker.className.ClassNameRegistryRepository; +import teetime.stage.kieker.traceReconstruction.TraceReconstructionFilter; +import teetime.stage.stringBuffer.StringBufferFilter; +import teetime.stage.stringBuffer.handler.IMonitoringRecordHandler; +import teetime.stage.stringBuffer.handler.StringHandler; import teetime.util.concurrent.hashmap.ConcurrentHashMapWithDefault; import teetime.util.concurrent.hashmap.TraceBuffer; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SingleElementPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe; -import teetime.variant.methodcallWithPorts.stage.Cache; -import teetime.variant.methodcallWithPorts.stage.Clock; -import teetime.variant.methodcallWithPorts.stage.CollectorSink; -import teetime.variant.methodcallWithPorts.stage.Counter; -import teetime.variant.methodcallWithPorts.stage.ElementThroughputMeasuringStage; -import teetime.variant.methodcallWithPorts.stage.InitialElementProducer; -import teetime.variant.methodcallWithPorts.stage.InstanceOfFilter; -import teetime.variant.methodcallWithPorts.stage.basic.merger.Merger; -import teetime.variant.methodcallWithPorts.stage.kieker.Dir2RecordsFilter; -import teetime.variant.methodcallWithPorts.stage.kieker.className.ClassNameRegistryRepository; -import teetime.variant.methodcallWithPorts.stage.kieker.traceReconstruction.TraceReconstructionFilter; -import teetime.variant.methodcallWithPorts.stage.stringBuffer.StringBufferFilter; -import teetime.variant.methodcallWithPorts.stage.stringBuffer.handler.IMonitoringRecordHandler; -import teetime.variant.methodcallWithPorts.stage.stringBuffer.handler.StringHandler; import kieker.analysis.plugin.filter.flow.TraceEventRecords; import kieker.common.record.IMonitoringRecord; import kieker.common.record.flow.IFlowRecord; -public class TraceReconstructionAnalysis extends Analysis { +public class TraceReconstructionAnalysis extends OldAnalysis { private final List<TraceEventRecords> elementCollection = new LinkedList<TraceEventRecords>(); diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/ChwHomeTcpTraceReconstructionAnalysisWithThreadsTest.java b/src/test/java/teetime/examples/traceReconstructionWithThreads/ChwHomeTcpTraceReconstructionAnalysisWithThreadsTest.java similarity index 96% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/ChwHomeTcpTraceReconstructionAnalysisWithThreadsTest.java rename to src/test/java/teetime/examples/traceReconstructionWithThreads/ChwHomeTcpTraceReconstructionAnalysisWithThreadsTest.java index ef0474b2..1b969f1c 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/ChwHomeTcpTraceReconstructionAnalysisWithThreadsTest.java +++ b/src/test/java/teetime/examples/traceReconstructionWithThreads/ChwHomeTcpTraceReconstructionAnalysisWithThreadsTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.traceReconstructionWithThreads; +package teetime.examples.traceReconstructionWithThreads; import static org.hamcrest.Matchers.both; import static org.hamcrest.Matchers.greaterThan; @@ -32,10 +32,10 @@ import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; +import teetime.framework.Analysis; +import teetime.framework.pipe.SpScPipe; import teetime.util.ListUtil; import teetime.util.StopWatch; -import teetime.variant.methodcallWithPorts.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe; import util.StatisticsUtil; /** diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest.java b/src/test/java/teetime/examples/traceReconstructionWithThreads/ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest.java similarity index 95% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest.java rename to src/test/java/teetime/examples/traceReconstructionWithThreads/ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest.java index 84a3cc49..8e849b55 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest.java +++ b/src/test/java/teetime/examples/traceReconstructionWithThreads/ChwWorkTcpTraceReconstructionAnalysisWithThreadsTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.traceReconstructionWithThreads; +package teetime.examples.traceReconstructionWithThreads; import static org.junit.Assert.assertEquals; @@ -27,10 +27,10 @@ import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; +import teetime.framework.Analysis; +import teetime.framework.pipe.SpScPipe; import teetime.util.ListUtil; import teetime.util.StopWatch; -import teetime.variant.methodcallWithPorts.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe; import util.StatisticsUtil; /** diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/TcpTraceReconstructionAnalysisWithThreadsConfiguration.java b/src/test/java/teetime/examples/traceReconstructionWithThreads/TcpTraceReconstructionAnalysisWithThreadsConfiguration.java similarity index 89% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/TcpTraceReconstructionAnalysisWithThreadsConfiguration.java rename to src/test/java/teetime/examples/traceReconstructionWithThreads/TcpTraceReconstructionAnalysisWithThreadsConfiguration.java index 06c17f05..fff9e149 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReconstructionWithThreads/TcpTraceReconstructionAnalysisWithThreadsConfiguration.java +++ b/src/test/java/teetime/examples/traceReconstructionWithThreads/TcpTraceReconstructionAnalysisWithThreadsConfiguration.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.examples.traceReconstructionWithThreads; +package teetime.examples.traceReconstructionWithThreads; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; @@ -6,24 +6,24 @@ import java.util.ArrayList; import java.util.LinkedList; import java.util.List; +import teetime.framework.AnalysisConfiguration; +import teetime.framework.HeadPipeline; +import teetime.framework.StageWithPort; +import teetime.framework.pipe.SingleElementPipe; +import teetime.framework.pipe.SpScPipe; +import teetime.stage.Clock; +import teetime.stage.Counter; +import teetime.stage.ElementDelayMeasuringStage; +import teetime.stage.ElementThroughputMeasuringStage; +import teetime.stage.InstanceCounter; +import teetime.stage.InstanceOfFilter; +import teetime.stage.Relay; +import teetime.stage.basic.Sink; +import teetime.stage.basic.distributor.Distributor; +import teetime.stage.io.TCPReader; +import teetime.stage.kieker.traceReconstruction.TraceReconstructionFilter; import teetime.util.concurrent.hashmap.ConcurrentHashMapWithDefault; import teetime.util.concurrent.hashmap.TraceBuffer; -import teetime.variant.methodcallWithPorts.framework.core.AnalysisConfiguration; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.StageWithPort; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SingleElementPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe; -import teetime.variant.methodcallWithPorts.stage.Clock; -import teetime.variant.methodcallWithPorts.stage.Counter; -import teetime.variant.methodcallWithPorts.stage.ElementDelayMeasuringStage; -import teetime.variant.methodcallWithPorts.stage.ElementThroughputMeasuringStage; -import teetime.variant.methodcallWithPorts.stage.InstanceCounter; -import teetime.variant.methodcallWithPorts.stage.InstanceOfFilter; -import teetime.variant.methodcallWithPorts.stage.Relay; -import teetime.variant.methodcallWithPorts.stage.basic.Sink; -import teetime.variant.methodcallWithPorts.stage.basic.distributor.Distributor; -import teetime.variant.methodcallWithPorts.stage.io.TCPReader; -import teetime.variant.methodcallWithPorts.stage.kieker.traceReconstruction.TraceReconstructionFilter; import kieker.analysis.plugin.filter.flow.TraceEventRecords; import kieker.common.record.IMonitoringRecord; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReductionWithThreads/ChwWorkTcpTraceReductionAnalysisWithThreadsTest.java b/src/test/java/teetime/examples/traceReductionWithThreads/ChwWorkTcpTraceReductionAnalysisWithThreadsTest.java similarity index 98% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/traceReductionWithThreads/ChwWorkTcpTraceReductionAnalysisWithThreadsTest.java rename to src/test/java/teetime/examples/traceReductionWithThreads/ChwWorkTcpTraceReductionAnalysisWithThreadsTest.java index 7db26144..340b4161 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReductionWithThreads/ChwWorkTcpTraceReductionAnalysisWithThreadsTest.java +++ b/src/test/java/teetime/examples/traceReductionWithThreads/ChwWorkTcpTraceReductionAnalysisWithThreadsTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package teetime.variant.methodcallWithPorts.examples.traceReductionWithThreads; +package teetime.examples.traceReductionWithThreads; import static org.junit.Assert.assertEquals; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReductionWithThreads/TcpTraceReductionAnalysisWithThreads.java b/src/test/java/teetime/examples/traceReductionWithThreads/TcpTraceReductionAnalysisWithThreads.java similarity index 86% rename from src/test/java/teetime/variant/methodcallWithPorts/examples/traceReductionWithThreads/TcpTraceReductionAnalysisWithThreads.java rename to src/test/java/teetime/examples/traceReductionWithThreads/TcpTraceReductionAnalysisWithThreads.java index 2a0f4b07..8879fc23 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/examples/traceReductionWithThreads/TcpTraceReductionAnalysisWithThreads.java +++ b/src/test/java/teetime/examples/traceReductionWithThreads/TcpTraceReductionAnalysisWithThreads.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.examples.traceReductionWithThreads; +package teetime.examples.traceReductionWithThreads; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; @@ -8,35 +8,35 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; +import teetime.framework.HeadPipeline; +import teetime.framework.OldAnalysis; +import teetime.framework.RunnableStage; +import teetime.framework.StageWithPort; +import teetime.framework.pipe.SingleElementPipe; +import teetime.framework.pipe.SpScPipe; +import teetime.stage.Clock; +import teetime.stage.Counter; +import teetime.stage.ElementDelayMeasuringStage; +import teetime.stage.ElementThroughputMeasuringStage; +import teetime.stage.InstanceCounter; +import teetime.stage.InstanceOfFilter; +import teetime.stage.Relay; +import teetime.stage.basic.Sink; +import teetime.stage.basic.distributor.Distributor; +import teetime.stage.io.TCPReader; +import teetime.stage.kieker.traceReconstruction.TraceReconstructionFilter; +import teetime.stage.kieker.traceReduction.TraceAggregationBuffer; +import teetime.stage.kieker.traceReduction.TraceComperator; +import teetime.stage.kieker.traceReduction.TraceReductionFilter; import teetime.util.concurrent.hashmap.ConcurrentHashMapWithDefault; import teetime.util.concurrent.hashmap.TraceBuffer; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcallWithPorts.framework.core.HeadPipeline; -import teetime.variant.methodcallWithPorts.framework.core.RunnableStage; -import teetime.variant.methodcallWithPorts.framework.core.StageWithPort; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SingleElementPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.SpScPipe; -import teetime.variant.methodcallWithPorts.stage.Clock; -import teetime.variant.methodcallWithPorts.stage.Counter; -import teetime.variant.methodcallWithPorts.stage.ElementDelayMeasuringStage; -import teetime.variant.methodcallWithPorts.stage.ElementThroughputMeasuringStage; -import teetime.variant.methodcallWithPorts.stage.InstanceCounter; -import teetime.variant.methodcallWithPorts.stage.InstanceOfFilter; -import teetime.variant.methodcallWithPorts.stage.Relay; -import teetime.variant.methodcallWithPorts.stage.basic.Sink; -import teetime.variant.methodcallWithPorts.stage.basic.distributor.Distributor; -import teetime.variant.methodcallWithPorts.stage.io.TCPReader; -import teetime.variant.methodcallWithPorts.stage.kieker.traceReconstruction.TraceReconstructionFilter; -import teetime.variant.methodcallWithPorts.stage.kieker.traceReduction.TraceAggregationBuffer; -import teetime.variant.methodcallWithPorts.stage.kieker.traceReduction.TraceComperator; -import teetime.variant.methodcallWithPorts.stage.kieker.traceReduction.TraceReductionFilter; import kieker.analysis.plugin.filter.flow.TraceEventRecords; import kieker.common.record.IMonitoringRecord; import kieker.common.record.flow.IFlowRecord; import kieker.common.record.flow.trace.TraceMetadata; -public class TcpTraceReductionAnalysisWithThreads extends Analysis { +public class TcpTraceReductionAnalysisWithThreads extends OldAnalysis { private static final int NUM_VIRTUAL_CORES = Runtime.getRuntime().availableProcessors(); private static final int MIO = 1000000; diff --git a/src/test/java/teetime/variant/methodcallWithPorts/runtime/typeCheck/ConnectionTypeTest.java b/src/test/java/teetime/runtime/typeCheck/ConnectionTypeTest.java similarity index 82% rename from src/test/java/teetime/variant/methodcallWithPorts/runtime/typeCheck/ConnectionTypeTest.java rename to src/test/java/teetime/runtime/typeCheck/ConnectionTypeTest.java index f6472699..e30d4da4 100644 --- a/src/test/java/teetime/variant/methodcallWithPorts/runtime/typeCheck/ConnectionTypeTest.java +++ b/src/test/java/teetime/runtime/typeCheck/ConnectionTypeTest.java @@ -1,4 +1,4 @@ -package teetime.variant.methodcallWithPorts.runtime.typeCheck; +package teetime.runtime.typeCheck; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -8,16 +8,16 @@ import java.lang.reflect.InvocationTargetException; import org.junit.Test; +import teetime.framework.pipe.IPipe; +import teetime.framework.pipe.PipeFactory; +import teetime.framework.pipe.PipeFactory.ThreadCommunication; +import teetime.stage.ObjectProducer; +import teetime.stage.PortTypeConfiguration; +import teetime.stage.StartTimestampFilter; +import teetime.stage.StopTimestampFilter; +import teetime.stage.basic.Sink; import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.methodcallWithPorts.framework.core.pipe.IPipe; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory; -import teetime.variant.methodcallWithPorts.framework.core.pipe.PipeFactory.ThreadCommunication; -import teetime.variant.methodcallWithPorts.stage.ObjectProducer; -import teetime.variant.methodcallWithPorts.stage.PortTypeConfiguration; -import teetime.variant.methodcallWithPorts.stage.StartTimestampFilter; -import teetime.variant.methodcallWithPorts.stage.StopTimestampFilter; -import teetime.variant.methodcallWithPorts.stage.basic.Sink; +import teetime.util.TimestampObject; public class ConnectionTypeTest { @@ -28,7 +28,7 @@ public class ConnectionTypeTest { @SuppressWarnings({ "unchecked", "rawtypes" }) @Test public void testDynamicPortConnection() throws NoSuchMethodException, SecurityException, InstantiationException, IllegalAccessException, - IllegalArgumentException, InvocationTargetException, ClassNotFoundException { + IllegalArgumentException, InvocationTargetException, ClassNotFoundException { ConstructorClosure<TimestampObject> constructorClosure = new ConstructorClosure<TimestampObject>() { @Override public TimestampObject create() { diff --git a/src/test/java/teetime/variant/explicitScheduling/examples/recordReader/RecordReaderAnalysisTest.java b/src/test/java/teetime/variant/explicitScheduling/examples/recordReader/RecordReaderAnalysisTest.java deleted file mode 100644 index 0de57c68..00000000 --- a/src/test/java/teetime/variant/explicitScheduling/examples/recordReader/RecordReaderAnalysisTest.java +++ /dev/null @@ -1,128 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.examples.recordReader; - -import java.io.File; -import java.util.LinkedList; -import java.util.List; - -import kieker.analysis.AnalysisController; -import kieker.analysis.IAnalysisController; -import kieker.analysis.IProjectContext; -import kieker.analysis.plugin.annotation.InputPort; -import kieker.analysis.plugin.filter.AbstractFilterPlugin; -import kieker.analysis.plugin.filter.forward.CountingFilter; -import kieker.analysis.plugin.filter.forward.ListCollectionFilter; -import kieker.analysis.plugin.reader.filesystem.FSReader; -import kieker.common.configuration.Configuration; -import kieker.common.record.IMonitoringRecord; -import kieker.common.util.registry.Registry; - -import org.junit.Assert; -import org.junit.Test; - -import teetime.variant.explicitScheduling.examples.recordReader.RecordReaderAnalysis; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistry; -import teetime.variant.explicitScheduling.stage.kieker.className.ClassNameRegistryRepository; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class RecordReaderAnalysisTest { - - private final static File INPUT_DIRECTORY = new File("examples/userguide/ch5--trace-monitoring-aspectj/testdata/kieker-20100830-082225522-UTC"); - - @Test - public void testExampleWithNewFramework() { - final List<IMonitoringRecord> records = new LinkedList<IMonitoringRecord>(); - - final RecordReaderAnalysis recordReaderAnalysis = new RecordReaderAnalysis(); - recordReaderAnalysis.init(); - recordReaderAnalysis.setInputFile(RecordReaderAnalysisTest.INPUT_DIRECTORY); - recordReaderAnalysis.setOutputRecordList(records); - recordReaderAnalysis.start(); - - final ClassNameRegistryRepository classNameRegistryRepository = recordReaderAnalysis.getClassNameRegistryRepository(); - Assert.assertEquals(1, classNameRegistryRepository.size()); - - final ClassNameRegistry classNameRegistry = classNameRegistryRepository.get(RecordReaderAnalysisTest.INPUT_DIRECTORY); - Assert.assertNotNull(classNameRegistry); - - Assert.assertEquals(2, classNameRegistry.size()); - Assert.assertEquals("kieker.common.record.misc.KiekerMetadataRecord", classNameRegistry.get(0)); - Assert.assertEquals("kieker.common.record.controlflow.OperationExecutionRecord", classNameRegistry.get(1)); - Assert.assertEquals(6541, records.size()); - Assert.assertEquals(1283156546127117246l, records.get(0).getLoggingTimestamp()); - } - - @Test - public void testExampleWithKiekerFramework() throws Exception { - final IAnalysisController ac = new AnalysisController(); - - final Configuration readerConfiguration = new Configuration(); - readerConfiguration.setProperty(FSReader.CONFIG_PROPERTY_NAME_INPUTDIRS, INPUT_DIRECTORY.getAbsolutePath()); - final FSReader reader = new FSReader(readerConfiguration, ac); - - final ListCollectionFilter<IMonitoringRecord> records = new ListCollectionFilter<IMonitoringRecord>(new Configuration(), ac); - final ClassNameRegistryFilter classNameRegistry = new ClassNameRegistryFilter(new Configuration(), ac); - - final CountingFilter countingFilter = new CountingFilter(new Configuration(), ac); - - ac.connect(reader, FSReader.OUTPUT_PORT_NAME_RECORDS, countingFilter, CountingFilter.INPUT_PORT_NAME_EVENTS); - ac.connect(reader, FSReader.OUTPUT_PORT_NAME_RECORDS, records, ListCollectionFilter.INPUT_PORT_NAME); - ac.connect(reader, FSReader.OUTPUT_PORT_NAME_RECORDS, classNameRegistry, ClassNameRegistryFilter.INPUT_PORT_NAME_RECORDS); - - ac.run(); - - // Keep in mind that the metadata record is not processed in a regular way - Assert.assertEquals(1, classNameRegistry.size()); - Assert.assertEquals("kieker.common.record.controlflow.OperationExecutionRecord", classNameRegistry.get(0)); - Assert.assertEquals(6540, countingFilter.getMessageCount()); - Assert.assertEquals(1283156545581511026L, records.getList().get(0).getLoggingTimestamp()); - } - - private static class ClassNameRegistryFilter extends AbstractFilterPlugin { - - public static final String INPUT_PORT_NAME_RECORDS = "input"; - - private final Registry<String> registry = new Registry<String>(); - - public ClassNameRegistryFilter(final Configuration configuration, final IProjectContext projectContext) { - super(configuration, projectContext); - } - - @InputPort(name = ClassNameRegistryFilter.INPUT_PORT_NAME_RECORDS, eventTypes = IMonitoringRecord.class) - public void input(final IMonitoringRecord record) { - this.registry.get(record.getClass().getName()); - } - - public Object get(final int id) { - return this.registry.get(id); - } - - public Object size() { - return this.registry.getSize(); - } - - @Override - public Configuration getCurrentConfiguration() { - return new Configuration(); - } - - } -} diff --git a/src/test/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputAnalysisTest.java b/src/test/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputAnalysisTest.java deleted file mode 100644 index d4fb3f2d..00000000 --- a/src/test/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputAnalysisTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.examples.throughput; - -import java.util.concurrent.Callable; - -import org.junit.Test; - -import teetime.util.StopWatch; -import util.PerformanceTest; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class ThroughputAnalysisTest extends PerformanceTest { - - private static final int numRuns = 2; - - @Test - public void testWithMultipleRuns() { - final StopWatch stopWatch = new StopWatch(); - final long[] durations = new long[numRuns]; - - for (int i = 0; i < numRuns; i++) { - System.out.println("current run: " + i); - final ThroughputAnalysis<Object> analysis = new ThroughputAnalysis<Object>(); - analysis.setNumNoopFilters(800); - analysis.setInput(NUM_OBJECTS_TO_CREATE, new Callable<Object>() { - @Override - public Object call() throws Exception { - return new Object(); - } - }); - analysis.init(); - - stopWatch.start(); - try { - analysis.start(); - } finally { - stopWatch.end(); - } - - durations[i] = stopWatch.getDurationInNs(); - } - - // for (final long dur : durations) { - // System.out.println("Duration: " + (dur / 1000) + " µs"); - // } - - long sum = 0; - for (int i = durations.length / 2; i < durations.length; i++) { - sum += durations[i]; - } - - final long avgDur = sum / (numRuns / 2); - System.out.println("avg duration: " + (avgDur / 1000) + " µs"); - } - -} diff --git a/src/test/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputTimestampAnalysisTest.java b/src/test/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputTimestampAnalysisTest.java deleted file mode 100644 index d6a3a393..00000000 --- a/src/test/java/teetime/variant/explicitScheduling/examples/throughput/ThroughputTimestampAnalysisTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.explicitScheduling.examples.throughput; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.Callable; - -import org.junit.Test; - -import teetime.util.StopWatch; -import util.PerformanceTest; -import util.StatisticsUtil; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class ThroughputTimestampAnalysisTest extends PerformanceTest { - - @Test - public void testWithManyObjects() { - System.out.println("Testing teetime with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" - + NUM_NOOP_FILTERS + "..."); - final StopWatch stopWatch = new StopWatch(); - final List<TimestampObject> timestampObjects = new ArrayList<TimestampObject>(NUM_OBJECTS_TO_CREATE); - - final ThroughputTimestampAnalysis analysis = new ThroughputTimestampAnalysis(); - analysis.setShouldUseQueue(true); - analysis.setNumNoopFilters(NUM_NOOP_FILTERS); // 4+n - analysis.setTimestampObjects(timestampObjects); - analysis.setInput(NUM_OBJECTS_TO_CREATE, new Callable<TimestampObject>() { - @Override - public TimestampObject call() throws Exception { - return new TimestampObject(); - } - }); - analysis.init(); - - stopWatch.start(); - try { - analysis.start(); - } finally { - stopWatch.end(); - } - - StatisticsUtil.computeStatistics(stopWatch.getDurationInNs(), timestampObjects); - } - -} diff --git a/src/test/java/teetime/variant/methodcall/examples/ChwComparisonMethodcall.java b/src/test/java/teetime/variant/methodcall/examples/ChwComparisonMethodcall.java deleted file mode 100644 index 084b8f39..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/ChwComparisonMethodcall.java +++ /dev/null @@ -1,80 +0,0 @@ -package teetime.variant.methodcall.examples; - -import static org.junit.Assert.assertEquals; - -import java.util.Map; -import java.util.Map.Entry; - -import org.junit.AfterClass; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import teetime.variant.methodcall.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test; -import teetime.variant.methodcall.examples.experiment02.MethodCallThoughputTimestampAnalysis2Test; -import teetime.variant.methodcall.examples.experiment03.MethodCallThoughputTimestampAnalysis3Test; -import teetime.variant.methodcall.examples.experiment04.MethodCallThoughputTimestampAnalysis4Test; -import teetime.variant.methodcall.examples.experiment05.MethodCallThoughputTimestampAnalysis5Test; -import teetime.variant.methodcall.examples.experiment06.MethodCallThoughputTimestampAnalysis6Test; -import teetime.variant.methodcall.examples.experiment07.MethodCallThoughputTimestampAnalysis7Test; -import teetime.variant.methodcall.examples.experiment08.MethodCallThoughputTimestampAnalysis8Test; -import teetime.variant.methodcall.examples.experiment12.MethodCallThoughputTimestampAnalysis12Test; -import teetime.variant.methodcall.examples.experiment13.MethodCallThoughputTimestampAnalysis13Test; -import util.PerformanceResult; -import util.PerformanceTest; - -@RunWith(Suite.class) -@SuiteClasses({ - MethodCallThoughputTimestampAnalysis1Test.class, - MethodCallThoughputTimestampAnalysis2Test.class, - MethodCallThoughputTimestampAnalysis3Test.class, - MethodCallThoughputTimestampAnalysis4Test.class, - MethodCallThoughputTimestampAnalysis5Test.class, - MethodCallThoughputTimestampAnalysis6Test.class, - MethodCallThoughputTimestampAnalysis7Test.class, - MethodCallThoughputTimestampAnalysis8Test.class, - MethodCallThoughputTimestampAnalysis12Test.class, - MethodCallThoughputTimestampAnalysis13Test.class, -}) -public class ChwComparisonMethodcall { - - @AfterClass - public static void doYourOneTimeTeardown() { - Map<String, PerformanceResult> performanceResults = PerformanceTest.measurementRepository.performanceResults; - for (Entry<String, PerformanceResult> entry : performanceResults.entrySet()) { - System.out.println("---> " + entry.getKey() + "\n" + entry.getValue()); - } - - PerformanceResult test1 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); - PerformanceResult test4 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment04.MethodCallThoughputTimestampAnalysis4Test)"); - PerformanceResult test7 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment07.MethodCallThoughputTimestampAnalysis7Test)"); - PerformanceResult test3 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment03.MethodCallThoughputTimestampAnalysis3Test)"); - PerformanceResult test8 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment08.MethodCallThoughputTimestampAnalysis8Test)"); - PerformanceResult test12 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment12.MethodCallThoughputTimestampAnalysis12Test)"); - PerformanceResult test13 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment13.MethodCallThoughputTimestampAnalysis13Test)"); - PerformanceResult test5 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment05.MethodCallThoughputTimestampAnalysis5Test)"); - PerformanceResult test2 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment02.MethodCallThoughputTimestampAnalysis2Test)"); - PerformanceResult test6 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment06.MethodCallThoughputTimestampAnalysis6Test)"); - - assertEquals(1, (double) test4.quantiles.get(0.5) / test1.quantiles.get(0.5), 0.1); - assertEquals(2, (double) test7.quantiles.get(0.5) / test1.quantiles.get(0.5), 0.1); - assertEquals(3, (double) test3.quantiles.get(0.5) / test1.quantiles.get(0.5), 0.1); - assertEquals(3, (double) test8.quantiles.get(0.5) / test1.quantiles.get(0.5), 0.1); - assertEquals(7, (double) test12.quantiles.get(0.5) / test1.quantiles.get(0.5), 0.1); - assertEquals(7, (double) test13.quantiles.get(0.5) / test1.quantiles.get(0.5), 0.1); - assertEquals(9, (double) test5.quantiles.get(0.5) / test1.quantiles.get(0.5), 0.1); - assertEquals(17, (double) test2.quantiles.get(0.5) / test1.quantiles.get(0.5), 0.1); - assertEquals(59, (double) test6.quantiles.get(0.5) / test1.quantiles.get(0.5), 1.1); - } - -} diff --git a/src/test/java/teetime/variant/methodcall/examples/NieComparisonMethodcall.java b/src/test/java/teetime/variant/methodcall/examples/NieComparisonMethodcall.java deleted file mode 100644 index ba1ff285..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/NieComparisonMethodcall.java +++ /dev/null @@ -1,80 +0,0 @@ -package teetime.variant.methodcall.examples; - -import static org.junit.Assert.assertEquals; - -import java.util.Map; -import java.util.Map.Entry; - -import org.junit.AfterClass; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -import teetime.variant.methodcall.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test; -import teetime.variant.methodcall.examples.experiment02.MethodCallThoughputTimestampAnalysis2Test; -import teetime.variant.methodcall.examples.experiment03.MethodCallThoughputTimestampAnalysis3Test; -import teetime.variant.methodcall.examples.experiment04.MethodCallThoughputTimestampAnalysis4Test; -import teetime.variant.methodcall.examples.experiment05.MethodCallThoughputTimestampAnalysis5Test; -import teetime.variant.methodcall.examples.experiment06.MethodCallThoughputTimestampAnalysis6Test; -import teetime.variant.methodcall.examples.experiment07.MethodCallThoughputTimestampAnalysis7Test; -import teetime.variant.methodcall.examples.experiment08.MethodCallThoughputTimestampAnalysis8Test; -import teetime.variant.methodcall.examples.experiment12.MethodCallThoughputTimestampAnalysis12Test; -import teetime.variant.methodcall.examples.experiment13.MethodCallThoughputTimestampAnalysis13Test; -import util.PerformanceResult; -import util.PerformanceTest; - -@RunWith(Suite.class) -@SuiteClasses({ - MethodCallThoughputTimestampAnalysis1Test.class, - MethodCallThoughputTimestampAnalysis2Test.class, - MethodCallThoughputTimestampAnalysis3Test.class, - MethodCallThoughputTimestampAnalysis4Test.class, - MethodCallThoughputTimestampAnalysis5Test.class, - MethodCallThoughputTimestampAnalysis6Test.class, - MethodCallThoughputTimestampAnalysis7Test.class, - MethodCallThoughputTimestampAnalysis8Test.class, - MethodCallThoughputTimestampAnalysis12Test.class, - MethodCallThoughputTimestampAnalysis13Test.class, -}) -public class NieComparisonMethodcall { - - @AfterClass - public static void doYourOneTimeTeardown() { - Map<String, PerformanceResult> performanceResults = PerformanceTest.measurementRepository.performanceResults; - for (Entry<String, PerformanceResult> entry : performanceResults.entrySet()) { - System.out.println("---> " + entry.getKey() + "\n" + entry.getValue()); - } - - PerformanceResult test1 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment01.MethodCallThoughputTimestampAnalysis1Test)"); - PerformanceResult test4 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment04.MethodCallThoughputTimestampAnalysis4Test)"); - PerformanceResult test7 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment07.MethodCallThoughputTimestampAnalysis7Test)"); - PerformanceResult test3 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment03.MethodCallThoughputTimestampAnalysis3Test)"); - PerformanceResult test8 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment08.MethodCallThoughputTimestampAnalysis8Test)"); - PerformanceResult test12 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment12.MethodCallThoughputTimestampAnalysis12Test)"); - PerformanceResult test13 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment13.MethodCallThoughputTimestampAnalysis13Test)"); - PerformanceResult test5 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment05.MethodCallThoughputTimestampAnalysis5Test)"); - PerformanceResult test2 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment02.MethodCallThoughputTimestampAnalysis2Test)"); - PerformanceResult test6 = performanceResults - .get("testWithManyObjects(teetime.variant.methodcall.examples.experiment06.MethodCallThoughputTimestampAnalysis6Test)"); - - assertEquals(1, (double) test4.quantiles.get(0.5) / test1.quantiles.get(0.5), 0.1); - assertEquals(2, (double) test7.quantiles.get(0.5) / test1.quantiles.get(0.5), 0.1); - assertEquals(4, (double) test3.quantiles.get(0.5) / test1.quantiles.get(0.5), 0.1); - assertEquals(4, (double) test8.quantiles.get(0.5) / test1.quantiles.get(0.5), 0.1); - assertEquals(8, (double) test12.quantiles.get(0.5) / test1.quantiles.get(0.5), 1.1); - assertEquals(8, (double) test13.quantiles.get(0.5) / test1.quantiles.get(0.5), 1.1); - assertEquals(10, (double) test5.quantiles.get(0.5) / test1.quantiles.get(0.5), 0.1); - assertEquals(17, (double) test2.quantiles.get(0.5) / test1.quantiles.get(0.5), 0.1); - assertEquals(65, (double) test6.quantiles.get(0.5) / test1.quantiles.get(0.5), 1.1); - } - -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment02/MethodCallThoughputTimestampAnalysis2Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment02/MethodCallThoughputTimestampAnalysis2Test.java deleted file mode 100644 index a8f7c001..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment02/MethodCallThoughputTimestampAnalysis2Test.java +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment02; - -import org.junit.Test; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import util.PerformanceTest; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThoughputTimestampAnalysis2Test extends PerformanceTest { - - @Test - public void testWithManyObjects() { - System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" - + NUM_NOOP_FILTERS + "..."); - - final MethodCallThroughputAnalysis2 analysis = new MethodCallThroughputAnalysis2(); - analysis.setNumNoopFilters(NUM_NOOP_FILTERS); - analysis.setTimestampObjects(this.timestampObjects); - analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { - @Override - public TimestampObject create() { - return new TimestampObject(); - } - }); - analysis.init(); - - this.stopWatch.start(); - try { - analysis.start(); - } finally { - this.stopWatch.end(); - } - } - -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment02/MethodCallThroughputAnalysis2.java b/src/test/java/teetime/variant/methodcall/examples/experiment02/MethodCallThroughputAnalysis2.java deleted file mode 100644 index 4baa051d..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment02/MethodCallThroughputAnalysis2.java +++ /dev/null @@ -1,115 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment02; - -import java.util.List; - -import teetime.util.ConstructorClosure; -import teetime.util.list.CommittableQueue; -import teetime.util.list.CommittableResizableArrayQueue; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcall.framework.core.Pipeline; -import teetime.variant.methodcall.stage.CollectorSink; -import teetime.variant.methodcall.stage.NoopFilter; -import teetime.variant.methodcall.stage.ObjectProducer; -import teetime.variant.methodcall.stage.StartTimestampFilter; -import teetime.variant.methodcall.stage.StopTimestampFilter; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThroughputAnalysis2 extends Analysis { - - private int numInputObjects; - private ConstructorClosure<TimestampObject> inputObjectCreator; - private int numNoopFilters; - private List<TimestampObject> timestampObjects; - private Runnable runnable; - - @Override - public void init() { - super.init(); - this.runnable = this.buildPipeline(); - } - - /** - * @param numNoopFilters - * @since 1.10 - */ - private Runnable buildPipeline() { - @SuppressWarnings("unchecked") - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // create stages - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - - final Pipeline<Void, Object> pipeline = new Pipeline<Void, Object>(); - pipeline.setFirstStage(objectProducer); - pipeline.addIntermediateStage(startTimestampFilter); - pipeline.addIntermediateStages(noopFilters); - pipeline.addIntermediateStage(stopTimestampFilter); - pipeline.setLastStage(collectorSink); - - pipeline.onStart(); - - final Runnable runnable = new Runnable() { - @Override - public void run() { - CommittableQueue<Void> inputQueue = new CommittableResizableArrayQueue<Void>(null, 0); - do { - pipeline.execute2(inputQueue); - } while (pipeline.isReschedulable()); - } - }; - - return runnable; - } - - @Override - public void start() { - super.start(); - this.runnable.run(); - } - - public void setInput(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public void setNumNoopFilters(final int numNoopFilters) { - this.numNoopFilters = numNoopFilters; - } - - public List<TimestampObject> getTimestampObjects() { - return this.timestampObjects; - } - - public void setTimestampObjects(final List<TimestampObject> timestampObjects) { - this.timestampObjects = timestampObjects; - } -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment03/MethodCallThoughputTimestampAnalysis3Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment03/MethodCallThoughputTimestampAnalysis3Test.java deleted file mode 100644 index f0254708..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment03/MethodCallThoughputTimestampAnalysis3Test.java +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment03; - -import org.junit.Test; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import util.PerformanceTest; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThoughputTimestampAnalysis3Test extends PerformanceTest { - - // 500 times faster than our new framework - // TODO check why - - @Test - public void testWithManyObjects() { - System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" - + NUM_NOOP_FILTERS + "..."); - - final MethodCallThroughputAnalysis3 analysis = new MethodCallThroughputAnalysis3(); - analysis.setNumNoopFilters(NUM_NOOP_FILTERS); - analysis.setTimestampObjects(this.timestampObjects); - analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { - @Override - public TimestampObject create() { - return new TimestampObject(); - } - }); - analysis.init(); - - this.stopWatch.start(); - try { - analysis.start(); - } finally { - this.stopWatch.end(); - } - } - -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment03/MethodCallThroughputAnalysis3.java b/src/test/java/teetime/variant/methodcall/examples/experiment03/MethodCallThroughputAnalysis3.java deleted file mode 100644 index 1f905d12..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment03/MethodCallThroughputAnalysis3.java +++ /dev/null @@ -1,146 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment03; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcall.framework.core.Stage; -import teetime.variant.methodcall.stage.CollectorSink; -import teetime.variant.methodcall.stage.NoopFilter; -import teetime.variant.methodcall.stage.ObjectProducer; -import teetime.variant.methodcall.stage.StartTimestampFilter; -import teetime.variant.methodcall.stage.StopTimestampFilter; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThroughputAnalysis3 extends Analysis { - - public abstract class WrappingPipeline { - - public abstract boolean execute(); - - } - - private int numInputObjects; - private ConstructorClosure<TimestampObject> inputObjectCreator; - private int numNoopFilters; - private List<TimestampObject> timestampObjects; - private Runnable runnable; - - @Override - public void init() { - super.init(); - this.runnable = this.buildPipeline(); - } - - /** - * @param numNoopFilters - * @since 1.10 - */ - private Runnable buildPipeline() { - @SuppressWarnings("unchecked") - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // create stages - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - - final List<Stage<?, ?>> stageList = new ArrayList<Stage<?, ?>>(); - stageList.add(objectProducer); - stageList.add(startTimestampFilter); - stageList.addAll(Arrays.asList(noopFilters)); - stageList.add(stopTimestampFilter); - stageList.add(collectorSink); - - // using an array decreases the performance from 60ms to 200ms (by 3x) - final Stage<?, ?>[] stages = stageList.toArray(new Stage[0]); - - final WrappingPipeline pipeline = new WrappingPipeline() { - @Override - public boolean execute() { - // extracting the null-check does NOT improve performance - // Stage stage = stages[0]; - // Object element = stage.execute(null); - // if (element == null) { - // return false; - // } - - Object element = null; - - for (int i = 0; i < stages.length; i++) { - Stage<?, ?> stage = stages[i]; - element = stage.execute(element); - if (element == null) { - return false; - } - } - - return true; - } - - }; - - final Runnable runnable = new Runnable() { - @Override - public void run() { - boolean success; - do { - success = pipeline.execute(); - } while (success); - } - }; - return runnable; - } - - @Override - public void start() { - super.start(); - this.runnable.run(); - } - - public void setInput(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public void setNumNoopFilters(final int numNoopFilters) { - this.numNoopFilters = numNoopFilters; - } - - public List<TimestampObject> getTimestampObjects() { - return this.timestampObjects; - } - - public void setTimestampObjects(final List<TimestampObject> timestampObjects) { - this.timestampObjects = timestampObjects; - } -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment04/MethodCallThoughputTimestampAnalysis4Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment04/MethodCallThoughputTimestampAnalysis4Test.java deleted file mode 100644 index bc5b0ea5..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment04/MethodCallThoughputTimestampAnalysis4Test.java +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment04; - -import org.junit.Test; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import util.PerformanceTest; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThoughputTimestampAnalysis4Test extends PerformanceTest { - - // 500 times faster than our new framework - // TODO check why - - @Test - public void testWithManyObjects() { - System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" - + NUM_NOOP_FILTERS + "..."); - - final MethodCallThroughputAnalysis4 analysis = new MethodCallThroughputAnalysis4(); - analysis.setNumNoopFilters(NUM_NOOP_FILTERS); - analysis.setTimestampObjects(this.timestampObjects); - analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { - @Override - public TimestampObject create() { - return new TimestampObject(); - } - }); - analysis.init(); - - this.stopWatch.start(); - try { - analysis.start(); - } finally { - this.stopWatch.end(); - } - } - -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment04/MethodCallThroughputAnalysis4.java b/src/test/java/teetime/variant/methodcall/examples/experiment04/MethodCallThroughputAnalysis4.java deleted file mode 100644 index 35983c03..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment04/MethodCallThroughputAnalysis4.java +++ /dev/null @@ -1,137 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment04; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcall.framework.core.Stage; -import teetime.variant.methodcall.stage.CollectorSink; -import teetime.variant.methodcall.stage.NoopFilter; -import teetime.variant.methodcall.stage.ObjectProducer; -import teetime.variant.methodcall.stage.StartTimestampFilter; -import teetime.variant.methodcall.stage.StopTimestampFilter; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThroughputAnalysis4 extends Analysis { - - public abstract class WrappingPipeline { - - public abstract boolean execute(); - - } - - private int numInputObjects; - private ConstructorClosure<TimestampObject> inputObjectCreator; - private int numNoopFilters; - private List<TimestampObject> timestampObjects; - private Runnable runnable; - - @Override - public void init() { - super.init(); - this.runnable = this.buildPipeline(); - } - - /** - * @param numNoopFilters - * @since 1.10 - */ - private Runnable buildPipeline() { - @SuppressWarnings("unchecked") - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // create stages - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - - List<Stage> stages = new ArrayList<Stage>(); - stages.add(objectProducer); - stages.add(startTimestampFilter); - stages.addAll(Arrays.asList(noopFilters)); - stages.add(stopTimestampFilter); - stages.add(collectorSink); - - final WrappingPipeline pipeline = new WrappingPipeline() { - @Override - public boolean execute() { - TimestampObject object = objectProducer.execute(null); - if (object == null) { - return false; - } - object = startTimestampFilter.execute(object); - for (final NoopFilter<TimestampObject> noopFilter : noopFilters) { - object = noopFilter.execute(object); - } - - object = stopTimestampFilter.execute(object); - collectorSink.execute(object); - return true; - } - - }; - - final Runnable runnable = new Runnable() { - @Override - public void run() { - boolean success; - do { - success = pipeline.execute(); - } while (success); - } - }; - return runnable; - } - - @Override - public void start() { - super.start(); - this.runnable.run(); - } - - public void setInput(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public void setNumNoopFilters(final int numNoopFilters) { - this.numNoopFilters = numNoopFilters; - } - - public List<TimestampObject> getTimestampObjects() { - return this.timestampObjects; - } - - public void setTimestampObjects(final List<TimestampObject> timestampObjects) { - this.timestampObjects = timestampObjects; - } -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment05/MethodCallThoughputTimestampAnalysis5Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment05/MethodCallThoughputTimestampAnalysis5Test.java deleted file mode 100644 index 6922fc2a..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment05/MethodCallThoughputTimestampAnalysis5Test.java +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment05; - -import org.junit.Test; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import util.PerformanceTest; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThoughputTimestampAnalysis5Test extends PerformanceTest { - - // 500 times faster than our new framework - // TODO check why - - @Test - public void testWithManyObjects() { - System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" - + NUM_NOOP_FILTERS + "..."); - - final MethodCallThroughputAnalysis5 analysis = new MethodCallThroughputAnalysis5(); - analysis.setNumNoopFilters(NUM_NOOP_FILTERS); - analysis.setTimestampObjects(this.timestampObjects); - analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { - @Override - public TimestampObject create() { - return new TimestampObject(); - } - }); - analysis.init(); - - this.stopWatch.start(); - try { - analysis.start(); - } finally { - this.stopWatch.end(); - } - } - -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment05/MethodCallThroughputAnalysis5.java b/src/test/java/teetime/variant/methodcall/examples/experiment05/MethodCallThroughputAnalysis5.java deleted file mode 100644 index 176f09ef..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment05/MethodCallThroughputAnalysis5.java +++ /dev/null @@ -1,146 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment05; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcall.framework.core.Stage; -import teetime.variant.methodcall.stage.CollectorSink; -import teetime.variant.methodcall.stage.NoopFilter; -import teetime.variant.methodcall.stage.ObjectProducer; -import teetime.variant.methodcall.stage.StartTimestampFilter; -import teetime.variant.methodcall.stage.StopTimestampFilter; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThroughputAnalysis5 extends Analysis { - - public abstract class WrappingPipeline { - - public abstract boolean execute(); - - } - - private int numInputObjects; - private ConstructorClosure<TimestampObject> inputObjectCreator; - private int numNoopFilters; - private List<TimestampObject> timestampObjects; - private Runnable runnable; - - @Override - public void init() { - super.init(); - this.runnable = this.buildPipeline(); - } - - /** - * @param numNoopFilters - * @since 1.10 - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - private Runnable buildPipeline() { - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // create stages - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - - final List<Stage> stageList = new ArrayList<Stage>(); - stageList.add(objectProducer); - stageList.add(startTimestampFilter); - stageList.addAll(Arrays.asList(noopFilters)); - stageList.add(stopTimestampFilter); - stageList.add(collectorSink); - - // using an array decreases the performance from 60ms to 440ms (by 7x) - final Stage[] stages = stageList.toArray(new Stage[0]); - for (int i = 0; i < stages.length - 1; i++) { - stages[i].setSuccessor(stages[i + 1]); - } - final Stage startStage = stages[0]; - - final WrappingPipeline pipeline = new WrappingPipeline() { - @Override - public boolean execute() { - Object element = null; - Stage stage = startStage; - - element = stage.execute(element); - if (element == null) { - return false; - } - stage = stage.next(); - - do { - element = stage.execute(element); - stage = stage.next(); - } while (stage != null); - return true; - } - - }; - - final Runnable runnable = new Runnable() { - @Override - public void run() { - boolean success; - do { - success = pipeline.execute(); - } while (success); - } - }; - return runnable; - } - - @Override - public void start() { - super.start(); - this.runnable.run(); - } - - public void setInput(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public void setNumNoopFilters(final int numNoopFilters) { - this.numNoopFilters = numNoopFilters; - } - - public List<TimestampObject> getTimestampObjects() { - return this.timestampObjects; - } - - public void setTimestampObjects(final List<TimestampObject> timestampObjects) { - this.timestampObjects = timestampObjects; - } -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment06/MethodCallThoughputTimestampAnalysis6Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment06/MethodCallThoughputTimestampAnalysis6Test.java deleted file mode 100644 index 7971dfa4..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment06/MethodCallThoughputTimestampAnalysis6Test.java +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment06; - -import org.junit.Test; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import util.PerformanceTest; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThoughputTimestampAnalysis6Test extends PerformanceTest { - - @Test - public void testWithManyObjects() { - System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" - + NUM_NOOP_FILTERS + "..."); - - final MethodCallThroughputAnalysis6 analysis = new MethodCallThroughputAnalysis6(); - analysis.setNumNoopFilters(NUM_NOOP_FILTERS); - analysis.setTimestampObjects(this.timestampObjects); - analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { - @Override - public TimestampObject create() { - return new TimestampObject(); - } - }); - analysis.init(); - - this.stopWatch.start(); - try { - analysis.start(); - } finally { - this.stopWatch.end(); - } - } - -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment06/MethodCallThroughputAnalysis6.java b/src/test/java/teetime/variant/methodcall/examples/experiment06/MethodCallThroughputAnalysis6.java deleted file mode 100644 index 04faa048..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment06/MethodCallThroughputAnalysis6.java +++ /dev/null @@ -1,939 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment06; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcall.framework.core.Stage; -import teetime.variant.methodcall.stage.CollectorSink; -import teetime.variant.methodcall.stage.NoopFilter; -import teetime.variant.methodcall.stage.ObjectProducer; -import teetime.variant.methodcall.stage.StartTimestampFilter; -import teetime.variant.methodcall.stage.StopTimestampFilter; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThroughputAnalysis6 extends Analysis { - - public abstract class WrappingPipeline { - - public abstract boolean execute(); - - } - - private int numInputObjects; - private ConstructorClosure<TimestampObject> inputObjectCreator; - private int numNoopFilters; - private List<TimestampObject> timestampObjects; - private Runnable runnable; - - @Override - public void init() { - super.init(); - this.runnable = this.buildPipeline(); - } - - /** - * @param numNoopFilters - * @since 1.10 - */ - private Runnable buildPipeline() { - @SuppressWarnings("unchecked") - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // create stages - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - - List<Stage> stages = new ArrayList<Stage>(); - stages.add(objectProducer); - stages.add(startTimestampFilter); - stages.addAll(Arrays.asList(noopFilters)); - stages.add(stopTimestampFilter); - stages.add(collectorSink); - - final WrappingPipeline pipeline = new WrappingPipeline() { - @Override - public boolean execute() { - TimestampObject object = objectProducer.execute(null); - if (object == null) { - return false; - } - object = startTimestampFilter.execute(object); - // for (final NoopFilter<TimestampObject> noopFilter : noopFilters) { - // object = noopFilter.execute(object); - // } - - int i = 0; - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - object = noopFilters[i++].execute(object); - - object = stopTimestampFilter.execute(object); - collectorSink.execute(object); - return true; - } - - }; - - final Runnable runnable = new Runnable() { - @Override - public void run() { - boolean success; - do { - success = pipeline.execute(); - } while (success); - } - }; - return runnable; - } - - @Override - public void start() { - super.start(); - this.runnable.run(); - } - - public void setInput(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public void setNumNoopFilters(final int numNoopFilters) { - this.numNoopFilters = numNoopFilters; - } - - public List<TimestampObject> getTimestampObjects() { - return this.timestampObjects; - } - - public void setTimestampObjects(final List<TimestampObject> timestampObjects) { - this.timestampObjects = timestampObjects; - } -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment07/MethodCallThoughputTimestampAnalysis7Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment07/MethodCallThoughputTimestampAnalysis7Test.java deleted file mode 100644 index 77249c1d..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment07/MethodCallThoughputTimestampAnalysis7Test.java +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment07; - -import org.junit.Test; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import util.PerformanceTest; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThoughputTimestampAnalysis7Test extends PerformanceTest { - - @Test - public void testWithManyObjects() { - System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" - + NUM_NOOP_FILTERS + "..."); - - final MethodCallThroughputAnalysis7 analysis = new MethodCallThroughputAnalysis7(); - analysis.setNumNoopFilters(NUM_NOOP_FILTERS); - analysis.setTimestampObjects(this.timestampObjects); - analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { - @Override - public TimestampObject create() { - return new TimestampObject(); - } - }); - analysis.init(); - - this.stopWatch.start(); - try { - analysis.start(); - } finally { - this.stopWatch.end(); - } - } - -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment07/MethodCallThroughputAnalysis7.java b/src/test/java/teetime/variant/methodcall/examples/experiment07/MethodCallThroughputAnalysis7.java deleted file mode 100644 index 29f51446..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment07/MethodCallThroughputAnalysis7.java +++ /dev/null @@ -1,149 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment07; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcall.framework.core.AbstractStage; -import teetime.variant.methodcall.stage.CollectorSink; -import teetime.variant.methodcall.stage.NoopFilter; -import teetime.variant.methodcall.stage.ObjectProducer; -import teetime.variant.methodcall.stage.StartTimestampFilter; -import teetime.variant.methodcall.stage.StopTimestampFilter; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThroughputAnalysis7 extends Analysis { - - public abstract class WrappingPipeline { - - public abstract boolean execute(); - - } - - private int numInputObjects; - private ConstructorClosure<TimestampObject> inputObjectCreator; - private int numNoopFilters; - private List<TimestampObject> timestampObjects; - private Runnable runnable; - - @Override - public void init() { - super.init(); - this.runnable = this.buildPipeline(); - } - - /** - * @param numNoopFilters - * @since 1.10 - */ - @SuppressWarnings("rawtypes") - private Runnable buildPipeline() { - @SuppressWarnings("unchecked") - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // create stages - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - - final List<AbstractStage> stageList = new ArrayList<AbstractStage>(); - stageList.add(objectProducer); - stageList.add(startTimestampFilter); - stageList.addAll(Arrays.asList(noopFilters)); - stageList.add(stopTimestampFilter); - stageList.add(collectorSink); - - // using an array decreases the performance from 60ms to 200ms (by 3x) - final AbstractStage[] stages = stageList.toArray(new AbstractStage[0]); - - final WrappingPipeline pipeline = new WrappingPipeline() { - @Override - public boolean execute() { - // using the foreach for arrays (i.e., w/o using an iterator variable) increases the performance from 200ms to 130ms - Object element = null; - for (AbstractStage stage : stages) { - element = stage.execute(element); - if (element == null) { - return false; - } - } - - // changing the type of stages decreases performance by 2 (e.g., NoopFilter -> Stage) - // the VM seems to not optimize the code anymore if the concrete type is not declared - - // for (final NoopFilter<TimestampObject> noopFilter : noopFilters) { - // element = noopFilter.execute(element); - // } - // - // element = stopTimestampFilter.execute(element); - // element = collectorSink.execute(element); - - return true; - } - - }; - - final Runnable runnable = new Runnable() { - @Override - public void run() { - boolean success; - do { - success = pipeline.execute(); - } while (success); - } - }; - return runnable; - } - - @Override - public void start() { - super.start(); - this.runnable.run(); - } - - public void setInput(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public void setNumNoopFilters(final int numNoopFilters) { - this.numNoopFilters = numNoopFilters; - } - - public List<TimestampObject> getTimestampObjects() { - return this.timestampObjects; - } - - public void setTimestampObjects(final List<TimestampObject> timestampObjects) { - this.timestampObjects = timestampObjects; - } -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment08/MethodCallThoughputTimestampAnalysis8Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment08/MethodCallThoughputTimestampAnalysis8Test.java deleted file mode 100644 index c46ae4e1..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment08/MethodCallThoughputTimestampAnalysis8Test.java +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment08; - -import org.junit.Test; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import util.PerformanceTest; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThoughputTimestampAnalysis8Test extends PerformanceTest { - - @Test - public void testWithManyObjects() { - System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" - + NUM_NOOP_FILTERS + "..."); - - final MethodCallThroughputAnalysis8 analysis = new MethodCallThroughputAnalysis8(); - analysis.setNumNoopFilters(NUM_NOOP_FILTERS); - analysis.setTimestampObjects(this.timestampObjects); - analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { - @Override - public TimestampObject create() { - return new TimestampObject(); - } - }); - analysis.init(); - - this.stopWatch.start(); - try { - analysis.start(); - } finally { - this.stopWatch.end(); - } - } - -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment08/MethodCallThroughputAnalysis8.java b/src/test/java/teetime/variant/methodcall/examples/experiment08/MethodCallThroughputAnalysis8.java deleted file mode 100644 index 90c034eb..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment08/MethodCallThroughputAnalysis8.java +++ /dev/null @@ -1,152 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment08; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcall.framework.core.AbstractStage; -import teetime.variant.methodcall.framework.core.Stage; -import teetime.variant.methodcall.stage.CollectorSink; -import teetime.variant.methodcall.stage.NoopFilter; -import teetime.variant.methodcall.stage.ObjectProducer; -import teetime.variant.methodcall.stage.StartTimestampFilter; -import teetime.variant.methodcall.stage.StopTimestampFilter; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThroughputAnalysis8 extends Analysis { - - public abstract class WrappingPipeline { - - public abstract boolean execute(); - - } - - private int numInputObjects; - private ConstructorClosure<TimestampObject> inputObjectCreator; - private int numNoopFilters; - private List<TimestampObject> timestampObjects; - private Runnable runnable; - - @Override - public void init() { - super.init(); - this.runnable = this.buildPipeline(); - } - - /** - * @param numNoopFilters - * @since 1.10 - */ - private Runnable buildPipeline() { - @SuppressWarnings("unchecked") - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // create stages - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - - final List<AbstractStage<?, ?>> stageList = new ArrayList<AbstractStage<?, ?>>(); - stageList.add(objectProducer); - stageList.add(startTimestampFilter); - stageList.addAll(Arrays.asList(noopFilters)); - stageList.add(stopTimestampFilter); - stageList.add(collectorSink); - - // using an array decreases the performance from 60ms to 200ms (by 3x) - final AbstractStage<?, ?>[] stages = stageList.toArray(new AbstractStage[0]); - - final WrappingPipeline pipeline = new WrappingPipeline() { - private int startIndex; - - @Override - public boolean execute() { - // using the foreach for arrays (i.e., w/o using an iterator variable) increases the performance from 200ms to 130ms - Object element = null; - for (int i = this.startIndex; i < stages.length; i++) { - Stage<?, ?> stage = stages[i]; - element = stage.execute(element); - if (element == null) { - return false; - } - } - - // changing the type of stages decreases performance by 2 (e.g., NoopFilter -> Stage) - // the VM seems to not optimize the code anymore if the concrete type is not declared - - // for (final NoopFilter<TimestampObject> noopFilter : noopFilters) { - // element = noopFilter.execute(element); - // } - // - // element = stopTimestampFilter.execute(element); - // element = collectorSink.execute(element); - - return true; - } - - }; - - final Runnable runnable = new Runnable() { - @Override - public void run() { - boolean success; - do { - success = pipeline.execute(); - } while (success); - } - }; - return runnable; - } - - @Override - public void start() { - super.start(); - this.runnable.run(); - } - - public void setInput(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public void setNumNoopFilters(final int numNoopFilters) { - this.numNoopFilters = numNoopFilters; - } - - public List<TimestampObject> getTimestampObjects() { - return this.timestampObjects; - } - - public void setTimestampObjects(final List<TimestampObject> timestampObjects) { - this.timestampObjects = timestampObjects; - } -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment12/MethodCallThoughputTimestampAnalysis12Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment12/MethodCallThoughputTimestampAnalysis12Test.java deleted file mode 100644 index 61207a67..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment12/MethodCallThoughputTimestampAnalysis12Test.java +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment12; - -import org.junit.Test; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import util.PerformanceTest; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThoughputTimestampAnalysis12Test extends PerformanceTest { - - @Test - public void testWithManyObjects() { - System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" - + NUM_NOOP_FILTERS + "..."); - - final MethodCallThroughputAnalysis12 analysis = new MethodCallThroughputAnalysis12(); - analysis.setNumNoopFilters(NUM_NOOP_FILTERS); - analysis.setTimestampObjects(this.timestampObjects); - analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { - @Override - public TimestampObject create() { - return new TimestampObject(); - } - }); - analysis.init(); - - this.stopWatch.start(); - try { - analysis.start(); - } finally { - this.stopWatch.end(); - } - } - -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment12/MethodCallThroughputAnalysis12.java b/src/test/java/teetime/variant/methodcall/examples/experiment12/MethodCallThroughputAnalysis12.java deleted file mode 100644 index 399ccc27..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment12/MethodCallThroughputAnalysis12.java +++ /dev/null @@ -1,113 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment12; - -import java.util.List; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcall.framework.core.Pipeline; -import teetime.variant.methodcall.stage.CollectorSink; -import teetime.variant.methodcall.stage.NoopFilter; -import teetime.variant.methodcall.stage.ObjectProducer; -import teetime.variant.methodcall.stage.StartTimestampFilter; -import teetime.variant.methodcall.stage.StopTimestampFilter; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThroughputAnalysis12 extends Analysis { - - private long numInputObjects; - private ConstructorClosure<TimestampObject> inputObjectCreator; - private int numNoopFilters; - private List<TimestampObject> timestampObjects; - private Runnable runnable; - - @Override - public void init() { - super.init(); - this.runnable = this.buildPipeline(); - } - - /** - * @param numNoopFilters - * @since 1.10 - */ - private Runnable buildPipeline() { - @SuppressWarnings("unchecked") - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // create stages - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - - final Pipeline<Void, Object> pipeline = new Pipeline<Void, Object>(); - pipeline.setFirstStage(objectProducer); - pipeline.addIntermediateStage(startTimestampFilter); - pipeline.addIntermediateStages(noopFilters); - pipeline.addIntermediateStage(stopTimestampFilter); - pipeline.setLastStage(collectorSink); - - pipeline.onStart(); - - final Runnable runnable = new Runnable() { - @Override - public void run() { - Object result; - do { - result = pipeline.executeRecursively(null); - } while (result != null); - } - }; - - return runnable; - } - - @Override - public void start() { - super.start(); - this.runnable.run(); - } - - public void setInput(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public void setNumNoopFilters(final int numNoopFilters) { - this.numNoopFilters = numNoopFilters; - } - - public List<TimestampObject> getTimestampObjects() { - return this.timestampObjects; - } - - public void setTimestampObjects(final List<TimestampObject> timestampObjects) { - this.timestampObjects = timestampObjects; - } -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment13/MethodCallThoughputTimestampAnalysis13Test.java b/src/test/java/teetime/variant/methodcall/examples/experiment13/MethodCallThoughputTimestampAnalysis13Test.java deleted file mode 100644 index d0d50d5b..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment13/MethodCallThoughputTimestampAnalysis13Test.java +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment13; - -import org.junit.Test; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import util.PerformanceTest; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThoughputTimestampAnalysis13Test extends PerformanceTest { - - @Test - public void testWithManyObjects() { - System.out.println("Testing teetime (mc) with NUM_OBJECTS_TO_CREATE=" + NUM_OBJECTS_TO_CREATE + ", NUM_NOOP_FILTERS=" - + NUM_NOOP_FILTERS + "..."); - - final MethodCallThroughputAnalysis13 analysis = new MethodCallThroughputAnalysis13(); - analysis.setNumNoopFilters(NUM_NOOP_FILTERS); - analysis.setTimestampObjects(this.timestampObjects); - analysis.setInput(NUM_OBJECTS_TO_CREATE, new ConstructorClosure<TimestampObject>() { - @Override - public TimestampObject create() { - return new TimestampObject(); - } - }); - analysis.init(); - - this.stopWatch.start(); - try { - analysis.start(); - } finally { - this.stopWatch.end(); - } - } - -} diff --git a/src/test/java/teetime/variant/methodcall/examples/experiment13/MethodCallThroughputAnalysis13.java b/src/test/java/teetime/variant/methodcall/examples/experiment13/MethodCallThroughputAnalysis13.java deleted file mode 100644 index edd8b95e..00000000 --- a/src/test/java/teetime/variant/methodcall/examples/experiment13/MethodCallThroughputAnalysis13.java +++ /dev/null @@ -1,138 +0,0 @@ -/*************************************************************************** - * Copyright 2014 Kieker Project (http://kieker-monitoring.net) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ***************************************************************************/ -package teetime.variant.methodcall.examples.experiment13; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import teetime.util.ConstructorClosure; -import teetime.variant.explicitScheduling.examples.throughput.TimestampObject; -import teetime.variant.explicitScheduling.framework.core.Analysis; -import teetime.variant.methodcall.framework.core.AbstractStage; -import teetime.variant.methodcall.framework.core.Stage; -import teetime.variant.methodcall.stage.CollectorSink; -import teetime.variant.methodcall.stage.EndStage; -import teetime.variant.methodcall.stage.NoopFilter; -import teetime.variant.methodcall.stage.ObjectProducer; -import teetime.variant.methodcall.stage.StartTimestampFilter; -import teetime.variant.methodcall.stage.StopTimestampFilter; - -/** - * @author Christian Wulf - * - * @since 1.10 - */ -public class MethodCallThroughputAnalysis13 extends Analysis { - - public abstract class WrappingPipeline { - - public abstract boolean execute(); - - } - - private long numInputObjects; - private ConstructorClosure<TimestampObject> inputObjectCreator; - private int numNoopFilters; - private List<TimestampObject> timestampObjects; - private Runnable runnable; - - @Override - public void init() { - super.init(); - this.runnable = this.buildPipeline(); - } - - /** - * @param numNoopFilters - * @since 1.10 - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - private Runnable buildPipeline() { - final NoopFilter<TimestampObject>[] noopFilters = new NoopFilter[this.numNoopFilters]; - // create stages - final ObjectProducer<TimestampObject> objectProducer = new ObjectProducer<TimestampObject>(this.numInputObjects, this.inputObjectCreator); - final StartTimestampFilter startTimestampFilter = new StartTimestampFilter(); - for (int i = 0; i < noopFilters.length; i++) { - noopFilters[i] = new NoopFilter<TimestampObject>(); - } - final StopTimestampFilter stopTimestampFilter = new StopTimestampFilter(); - final CollectorSink<TimestampObject> collectorSink = new CollectorSink<TimestampObject>(this.timestampObjects); - - final List<AbstractStage> stageList = new ArrayList<AbstractStage>(); - stageList.add(objectProducer); - stageList.add(startTimestampFilter); - stageList.addAll(Arrays.asList(noopFilters)); - stageList.add(stopTimestampFilter); - stageList.add(collectorSink); - - // using an array decreases the performance from 60ms to 200ms (by 3x) - final AbstractStage[] stages = stageList.toArray(new AbstractStage[0]); - - for (int i = 0; i < stages.length - 1; i++) { - Stage<?, ?> stage = stages[i]; - stage.setSuccessor(stages[i + 1]); - } - stages[stages.length - 1].setSuccessor(new EndStage<Object>()); - - final WrappingPipeline pipeline = new WrappingPipeline() { - @Override - public boolean execute() { - Object result = stages[0].executeRecursively(null); - return result != null; - } - - }; - - final Runnable runnable = new Runnable() { - @Override - public void run() { - boolean success; - do { - success = pipeline.execute(); - } while (success); - } - }; - return runnable; - } - - @Override - public void start() { - super.start(); - this.runnable.run(); - } - - public void setInput(final int numInputObjects, final ConstructorClosure<TimestampObject> inputObjectCreator) { - this.numInputObjects = numInputObjects; - this.inputObjectCreator = inputObjectCreator; - } - - public int getNumNoopFilters() { - return this.numNoopFilters; - } - - public void setNumNoopFilters(final int numNoopFilters) { - this.numNoopFilters = numNoopFilters; - } - - public List<TimestampObject> getTimestampObjects() { - return this.timestampObjects; - } - - public void setTimestampObjects(final List<TimestampObject> timestampObjects) { - this.timestampObjects = timestampObjects; - } -} -- GitLab