dkpro-jwpl icon indicating copy to clipboard operation
dkpro-jwpl copied to clipboard

Fixes #24 - Automatically delete *.bin files after dump creation process

Open mawiesne opened this issue 6 years ago • 17 comments

  • Adds a "path/file deletion watch dog" which guarantees to remove files upon JVM shutdown to avoid left behind (intermediate) files
  • Adapts the SimpleBinaryDumpWriter implementation to register all created *.bin at the DeleteFilesAtShutdown monitor
  • Reduces CnP code by adding helper methods to SimpleBinaryDumpWriter

@daxenberger / @reckart Please review the changes in this branch I pushed to solve #24.

Note: This needs proper, manual testing as there isn't any JUnit test for this. This should - ideally - be tested on different OSes, i.e. Linux/Windows/MacOS and under OpenJDK/Oracle JDK 8.

Fixes #24 - Automatically delete *.bin files after dump creation process

mawiesne avatar Jul 07 '18 15:07 mawiesne

20% (+20.07%) vs master 0%

ukp-svc-jenkins avatar Jul 07 '18 16:07 ukp-svc-jenkins

Why not simply call File.deleteOnExit()?

reckart avatar Jul 08 '18 09:07 reckart

I'm not even sure that DumpWriter should really clean up after itself. What if somebody really just wants to create these files and doesn't want them to get deleted at shutdown? I thing that DumpWriter should implement some clean-up method which the code that makes use of the DumpWriter can call at the end. Then the code which makes use of the DumpWriter should be changed to call this method after it does not need the data produced by the DumpWriter anymore.

reckart avatar Jul 08 '18 09:07 reckart

21% (+21.0%) vs master 0%

ukp-svc-jenkins avatar Jul 08 '18 12:07 ukp-svc-jenkins

@daxenberger I agree: .bin files are not of much interest to most (>90%) users. Please specify an optional parameter in the original issue (#24) as a comment. I could then rework the PR to reflect this idea, so users can decide whether to keep the files or not.

mawiesne avatar Jul 09 '18 07:07 mawiesne

21% (+21.02%) vs master 0%

ukp-svc-jenkins avatar Jul 10 '18 15:07 ukp-svc-jenkins

Note: this is still in a WIP state. See comments/discussion in #24

mawiesne avatar Jul 16 '18 15:07 mawiesne

21% (+21.04%) vs master 0%

ukp-svc-jenkins avatar Jul 16 '18 16:07 ukp-svc-jenkins

I have added a WIP label and marked this PR with it.

reckart avatar Jul 17 '18 12:07 reckart

thx, that's helpful for other cases as well.

mawiesne avatar Jul 17 '18 12:07 mawiesne

23% (+0.04%) vs master 23%

ukp-svc-jenkins avatar Jul 17 '18 13:07 ukp-svc-jenkins

23% (0.0%) vs master 23%

ukp-svc-jenkins avatar Jul 19 '18 12:07 ukp-svc-jenkins

23% (0.0%) vs master 23%

ukp-svc-jenkins avatar Jul 24 '18 21:07 ukp-svc-jenkins

24% (0.0%) vs master 24%

ukp-svc-jenkins avatar Aug 22 '18 10:08 ukp-svc-jenkins

Any updates ?

tgalery avatar Oct 05 '18 15:10 tgalery

@tgalery Vietnam..., lack of time. I'll try to make progress with this PR during the next 1 or 2 weeks.

mawiesne avatar Oct 07 '18 10:10 mawiesne

24% (0.0%) vs master 24%

ukp-svc-jenkins avatar Oct 07 '18 10:10 ukp-svc-jenkins