+ ";create=false");\r
\r
conn.setAutoCommit(true);\r
-\r
- Runtime.getRuntime().addShutdownHook(new Thread() {\r
- @Override\r
- public void run() {\r
- shutdownDBServer();\r
- }\r
- });\r
+ /*\r
+ * Runtime.getRuntime().addShutdownHook(new Thread() {\r
+ * \r
+ * @Override public void run() { shutdownDBServer(); } });\r
+ */\r
}\r
return conn;\r
}\r
}\r
\r
void insertData(Set<JobStat> jobstatus) throws SQLException {\r
- System.out.println("Inserting " + jobstatus.size());\r
+ log.info("Inserting " + jobstatus.size()\r
+ + " new records into the statistics database");\r
\r
conn.setAutoCommit(false);\r
String insert = "insert into exec_stat (service_name, cluster_job_id, job_id, start, finish, "\r
\r
return stats;\r
}\r
+\r
+ /**\r
+ * Removes the job if\r
+ * \r
+ * 1) It has already been recorded\r
+ * \r
+ * 2) It has not completed and did not timeout - this is to prevent\r
+ * recording the information on the incomplete jobs.\r
+ * \r
+ * @param fsJobs\r
+ * @throws SQLException\r
+ */\r
public void removeRecordedJobs(Set<JobStat> fsJobs) throws SQLException {\r
\r
String query = "select job_id from exec_stat";\r
st.close();\r
}\r
\r
- private static synchronized final void shutdownDBServer() {\r
+ public static synchronized final void shutdownDBServer() {\r
// ## DATABASE SHUTDOWN SECTION ##\r
/***\r
* In embedded mode, an application should shut down Derby. Shutdown\r