Skip to content

Commit

Permalink
Re-arrange to match original order
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorgerhardt committed Nov 3, 2023
1 parent ee854e9 commit 21d6956
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public LocalBackendComponents () {
authentication = new LocalAuthentication();
// TODO add nested LocalWorkerComponents here, to reuse some components, and pass it into the LocalWorkerLauncher?
workerLauncher = new LocalWorkerLauncher(config, fileStorage, gtfsCache, osmCache);
broker = new Broker(config, eventBus, workerLauncher, fileStorage);
broker = new Broker(config, fileStorage, eventBus, workerLauncher);
censusExtractor = new SeamlessCensusGridExtractor(config);
// Instantiate the HttpControllers last, when all the components except the HttpApi are already created.
List<HttpController> httpControllers = standardHttpControllers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public interface Config {
private Config config;

// Component Dependencies
// Result assemblers return files that need to be permanently stored.
private final FileStorage fileStorage;
private final EventBus eventBus;
private final WorkerLauncher workerLauncher;

Expand Down Expand Up @@ -140,23 +142,18 @@ public interface Config {
*/
private static Map<String, MultiOriginAssembler> resultAssemblers = new HashMap<>();

/**
* Result assemblers return files that need to be permanently stored.
*/
private final FileStorage fileStorage;

/**
* keep track of which graphs we have launched workers on and how long ago we launched them, so
* that we don't re-request workers which have been requested.
*/
public TObjectLongMap<WorkerCategory> recentlyRequestedWorkers =
TCollections.synchronizedMap(new TObjectLongHashMap<>());

public Broker (Config config, EventBus eventBus, WorkerLauncher workerLauncher, FileStorage fileStorage) {
public Broker (Config config, FileStorage fileStorage, EventBus eventBus, WorkerLauncher workerLauncher) {
this.config = config;
this.fileStorage = fileStorage;
this.eventBus = eventBus;
this.workerLauncher = workerLauncher;
this.fileStorage = fileStorage;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public abstract class CsvResultWriter implements RegionalResultWriter {
* Construct a writer to record incoming results in a CSV file, with header row consisting of
* "origin", "destination", and the supplied indicator.
*/
public CsvResultWriter (RegionalTask task) {
CsvResultWriter (RegionalTask task) {
checkArgument(task.originPointSet != null, "CsvResultWriters require FreeFormPointSet origins.");
String[] columns = columnHeaders();
csvWriter = getBufferedCsvWriter(columns);
Expand Down

0 comments on commit 21d6956

Please sign in to comment.