public void run() { java.io.File[] logFileList; int logs_to_keep = 3; int minlog; for (; ; ) { /* * Wait for one minute, polling once per second to see if * application has finished. When application has finished, * terminate this thread. */ for (int i = 0; i < 60; i++) { try { Thread.sleep(1000); } catch (InterruptedException ie) { } if (myEnv.getAppFinished()) return; } try { /* Get the list of unneeded log files. */ logFileList = myEnv.getArchiveLogFiles(false); /* * Remove all but the logs_to_keep most recent unneeded * log files. */ minlog = logFileList.length - logs_to_keep; for (int i = 0; i < minlog; i++) { logFileList[i].delete(); } } catch (DatabaseException de) { System.err.println("Problem deleting log archive files."); } } }
public void run() { for (; ; ) { /* * Wait for one minute, polling once per second to see if * application has finished. When application has finished, * terminate this thread. */ for (int i = 0; i < 60; i++) { try { Thread.sleep(1000); } catch (InterruptedException ie) { } if (myEnv.getAppFinished()) return; } /* Perform a checkpoint. */ try { myEnv.checkpoint(null); } catch (DatabaseException de) { System.err.println("Could not perform checkpoint."); } } }