Skip to content

Commit

Permalink
Merge branch 'hotfix/1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-yuen committed May 1, 2015
2 parents fa60dca + db64b64 commit 5b4cc9a
Show file tree
Hide file tree
Showing 51 changed files with 978 additions and 198 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<artifactId>seqware</artifactId>
<packaging>pom</packaging>
<groupId>com.github.seqware</groupId>
<version>1.1.0</version>
<version>1.1.1</version>

<repositories>
<repository>
Expand Down
2 changes: 1 addition & 1 deletion seqware-admin-webservice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>com.github.seqware</groupId>
<artifactId>seqware</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion seqware-archetypes/seqware-archetype-decider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<description>SeqWare Java Decider archetype</description>

<parent>
<version>1.1.0</version>
<version>1.1.1</version>
<groupId>com.github.seqware</groupId>
<artifactId>seqware</artifactId>
<relativePath>../../pom.xml</relativePath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<seqware-version>1.1.0</seqware-version>
<seqware-version>1.1.1</seqware-version>
<workflow-version>1.0</workflow-version>
<workflow-name>${workflow-name}</workflow-name>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion seqware-archetypes/seqware-archetype-java-workflow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<description>SeqWare Java workflow archetype</description>

<parent>
<version>1.1.0</version>
<version>1.1.1</version>
<groupId>com.github.seqware</groupId>
<artifactId>seqware</artifactId>
<relativePath>../../pom.xml</relativePath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<seqware-version>1.1.0</seqware-version>
<seqware-version>1.1.1</seqware-version>
<skipITs>true</skipITs>
<workflow-full-name>Workflow_Bundle_${workflow-name}_${workflow-version}_SeqWare_${seqware-version}</workflow-full-name>
<workflow-dir>${project.build.directory}/${workflow-full-name}/Workflow_Bundle_${workflow-name}/${workflow-version}</workflow-dir>
Expand Down
2 changes: 1 addition & 1 deletion seqware-archetypes/seqware-archetype-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<description>SeqWare module archetype</description>

<parent>
<version>1.1.0</version>
<version>1.1.1</version>
<groupId>com.github.seqware</groupId>
<artifactId>seqware</artifactId>
<relativePath>../../pom.xml</relativePath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<seqware-version>1.1.0</seqware-version>
<seqware-version>1.1.1</seqware-version>
</properties>

<build>
Expand Down
2 changes: 1 addition & 1 deletion seqware-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<packaging>jar</packaging>

