(actor) Give process spawners more easily recognizable names.

This commit is contained in:
Viktor Lofgren 2023-10-16 14:19:00 +02:00
parent 39911e3acd
commit ede5d1f890
8 changed files with 46 additions and 21 deletions

View File

@ -4,17 +4,17 @@ public enum Actor {
CRAWL,
RECRAWL,
CONVERT_AND_LOAD,
CONVERTER_MONITOR,
LOADER_MONITOR,
CRAWLER_MONITOR,
MESSAGE_QUEUE_MONITOR,
PROCESS_LIVENESS_MONITOR,
FILE_STORAGE_MONITOR,
PROC_CONVERTER_SPAWNER,
PROC_LOADER_SPAWNER,
PROC_CRAWLER_SPAWNER,
MONITOR_MESSAGE_QUEUE,
MONITOR_PROCESS_LIVENESS,
MONITOR_FILE_STORAGE,
ADJACENCY_CALCULATION,
CRAWL_JOB_EXTRACTOR,
EXPORT_DATA,
TRUNCATE_LINK_DATABASE,
INDEX_CONSTRUCTOR_MONITOR,
PROC_INDEX_CONSTRUCTOR_SPAWNER,
CONVERT,
RESTORE_BACKUP;

View File

@ -5,6 +5,7 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import lombok.SneakyThrows;
import nu.marginalia.actor.monitor.*;
import nu.marginalia.actor.proc.*;
import nu.marginalia.actor.prototype.AbstractActorPrototype;
import nu.marginalia.actor.state.ActorStateInstance;
import nu.marginalia.actor.task.*;
@ -29,7 +30,6 @@ public class ActorControlService {
private final int node;
@Inject
public ActorControlService(MessageQueueFactory messageQueueFactory,
GsonFactory gsonFactory,
BaseServiceParams baseServiceParams,
ConvertActor convertActor,
ConvertAndLoadActor convertAndLoadActor,
@ -50,7 +50,7 @@ public class ActorControlService {
) {
this.messageQueueFactory = messageQueueFactory;
this.eventLog = baseServiceParams.eventLog;
this.gson = gsonFactory.get();
this.gson = GsonFactory.get();
this.node = baseServiceParams.configuration.node();
register(Actor.CRAWL, crawlActor);
@ -59,13 +59,14 @@ public class ActorControlService {
register(Actor.RESTORE_BACKUP, restoreBackupActor);
register(Actor.CONVERT_AND_LOAD, convertAndLoadActor);
register(Actor.INDEX_CONSTRUCTOR_MONITOR, indexConstructorMonitorActor);
register(Actor.CONVERTER_MONITOR, converterMonitorFSM);
register(Actor.LOADER_MONITOR, loaderMonitor);
register(Actor.CRAWLER_MONITOR, crawlerMonitorActor);
register(Actor.MESSAGE_QUEUE_MONITOR, messageQueueMonitor);
register(Actor.PROCESS_LIVENESS_MONITOR, processMonitorFSM);
register(Actor.FILE_STORAGE_MONITOR, fileStorageMonitorActor);
register(Actor.PROC_INDEX_CONSTRUCTOR_SPAWNER, indexConstructorMonitorActor);
register(Actor.PROC_CONVERTER_SPAWNER, converterMonitorFSM);
register(Actor.PROC_LOADER_SPAWNER, loaderMonitor);
register(Actor.PROC_CRAWLER_SPAWNER, crawlerMonitorActor);
register(Actor.MONITOR_MESSAGE_QUEUE, messageQueueMonitor);
register(Actor.MONITOR_PROCESS_LIVENESS, processMonitorFSM);
register(Actor.MONITOR_FILE_STORAGE, fileStorageMonitorActor);
register(Actor.ADJACENCY_CALCULATION, triggerAdjacencyCalculationActor);
register(Actor.CRAWL_JOB_EXTRACTOR, crawlJobExtractorActor);

View File

@ -1,8 +1,9 @@
package nu.marginalia.actor.monitor;
package nu.marginalia.actor.proc;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import nu.marginalia.actor.ActorStateFactory;
import nu.marginalia.actor.monitor.AbstractProcessSpawnerActor;
import nu.marginalia.control.process.ProcessService;
import nu.marginalia.mq.persistence.MqPersistence;
import nu.marginalia.mqapi.ProcessInboxNames;

View File

@ -1,8 +1,9 @@
package nu.marginalia.actor.monitor;
package nu.marginalia.actor.proc;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import nu.marginalia.actor.ActorStateFactory;
import nu.marginalia.actor.monitor.AbstractProcessSpawnerActor;
import nu.marginalia.control.process.ProcessService;
import nu.marginalia.mq.persistence.MqPersistence;
import nu.marginalia.mqapi.ProcessInboxNames;

View File

@ -1,8 +1,9 @@
package nu.marginalia.actor.monitor;
package nu.marginalia.actor.proc;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import nu.marginalia.actor.ActorStateFactory;
import nu.marginalia.actor.monitor.AbstractProcessSpawnerActor;
import nu.marginalia.control.process.ProcessService;
import nu.marginalia.mq.persistence.MqPersistence;
import nu.marginalia.mqapi.ProcessInboxNames;

View File

@ -1,8 +1,9 @@
package nu.marginalia.actor.monitor;
package nu.marginalia.actor.proc;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import nu.marginalia.actor.ActorStateFactory;
import nu.marginalia.actor.monitor.AbstractProcessSpawnerActor;
import nu.marginalia.control.process.ProcessService;
import nu.marginalia.mq.persistence.MqPersistence;
import nu.marginalia.mqapi.ProcessInboxNames;

View File

@ -1,4 +1,4 @@
package nu.marginalia.actor.monitor;
package nu.marginalia.actor.proc;
import com.google.inject.Inject;
import com.google.inject.Singleton;

View File

@ -37,6 +37,26 @@
{{> control/partials/actors-table }}
</div>
<div class="m-3 p-3 border bg-light">
<h3 class="my-3">Actors</h3>
<p>
Actors are programs that primarily run within the executor services that keep their state on the
<a href="/message-queue">message queue</a>.
</p>
<h4 class="my-3">Monitors</h4>
<em>MONITOR_</em> actors perform maintenance duties, clean up stale events and heartbeats,
that sort of thing, typically waking up once a minute or so to perform some task.
<h4 class="my-3">Process Spawners</h4>
<em>PROC_..._SPAWNER</em> actors launch and observe independent processes, such as the crawler or loader.
They eavesdrop on the message queue for message to their corresponding process, and when such a message is detected,
the process is launched. Turning off these actors will terminate the associated process and set their instructions
messages to status dead, ensuring they will not re-spawn automatically.
<h4 class="my-3">Programs</h4>
There are other actors that act to orchestrate processing flows in the system. They enable long-running tasks
such as crawling to survive a system shutdown or some form of error.
</p>
</div>
</div>
</body>