diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/GlueJobRunTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/GlueJobRunTest.java
new file mode 100644
index 0000000000..8276f28679
--- /dev/null
+++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/GlueJobRunTest.java
@@ -0,0 +1,108 @@
+package com.floci.test;
+
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+import software.amazon.awssdk.services.glue.GlueClient;
+import software.amazon.awssdk.services.glue.model.BatchGetJobsResponse;
+import software.amazon.awssdk.services.glue.model.BatchStopJobRunResponse;
+import software.amazon.awssdk.services.glue.model.EntityNotFoundException;
+import software.amazon.awssdk.services.glue.model.JobRun;
+import software.amazon.awssdk.services.glue.model.JobRunState;
+import software.amazon.awssdk.services.glue.model.WorkerType;
+
+import java.util.Map;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+@DisplayName("Glue job runs")
+class GlueJobRunTest {
+
+ private static final String JOB_NAME = TestFixtures.uniqueName("run_job");
+ private static final String ROLE = "arn:aws:iam::000000000000:role/glue";
+
+ private static GlueClient glue;
+
+ @BeforeAll
+ static void setup() {
+ glue = TestFixtures.glueClient();
+ glue.createJob(r -> r
+ .name(JOB_NAME)
+ .role(ROLE)
+ .command(c -> c.name("glueetl").scriptLocation("s3://scripts/etl.py"))
+ .workerType(WorkerType.G_1_X)
+ .numberOfWorkers(2)
+ .tags(Map.of("team", "data")));
+ }
+
+ @AfterAll
+ static void cleanup() {
+ if (glue == null) {
+ return;
+ }
+ try {
+ glue.deleteJob(r -> r.jobName(JOB_NAME));
+ }
+ catch (Exception ignored) {
+ // Cleanup is best effort: the job name is unique to this run and the emulator is disposable.
+ }
+ glue.close();
+ }
+
+ @Test
+ @DisplayName("StartJobRun, GetJobRun and GetJobRuns parse with the SDK")
+ void startAndReadARun() {
+ String runId = glue.startJobRun(r -> r
+ .jobName(JOB_NAME)
+ .arguments(Map.of("--day", "2026-09-25"))
+ .numberOfWorkers(4)).jobRunId();
+
+ assertThat(runId).matches("jr_[0-9a-f]{64}");
+
+ JobRun run = glue.getJobRun(r -> r.jobName(JOB_NAME).runId(runId)).jobRun();
+ assertThat(run.id()).isEqualTo(runId);
+ assertThat(run.jobName()).isEqualTo(JOB_NAME);
+ assertThat(run.jobRunState()).isEqualTo(JobRunState.SUCCEEDED);
+ assertThat(run.arguments()).containsEntry("--day", "2026-09-25");
+ assertThat(run.workerType()).isEqualTo(WorkerType.G_1_X);
+ assertThat(run.numberOfWorkers()).isEqualTo(4);
+ assertThat(run.startedOn()).isNotNull();
+ assertThat(run.completedOn()).isNotNull();
+
+ assertThat(glue.getJobRuns(r -> r.jobName(JOB_NAME)).jobRuns())
+ .extracting(JobRun::id)
+ .contains(runId);
+ }
+
+ @Test
+ @DisplayName("BatchStopJobRun reports a finished run under Errors")
+ void stopAFinishedRun() {
+ String runId = glue.startJobRun(r -> r.jobName(JOB_NAME)).jobRunId();
+
+ BatchStopJobRunResponse response = glue.batchStopJobRun(r -> r.jobName(JOB_NAME).jobRunIds(runId));
+
+ assertThat(response.successfulSubmissions()).isEmpty();
+ assertThat(response.errors()).hasSize(1);
+ assertThat(response.errors().get(0).jobRunId()).isEqualTo(runId);
+ assertThat(response.errors().get(0).errorDetail().errorCode()).isEqualTo("InvalidInputException");
+ }
+
+ @Test
+ @DisplayName("ListJobs filters on tags and BatchGetJobs reports missing names")
+ void listAndBatchGetJobs() {
+ assertThat(glue.listJobs(r -> r.tags(Map.of("team", "data"))).jobNames()).contains(JOB_NAME);
+
+ BatchGetJobsResponse response = glue.batchGetJobs(r -> r.jobNames(JOB_NAME, "absent_job"));
+ assertThat(response.jobs()).extracting(job -> job.name()).containsExactly(JOB_NAME);
+ assertThat(response.jobsNotFound()).containsExactly("absent_job");
+ }
+
+ @Test
+ @DisplayName("GetJobRun on an unknown run is EntityNotFoundException")
+ void unknownRun() {
+ assertThatThrownBy(() -> glue.getJobRun(r -> r.jobName(JOB_NAME).runId("jr_missing")))
+ .isInstanceOf(EntityNotFoundException.class);
+ }
+}
diff --git a/docs/services/glue.md b/docs/services/glue.md
index 4cf4b50c78..9c49f183e9 100644
--- a/docs/services/glue.md
+++ b/docs/services/glue.md
@@ -140,8 +140,23 @@ retroactively.
| CreateJob | Creates a new job definition. |
| GetJob | Retrieves an existing job definition. |
| GetJobs | Retrieves all current job definitions. |
+| ListJobs | Lists job names, optionally only those carrying every given tag. |
+| BatchGetJobs | Retrieves several job definitions by name and reports the names not found. |
| UpdateJob | Updates an existing job definition. |
-| DeleteJob | Deletes a specified job definition. |
+| DeleteJob | Deletes a specified job definition and its runs. |
+| StartJobRun | Starts a run of a job, with per-run arguments and capacity overrides. |
+| GetJobRun | Retrieves one run of a job. |
+| GetJobRuns | Lists a job's runs, newest first. |
+| BatchStopJobRun | Stops running runs of a job and reports the rest in `Errors`. |
+
+Job runs do not execute the job's script. A run follows Glue's state machine and response shape: it
+takes the job's worker type, worker count, timeout and Glue version unless the request overrides them,
+and `MaxConcurrentRuns` (1 when unset) rejects a start with `ConcurrentRunsExceededException` unless
+`JobRunQueuingEnabled` is set. With the default `job-run-duration-seconds` of 0 a run is `SUCCEEDED` as
+soon as it starts. A positive value keeps each run `RUNNING` for that many seconds, so a test can observe
+`BatchStopJobRun` (the run ends `STOPPED`) and the concurrency limit; a run whose duration exceeds the job
+timeout ends `TIMEOUT` when the timeout is reached. Queued runs are admitted straight away rather than
+waiting in `WAITING`.
#### Crawlers
@@ -215,6 +230,7 @@ Supported schema formats are `AVRO`, `JSON`, and `PROTOBUF`. Compatibility modes
| Variable | Default | Description |
|---|---|---|
| `FLOCI_SERVICES_GLUE_ENABLED` | `true` | Enable or disable the service |
+| `FLOCI_SERVICES_GLUE_JOB_RUN_DURATION_SECONDS` | `0` | Seconds a job run stays `RUNNING` before it succeeds; `0` finishes it as soon as it starts |
## Integration with Athena
diff --git a/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java b/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java
index 0856df3f9f..d2842ea2d7 100644
--- a/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java
+++ b/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java
@@ -1957,6 +1957,10 @@ public interface EmulatorConfig {
interface GlueServiceConfig {
@WithDefault("true")
boolean enabled();
+
+ /** How long a job run stays RUNNING before it succeeds; 0 = a run succeeds as soon as it starts. */
+ @WithDefault("0")
+ int jobRunDurationSeconds();
}
interface SesServiceConfig {
diff --git a/src/main/java/io/github/hectorvent/floci/services/glue/GlueJobRunService.java b/src/main/java/io/github/hectorvent/floci/services/glue/GlueJobRunService.java
new file mode 100644
index 0000000000..f08df58860
--- /dev/null
+++ b/src/main/java/io/github/hectorvent/floci/services/glue/GlueJobRunService.java
@@ -0,0 +1,264 @@
+package io.github.hectorvent.floci.services.glue;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import io.github.hectorvent.floci.config.EmulatorConfig;
+import io.github.hectorvent.floci.core.common.AwsException;
+import io.github.hectorvent.floci.core.storage.StorageBackend;
+import io.github.hectorvent.floci.core.storage.StorageFactory;
+import io.github.hectorvent.floci.services.glue.model.ExecutionProperty;
+import io.github.hectorvent.floci.services.glue.model.Job;
+import io.github.hectorvent.floci.services.glue.model.JobRun;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Inject;
+import org.jboss.logging.Logger;
+
+import java.time.Clock;
+import java.time.Duration;
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+
+/**
+ * Glue job runs. No script executes: a run follows Glue's state machine and its response shape,
+ * and settles lazily when read. With the default {@code job-run-duration-seconds} of 0 a run is
+ * SUCCEEDED as soon as it starts; a positive duration keeps it RUNNING until that much time has
+ * passed, which is what makes BatchStopJobRun and MaxConcurrentRuns observable.
+ *
+ *
Every public method is synchronized: the store has no atomic compare and set, so admitting a
+ * run (count the live runs, check the limit, write the run), stopping one, settling one and
+ * removing a deleted job's runs must not interleave.
+ */
+@ApplicationScoped
+public class GlueJobRunService {
+
+ private static final Logger LOG = Logger.getLogger(GlueJobRunService.class);
+
+ static final String STATE_RUNNING = "RUNNING";
+ static final String STATE_SUCCEEDED = "SUCCEEDED";
+ static final String STATE_STOPPED = "STOPPED";
+ static final String STATE_TIMEOUT = "TIMEOUT";
+
+ private static final Set TERMINAL_STATES =
+ Set.of(STATE_SUCCEEDED, STATE_STOPPED, "FAILED", STATE_TIMEOUT, "ERROR", "EXPIRED");
+
+ // ExecutionProperty.MaxConcurrentRuns defaults to 1 when a job does not set it.
+ private static final int DEFAULT_MAX_CONCURRENT_RUNS = 1;
+ private static final int MAX_JOB_RUNS_PAGE_SIZE = 200;
+ private static final String LOG_GROUP_NAME = "/aws-glue/jobs";
+
+ private final StorageBackend runStore;
+ private final GlueService glueService;
+ private final int runDurationSeconds;
+ private final Clock clock;
+
+ @Inject
+ public GlueJobRunService(StorageFactory storageFactory, GlueService glueService, EmulatorConfig config) {
+ this(storageFactory.create("glue", "job_runs.json", new TypeReference<>() {}),
+ glueService, config.services().glue().jobRunDurationSeconds(), Clock.systemUTC());
+ }
+
+ GlueJobRunService(StorageBackend runStore, GlueService glueService,
+ int runDurationSeconds, Clock clock) {
+ if (runDurationSeconds < 0) {
+ throw new IllegalArgumentException(
+ "floci.services.glue.job-run-duration-seconds must not be negative: " + runDurationSeconds);
+ }
+ this.runStore = runStore;
+ this.glueService = glueService;
+ this.runDurationSeconds = runDurationSeconds;
+ this.clock = clock;
+ }
+
+ /**
+ * Starts a run of {@code jobName}. {@code overrides} carries the per-run request fields
+ * (Arguments, Timeout, WorkerType, NumberOfWorkers, MaxCapacity, AllocatedCapacity,
+ * SecurityConfiguration, NotificationProperty, ExecutionClass, JobRunQueuingEnabled); an
+ * unset field falls back to the job definition.
+ */
+ public synchronized JobRun startJobRun(String jobName, String previousRunId, JobRun overrides) {
+ Job job = glueService.getJob(jobName);
+ // The job's own Timeout is stored as given by CreateJob/UpdateJob, so check what the run inherits.
+ Integer timeout = firstNonNull(overrides.getTimeout(), job.getTimeout());
+ if (timeout != null && timeout < 1) {
+ throw new AwsException("InvalidInputException", "Timeout must be at least 1 minute.", 400);
+ }
+ if (previousRunId != null) {
+ findRun(jobName, previousRunId);
+ }
+
+ boolean queuingEnabled = Boolean.TRUE.equals(firstNonNull(
+ overrides.getJobRunQueuingEnabled(), job.getJobRunQueuingEnabled()));
+ long active = runsOf(jobName).stream().filter(run -> !isTerminal(settle(run))).count();
+ if (!queuingEnabled && active >= maxConcurrentRuns(job)) {
+ throw new AwsException("ConcurrentRunsExceededException",
+ "Concurrent runs exceeded for " + jobName, 400);
+ }
+
+ Instant now = clock.instant();
+ JobRun run = new JobRun();
+ run.setId(newRunId());
+ run.setAttempt(0);
+ run.setPreviousRunId(previousRunId);
+ run.setJobName(job.getName());
+ run.setJobMode(job.getJobMode());
+ run.setJobRunQueuingEnabled(queuingEnabled);
+ run.setStartedOn(now);
+ run.setLastModifiedOn(now);
+ run.setJobRunState(STATE_RUNNING);
+ run.setArguments(overrides.getArguments());
+ run.setAllocatedCapacity(firstNonNull(overrides.getAllocatedCapacity(), job.getAllocatedCapacity()));
+ run.setTimeout(timeout);
+ run.setMaxCapacity(firstNonNull(overrides.getMaxCapacity(), job.getMaxCapacity()));
+ run.setWorkerType(firstNonNull(overrides.getWorkerType(), job.getWorkerType()));
+ run.setNumberOfWorkers(firstNonNull(overrides.getNumberOfWorkers(), job.getNumberOfWorkers()));
+ run.setSecurityConfiguration(
+ firstNonNull(overrides.getSecurityConfiguration(), job.getSecurityConfiguration()));
+ run.setNotificationProperty(
+ firstNonNull(overrides.getNotificationProperty(), job.getNotificationProperty()));
+ run.setExecutionClass(firstNonNull(overrides.getExecutionClass(), job.getExecutionClass()));
+ run.setGlueVersion(job.getGlueVersion());
+ run.setLogGroupName(LOG_GROUP_NAME);
+ run.setExecutionTime(0);
+ runStore.put(run.getId(), run);
+ LOG.infov("Started Glue job run {0} for job {1}", run.getId(), jobName);
+ return settle(run);
+ }
+
+ public synchronized JobRun getJobRun(String jobName, String runId) {
+ glueService.getJob(jobName);
+ if (runId == null) {
+ throw new AwsException("InvalidInputException", "RunId is required.", 400);
+ }
+ return settle(findRun(jobName, runId));
+ }
+
+ public synchronized GlueService.Page getJobRuns(String jobName, Integer maxResults,
+ String nextToken) {
+ glueService.getJob(jobName);
+ if (maxResults != null && (maxResults < 1 || maxResults > MAX_JOB_RUNS_PAGE_SIZE)) {
+ throw new AwsException("InvalidInputException",
+ "MaxResults must be between 1 and " + MAX_JOB_RUNS_PAGE_SIZE, 400);
+ }
+ List runs = new ArrayList<>();
+ for (JobRun run : runsOf(jobName)) {
+ runs.add(settle(run));
+ }
+ runs.sort(Comparator.comparing(JobRun::getStartedOn).reversed().thenComparing(JobRun::getId));
+ return glueService.paginate(runs, maxResults, nextToken);
+ }
+
+ public synchronized StopResult batchStopJobRun(String jobName, List runIds) {
+ if (jobName == null) {
+ throw new AwsException("InvalidInputException", "JobName is required.", 400);
+ }
+ if (runIds == null || runIds.isEmpty()) {
+ throw new AwsException("InvalidInputException", "JobRunIds is required.", 400);
+ }
+ List stopped = new ArrayList<>();
+ List errors = new ArrayList<>();
+ for (String runId : runIds) {
+ JobRun run = runStore.get(runId)
+ .filter(candidate -> jobName.equals(candidate.getJobName()))
+ .orElse(null);
+ if (run == null) {
+ errors.add(new StopError(jobName, runId, "EntityNotFoundException",
+ "Job run " + runId + " not found for job " + jobName));
+ continue;
+ }
+ settle(run);
+ if (isTerminal(run)) {
+ errors.add(new StopError(jobName, runId, "InvalidInputException",
+ "Job run " + runId + " is not running; its state is " + run.getJobRunState()));
+ continue;
+ }
+ complete(run, STATE_STOPPED, clock.instant(), null);
+ stopped.add(new StoppedRun(jobName, runId));
+ }
+ return new StopResult(stopped, errors);
+ }
+
+ /** Runs belong to their job: deleting the job removes them, as it does on AWS. */
+ public synchronized void deleteRuns(String jobName) {
+ for (JobRun run : runsOf(jobName)) {
+ runStore.delete(run.getId());
+ }
+ }
+
+ private JobRun settle(JobRun run) {
+ if (isTerminal(run)) {
+ return run;
+ }
+ Instant startedOn = run.getStartedOn();
+ long timeoutSeconds = run.getTimeout() == null ? Long.MAX_VALUE : run.getTimeout() * 60L;
+ if (runDurationSeconds >= timeoutSeconds) {
+ Instant timedOutAt = startedOn.plusSeconds(timeoutSeconds);
+ if (!clock.instant().isBefore(timedOutAt)) {
+ complete(run, STATE_TIMEOUT, timedOutAt,
+ "Job run exceeded the timeout of " + run.getTimeout() + " minutes");
+ }
+ return run;
+ }
+ Instant finishedAt = startedOn.plusSeconds(runDurationSeconds);
+ if (!clock.instant().isBefore(finishedAt)) {
+ complete(run, STATE_SUCCEEDED, finishedAt, null);
+ }
+ return run;
+ }
+
+ private void complete(JobRun run, String state, Instant completedOn, String errorMessage) {
+ run.setJobRunState(state);
+ run.setCompletedOn(completedOn);
+ run.setLastModifiedOn(completedOn);
+ run.setExecutionTime((int) Duration.between(run.getStartedOn(), completedOn).toSeconds());
+ run.setErrorMessage(errorMessage);
+ runStore.put(run.getId(), run);
+ }
+
+ private JobRun findRun(String jobName, String runId) {
+ return runStore.get(runId)
+ .filter(run -> jobName.equals(run.getJobName()))
+ .orElseThrow(() -> new AwsException("EntityNotFoundException",
+ "Job run " + runId + " not found for job " + jobName, 400));
+ }
+
+ private List runsOf(String jobName) {
+ List runs = new ArrayList<>();
+ for (JobRun run : runStore.scan(key -> true)) {
+ if (jobName.equals(run.getJobName())) {
+ runs.add(run);
+ }
+ }
+ return runs;
+ }
+
+ private static boolean isTerminal(JobRun run) {
+ return TERMINAL_STATES.contains(run.getJobRunState());
+ }
+
+ private static int maxConcurrentRuns(Job job) {
+ ExecutionProperty property = job.getExecutionProperty();
+ if (property == null || property.getMaxConcurrentRuns() == null) {
+ return DEFAULT_MAX_CONCURRENT_RUNS;
+ }
+ return property.getMaxConcurrentRuns();
+ }
+
+ // Glue job run ids are "jr_" followed by 64 hex characters.
+ private static String newRunId() {
+ return "jr_" + UUID.randomUUID().toString().replace("-", "")
+ + UUID.randomUUID().toString().replace("-", "");
+ }
+
+ private static T firstNonNull(T preferred, T fallback) {
+ return preferred != null ? preferred : fallback;
+ }
+
+ public record StoppedRun(String jobName, String jobRunId) {}
+
+ public record StopError(String jobName, String jobRunId, String errorCode, String errorMessage) {}
+
+ public record StopResult(List stopped, List errors) {}
+}
diff --git a/src/main/java/io/github/hectorvent/floci/services/glue/GlueJsonHandler.java b/src/main/java/io/github/hectorvent/floci/services/glue/GlueJsonHandler.java
index 7adc50be74..670b124714 100644
--- a/src/main/java/io/github/hectorvent/floci/services/glue/GlueJsonHandler.java
+++ b/src/main/java/io/github/hectorvent/floci/services/glue/GlueJsonHandler.java
@@ -31,14 +31,17 @@ public class GlueJsonHandler {
private static final TypeReference> PARTITION_LIST = new TypeReference<>() {};
private final GlueService glueService;
+ private final GlueJobRunService jobRunService;
private final GlueSchemaRegistryService schemaRegistryService;
private final ObjectMapper mapper;
@Inject
public GlueJsonHandler(GlueService glueService,
+ GlueJobRunService jobRunService,
GlueSchemaRegistryService schemaRegistryService,
ObjectMapper mapper) {
this.glueService = glueService;
+ this.jobRunService = jobRunService;
this.schemaRegistryService = schemaRegistryService;
this.mapper = mapper;
}
@@ -233,9 +236,43 @@ public class GlueJsonHandler {
}
case "DeleteJob" -> {
DeleteJobRequest req = mapper.treeToValue(request, DeleteJobRequest.class);
+ // Job first, runs second: a StartJobRun that checked the job before it was deleted has
+ // stored its run by the time deleteRuns takes the run service's lock.
glueService.deleteJob(req.getJobName(), region);
+ jobRunService.deleteRuns(req.getJobName());
yield Response.ok(new DeleteJobResponse(req.getJobName())).build();
}
+ case "ListJobs" -> {
+ Map tags = request.hasNonNull("Tags")
+ ? mapper.convertValue(request.get("Tags"), STRING_MAP)
+ : null;
+ GlueService.Page page = glueService.listJobs(
+ readMaxResults(request), readNextToken(request), tags, region);
+ yield Response.ok(pageResponse("JobNames", page.items(), page.nextToken())).build();
+ }
+ case "BatchGetJobs" -> {
+ List names = request.hasNonNull("JobNames")
+ ? mapper.convertValue(request.get("JobNames"), STRING_LIST)
+ : null;
+ GlueService.BatchGetJobsResult result = glueService.batchGetJobs(names);
+ Map response = new LinkedHashMap<>();
+ response.put("Jobs", result.jobs());
+ response.put("JobsNotFound", result.jobsNotFound());
+ yield Response.ok(response).build();
+ }
+ case "StartJobRun" -> {
+ JobRun run = jobRunService.startJobRun(request.path("JobName").asText(null),
+ request.path("JobRunId").asText(null), jobRunOverrides(request));
+ yield Response.ok(Map.of("JobRunId", run.getId())).build();
+ }
+ case "GetJobRun" -> Response.ok(Map.of("JobRun", jobRunService.getJobRun(
+ request.path("JobName").asText(null), request.path("RunId").asText(null)))).build();
+ case "GetJobRuns" -> {
+ GlueService.Page page = jobRunService.getJobRuns(
+ request.path("JobName").asText(null), readMaxResults(request), readNextToken(request));
+ yield Response.ok(pageResponse("JobRuns", page.items(), page.nextToken())).build();
+ }
+ case "BatchStopJobRun" -> handleBatchStopJobRun(request);
case "CreateClassifier" -> {
Classifier classifier = mapper.treeToValue(request, Classifier.class);
glueService.createClassifier(classifier);
@@ -971,6 +1008,72 @@ public class GlueJsonHandler {
return Response.ok(Map.of()).build();
}
+ private JobRun jobRunOverrides(JsonNode request) throws Exception {
+ JobRun overrides = new JobRun();
+ if (request.hasNonNull("Arguments")) {
+ overrides.setArguments(mapper.convertValue(request.get("Arguments"), STRING_MAP));
+ }
+ if (request.hasNonNull("AllocatedCapacity")) {
+ overrides.setAllocatedCapacity(request.get("AllocatedCapacity").asInt());
+ }
+ if (request.hasNonNull("Timeout")) {
+ overrides.setTimeout(request.get("Timeout").asInt());
+ }
+ if (request.hasNonNull("MaxCapacity")) {
+ overrides.setMaxCapacity(request.get("MaxCapacity").asDouble());
+ }
+ if (request.hasNonNull("WorkerType")) {
+ overrides.setWorkerType(request.get("WorkerType").asText());
+ }
+ if (request.hasNonNull("NumberOfWorkers")) {
+ overrides.setNumberOfWorkers(request.get("NumberOfWorkers").asInt());
+ }
+ if (request.hasNonNull("SecurityConfiguration")) {
+ overrides.setSecurityConfiguration(request.get("SecurityConfiguration").asText());
+ }
+ if (request.hasNonNull("NotificationProperty")) {
+ overrides.setNotificationProperty(
+ mapper.treeToValue(request.get("NotificationProperty"), NotificationProperty.class));
+ }
+ if (request.hasNonNull("ExecutionClass")) {
+ overrides.setExecutionClass(request.get("ExecutionClass").asText());
+ }
+ if (request.hasNonNull("JobRunQueuingEnabled")) {
+ overrides.setJobRunQueuingEnabled(request.get("JobRunQueuingEnabled").asBoolean());
+ }
+ return overrides;
+ }
+
+ private Response handleBatchStopJobRun(JsonNode request) {
+ List runIds = request.hasNonNull("JobRunIds")
+ ? mapper.convertValue(request.get("JobRunIds"), STRING_LIST)
+ : null;
+ GlueJobRunService.StopResult result =
+ jobRunService.batchStopJobRun(request.path("JobName").asText(null), runIds);
+ List