Skip to content

Commit

Permalink
Revert deletion of parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
lukfor committed Mar 21, 2024
1 parent 9975ed9 commit 012a10b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 33 deletions.
3 changes: 0 additions & 3 deletions src/main/java/cloudgene/mapred/api/v2/admin/ArchiveJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ public Representation get() {
job.setState(AbstractJob.STATE_RETIRED);
dao.update(job);

ParameterDao parameterDao = new ParameterDao(getDatabase());
parameterDao.deleteAllByJob(job);

if (externalWorkspace != null) {
try {
externalWorkspace.delete(job.getId());
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/cloudgene/mapred/api/v2/jobs/GetJobDetails.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ public Representation deleteJob(Representation entity) {
job.setState(AbstractJob.STATE_DELETED);
dao.update(job);

ParameterDao parameterDao = new ParameterDao(getDatabase());
parameterDao.deleteAllByJob(job);

Settings settings = getSettings();

IExternalWorkspace externalWorkspace = null;
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/cloudgene/mapred/cron/CleanUpTasks.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public class CleanUpTasks {
public static int executeRetire(Database database, Settings settings) {
JobDao dao = new JobDao(database);

ParameterDao parameterDao = new ParameterDao(database);

List<AbstractJob> oldJobs = dao.findAllNotifiedJobs();

int deleted = 0;
Expand Down Expand Up @@ -57,8 +55,6 @@ public static int executeRetire(Database database, Settings settings) {
dao.update(job);


parameterDao.deleteAllByJob(job);

log.info("Job " + job.getId() + " retired.");
deleted++;

Expand Down
23 changes: 0 additions & 23 deletions src/main/java/cloudgene/mapred/database/ParameterDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,29 +183,6 @@ public CloudgeneParameterOutput findById(int id) {
}
}

public boolean deleteAllByJob(AbstractJob job) {
try {

StringBuilder sql = new StringBuilder();
sql.append("delete ");
sql.append("from parameter ");
sql.append("where job_id = ?");

Object[] params = new Object[1];
params[0] = job.getId();

update(sql.toString(), params);

log.debug("delete all parameters by job_id '" + job.getId() + "' successful.");

return true;

} catch (SQLException e) {
log.error("delete all parameters by job_id '" + job.getId() + "' failed.", e);
return false;
}
}

class ParameterInputMapper implements IRowMapper {

@Override
Expand Down

0 comments on commit 012a10b

Please sign in to comment.