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

removed a deprecated method

parent 9792f780
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,13 @@ public interface IPipeFactory { ...@@ -10,6 +10,13 @@ public interface IPipeFactory {
@Deprecated @Deprecated
IPipe create(int capacity); 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);
<T> IPipe create(OutputPort<? extends T> sourcePort, InputPort<T> targetPort, int capacity); <T> IPipe create(OutputPort<? extends T> sourcePort, InputPort<T> targetPort, int capacity);
......
...@@ -43,17 +43,7 @@ public class PipeFactory { ...@@ -43,17 +43,7 @@ public class PipeFactory {
} }
} }
/** @Deprecated
* 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);
}
public IPipe create(final ThreadCommunication tc, final PipeOrdering ordering, final boolean growable, final int capacity) { public IPipe create(final ThreadCommunication tc, final PipeOrdering ordering, final boolean growable, final int capacity) {
IPipeFactory pipeFactory = getPipeFactory(tc, ordering, growable); IPipeFactory pipeFactory = getPipeFactory(tc, ordering, growable);
return pipeFactory.create(capacity); return pipeFactory.create(capacity);
......
...@@ -21,8 +21,9 @@ import teetime.framework.HeadPipeline; ...@@ -21,8 +21,9 @@ import teetime.framework.HeadPipeline;
import teetime.framework.HeadStage; import teetime.framework.HeadStage;
import teetime.framework.OldAnalysis; import teetime.framework.OldAnalysis;
import teetime.framework.RunnableStage; import teetime.framework.RunnableStage;
import teetime.framework.pipe.IPipe; import teetime.framework.pipe.IPipeFactory;
import teetime.framework.pipe.PipeFactory; import teetime.framework.pipe.PipeFactory;
import teetime.framework.pipe.PipeFactory.PipeOrdering;
import teetime.framework.pipe.PipeFactory.ThreadCommunication; import teetime.framework.pipe.PipeFactory.ThreadCommunication;
import teetime.stage.CollectorSink; import teetime.stage.CollectorSink;
import teetime.stage.NoopFilter; import teetime.stage.NoopFilter;
...@@ -74,18 +75,15 @@ public class MethodCallThroughputAnalysis14 extends OldAnalysis { ...@@ -74,18 +75,15 @@ public class MethodCallThroughputAnalysis14 extends OldAnalysis {
pipeline.setFirstStage(objectProducer); pipeline.setFirstStage(objectProducer);
pipeline.setLastStage(collectorSink); pipeline.setLastStage(collectorSink);
IPipe pipe = this.pipeFactory.create(ThreadCommunication.INTRA); IPipeFactory factory = this.pipeFactory.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.QUEUE_BASED, true);
pipe.connectPorts(objectProducer.getOutputPort(), startTimestampFilter.getInputPort());
pipe = this.pipeFactory.create(ThreadCommunication.INTRA); factory.create(objectProducer.getOutputPort(), startTimestampFilter.getInputPort());
pipe.connectPorts(startTimestampFilter.getOutputPort(), noopFilters[0].getInputPort()); factory.create(startTimestampFilter.getOutputPort(), noopFilters[0].getInputPort());
for (int i = 0; i < noopFilters.length - 1; i++) { for (int i = 0; i < noopFilters.length - 1; i++) {
pipe = this.pipeFactory.create(ThreadCommunication.INTRA); factory.create(noopFilters[i].getOutputPort(), noopFilters[i + 1].getInputPort());
pipe.connectPorts(noopFilters[i].getOutputPort(), noopFilters[i + 1].getInputPort());
} }
pipe = this.pipeFactory.create(ThreadCommunication.INTRA); factory.create(noopFilters[noopFilters.length - 1].getOutputPort(), stopTimestampFilter.getInputPort());
pipe.connectPorts(noopFilters[noopFilters.length - 1].getOutputPort(), stopTimestampFilter.getInputPort()); factory.create(stopTimestampFilter.getOutputPort(), collectorSink.getInputPort());
pipe = this.pipeFactory.create(ThreadCommunication.INTRA);
pipe.connectPorts(stopTimestampFilter.getOutputPort(), collectorSink.getInputPort());
return pipeline; return pipeline;
} }
......
package teetime.examples.loopStage; package teetime.examples.loopStage;
import teetime.framework.AnalysisConfiguration; import teetime.framework.AnalysisConfiguration;
import teetime.framework.pipe.IPipeFactory;
import teetime.framework.pipe.PipeFactory; import teetime.framework.pipe.PipeFactory;
import teetime.framework.pipe.PipeFactory.PipeOrdering;
import teetime.framework.pipe.PipeFactory.ThreadCommunication; import teetime.framework.pipe.PipeFactory.ThreadCommunication;
public class LoopStageAnalysisConfiguration extends AnalysisConfiguration { public class LoopStageAnalysisConfiguration extends AnalysisConfiguration {
private final PipeFactory pipeFactory = PipeFactory.INSTANCE;
public LoopStageAnalysisConfiguration() { public LoopStageAnalysisConfiguration() {
Countdown countdown = new Countdown(10); Countdown countdown = new Countdown(10);
PipeFactory.INSTANCE.create(ThreadCommunication.INTRA) IPipeFactory factory = this.pipeFactory.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.QUEUE_BASED, true);
.connectPorts(countdown.getNewCountdownOutputPort(), countdown.getCountdownInputPort()); factory.create(countdown.getNewCountdownOutputPort(), countdown.getCountdownInputPort());
this.getFiniteProducerStages().add(countdown); this.getFiniteProducerStages().add(countdown);
} }
......
...@@ -8,8 +8,9 @@ import java.lang.reflect.InvocationTargetException; ...@@ -8,8 +8,9 @@ import java.lang.reflect.InvocationTargetException;
import org.junit.Test; import org.junit.Test;
import teetime.framework.pipe.IPipe; import teetime.framework.pipe.IPipeFactory;
import teetime.framework.pipe.PipeFactory; import teetime.framework.pipe.PipeFactory;
import teetime.framework.pipe.PipeFactory.PipeOrdering;
import teetime.framework.pipe.PipeFactory.ThreadCommunication; import teetime.framework.pipe.PipeFactory.ThreadCommunication;
import teetime.stage.ObjectProducer; import teetime.stage.ObjectProducer;
import teetime.stage.PortTypeConfiguration; import teetime.stage.PortTypeConfiguration;
...@@ -46,12 +47,10 @@ public class ConnectionTypeTest { ...@@ -46,12 +47,10 @@ public class ConnectionTypeTest {
StopTimestampFilter stopTimestampFilter = StopTimestampFilter.class.newInstance(); StopTimestampFilter stopTimestampFilter = StopTimestampFilter.class.newInstance();
Sink sink = Sink.class.newInstance(); Sink sink = Sink.class.newInstance();
IPipe pipe = this.pipeFactory.create(ThreadCommunication.INTRA); IPipeFactory factory = this.pipeFactory.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.QUEUE_BASED, true);
pipe.connectPorts(objectProducer.getOutputPort(), startTimestampFilter.getInputPort()); factory.create(objectProducer.getOutputPort(), startTimestampFilter.getInputPort());
pipe = this.pipeFactory.create(ThreadCommunication.INTRA); factory.create(startTimestampFilter.getOutputPort(), stopTimestampFilter.getInputPort());
pipe.connectPorts(startTimestampFilter.getOutputPort(), stopTimestampFilter.getInputPort()); factory.create(stopTimestampFilter.getOutputPort(), sink.getInputPort());
pipe = this.pipeFactory.create(ThreadCommunication.INTRA);
pipe.connectPorts(stopTimestampFilter.getOutputPort(), sink.getInputPort());
// TypeVariable<Class<ObjectProducer>>[] objectProducerTypeParameters = ObjectProducer.class.getTypeParameters(); // TypeVariable<Class<ObjectProducer>>[] objectProducerTypeParameters = ObjectProducer.class.getTypeParameters();
// for (TypeVariable<Class<ObjectProducer>> typeVariable : objectProducerTypeParameters) { // 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