From 9591c72242eb8a8868584a82bc9850307596ae96 Mon Sep 17 00:00:00 2001 From: Nikolaus Krismer <nikolaus.krismer@uibk.ac.at> Date: Wed, 6 Aug 2014 12:45:15 +0200 Subject: [PATCH] upgrading to postgresql-9.4 beta moving jackson annotations completely to isochrone-web project --- build.gradle | 7 ++- etc/vagrant/bootstrap.sh | 57 +++++++++++-------- .../inf/isochrone/config/ConfigDataset.java | 23 -------- .../it/unibz/inf/isochrone/db/TableEntry.java | 7 --- .../it/unibz/inf/isochrone/util/Point.java | 4 -- .../isochrone/network/AlgorithmHelper.java | 4 ++ src/test/resources/config-test.xml | 6 -- 7 files changed, 41 insertions(+), 67 deletions(-) delete mode 100644 src/test/resources/config-test.xml diff --git a/build.gradle b/build.gradle index 174cffe3..b21bd883 100644 --- a/build.gradle +++ b/build.gradle @@ -49,6 +49,7 @@ ext { isRelease = false versionFindbugs = '+' versionJacoco = '+' + versionPostgresql = '9.4+' } if (!version.matches(~/[0-9\.]*(-SNAPSHOT)?/)) { @@ -110,6 +111,7 @@ def getDate() { repositories { mavenCentral() + flatDir{ dirs 'lib'} } buildscript { @@ -128,11 +130,10 @@ buildscript { } dependencies { - compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.+' compile group: 'com.google.code.findbugs', name: 'annotations', version: versionFindbugs compile group: 'com.jolbox', name: 'bonecp', version: '+' - compile group: 'com.tngtech.java', name: 'config-builder', version: '1.+' - compile group: 'org.postgresql', name: 'postgresql', version: '9.2-1004-jdbc41' + compile group: 'com.tngtech.java', name: 'config-builder', version: '+' + compile group: 'org.postgresql', name: 'postgresql', version: versionPostgresql runtime 'org.slf4j:jcl-over-slf4j:1+' runtime 'ch.qos.logback:logback-classic:1+' diff --git a/etc/vagrant/bootstrap.sh b/etc/vagrant/bootstrap.sh index 40a62048..dc7ab5bb 100644 --- a/etc/vagrant/bootstrap.sh +++ b/etc/vagrant/bootstrap.sh @@ -150,18 +150,21 @@ OSMOSIS_DOWNLOAD_URL="http://bretth.dev.openstreetmap.org/osmosis-build/$OSMOSIS POSTGIS_GIT_URL="https://github.com/postgis/postgis.git" POSTGIS_VERSION="auto" # activate to install from repository #POSTGIS_VERSION="2.1.3" # activate to install from source -POSTGRESQL_DATA_DIR="/var/lib/pgsql/9.3/data" +POSTGRESQL_VERSION="9.4" +POSTGRESQL_SHORT_VERSION="94" +POSTGRESQL_DATA_DIR="/var/lib/pgsql/$POSTGRESQL_VERSION/data" POSTGRESQL_HBA_CONF="$POSTGRESQL_DATA_DIR/pg_hba.conf" -POSTGRESQL_PKG_NAME="postgresql93" -POSTGRESQL_SERVICE_NAME="postgresql-9.3" +POSTGRESQL_PKG_NAME="postgresql$POSTGRESQL_SHORT_VERSION" +POSTGRESQL_SERVICE_NAME="postgresql-$POSTGRESQL_VERSION" PGROUTING_GIT_URL="https://github.com/pgRouting/pgrouting.git" PGROUTING_VERSION="auto" # activate to install from repository #PGROUTING_VERSION="2.0.0" # activate to install from source REPO_CONFIG="/etc/yum.repos.d/fedora-updates.repo" +REPO_ELGIS="http://elgis.argeo.org/repos/6/elgis-release-6-6_0.noarch.rpm" REPO_EPEL="http://fedora.aau.at/epel/6/i386/epel-release-6-8.noarch.rpm" REPO_POSTGRESQL="" # will be set later (depending on architecture) -REPO_POSTGRESQL_32="http://yum.postgresql.org/9.3/fedora/fedora-20-i386/pgdg-fedora93-9.3-1.noarch.rpm" -REPO_POSTGRESQL_64="http://yum.postgresql.org/9.3/fedora/fedora-20-x86_64/pgdg-fedora93-9.3-1.noarch.rpm" +REPO_POSTGRESQL_32="http://yum.postgresql.org/9.4/fedora/fedora-20-i686/pgdg-fedora94-9.4-1.noarch.rpm" +REPO_POSTGRESQL_64="http://yum.postgresql.org/9.4/fedora/fedora-20-x86_64/pgdg-fedora94-9.4-1.noarch.rpm" REPO_RPMFORGE="" # will be set later (depending on architecture) REPO_RPMFORGE_32="http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm" REPO_RPMFORGE_64="http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm" @@ -223,6 +226,11 @@ fi # OS check & configuration # ############################ +IS_64_BIT=false +if [ "x86_64" == $(uname -m) ]; then + IS_64_BIT=true +fi + DISTRI_FILE="/etc/redhat-release" if [ ! -f "$DISTRI_FILE" ]; then DISTRI_FILE="/etc/issue" @@ -235,34 +243,27 @@ if [ "$DISTRI" == "CentOS" ]; then REPO_CONFIG="/etc/yum.repos.d/CentOS-Base.repo" if printf "$DISTRI_NAME" | egrep -q " 6." ; then DISTRI_TYPE="CentOS 6" - REPO_POSTGRESQL_32="http://yum.postgresql.org/9.3/redhat/rhel-6-i386/pgdg-centos93-9.3-1.noarch.rpm" - REPO_POSTGRESQL_64="http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm" + REPO_POSTGRESQL_32="http://yum.postgresql.org/9.4/redhat/rhel-6-i386/pgdg-centos94-9.4-1.noarch.rpm" + REPO_POSTGRESQL_64="http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-1.noarch.rpm" DISTRI_SUPPORTED=true elif printf "$DISTRI_NAME" | egrep -q " 7." ; then DISTRI_TYPE="CentOS 7" REPO_EPEL="http://fedora.aau.at/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm" - REPO_POSTGRESQL_32="http://yum.postgresql.org/9.3/redhat/rhel-7-i386/pgdg-centos93-9.3-1.noarch.rpm" - REPO_POSTGRESQL_64="http://yum.postgresql.org/9.3/redhat/rhel-7-x86_64/pgdg-centos93-9.3-1.noarch.rpm" - REPO_RPMFORGE_32="http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.i686.rpm" + REPO_POSTGRESQL_64="http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-1.noarch.rpm" REPO_RPMFORGE_64="http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm" - DISTRI_SUPPORTED=true + DISTRI_SUPPORTED=$IS_64_BIT fi -elif [ "$DISTRI" == "Fedora" ]; then +elif [ "$DISTRI" == "Fedora"]; then if echo $DISTRI_NAME | egrep -q " 20 (Heisenbug)" ; then DISTRI_SUPPORTED=true fi fi if ! $DISTRI_SUPPORTED; then - echo "Unsupported OS. Only CentOS 6, CentOS 7 and Fedora 20 are supported!" + echo "Unsupported OS. Only CentOS 6, CentOS 7 (64bit) and Fedora 20 are supported!" exit 1; fi -IS_64_BIT=false -if [ "x86_64" == $(uname -m) ]; then - IS_64_BIT=true -fi - if $IS_64_BIT; then REPO_POSTGRESQL="$REPO_POSTGRESQL_64" REPO_RPMFORGE="$REPO_RPMFORGE_64" @@ -451,6 +452,14 @@ if $INSTALL_POSTGRES; then sed -i 's/\[fedora\]/\[fedora\]\nexclude=postgresql\*/' $REPO_CONFIG fi + # Postgresql 9.4 needs never version of gdal which is not part of epel yet (so we install elgis repo) + if [ $POSTGRESQL_SHORT_VERSION \> "93" ]; then + echo "Installing elgis repository" + fn_download $DOWNLOAD_DIR/elgis-repo.rpm $REPO_ELGIS + yum -y localinstall $DOWNLOAD_DIR/elgis-repo.rpm >> install_elgis_repo.log 2>&1 + echo " - enabled" + fi + # Epel Repository is needed for dependencies (gdal!) of postgresql/postgis/pgRouting echo "Installing epel repository" fn_download $DOWNLOAD_DIR/epel-repo.rpm $REPO_EPEL @@ -490,7 +499,7 @@ if $INSTALL_MAVEN; then echo " - apache maven $MAVEN_VERSION"; fi if $INSTALL_JAVA; then echo " - java $JAVA_VERSION"; fi if $INSTALL_NEO4J; then echo " - neo4j $NEO4J_VERSION"; fi if $INSTALL_NEO4J_SPATIAL; then echo " - neo4j-spatial $NEO4J_SPATIAL_VERSION"; fi -if $INSTALL_POSTGRES; then echo " - postgresql 9.3"; fi +if $INSTALL_POSTGRES; then echo " - postgresql $POSTGRESQL_VERSION"; fi if $INSTALL_POSTGIS; then echo " - postgis 2"; fi if $INSTALL_PGROUTING; then echo " - pgRouting $PGROUTING_VERSION"; fi if $INSTALL_TOMCAT; then echo " - tomcat $TOMCAT_VERSION"; fi @@ -521,7 +530,7 @@ if $INSTALL_POSTGRES; then yum -y install $POSTGRESQL_PKG_NAME $POSTGRESQL_PKG_NAME-contrib $POSTGRESQL_PKG_NAME-devel $POSTGRESQL_PKG_NAME-libs $POSTGRESQL_PKG_NAME-server >> install_postgresql.log 2>&1 echo " - exporting postgresql options" - echo "export PostgreSQL_ROOT=/usr/pgsql-9.3" >> /etc/profile.d/postgresql.sh + echo "export PostgreSQL_ROOT=/usr/pgsql-$POSTGRESQL_VERSION" >> /etc/profile.d/postgresql.sh source /etc/profile.d/postgresql.sh fi @@ -531,7 +540,7 @@ if $INSTALL_POSTGIS; then if [ "$POSTGIS_VERSION" == "auto" ]; then echo "Installing postgis (from repository)" - yum -y install postgis2_93 postgis2_93-devel >> install_postgis.log 2>&1 + yum -y install postgis2_$POSTGRESQL_SHORT_VERSION postgis2_$POSTGRESQL_SHORT_VERSION-devel >> install_postgis.log 2>&1 else echo "Installing postgis dependencies" yum -y install gdal-devel geos-devel json-c-devel libxml2-devel proj-devel >> install_postgis_deps.log 2>&1 @@ -556,7 +565,7 @@ fi if $INSTALL_PGROUTING; then if [ "$PGROUTING_VERSION" == "auto" ]; then echo "Installing pgRouting (from repository)" - yum -y install pgrouting_93 >> install_pgRouting.log 2>&1 + yum -y install pgrouting_$POSTGRESQL_SHORT_VERSION >> install_pgRouting.log 2>&1 else echo "Installing pgRouting dependencies" yum -y install boost-devel >> install_pgRouting_deps.log 2>&1 @@ -778,9 +787,9 @@ echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" if $INSTALL_POSTGRES; then echo "Initializing postgresql database" - if [ -f "$PostgreSQL_ROOT/bin/postgresql93-setup" ]; then + if [ -f "$PostgreSQL_ROOT/bin/postgresql$POSTGRESQL_SHORT_VERSION-setup" ]; then rm -rf $POSTGRESQL_DATA_DIR - $PostgreSQL_ROOT/bin/postgresql93-setup initdb >> initialize_postgresql.log 2>&1 + $PostgreSQL_ROOT/bin/postgresql$POSTGRESQL_SHORT_VERSION-setup initdb >> initialize_postgresql.log 2>&1 else service $POSTGRESQL_SERVICE_NAME initdb >> initialize_postgresql.log 2>&1 fi diff --git a/src/main/java/it/unibz/inf/isochrone/config/ConfigDataset.java b/src/main/java/it/unibz/inf/isochrone/config/ConfigDataset.java index ce22faeb..071bcb65 100644 --- a/src/main/java/it/unibz/inf/isochrone/config/ConfigDataset.java +++ b/src/main/java/it/unibz/inf/isochrone/config/ConfigDataset.java @@ -1,7 +1,5 @@ package it.unibz.inf.isochrone.config; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; import com.tngtech.configbuilder.ConfigBuilder; import com.tngtech.configbuilder.annotation.propertyloaderconfiguration.PropertyExtension; import com.tngtech.configbuilder.annotation.propertyloaderconfiguration.PropertyLocations; @@ -205,107 +203,86 @@ public class ConfigDataset { // Getter - @JsonProperty(value = "isoCoverageLayer") public TableEntry getAreaBufferTableEntry() { return areaBufferTableEntry; } - @JsonProperty(value = "name") public String getDatasetName() { return datasetName; } - @JsonIgnore public int getDistanceTolerance() { return distanceTolerance; } - @JsonProperty(value = "isoEdgeLayer") public TableEntry getEdgeTableEntry() { return edgeTableEntry; } - @JsonIgnore public String getIndexIsoAreaBuffer() { return indexIsoAreaBuffer; } - @JsonIgnore public String getIndexIsoLinks() { return indexIsoLinks; } - @JsonIgnore public String getIndexIsoNodes() { return indexIsoNodes; } - @JsonIgnore public int getServerSRID() { return serverSRID; } -// @JsonIgnore // public String getTableBuilding() { // return tableBuilding; // } - @JsonIgnore public String getTableDatecodes() { return tableDatecodes; } - @JsonIgnore public String getTableEdges() { return tableEdges; } - @JsonIgnore public String getTableIsoAreaBuffer() { return tableIsoAreaBuffer; } - @JsonIgnore public String getTableIsoLinks() { return tableIsoLinks; } - @JsonIgnore public String getTableIsoNodes() { return tableIsoNodes; } - @JsonIgnore public String getTableIsoNodesAnnotations() { return tableIsoNodesAnnotations; } - @JsonIgnore public String getTableRoutes() { return tableRoutes; } - @JsonIgnore public String getTableSchedule() { return tableSchedules; } - @JsonIgnore public String getTableVertex() { return tableVertex; } - @JsonIgnore public String getTableVertexDensity() { return tableVertexDensity; } - @JsonIgnore public TableEntry getVertexAnnotatedTableEntry() { return vertexAnnotatedTableEntry; } - @JsonProperty(value = "isoVertexLayer") public TableEntry getVertexTableEntry() { return vertexTableEntry; } diff --git a/src/main/java/it/unibz/inf/isochrone/db/TableEntry.java b/src/main/java/it/unibz/inf/isochrone/db/TableEntry.java index 4db89ae4..8e263a5e 100644 --- a/src/main/java/it/unibz/inf/isochrone/db/TableEntry.java +++ b/src/main/java/it/unibz/inf/isochrone/db/TableEntry.java @@ -1,8 +1,5 @@ package it.unibz.inf.isochrone.db; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - import it.unibz.inf.isochrone.util.EnumContainer.TableType; import java.util.Locale; @@ -29,12 +26,10 @@ public class TableEntry { // Getter - @JsonProperty(value = "name") public String getDescription() { return type.toString(); } - @JsonIgnore public String getGeometryType() { switch (type) { case VERTEX: @@ -48,12 +43,10 @@ public class TableEntry { } } - @JsonIgnore public String getIndexName() { return indexName; } - @JsonProperty(value = "layer") public String getTableName() { return tableName; } diff --git a/src/main/java/it/unibz/inf/isochrone/util/Point.java b/src/main/java/it/unibz/inf/isochrone/util/Point.java index 0a5ccda0..83d6c079 100644 --- a/src/main/java/it/unibz/inf/isochrone/util/Point.java +++ b/src/main/java/it/unibz/inf/isochrone/util/Point.java @@ -1,7 +1,5 @@ package it.unibz.inf.isochrone.util; -import com.fasterxml.jackson.annotation.JsonProperty; - /** * Represents a point with two coordinates. * @@ -16,12 +14,10 @@ public class Point { this.y = y; } - @JsonProperty public double getX() { return x; } - @JsonProperty public double getY() { return y; } diff --git a/src/test/java/it/unibz/inf/isochrone/network/AlgorithmHelper.java b/src/test/java/it/unibz/inf/isochrone/network/AlgorithmHelper.java index 8ba1d4f3..f21df3cd 100644 --- a/src/test/java/it/unibz/inf/isochrone/network/AlgorithmHelper.java +++ b/src/test/java/it/unibz/inf/isochrone/network/AlgorithmHelper.java @@ -43,6 +43,10 @@ final class AlgorithmHelper { public static AlgorithmResult run(final Class<? extends Isochrone> algorithmClass, final TestParameters params, final boolean expireNodes) { final ConfigDataset c = ConfigDataset.getInstance(params.getDataset()); + if (c == null) { + Assert.fail("Could not create dataset from configuration"); + } + final Query query = new Query(params.getDirection(), params.getWalkingSpeed(), params.getDuration(), params.getDate(), expireNodes, params.getMode()); query.setStartNodeIds(params.getStartNodeId()); diff --git a/src/test/resources/config-test.xml b/src/test/resources/config-test.xml deleted file mode 100644 index b6a7ae3f..00000000 --- a/src/test/resources/config-test.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> -<properties> - <!-- Postgres database --> - <entry key="org.postgresql.servername">dbis-isochrone.uibk.ac.at</entry> -</properties> -- GitLab