Skip to content

Backend: Getting started

Daniel Tischner edited this page Sep 13, 2018 · 4 revisions
Table of Contents

Overview

For details on the API refer to REST APIs. Before being able to start the backend it must be compiled first, see Compiling.

After configuring the backend it can easily be started. The details are described in the following.

Setup

For setting up the backend the backend/res/ directory acts as entry point.

Before starting the backend it must be configured. The configuration itself is read from a backend/res/config.ini file, refer to Configuration for details.

All data to consider should be moved to the corresponding directories, as set in the configuration file. The default directories are

  • GTFS files - backend/res/input/gtfs/
  • OSM files - backend/res/input/osm/

The backend supports various compression formats. However, parsing from uncompressed files is faster.

Configuration of the logger is located at backend/res/logging/logConfig.xml. Refer to documentation of Logback. It must be adjusted if the logger driver is exchanged.

Starting

Starting the backend is simple. It supports three commands

  • start - Starts the default service which consists of several servers. Supports additional arguments:
    • List of paths to data files that should be considered. If not present all files in the directory set in the configuration file will be considered.
  • reduce - Reduces all input data such that the start command will run faster. Supports additional arguments:
    • List of paths to data files that should be reduced. If not present all files in the directory set in the configuration file will be reduced.
  • clean - Clears the database and all cached and serialized data
  • benchmark - Initializes the API and benchmarks the routing model. Supports additional arguments:
    • List of paths to data files that should be considered. If not present all files in the directory set in the configuration file will be considered.

If using large data-sets the reduce command should be used once. The start command is the default command used when no arguments are given.

Assuming ant jar was used (see Compiling) valid calls could look like

java -Xmx10g -jar .\cobwebBackend-1.2-standalone.jar
java -jar .\cobwebBackend-1.2-standalone.jar reduce
java -jar .\cobwebBackend-1.2-standalone.jar clean
java -jar .\cobwebBackend-1.2-standalone.jar reduce .\res\input\osm\freiburg-regbez-latest.osm
java -jar .\cobwebBackend-1.2-standalone.jar benchmark .\res\input\osm\freiburg-regbez-latest.osm .\res\input\gtfs\VAGFR.zip

After starting the backend will initialize several modules, including parsing relevant data files. This may take a while depending on the size of the data-sets. After that the server will be started and the REST-APIs are ready for use and accept clients.