<parent>
<version>1.1.0</version>
<version>1.1.1</version>
<groupId>com.github.seqware</groupId>
<artifactId>seqware</artifactId>
<relativePath>../pom.xml</relativePath>
Expand Down
12 changes: 6 additions & 6 deletions seqware-common/src/main/java/io/seqware/Engines.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public String toString() {

/**
* Check whether the workflow engine is Oozie-based.
*
*
* @param engine
* @return
*/
Expand All @@ -46,7 +46,7 @@ public static boolean isOozie(final String engine) {

/**
* Check whether the workflow engine is whitestar-based.
*
*
* @param engine
* @return
*/
Expand All @@ -56,7 +56,7 @@ public static boolean isWhiteStar(final String engine) {

/**
* Check whether the workflow engine supports parallel operation.
*
*
* @param engine
* @return
*/
Expand All @@ -66,7 +66,7 @@ public static boolean isWhiteStarParallel(final String engine) {

/**
* Check whether the workflow engine supports cancel.
*
*
* @param engine
* @return
*/
Expand All @@ -75,8 +75,8 @@ public static boolean supportsCancel(final String engine) {
}

/**
* Check whether the workflow engine supports retry.
*
* Check whether the workflow engine supports retry. Here we mean asynchronous retry.
*
* @param engine
* @return
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ public enum SqwKeys {
OOZIE_QUEUENAME(null, Categories.LAUNCH, true, "Hadoop queue onto which to schedule jobs", "default"),
OOZIE_WORK_DIR(null, Categories.LAUNCH, true,
"Working directory where your workflow steps execute and where we store generated scripts and logs", "/usr/tmp/seqware-oozie"),
OOZIE_RETRY_MAX(null, Categories.LAUNCH, false, "Number of times that Oozie will retry user steps in workflows", "5"),
OOZIE_RETRY_MAX(null, Categories.LAUNCH, false, "Number of times that Oozie and Whitestar will retry user steps in workflows", "5"),
OOZIE_RETRY_INTERVAL(null, Categories.LAUNCH, false, "Minutes to wait before retry for user steps in workflows", "5"),
OOZIE_BATCH_THRESHOLD(null, Categories.LAUNCH, false,
"Above this threshold, provision file events on the same job/workflow will be batched together", "10"),
OOZIE_BATCH_SIZE(null, Categories.LAUNCH, false, "Number of provision file events that should be batched together", "100"),
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)),
FS_HDFS_IMPL("FS.HDFS.IMPL", Categories.LAUNCH, true, "HDFS implementation class", "org.apache.hadoop.hdfs.DistributedFileSystem"),
OOZIE_SGE_THREADS_PARAM_FORMAT(null, Categories.LAUNCH, false,
"Only used for 'oozie-sge' engine. Format of qsub flag for specifying number of threads. "
Expand Down Expand Up @@ -171,6 +172,7 @@ public enum Categories {
"Settings used to configure the installation of workflow bundles"),
LAUNCH(
"Oozie engine settings. Only used for both 'oozie' and 'oozie-sge' engines."),
WHITESTAR("WhiteStar engine settings. Only used for the 'whitestar' series of engines."),
OOZIE_SGE(
"Oozie-SGE engine settings. Only used for 'oozie-sge' engine."),
ADMIN("Settings used for administrators"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import io.seqware.common.model.ProcessingStatus;
import io.seqware.common.model.SequencerRunStatus;
import io.seqware.common.model.WorkflowRunStatus;
import io.seqware.pipeline.SqwKeys;
import java.io.Writer;
import java.sql.SQLException;
import java.util.ArrayList;
Expand All @@ -43,6 +44,7 @@
import net.sourceforge.seqware.common.model.File;
import net.sourceforge.seqware.common.model.FileAttribute;
import net.sourceforge.seqware.common.model.FileProvenanceParam;
import net.sourceforge.seqware.common.model.FirstTierModel;
import net.sourceforge.seqware.common.model.IUS;
import net.sourceforge.seqware.common.model.IUSAttribute;
import net.sourceforge.seqware.common.model.Lane;
Expand All @@ -69,6 +71,7 @@
import net.sourceforge.seqware.common.model.WorkflowRunAttribute;
import net.sourceforge.seqware.common.module.ReturnValue;
import net.sourceforge.seqware.common.util.Log;
import net.sourceforge.seqware.common.util.configtools.ConfigTools;

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

/**
* Not really thread-safe, why does Guava not have a synchronized wrapper?
*
* @return the store
*/
private static synchronized Table<Integer, Class, Object> getStore() {
private static synchronized Table<Integer, Class<?>, Object> getStore() {
return STORE;
}

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

private synchronized int getCurrentSwAccession() {
int currKey = MetadataInMemory.getStore().rowKeySet().size();
return currKey;
}

private synchronized int getNextSwAccession() {
int nextKey = MetadataInMemory.getStore().rowKeySet().size() + 1;
return nextKey;
}

public void loadEntity(FirstTierModel model) {
// populate store up to the desiredkey
int currSWID = getCurrentSwAccession();
while (currSWID < model.getSwAccession()) {
int swid = getNextSwAccession();
MetadataInMemory.getStore().put(swid, Integer.class, swid);
currSWID = getCurrentSwAccession();
}
MetadataInMemory.getStore().put(model.getSwAccession(), model.getClass(), model);
}

@Override
public ReturnValue updateWorkflow(int workflowId, String permanentBundleLocation) {
throw new UnsupportedOperationException("Not supported yet.");
Expand Down Expand Up @@ -520,12 +540,14 @@ public String getWorkflowRunReport(int workflowRunSWID) {

@Override
public String getWorkflowRunReportStdErr(int workflowRunSWID) {
throw new UnsupportedOperationException("Not supported yet.");
WorkflowRun wr = (WorkflowRun) MetadataInMemory.getStore().get(workflowRunSWID, WorkflowRun.class);
return wr.getStdErr() == null ? "" : wr.getStdErr();
}

@Override
public String getWorkflowRunReportStdOut(int workflowRunSWID) {
throw new UnsupportedOperationException("Not supported yet.");
WorkflowRun wr = (WorkflowRun) MetadataInMemory.getStore().get(workflowRunSWID, WorkflowRun.class);
return wr.getStdOut() == null ? "" : wr.getStdOut();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @version $Id: $Id
*/
public class Experiment extends PermissionsAware implements Serializable, Comparable<Experiment>, ParentAccessionModel,
Annotatable<ExperimentAttribute> {
Annotatable<ExperimentAttribute>, FirstTierModel {

private static final long serialVersionUID = 2L;
private Integer experimentId;
Expand Down Expand Up @@ -150,19 +150,19 @@ public int hashCode() {

/*
* public int compareTo(Experiment that) { if(that == null) return -1;
*
*
* if(that.getName() == this.getName()) // when both names are null return 0;
*
*
* if(that.getName() == null) return -1; // when only the other name is null
*
*
* return(that.getName().compareTo(this.getName())); }
*
*
* public String toString() { return new ToStringBuilder(this) .append("experimentId", getExperimentId()) .append("name", getName())
* .toString(); }
*
*
* public boolean equals(Object other) { if ( (this == other ) ) return true; if ( !(other instanceof Experiment) ) return false;
* Experiment castOther = (Experiment) other; return new EqualsBuilder() .append(this.getName(), castOther.getName()) .isEquals(); }
*
*
* public int hashCode() { return new HashCodeBuilder() .append(getName()) .toHashCode(); }
*/
/**
Expand Down Expand Up @@ -425,6 +425,7 @@ public void setExperimentId(Integer experimentId) {
*
* @return a {@link java.lang.Integer} object.
*/
@Override
public Integer getSwAccession() {
return swAccession;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @author boconnor
* @version $Id: $Id
*/
public class File extends PermissionsAware implements Serializable, Comparable<File>, Annotatable<FileAttribute> {
public class File extends PermissionsAware implements Serializable, Comparable<File>, Annotatable<FileAttribute>, FirstTierModel {

private static final long serialVersionUID = 3681322115923390568L;
private Integer fileId;
Expand Down Expand Up @@ -268,6 +268,7 @@ public void setDescription(String description) {
*
* @return a {@link java.lang.Integer} object.
*/
@Override
public Integer getSwAccession() {
return swAccession;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (C) 2014 SeqWare
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sourceforge.seqware.common.model;

/**
* This links together all models that have a FirstTierModel.
*
* @author dyuen
*/
public interface FirstTierModel {

/**
* A unique identifier for entities that are unique within the SeqWare database.
*
* @return
*/
public Integer getSwAccession();
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @author boconnor
* @version $Id: $Id
*/
public class IUS extends PermissionsAware implements Serializable, Comparable<IUS>, ParentAccessionModel, Annotatable<IUSAttribute> {
public class IUS extends PermissionsAware implements Serializable, Comparable<IUS>, ParentAccessionModel, Annotatable<IUSAttribute>, FirstTierModel {

private static final long serialVersionUID = 3472028115923390568L;
private Integer iusId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @author boconnor
* @version $Id: $Id
*/
public class Invoice extends PermissionsAware implements Serializable, Comparable<Invoice> {
public class Invoice extends PermissionsAware implements Serializable, Comparable<Invoice>, FirstTierModel {
/**
* LEFT OFF WITH: this needs to be finished
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
* @author boconnor
* @version $Id: $Id
*/
public class Lane extends PermissionsAware implements Serializable, Comparable<Lane>, ParentAccessionModel, Annotatable<LaneAttribute> {
public class Lane extends PermissionsAware implements Serializable, Comparable<Lane>, ParentAccessionModel, Annotatable<LaneAttribute>,
FirstTierModel {

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

/*
* public int compareTo(Lane that) { if(that == null || getSwAccession() == null) return -1;
*
*
* if(that.getSwAccession() == this.getSwAccession()) // when both names are null return 0;
*
*
* if(that.getSwAccession() == null) return -1; // when only the other name is null
*
*
* return(that.getSwAccession().compareTo(this.getSwAccession())); }
*
*
* public String toString() { return new ToStringBuilder(this) .append("laneId", getLaneId()) .toString(); }
*
*
* public boolean equals(Object other) { if ( (this == other ) ) return true; if ( !(other instanceof Lane) ) return false; Lane
* castOther = (Lane) other; return new EqualsBuilder() .append(this.getSwAccession(), castOther.getSwAccession()) .isEquals(); }
*
*
* public int hashCode() { return new HashCodeBuilder() .append(getSwAccession()) .toHashCode(); }
*/
/**
Expand Down Expand Up @@ -687,7 +688,7 @@ public void setSampleType(String sampleType) {

/*
* public String getSampleName() { return sampleName; }
*
*
* public void setSampleName(String sampleName) { this.sampleName = sampleName; }
*/
/**
Expand Down
Loading

0 comments on commit 5b4cc9a

Please sign in to comment.