Skip to content
Snippets Groups Projects
Commit 7c362201 authored by Christian Wulf's avatar Christian Wulf
Browse files

removed a deprecated method

parent 5fe18f27
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,13 @@ public interface IPipeFactory {
@Deprecated
IPipe create(int capacity);
/**
* with the default capacity
*
* @param sourcePort
* @param targetPort
* @return
*/
<T> IPipe create(OutputPort<? extends T> sourcePort, InputPort<T> targetPort);
<T> IPipe create(OutputPort<? extends T> sourcePort, InputPort<T> targetPort, int capacity);
......
......@@ -43,17 +43,7 @@ public class PipeFactory {
}
}
/**
* Creates a new FIFO-ordered, growable pipe with an initial capacity of 1. <br>
* <i>This method is suitable for most situations.</i>
*
* @param tc
* @return
*/
public IPipe create(final ThreadCommunication tc) {
return this.create(tc, PipeOrdering.QUEUE_BASED, true, 1);
}
@Deprecated
public IPipe create(final ThreadCommunication tc, final PipeOrdering ordering, final boolean growable, final int capacity) {
IPipeFactory pipeFactory = getPipeFactory(tc, ordering, growable);
return pipeFactory.create(capacity);
......
......@@ -21,8 +21,9 @@ 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.IPipeFactory;
import teetime.framework.pipe.PipeFactory;
import teetime.framework.pipe.PipeFactory.PipeOrdering;
import teetime.framework.pipe.PipeFactory.ThreadCommunication;
import teetime.stage.CollectorSink;
import teetime.stage.NoopFilter;
......@@ -74,18 +75,15 @@ public class MethodCallThroughputAnalysis14 extends OldAnalysis {
pipeline.setFirstStage(objectProducer);
pipeline.setLastStage(collectorSink);
IPipe pipe = this.pipeFactory.create(ThreadCommunication.INTRA);
pipe.connectPorts(objectProducer.getOutputPort(), startTimestampFilter.getInputPort());
pipe = this.pipeFactory.create(ThreadCommunication.INTRA);
pipe.connectPorts(startTimestampFilter.getOutputPort(), noopFilters[0].getInputPort());
IPipeFactory factory = this.pipeFactory.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.QUEUE_BASED, true);
factory.create(objectProducer.getOutputPort(), startTimestampFilter.getInputPort());
factory.create(startTimestampFilter.getOutputPort(), noopFilters[0].getInputPort());
for (int i = 0; i < noopFilters.length - 1; i++) {
pipe = this.pipeFactory.create(ThreadCommunication.INTRA);
pipe.connectPorts(noopFilters[i].getOutputPort(), noopFilters[i + 1].getInputPort());
factory.create(noopFilters[i].getOutputPort(), noopFilters[i + 1].getInputPort());
}
pipe = this.pipeFactory.create(ThreadCommunication.INTRA);
pipe.connectPorts(noopFilters[noopFilters.length - 1].getOutputPort(), stopTimestampFilter.getInputPort());
pipe = this.pipeFactory.create(ThreadCommunication.INTRA);
pipe.connectPorts(stopTimestampFilter.getOutputPort(), collectorSink.getInputPort());
factory.create(noopFilters[noopFilters.length - 1].getOutputPort(), stopTimestampFilter.getInputPort());
factory.create(stopTimestampFilter.getOutputPort(), collectorSink.getInputPort());
return pipeline;
}
......
package teetime.examples.loopStage;
import teetime.framework.AnalysisConfiguration;
import teetime.framework.pipe.IPipeFactory;
import teetime.framework.pipe.PipeFactory;
import teetime.framework.pipe.PipeFactory.PipeOrdering;
import teetime.framework.pipe.PipeFactory.ThreadCommunication;
public class LoopStageAnalysisConfiguration extends AnalysisConfiguration {
private final PipeFactory pipeFactory = PipeFactory.INSTANCE;
public LoopStageAnalysisConfiguration() {
Countdown countdown = new Countdown(10);
PipeFactory.INSTANCE.create(ThreadCommunication.INTRA)
.connectPorts(countdown.getNewCountdownOutputPort(), countdown.getCountdownInputPort());
IPipeFactory factory = this.pipeFactory.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.QUEUE_BASED, true);
factory.create(countdown.getNewCountdownOutputPort(), countdown.getCountdownInputPort());
this.getFiniteProducerStages().add(countdown);
}
......
......@@ -8,8 +8,9 @@ import java.lang.reflect.InvocationTargetException;
import org.junit.Test;
import teetime.framework.pipe.IPipe;
import teetime.framework.pipe.IPipeFactory;
import teetime.framework.pipe.PipeFactory;
import teetime.framework.pipe.PipeFactory.PipeOrdering;
import teetime.framework.pipe.PipeFactory.ThreadCommunication;
import teetime.stage.ObjectProducer;
import teetime.stage.PortTypeConfiguration;
......@@ -46,12 +47,10 @@ public class ConnectionTypeTest {
StopTimestampFilter stopTimestampFilter = StopTimestampFilter.class.newInstance();
Sink sink = Sink.class.newInstance();
IPipe pipe = this.pipeFactory.create(ThreadCommunication.INTRA);
pipe.connectPorts(objectProducer.getOutputPort(), startTimestampFilter.getInputPort());
pipe = this.pipeFactory.create(ThreadCommunication.INTRA);
pipe.connectPorts(startTimestampFilter.getOutputPort(), stopTimestampFilter.getInputPort());
pipe = this.pipeFactory.create(ThreadCommunication.INTRA);
pipe.connectPorts(stopTimestampFilter.getOutputPort(), sink.getInputPort());
IPipeFactory factory = this.pipeFactory.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.QUEUE_BASED, true);
factory.create(objectProducer.getOutputPort(), startTimestampFilter.getInputPort());
factory.create(startTimestampFilter.getOutputPort(), stopTimestampFilter.getInputPort());
factory.create(stopTimestampFilter.getOutputPort(), sink.getInputPort());
// TypeVariable<Class<ObjectProducer>>[] objectProducerTypeParameters = ObjectProducer.class.getTypeParameters();
// for (TypeVariable<Class<ObjectProducer>> typeVariable : objectProducerTypeParameters) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment