Yuta HIGUCHI | 8f18219 | 2014-08-02 18:47:42 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.util.distributed.sharedlog.exception; |
| 2 | |
| 3 | import com.google.common.annotations.Beta; |
| 4 | |
| 5 | import net.onrc.onos.core.util.distributed.sharedlog.SeqNum; |
| 6 | |
| 7 | /** |
| 8 | * Exception thrown, when log can no longer be replayed. |
| 9 | * Caller need to jump to the available snapshot and restart from snapshot. |
| 10 | */ |
| 11 | @Beta |
| 12 | public class LogNotContiguous extends Exception { |
| 13 | |
| 14 | /** |
| 15 | * Construct a new exception. |
| 16 | * |
| 17 | * @param failed sequence number which failed |
| 18 | */ |
| 19 | public LogNotContiguous(final SeqNum failed) { |
| 20 | this(failed + " cannot be read"); |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * Constructs a new exception with the specified detail message. |
| 25 | * {@link Exception#Exception(String)} |
| 26 | * |
| 27 | * @param message failure description |
| 28 | */ |
| 29 | protected LogNotContiguous(String message) { |
| 30 | super(message); |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Constructs a new exception with the specified cause. |
| 35 | * {@link Exception#Exception(Throwable)} |
| 36 | * |
| 37 | * @param failed sequence number which failed |
| 38 | * @param cause exception causing this. |
| 39 | */ |
| 40 | public LogNotContiguous(SeqNum failed, Throwable cause) { |
| 41 | this(failed + " cannot be read", cause); |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Constructs a new exception with the specified cause. |
| 46 | * {@link Exception#Exception(Throwable)} |
| 47 | * |
| 48 | * @param cause exception causing this. |
| 49 | */ |
| 50 | protected LogNotContiguous(Throwable cause) { |
| 51 | super(cause); |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Constructs a new exception with the specified detail message and cause. |
| 56 | * {@link Exception#Exception(String, Throwable)} |
| 57 | * |
| 58 | * @param message failure description |
| 59 | * @param cause exception causing this. |
| 60 | */ |
| 61 | public LogNotContiguous(String message, Throwable cause) { |
| 62 | super(message, cause); |
| 63 | // TODO Auto-generated constructor stub |
| 64 | } |
| 65 | } |