Skip to content

Commit

Permalink
Use dirty flagging execution variant.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gohla committed Feb 7, 2018
1 parent ee53b94 commit e877f3d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import kotlin.Unit;
import mb.pie.runtime.core.ExecException;
import mb.pie.runtime.core.FuncApp;
import mb.pie.runtime.core.exec.ExecutionVariant;
import mb.pie.runtime.core.exec.ObservingExecutor;
import mb.pie.runtime.core.impl.exec.ObservingExecutorImpl;
import mb.spoofax.runtime.pie.builder.SpoofaxPipeline;
Expand Down Expand Up @@ -40,7 +41,8 @@ public void exec(WorkspaceState workspaceState, List<PPath> changedPaths) {

private void init(SpoofaxPieState spoofaxPieState, WorkspaceState workspaceState, InfraState infraState) {
this.executor =
new ObservingExecutorImpl(infraState.store, infraState.cache, infraState.share, infraState.layer,
new ObservingExecutorImpl(infraState.store, infraState.cache, ExecutionVariant.Naive, infraState.share,
infraState.layer,
infraState.logger, spoofaxPieState.logger, infraState.funcs);
final PPath root = workspaceState.root;
try(final Stream<PPath> stream = root.list(PPaths.directoryPathMatcher())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import mb.log.Logger;
import mb.pie.runtime.core.ExecException;
import mb.pie.runtime.core.FuncApp;
import mb.pie.runtime.core.exec.ExecutionVariant;
import mb.pie.runtime.core.exec.ObservingExecutor;
import mb.spoofax.runtime.eclipse.SpoofaxPlugin;
import mb.spoofax.runtime.eclipse.editor.SpoofaxEditor;
Expand Down Expand Up @@ -58,7 +59,7 @@ public class ObservingPipelineAdapter implements PipelineAdapter {
this.eclipseRoot = ResourcesPlugin.getWorkspace().getRoot();
this.root = pathSrv.resolve(eclipseRoot);

this.executor = pieSrv.getObservingExecutor(root, SpoofaxPlugin.useInMemoryStore);
this.executor = pieSrv.getObservingExecutor(root, SpoofaxPlugin.useInMemoryStore, ExecutionVariant.DirtyFlagging);
}


Expand Down
6 changes: 3 additions & 3 deletions runtime/pie/src/main/kotlin/mb/spoofax/runtime/pie/Service.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import java.util.concurrent.ConcurrentHashMap
interface PieSrv {
fun getPullingExecutor(dir: PPath, useInMemoryStore: Boolean): PullingExecutor
fun getDirtyFlaggingExecutor(dir: PPath, useInMemoryStore: Boolean): DirtyFlaggingExecutor
fun getObservingExecutor(dir: PPath, useInMemoryStore: Boolean): ObservingExecutor
fun getObservingExecutor(dir: PPath, useInMemoryStore: Boolean, executionVariant: ExecutionVariant = ExecutionVariant.Naive): ObservingExecutor
}

class PieSrvImpl @Inject constructor(
Expand Down Expand Up @@ -49,11 +49,11 @@ class PieSrvImpl @Inject constructor(
}
}

override fun getObservingExecutor(dir: PPath, useInMemoryStore: Boolean): ObservingExecutor {
override fun getObservingExecutor(dir: PPath, useInMemoryStore: Boolean, executionVariant: ExecutionVariant): ObservingExecutor {
return observingExecutors.getOrPut(dir) {
val store = getStore(dir, useInMemoryStore)
val cache = getCache(dir)
observingExecutorFactory.create(store, cache)
observingExecutorFactory.create(store, cache, executionVariant)
}
}

Expand Down

0 comments on commit e877f3d

Please sign in to comment.