Skip to content

Commit

Permalink
Use a separate directory to store registration information (#582)
Browse files Browse the repository at this point in the history
* Changing the log level to debug

* Use a separate directory to store registration information

* Fixing the spotless issue

---------

Co-authored-by: Sundaram Ananthanarayanan <[email protected]>
  • Loading branch information
sundargates and sundargates authored Nov 10, 2023
1 parent 8f5ad73 commit e5fad93
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ default String getTaskExecutorHostName() {
@Default("5")
int registrationRetryMaxAttempts();

@Config("mantis.taskexecutor.registration.store")
@DefaultNull
File getRegistrationStoreDir();

default Time getHeartbeatTimeout() {
return Time.milliseconds(heartbeatTimeoutMs());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,9 @@ public double getNetworkBandwidthInMB() {
public String taskExecutorAttributes() {
return this.taskExecutorAttributesStr;
}

@Override
public File getRegistrationStoreDir() {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import io.mantisrx.server.master.resourcecluster.TaskExecutorHeartbeat;
import io.mantisrx.server.master.resourcecluster.TaskExecutorRegistration;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import lombok.Getter;
import lombok.Setter;
Expand All @@ -51,7 +50,6 @@ class ResourceManagerGatewayCxn extends ExponentialBackoffAbstractScheduledServi
private volatile ResourceClusterGateway gateway;
private final Time heartBeatInterval;
private final Time heartBeatTimeout;
private final Time timeout = Time.of(1000, TimeUnit.MILLISECONDS);
private final long registrationRetryInitialDelayMillis;
private final double registrationRetryMultiplier;
private final double registrationRetryRandomizationFactor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ public TaskExecutor(

this.resourceManagerCxnIdx = 0;
this.taskFactory = taskFactory == null ? new SingleTaskOnlyFactory() : taskFactory;
this.registeredState = new DurableBooleanState(new File(workerConfiguration.getLocalStorageDir(), "rmCxnState.txt").getAbsolutePath());
this.registeredState = new DurableBooleanState(
new File(workerConfiguration.getRegistrationStoreDir(),
"rmCxnState.txt").getAbsolutePath());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public void setUp() throws IOException {
props.setProperty("mantis.zookeeper.root", "");

props.setProperty("mantis.taskexecutor.cluster.storage-dir", "");
props.setProperty("mantis.taskexecutor.blob-store.local-cache", tempFolder.newFolder().getAbsolutePath());
props.setProperty("mantis.taskexecutor.registration.store", tempFolder.newFolder().getAbsolutePath());
props.setProperty("mantis.taskexecutor.cluster-id", "default");
props.setProperty("mantis.taskexecutor.heartbeats.interval", "100");
props.setProperty("mantis.taskexecutor.metrics.collector", "io.mantisrx.server.agent.DummyMetricsCollector");
Expand Down

0 comments on commit e5fad93

Please sign in to comment.