Skip to content

Commit

Permalink
LocalRuntime defaultMinimalTime
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Sokolov committed Feb 23, 2021
1 parent e444d54 commit 26de885
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ private Cluster(
int millisBetweenCommits,
SystemConfig.Acking acking,
boolean blinking,
int blinkPeriodSec
int blinkPeriodSec,
long defaultMinimalTime
) {
this.blinking = blinking;
this.blinkPeriodSec = blinkPeriodSec;
Expand All @@ -82,7 +83,6 @@ private Cluster(
ranges.put(id, new HashGroup(Collections.singleton(range)));
}
final ClusterConfig clusterConfig = new ClusterConfig(paths, "node-0");
final int defaultMinimalTime = 0;
final SystemConfig systemConfig =
new SystemConfig(
maxElementsInGraph,
Expand Down Expand Up @@ -169,7 +169,8 @@ static Props props(Graph g,
int millisBetweenCommits,
SystemConfig.Acking acking,
boolean blinking,
int blinkPeriodSec
int blinkPeriodSec,
long defaultMinimalTime
) {
return Props.create(
Cluster.class,
Expand All @@ -181,7 +182,8 @@ static Props props(Graph g,
millisBetweenCommits,
acking,
blinking,
blinkPeriodSec
blinkPeriodSec,
defaultMinimalTime
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class LocalRuntime implements FlameRuntime {
private final boolean barrierDisabled;
private final boolean blinking;
private final int blinkPeriodSec;
private final long defaultMinimalTime;

private LocalRuntime(
ActorSystem system,
Expand All @@ -40,6 +41,7 @@ private LocalRuntime(
int millisBetweenCommits,
boolean blinking,
int blinkPeriodSec,
long defaultMinimalTime,
SystemConfig.Acking acking,
StateStorage stateStorage
) {
Expand All @@ -50,6 +52,7 @@ private LocalRuntime(
this.millisBetweenCommits = millisBetweenCommits;
this.system = system;
this.blinkPeriodSec = blinkPeriodSec;
this.defaultMinimalTime = defaultMinimalTime;
this.acking = acking;
this.stateStorage = stateStorage;
}
Expand All @@ -70,7 +73,8 @@ public Flame run(Graph g) {
millisBetweenCommits,
acking,
blinking,
blinkPeriodSec
blinkPeriodSec,
defaultMinimalTime
),
"restarter"
);
Expand Down Expand Up @@ -122,6 +126,7 @@ public static class Builder {
private int blinkPeriodSec = 10;
private SystemConfig.Acking acking = SystemConfig.Acking.CENTRALIZED;
private StateStorage stateStorage = new InMemStateStorage();
private long defaultMinimalTime = 0;

@Nullable
private ActorSystem system = null;
Expand All @@ -147,6 +152,11 @@ public Builder blinkPeriodSec(int blinkPeriodSec) {
return this;
}

public Builder defaultMinimalTime(long defaultMinimalTime) {
this.defaultMinimalTime = defaultMinimalTime;
return this;
}

public Builder withStateStorage(StateStorage stateStorage) {
this.stateStorage = stateStorage;
return this;
Expand Down Expand Up @@ -184,6 +194,7 @@ public LocalRuntime build() {
millisBetweenCommits,
blinking,
blinkPeriodSec,
defaultMinimalTime,
acking,
stateStorage
);
Expand Down

0 comments on commit 26de885

Please # to comment.