Skip to content

Commit 5b4cc9a

Browse files
committed
Merge branch 'hotfix/1.1.1'
2 parents fa60dca + db64b64 commit 5b4cc9a

File tree

51 files changed

+978
-198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+978
-198
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<artifactId>seqware</artifactId>
8383
<packaging>pom</packaging>
8484
<groupId>com.github.seqware</groupId>
85-
<version>1.1.0</version>
85+
<version>1.1.1</version>
8686

8787
<repositories>
8888
<repository>

seqware-admin-webservice/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<parent>
1515
<groupId>com.github.seqware</groupId>
1616
<artifactId>seqware</artifactId>
17-
<version>1.1.0</version>
17+
<version>1.1.1</version>
1818
<relativePath>../pom.xml</relativePath>
1919
</parent>
2020

seqware-archetypes/seqware-archetype-decider/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<description>SeqWare Java Decider archetype</description>
1010

1111
<parent>
12-
<version>1.1.0</version>
12+
<version>1.1.1</version>
1313
<groupId>com.github.seqware</groupId>
1414
<artifactId>seqware</artifactId>
1515
<relativePath>../../pom.xml</relativePath>

seqware-archetypes/seqware-archetype-decider/src/main/resources/archetype-resources/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<properties>
1616
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1717
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
18-
<seqware-version>1.1.0</seqware-version>
18+
<seqware-version>1.1.1</seqware-version>
1919
<workflow-version>1.0</workflow-version>
2020
<workflow-name>${workflow-name}</workflow-name>
2121
</properties>

seqware-archetypes/seqware-archetype-java-workflow/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<description>SeqWare Java workflow archetype</description>
1010

1111
<parent>
12-
<version>1.1.0</version>
12+
<version>1.1.1</version>
1313
<groupId>com.github.seqware</groupId>
1414
<artifactId>seqware</artifactId>
1515
<relativePath>../../pom.xml</relativePath>

seqware-archetypes/seqware-archetype-java-workflow/src/main/resources/archetype-resources/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<properties>
2020
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2121
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
22-
<seqware-version>1.1.0</seqware-version>
22+
<seqware-version>1.1.1</seqware-version>
2323
<skipITs>true</skipITs>
2424
<workflow-full-name>Workflow_Bundle_${workflow-name}_${workflow-version}_SeqWare_${seqware-version}</workflow-full-name>
2525
<workflow-dir>${project.build.directory}/${workflow-full-name}/Workflow_Bundle_${workflow-name}/${workflow-version}</workflow-dir>

seqware-archetypes/seqware-archetype-module/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<description>SeqWare module archetype</description>
1010

1111
<parent>
12-
<version>1.1.0</version>
12+
<version>1.1.1</version>
1313
<groupId>com.github.seqware</groupId>
1414
<artifactId>seqware</artifactId>
1515
<relativePath>../../pom.xml</relativePath>

seqware-archetypes/seqware-archetype-module/src/main/resources/archetype-resources/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<properties>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1616
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
17-
<seqware-version>1.1.0</seqware-version>
17+
<seqware-version>1.1.1</seqware-version>
1818
</properties>
1919

2020
<build>

seqware-common/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<packaging>jar</packaging>
1212

1313
<parent>
14-
<version>1.1.0</version>
14+
<version>1.1.1</version>
1515
<groupId>com.github.seqware</groupId>
1616
<artifactId>seqware</artifactId>
1717
<relativePath>../pom.xml</relativePath>

