()
| 317 | } |
| 318 | |
| 319 | @TestOnly |
| 320 | public void flushJobs() { |
| 321 | pauseThread(); |
| 322 | for (int i = 0, n = jobs.size(); i < n; i++) { |
| 323 | LogWriter job = jobs.get(i); |
| 324 | if (job != null) { |
| 325 | try { |
| 326 | job.drain(0); |
| 327 | } catch (Exception th) { |
| 328 | // Exception means we cannot log anymore. Perhaps network is down or disk is full. |
| 329 | // Switch to the next job. |
| 330 | } |
| 331 | } |
| 332 | } |
| 333 | startThread(); |
| 334 | } |
| 335 | |
| 336 | @TestOnly |
| 337 | public ObjHashSet<LogWriter> getJobs() { |