time_online = new TimeHandler(this.request, this.timezone);
start = time_online.getStartTime();
end = time_online.getEndTime();
}
DatabaseWriter dbw = new DatabaseWriter(this.cluster);
String query;
// setup query
if (this.shuffle_option != null && this.shuffle_option.equals("shuffles")) {
query = "select job_id,friendly_id,start_time,finish_time,start_time_millis,finish_time_millis,status,state_name,hostname from ["+this.table+"] where finish_time between '[start]' and '[end]'";
} else {
query = "select job_id,friendly_id,start_time,finish_time,start_time_millis,finish_time_millis,status,state_name,hostname from ["+this.table+"] where finish_time between '[start]' and '[end]' and not state_name like 'shuffle_local' and not state_name like 'shuffle_remote'";
}
if (this.jobname != null) {
query = query + " and job_id like '"+ this.jobname +"'";
}
Macro mp = new Macro(start,end,query);
query = mp.toString() + " order by start_time";
Table rs_tab = null;
DatabaseDataSource dds;
log.debug("Query: " + query);
// execute query
try {
dds = ConnectionFactory.getDatabaseConnection(dbw.getConnection());
rs_tab = dds.getData(query);
} catch (prefuse.data.io.DataIOException e) {
System.err.println("prefuse data IO error: " + e);
log.warn("prefuse data IO error: " + e);
return null;