Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.linkedin.openhouse.optimizer.scheduler;

import com.linkedin.openhouse.optimizer.model.OperationTypeDto;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
Expand All @@ -26,29 +24,27 @@
public class SchedulerApplication implements CommandLineRunner, ExitCodeGenerator {

private final SchedulerRunner runner;
private final Map<OperationTypeDto, BinPacker> binPackers;
private int exitCode = 0;

@Autowired
public SchedulerApplication(SchedulerRunner runner, Map<OperationTypeDto, BinPacker> binPackers) {
public SchedulerApplication(SchedulerRunner runner) {
this.runner = runner;
this.binPackers = binPackers;
}

public static void main(String[] args) {
System.exit(SpringApplication.exit(SpringApplication.run(SchedulerApplication.class, args)));
}

/**
* Runs the scheduler once per registered {@link BinPacker} per process invocation. Each call is
* scoped to one operation type. Any thrown exception is logged and surfaces as a non-zero exit
* code via {@link #getExitCode()} after the context is shut down cleanly.
* Runs the scheduler once per registered operation type per process invocation. Any thrown
* exception is logged and surfaces as a non-zero exit code via {@link #getExitCode()} after the
* context is shut down cleanly.
*/
@Override
public void run(String... args) {
try {
log.info("Scheduler starting; operation types: {}", binPackers.keySet());
binPackers.keySet().forEach(runner::schedule);
log.info("Scheduler starting; operation types: {}", runner.getRegisteredOperationTypes());
runner.getRegisteredOperationTypes().forEach(runner::schedule);
log.info("Scheduler completed successfully");
} catch (Exception e) {
log.error("Scheduler failed", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ spring.datasource.username=${OPTIMIZER_DB_USER:sa}
spring.datasource.password=${OPTIMIZER_DB_PASSWORD:}
spring.jpa.hibernate.ddl-auto=none
optimizer.scheduler.jobs.base-uri=${JOBS_BASE_URI:http://localhost:8002}
# Per-bin caps for ORPHAN_FILES_DELETION; 0 disables a dimension. File count is the OFD cost
# driver — per-file list, manifest joins, and delete calls dominate, independent of file size.
optimizer.scheduler.ofd.max-files-per-bin=${SCHEDULER_OFD_MAX_FILES_PER_BIN:1000000}
optimizer.scheduler.ofd.max-tables-per-bin=${SCHEDULER_OFD_MAX_TABLES_PER_BIN:50}
optimizer.scheduler.results-endpoint=${SCHEDULER_RESULTS_ENDPOINT:http://openhouse-optimizer:8080/v1/optimizer/operations}
optimizer.scheduler.cluster-id=${SCHEDULER_CLUSTER_ID:LocalHadoopCluster}

This file was deleted.

This file was deleted.

This file was deleted.

Loading