journal.io.api
Interface RecoveryErrorHandler

All Known Implementing Classes:
RecoveryErrorHandler.AbortOnError, RecoveryErrorHandler.DeleteOnError, RecoveryErrorHandler.IgnoreOnError

public interface RecoveryErrorHandler

Interface to implement for dealing with checksum errors during journal recovery.

Author:
Sergio Bossa

Nested Class Summary
static class RecoveryErrorHandler.AbortOnError
           
static class RecoveryErrorHandler.DeleteOnError
           
static class RecoveryErrorHandler.IgnoreOnError
           
 
Field Summary
static RecoveryErrorHandler ABORT
          On recovery error, aborts the recovery process, preventing the journal to be opened.
static RecoveryErrorHandler DELETE
          On recovery error, mark the failed locations as deleted and continue the recovery process.
static RecoveryErrorHandler IGNORE
          On recovery error, log about the failed locations and continue the recovery process.
 
Method Summary
 void onError(Journal journal, List<Location> locations)
          Invoked by the journal during its recovery process in case of a checksum error for the given locations.
 

Field Detail

ABORT

static final RecoveryErrorHandler ABORT
On recovery error, aborts the recovery process, preventing the journal to be opened. This is the strictest but safest choice.


DELETE

static final RecoveryErrorHandler DELETE
On recovery error, mark the failed locations as deleted and continue the recovery process.


IGNORE

static final RecoveryErrorHandler IGNORE
On recovery error, log about the failed locations and continue the recovery process.

Method Detail

onError

void onError(Journal journal,
             List<Location> locations)
             throws IOException
Invoked by the journal during its recovery process in case of a checksum error for the given locations. Please note this method will be invoked once for any batch containing failed locations.

Throws:
IOException


Copyright © 2013. All Rights Reserved.