seqware-common/src/main/java/io/seqware/Engines.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public String toString() {
3636

3737
/**
3838
* Check whether the workflow engine is Oozie-based.
39-
*
39+
*
4040
* @param engine
4141
* @return
4242
*/
@@ -46,7 +46,7 @@ public static boolean isOozie(final String engine) {
4646

4747
/**
4848
* Check whether the workflow engine is whitestar-based.
49-
*
49+
*
5050
* @param engine
5151
* @return
5252
*/
@@ -56,7 +56,7 @@ public static boolean isWhiteStar(final String engine) {
5656

5757
/**
5858
* Check whether the workflow engine supports parallel operation.
59-
*
59+
*
6060
* @param engine
6161
* @return
6262
*/
@@ -66,7 +66,7 @@ public static boolean isWhiteStarParallel(final String engine) {
6666

6767
/**
6868
* Check whether the workflow engine supports cancel.
69-
*
69+
*
7070
* @param engine
7171
* @return
7272
*/
@@ -75,8 +75,8 @@ public static boolean supportsCancel(final String engine) {
7575
}
7676

7777
/**
78-
* Check whether the workflow engine supports retry.
79-
*
78+
* Check whether the workflow engine supports retry. Here we mean asynchronous retry.
79+
*
8080
* @param engine
8181
* @return
8282
*/

seqware-common/src/main/java/io/seqware/pipeline/SqwKeys.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ public enum SqwKeys {
5555
OOZIE_QUEUENAME(null, Categories.LAUNCH, true, "Hadoop queue onto which to schedule jobs", "default"),
5656
OOZIE_WORK_DIR(null, Categories.LAUNCH, true,
5757
"Working directory where your workflow steps execute and where we store generated scripts and logs", "/usr/tmp/seqware-oozie"),
58-
OOZIE_RETRY_MAX(null, Categories.LAUNCH, false, "Number of times that Oozie will retry user steps in workflows", "5"),
58+
OOZIE_RETRY_MAX(null, Categories.LAUNCH, false, "Number of times that Oozie and Whitestar will retry user steps in workflows", "5"),
5959
OOZIE_RETRY_INTERVAL(null, Categories.LAUNCH, false, "Minutes to wait before retry for user steps in workflows", "5"),
6060
OOZIE_BATCH_THRESHOLD(null, Categories.LAUNCH, false,
6161
"Above this threshold, provision file events on the same job/workflow will be batched together", "10"),
6262
OOZIE_BATCH_SIZE(null, Categories.LAUNCH, false, "Number of provision file events that should be batched together", "100"),
63+
WHITESTAR_MEMORY_LIMIT(null, Categories.WHITESTAR, false, "Restrict the number of parallel jobs invoked in WhiteStar to this amount of memory",String.valueOf(Integer.MAX_VALUE)),
6364
FS_HDFS_IMPL("FS.HDFS.IMPL", Categories.LAUNCH, true, "HDFS implementation class", "org.apache.hadoop.hdfs.DistributedFileSystem"),
6465
OOZIE_SGE_THREADS_PARAM_FORMAT(null, Categories.LAUNCH, false,
6566
"Only used for 'oozie-sge' engine. Format of qsub flag for specifying number of threads. "
@@ -171,6 +172,7 @@ public enum Categories {
171172
"Settings used to configure the installation of workflow bundles"),
172173
LAUNCH(
173174
"Oozie engine settings. Only used for both 'oozie' and 'oozie-sge' engines."),
175+
WHITESTAR("WhiteStar engine settings. Only used for the 'whitestar' series of engines."),
174176
OOZIE_SGE(
175177
"Oozie-SGE engine settings. Only used for 'oozie-sge' engine."),
176178
ADMIN("Settings used for administrators"),

seqware-common/src/main/java/net/sourceforge/seqware/common/metadata/MetadataInMemory.java

+26-4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import io.seqware.common.model.ProcessingStatus;
2323
import io.seqware.common.model.SequencerRunStatus;
2424
import io.seqware.common.model.WorkflowRunStatus;
25+
import io.seqware.pipeline.SqwKeys;
2526
import java.io.Writer;
2627
import java.sql.SQLException;
2728
import java.util.ArrayList;
@@ -43,6 +44,7 @@
4344
import net.sourceforge.seqware.common.model.File;
4445
import net.sourceforge.seqware.common.model.FileAttribute;
4546
import net.sourceforge.seqware.common.model.FileProvenanceParam;
47+
import net.sourceforge.seqware.common.model.FirstTierModel;
4648
import net.sourceforge.seqware.common.model.IUS;
4749
import net.sourceforge.seqware.common.model.IUSAttribute;
4850
import net.sourceforge.seqware.common.model.Lane;
@@ -69,6 +71,7 @@
6971
import net.sourceforge.seqware.common.model.WorkflowRunAttribute;
7072
import net.sourceforge.seqware.common.module.ReturnValue;
7173
import net.sourceforge.seqware.common.util.Log;
74+
import net.sourceforge.seqware.common.util.configtools.ConfigTools;
7275

7376
/**
7477
* This stores some metadata in memory as an exploration of running workflows without a running database or web service.
@@ -82,14 +85,14 @@ public class MetadataInMemory implements Metadata {
8285
/**
8386
* Stores SWID/id -> Model object. Unlike the postgres database, we re-use the sw accession as the id
8487
*/
85-
private static final Table<Integer, Class, Object> STORE = HashBasedTable.create();
88+
private static final Table<Integer, Class<?>, Object> STORE = HashBasedTable.create();
8689

8790
/**
8891
* Not really thread-safe, why does Guava not have a synchronized wrapper?
8992
*
9093
* @return the store
9194
*/
92-
private static synchronized Table<Integer, Class, Object> getStore() {
95+
private static synchronized Table<Integer, Class<?>, Object> getStore() {
9396
return STORE;
9497
}
9598

@@ -230,6 +233,7 @@ public int add_workflow_run(int workflowAccession) {
230233
wr.setWorkflowRunId(wr.getSwAccession());
231234
wr.setCreateTimestamp(new Date());
232235
wr.setUpdateTimestamp(new Date());
236+
wr.setOwnerUserName(ConfigTools.getSettings().get(SqwKeys.SW_REST_USER.getSettingKey()));
233237
Workflow workflow = (Workflow) MetadataInMemory.getStore().get(workflowAccession, Workflow.class);
234238
wr.setWorkflow(workflow);
235239
MetadataInMemory.getStore().put(wr.getSwAccession(), WorkflowRun.class, wr);
@@ -334,11 +338,27 @@ public ReturnValue addWorkflow(String name, String version, String description,
334338
return returnValue;
335339
}
336340

341+
private synchronized int getCurrentSwAccession() {
342+
int currKey = MetadataInMemory.getStore().rowKeySet().size();
343+
return currKey;
344+
}
345+
337346
private synchronized int getNextSwAccession() {
338347
int nextKey = MetadataInMemory.getStore().rowKeySet().size() + 1;
339348
return nextKey;
340349
}
341350

351+
public void loadEntity(FirstTierModel model) {
352+
// populate store up to the desiredkey
353+
int currSWID = getCurrentSwAccession();
354+
while (currSWID < model.getSwAccession()) {
355+
int swid = getNextSwAccession();
356+
MetadataInMemory.getStore().put(swid, Integer.class, swid);
357+
currSWID = getCurrentSwAccession();
358+
}
359+
MetadataInMemory.getStore().put(model.getSwAccession(), model.getClass(), model);
360+
}
361+
342362
@Override
343363
public ReturnValue updateWorkflow(int workflowId, String permanentBundleLocation) {
344364
throw new UnsupportedOperationException("Not supported yet.");
@@ -520,12 +540,14 @@ public String getWorkflowRunReport(int workflowRunSWID) {
520540

521541
@Override
522542
public String getWorkflowRunReportStdErr(int workflowRunSWID) {
523-
throw new UnsupportedOperationException("Not supported yet.");
543+
WorkflowRun wr = (WorkflowRun) MetadataInMemory.getStore().get(workflowRunSWID, WorkflowRun.class);
544+
return wr.getStdErr() == null ? "" : wr.getStdErr();
524545
}
525546

526547
@Override
527548
public String getWorkflowRunReportStdOut(int workflowRunSWID) {
528-
throw new UnsupportedOperationException("Not supported yet.");
549+
WorkflowRun wr = (WorkflowRun) MetadataInMemory.getStore().get(workflowRunSWID, WorkflowRun.class);
550+
return wr.getStdOut() == null ? "" : wr.getStdOut();
529551
}
530552

531553
@Override

seqware-common/src/main/java/net/sourceforge/seqware/common/model/Experiment.java

+8-7
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* @version $Id: $Id
2828
*/
2929
public class Experiment extends PermissionsAware implements Serializable, Comparable<Experiment>, ParentAccessionModel,
30-
Annotatable<ExperimentAttribute> {
30+
Annotatable<ExperimentAttribute>, FirstTierModel {
3131

3232
private static final long serialVersionUID = 2L;
3333
private Integer experimentId;
@@ -150,19 +150,19 @@ public int hashCode() {
150150

151151
/*
152152
* public int compareTo(Experiment that) { if(that == null) return -1;
153-
*
153+
*
154154
* if(that.getName() == this.getName()) // when both names are null return 0;
155-
*
155+
*
156156
* if(that.getName() == null) return -1; // when only the other name is null
157-
*
157+
*
158158
* return(that.getName().compareTo(this.getName())); }
159-
*
159+
*
160160
* public String toString() { return new ToStringBuilder(this) .append("experimentId", getExperimentId()) .append("name", getName())
161161
* .toString(); }
162-
*
162+
*
163163
* public boolean equals(Object other) { if ( (this == other ) ) return true; if ( !(other instanceof Experiment) ) return false;
164164
* Experiment castOther = (Experiment) other; return new EqualsBuilder() .append(this.getName(), castOther.getName()) .isEquals(); }
165-
*
165+
*
166166
* public int hashCode() { return new HashCodeBuilder() .append(getName()) .toHashCode(); }
167167
*/
168168
/**
@@ -425,6 +425,7 @@ public void setExperimentId(Integer experimentId) {
425425
*
426426
* @return a {@link java.lang.Integer} object.
427427
*/
428+
@Override
428429
public Integer getSwAccession() {
429430
return swAccession;
430431
}

seqware-common/src/main/java/net/sourceforge/seqware/common/model/File.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* @author boconnor
2020
* @version $Id: $Id
2121
*/
22-
public class File extends PermissionsAware implements Serializable, Comparable<File>, Annotatable<FileAttribute> {
22+
public class File extends PermissionsAware implements Serializable, Comparable<File>, Annotatable<FileAttribute>, FirstTierModel {
2323

2424
private static final long serialVersionUID = 3681322115923390568L;
2525
private Integer fileId;
@@ -268,6 +268,7 @@ public void setDescription(String description) {
268268
*
269269
* @return a {@link java.lang.Integer} object.
270270
*/
271+
@Override
271272
public Integer getSwAccession() {
272273
return swAccession;
273274
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (C) 2014 SeqWare
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
package net.sourceforge.seqware.common.model;
18+
19+
/**
20+
* This links together all models that have a FirstTierModel.
21+
*
22+
* @author dyuen
23+
*/
24+
public interface FirstTierModel {
25+
26+
/**
27+
* A unique identifier for entities that are unique within the SeqWare database.
28+
*
29+
* @return
30+
*/
31+
public Integer getSwAccession();
32+
}

seqware-common/src/main/java/net/sourceforge/seqware/common/model/IUS.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* @author boconnor
2424
* @version $Id: $Id
2525
*/
26-
public class IUS extends PermissionsAware implements Serializable, Comparable<IUS>, ParentAccessionModel, Annotatable<IUSAttribute> {
26+
public class IUS extends PermissionsAware implements Serializable, Comparable<IUS>, ParentAccessionModel, Annotatable<IUSAttribute>, FirstTierModel {
2727

2828
private static final long serialVersionUID = 3472028115923390568L;
2929
private Integer iusId;

seqware-common/src/main/java/net/sourceforge/seqware/common/model/Invoice.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* @author boconnor
2020
* @version $Id: $Id
2121
*/
22-
public class Invoice extends PermissionsAware implements Serializable, Comparable<Invoice> {
22+
public class Invoice extends PermissionsAware implements Serializable, Comparable<Invoice>, FirstTierModel {
2323
/**
2424
* LEFT OFF WITH: this needs to be finished
2525
*/

seqware-common/src/main/java/net/sourceforge/seqware/common/model/Lane.java

+9-8
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
* @author boconnor
2626
* @version $Id: $Id
2727
*/
28-
public class Lane extends PermissionsAware implements Serializable, Comparable<Lane>, ParentAccessionModel, Annotatable<LaneAttribute> {
28+
public class Lane extends PermissionsAware implements Serializable, Comparable<Lane>, ParentAccessionModel, Annotatable<LaneAttribute>,
29+
FirstTierModel {
2930

3031
private static final long serialVersionUID = 5681328115923390568L;
3132
private Integer laneId;
@@ -125,18 +126,18 @@ public int hashCode() {
125126

126127
/*
127128
* public int compareTo(Lane that) { if(that == null || getSwAccession() == null) return -1;
128-
*
129+
*
129130
* if(that.getSwAccession() == this.getSwAccession()) // when both names are null return 0;
130-
*
131+
*
131132
* if(that.getSwAccession() == null) return -1; // when only the other name is null
132-
*
133+
*
133134
* return(that.getSwAccession().compareTo(this.getSwAccession())); }
134-
*
135+
*
135136
* public String toString() { return new ToStringBuilder(this) .append("laneId", getLaneId()) .toString(); }
136-
*
137+
*
137138
* public boolean equals(Object other) { if ( (this == other ) ) return true; if ( !(other instanceof Lane) ) return false; Lane
138139
* castOther = (Lane) other; return new EqualsBuilder() .append(this.getSwAccession(), castOther.getSwAccession()) .isEquals(); }
139-
*
140+
*
140141
* public int hashCode() { return new HashCodeBuilder() .append(getSwAccession()) .toHashCode(); }
141142
*/
142143
/**
@@ -687,7 +688,7 @@ public void setSampleType(String sampleType) {
687688

688689
/*
689690
* public String getSampleName() { return sampleName; }
690-
*
691+
*
691692
* public void setSampleName(String sampleName) { this.sampleName = sampleName; }
692693
*/
693694
/**

0 commit comments

Comments
 (0)