public class StatDB
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static java.sql.Connection |
conn |
private static java.lang.String |
driver |
private static org.apache.log4j.Logger |
log |
private static java.lang.String |
protocol |
private static java.lang.String |
statDBName |
Constructor and Description |
---|
StatDB() |
StatDB(boolean ignored)
Connect to test database
|
Modifier and Type | Method and Description |
---|---|
(package private) static void |
clearStatTable() |
private void |
createStatTable()
rs.getBoolean(i) will return true for any non-zero value and false for 0
on SMALLINT data column.
|
int |
getAbandonedCount(java.sql.Timestamp from,
java.sql.Timestamp to) |
int |
getCancelledCount(java.sql.Timestamp from,
java.sql.Timestamp to) |
private static java.sql.Connection |
getDBConnection() |
java.util.Date |
getEarliestRecord() |
int |
getIncompleteCount(java.sql.Timestamp from,
java.sql.Timestamp to) |
private int |
getIntResult(java.sql.Timestamp from,
java.sql.Timestamp to,
java.lang.String query) |
private static java.sql.Connection |
getTestDBConnection() |
int |
getTotalJobsCount(java.sql.Timestamp from,
java.sql.Timestamp to) |
(package private) void |
insertData(java.util.Set<JobStat> jobstatus) |
static void |
main(java.lang.String[] args) |
java.util.List<JobStat> |
readData(java.sql.Timestamp from,
java.sql.Timestamp to,
Services wservice,
java.lang.Boolean clusterOnly) |
void |
removeRecordedJobs(java.util.Set<JobStat> fsJobs)
Removes the job if
1) It has already been recorded
2) It has not completed and did not timeout - this is to prevent
recording the information on the incomplete jobs.
|
static void |
shutdownDBServer() |
private static final java.lang.String driver
private static final java.lang.String protocol
private static final java.lang.String statDBName
private static final org.apache.log4j.Logger log
static java.sql.Connection conn
public StatDB() throws java.sql.SQLException
java.sql.SQLException
StatDB(boolean ignored) throws java.sql.SQLException
ignored
- java.sql.SQLException
private static java.sql.Connection getDBConnection() throws java.sql.SQLException
java.sql.SQLException
private static java.sql.Connection getTestDBConnection() throws java.sql.SQLException
java.sql.SQLException
private void createStatTable() throws java.sql.SQLException
java.sql.SQLException
static void clearStatTable() throws java.sql.SQLException
java.sql.SQLException
void insertData(java.util.Set<JobStat> jobstatus) throws java.sql.SQLException
java.sql.SQLException
public java.util.Date getEarliestRecord() throws java.sql.SQLException
java.sql.SQLException
public int getTotalJobsCount(java.sql.Timestamp from, java.sql.Timestamp to) throws java.sql.SQLException
java.sql.SQLException
public int getCancelledCount(java.sql.Timestamp from, java.sql.Timestamp to) throws java.sql.SQLException
java.sql.SQLException
public int getAbandonedCount(java.sql.Timestamp from, java.sql.Timestamp to) throws java.sql.SQLException
java.sql.SQLException
public int getIncompleteCount(java.sql.Timestamp from, java.sql.Timestamp to) throws java.sql.SQLException
java.sql.SQLException
private int getIntResult(java.sql.Timestamp from, java.sql.Timestamp to, java.lang.String query) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<JobStat> readData(java.sql.Timestamp from, java.sql.Timestamp to, Services wservice, java.lang.Boolean clusterOnly) throws java.sql.SQLException
java.sql.SQLException
public void removeRecordedJobs(java.util.Set<JobStat> fsJobs) throws java.sql.SQLException
fsJobs
- java.sql.SQLException
public static final void shutdownDBServer()
public static void main(java.lang.String[] args)