Skip to content
Merged
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
4 changes: 2 additions & 2 deletions cadc-uws-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ sourceCompatibility = 11

group = 'org.opencadc'

version = '1.3.0'
version = '1.3.1'

description = 'OpenCADC UWS server library'
def git_url = 'https://github.com/opencadc/uws'

dependencies {
implementation 'javax.servlet:javax.servlet-api:3.1.0'
implementation 'org.opencadc:cadc-util:[1.12.0,2.0)'
implementation 'org.opencadc:cadc-util:[1.12.14,2.0)'
implementation 'org.opencadc:cadc-rest:[1.4.6,2.0)'
api 'org.opencadc:cadc-uws:[1.0.7,2.0)'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@
import java.sql.Timestamp;
import java.sql.Types;
import java.text.DateFormat;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public class InitDatabaseUWS extends InitDatabase {
public static final String MODEL_NAME = "UWS";
public static final String MODEL_VERSION = "1.3.0";
public static final String PREV_MODEL_VERSION = "1.2.18";
private static final boolean MAJOR_MINOR_UPGRADE = true;

public static final String[] CREATE_SQL = new String[] {
"uws.ModelVersion.sql",
Expand All @@ -100,26 +101,45 @@ public class InitDatabaseUWS extends InitDatabase {
"uws.upgrade-1.3.0.sql"
};

public static final String[] MAINT_SQL = new String[] {
public static final String[] ROLLOVER_SQL = new String[] {
"uws.rollover.sql",
"uws.Job.sql",
"uws.JobDetail.sql",
"uws.permissions.sql"
};

public InitDatabaseUWS(DataSource dataSource, String database, String schema) {
this(dataSource, database, schema, false);
}

public InitDatabaseUWS(DataSource dataSource, String database, String schema, boolean forceRolloverBeforeMinorUpgrade) {
super(dataSource, database, schema, MODEL_NAME, MODEL_VERSION, PREV_MODEL_VERSION);
for (String s : CREATE_SQL) {
createSQL.add(s);
}
for (String s : UPGRADE_SQL) {
upgradeSQL.add(s);
if (forceRolloverBeforeMinorUpgrade) {
// TODO: this has to be examined carefully for each upgrade
// for 1.2.18 to 1.3.0 the change is in Job table structure so rollover replaces the upgrade
upgradeSQL.add("uws.rollover-1218.sql");
for (int i = 1; i < ROLLOVER_SQL.length; i++) {
upgradeSQL.add(ROLLOVER_SQL[i]);
}
} else {
for (String s : UPGRADE_SQL) {
upgradeSQL.add(s);
}
}
for (String s : MAINT_SQL) {
for (String s : ROLLOVER_SQL) {
maintenanceSQL.add(s);
}
}

@Override
public boolean doInit() {
return super.doInit();
}


@Override
public boolean doMaintenance(Date lastModified, String tag) {
if (tag == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- rollover Job and JobDetail tables to keep active table small and preserve history
-- this is used by vospace services when upgarding to 1.3.0 with modified jobInfo storage
-- so it is tagged with something like the previous db versiona

-- rename indices
ALTER INDEX <schema>.jobdetail_fkey RENAME TO jobdetail_fkey_1218;
ALTER INDEX <schema>.job_creationtime RENAME TO job_creationtime_1218;
ALTER INDEX <schema>.job_ownerid RENAME TO job_ownerid_1218;
ALTER INDEX <schema>.job_pkey RENAME TO job_pkey_1218;

-- rename tables
alter table <schema>.Job rename to Job_1218;
alter table <schema>.JobDetail rename to JobDetail_1218;

-- the FK constraint in JobDetail->Job automatically follows the Job table rename
26 changes: 14 additions & 12 deletions opencadc.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
configurations {
checkstyleDep
intTestImplementation.extendsFrom testImplementation

runtimeOnly.exclude module: 'slf4j-reload4j'
runtimeOnly.exclude module: 'reload4j'
}

dependencies {
testImplementation 'com.puppycrawl.tools:checkstyle:8.2'
checkstyleDep 'org.opencadc:cadc-quality:[1.0,)'
checkstyleDep 'org.opencadc:cadc-quality:[1.0,1.1)'
}

checkstyle {
Expand All @@ -28,17 +31,16 @@ sourceSets {

// Temporary work around for issue https://github.com/gradle/gradle/issues/881 -
// gradle not displaying fail build status when warnings reported -->

//tasks.withType(Checkstyle).each { checkstyleTask ->
// checkstyleTask.doLast {
// reports.all { report ->
// def outputFile = report.destination
// if (outputFile.exists() && outputFile.text.contains("<error ")) {
// throw new GradleException("There were checkstyle warnings! For more info check $outputFile")
// }
// }
// }
//}
tasks.withType(Checkstyle).each { checkstyleTask ->
checkstyleTask.doLast {
reports.all { report ->
def outputFile = report.outputLocation.get().asFile
if (outputFile.exists() && outputFile.text.contains("<error ")) {
throw new GradleException("There were checkstyle warnings! For more info check $outputFile")
}
}
}
}

tasks.withType(Test) {
// reset the report destinations so that intTests go to their own page
Expand Down