From 1fc583f99db92717afded1230caac3ac74d89c46 Mon Sep 17 00:00:00 2001 From: Christian Wulf <chw@informatik.uni-kiel.de> Date: Fri, 4 Jul 2014 08:24:30 +0200 Subject: [PATCH] removed execute2() method from StageWithPort --- .../framework/core/AbstractStage.java | 26 ------------------- .../framework/core/ConsumerStage.java | 15 ----------- .../framework/core/Pipeline.java | 23 ---------------- .../framework/core/ProducerStage.java | 13 ---------- .../framework/core/StageWithPort.java | 3 --- .../methodcallWithPorts/stage/EndStage.java | 7 ----- 6 files changed, 87 deletions(-) diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/AbstractStage.java b/src/main/java/teetime/variant/methodcallWithPorts/framework/core/AbstractStage.java index 8c0584a..7e8e853 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/AbstractStage.java +++ b/src/main/java/teetime/variant/methodcallWithPorts/framework/core/AbstractStage.java @@ -37,32 +37,6 @@ public abstract class AbstractStage<I, O> implements StageWithPort<I, O> { return this.outputPort; } - @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; - return null; - } - protected void execute4(final CommittableQueue<I> elements) { throw new IllegalStateException(); // default implementation } diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/ConsumerStage.java b/src/main/java/teetime/variant/methodcallWithPorts/framework/core/ConsumerStage.java index 331e420..e43c0f4 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/ConsumerStage.java +++ b/src/main/java/teetime/variant/methodcallWithPorts/framework/core/ConsumerStage.java @@ -1,23 +1,8 @@ package teetime.variant.methodcallWithPorts.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 executeWithPorts() { // if (this.logger.isDebugEnabled()) { diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/Pipeline.java b/src/main/java/teetime/variant/methodcallWithPorts/framework/core/Pipeline.java index 4d066d5..2da5e52 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/Pipeline.java +++ b/src/main/java/teetime/variant/methodcallWithPorts/framework/core/Pipeline.java @@ -5,8 +5,6 @@ import java.util.LinkedList; import java.util.List; import java.util.UUID; -import teetime.util.list.CommittableQueue; - import kieker.common.logging.Log; import kieker.common.logging.LogFactory; @@ -58,27 +56,6 @@ public class Pipeline<I, O> implements StageWithPort<I, O> { this.lastStage = stage; } - @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) - CommittableQueue queue = elements; - - // for (int i = this.startIndex; i < this.stages.length; i++) { - // Stage<?, ?> stage = this.stages[i]; - // queue = stage.execute2(queue); - // } - - this.firstStage.execute2(elements); - this.setReschedulable(this.firstStage.isReschedulable()); - return queue; - } - @Override public void executeWithPorts() { // StageWithPort<?, ?> headStage = this.currentHeads.next(); diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/ProducerStage.java b/src/main/java/teetime/variant/methodcallWithPorts/framework/core/ProducerStage.java index 16dabc4..f960b56 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/ProducerStage.java +++ b/src/main/java/teetime/variant/methodcallWithPorts/framework/core/ProducerStage.java @@ -1,6 +1,5 @@ package teetime.variant.methodcallWithPorts.framework.core; -import teetime.util.list.CommittableQueue; public abstract class ProducerStage<I, O> extends AbstractStage<I, O> { @@ -8,18 +7,6 @@ public abstract class ProducerStage<I, O> extends AbstractStage<I, O> { 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 executeWithPorts() { this.execute5(null); diff --git a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/StageWithPort.java b/src/main/java/teetime/variant/methodcallWithPorts/framework/core/StageWithPort.java index 3503d3c..8cea382 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/framework/core/StageWithPort.java +++ b/src/main/java/teetime/variant/methodcallWithPorts/framework/core/StageWithPort.java @@ -1,6 +1,5 @@ package teetime.variant.methodcallWithPorts.framework.core; -import teetime.util.list.CommittableQueue; public interface StageWithPort<I, O> { @@ -10,8 +9,6 @@ public interface StageWithPort<I, O> { void executeWithPorts(); - CommittableQueue<O> execute2(CommittableQueue<I> elements); - StageWithPort<?, ?> getParentStage(); void setParentStage(StageWithPort<?, ?> parentStage, int index); diff --git a/src/main/java/teetime/variant/methodcallWithPorts/stage/EndStage.java b/src/main/java/teetime/variant/methodcallWithPorts/stage/EndStage.java index 41e4f9e..8019b0d 100644 --- a/src/main/java/teetime/variant/methodcallWithPorts/stage/EndStage.java +++ b/src/main/java/teetime/variant/methodcallWithPorts/stage/EndStage.java @@ -4,7 +4,6 @@ import java.util.LinkedList; import java.util.List; import teetime.util.ConstructorClosure; -import teetime.util.list.CommittableQueue; import teetime.variant.methodcallWithPorts.framework.core.InputPort; import teetime.variant.methodcallWithPorts.framework.core.OutputPort; import teetime.variant.methodcallWithPorts.framework.core.StageWithPort; @@ -22,12 +21,6 @@ public class EndStage<T> implements StageWithPort<T, T> { // do nothing } - @Override - public CommittableQueue<T> execute2(final CommittableQueue<T> elements) { - // TODO Auto-generated method stub - return null; - } - @Override public StageWithPort<?, ?> getParentStage() { // TODO Auto-generated method stub -- GitLab