DataImportHandler has onImportStart and onImportEnd. An onRollback handler is a useful addition.
Here's a patch that implements onRollback, including tests.
Commit 1612124 from Erik Hatcher in branch 'dev/trunk'
[ https://svn.apache.org/r1612124 ]
SOLR-6258: Added onRollback event handler hook to Data Import Handler
Commit 1612126 from Erik Hatcher in branch 'dev/branches/branch_4x'
[ https://svn.apache.org/r1612126 ]