// Path: src/main/java/io/openio/sds/exceptions/DeadlineReachedException.java
// public class DeadlineReachedException extends OioException {
// 
//     private static final long serialVersionUID = -3825904433261832246L;
// 
//     /**
//      * @param message A message for the exception
//      */
//     public DeadlineReachedException(String message) {
//         super(message);
//     }
// 
//     /**
//      * 
//      * @param excess by how much time the deadline has been exceeded (milliseconds) 
//      */
//     public DeadlineReachedException(int excess) {
//         super("Request deadline exceeded by " + excess + " milliseconds");
//     }
// 
//     public DeadlineReachedException() {
//         super("Request deadline reached");
//     }
// }


import io.openio.sds.exceptions.DeadlineReachedException;
            synchronized (DeadlineManager.class) {
                if (instance == null) {
                    instance = new DeadlineManager();
                }
            }
        }
        return instance;
    }

    /**
     * Force the DeadlineManager to use a mocked {@link ClockSource}
     * @param clockSource The new clock source to use
     */
    public void useMockedClockSource(ClockSource clockSource) {
        this.clock = clockSource;
    }

    /**
     * Force the DeadlineManager to use the system monotonic clock source.
     */
    public void useSystemClockSource() {
        this.clock = this.new SystemClockSource();
    }

    /**
     * Raise an exception when a deadline has been reached.
     * 
     * @param deadline the deadline, in milliseconds
     * @throws DeadlineReachedException when the deadline has been reached
     */
// Path: src/main/java/io/openio/sds/exceptions/DeadlineReachedException.java
// public class DeadlineReachedException extends OioException {
// 
//     private static final long serialVersionUID = -3825904433261832246L;
// 
//     /**
//      * @param message A message for the exception
//      */
//     public DeadlineReachedException(String message) {
//         super(message);
//     }
// 
//     /**
//      * 
//      * @param excess by how much time the deadline has been exceeded (milliseconds) 
//      */
//     public DeadlineReachedException(int excess) {
//         super("Request deadline exceeded by " + excess + " milliseconds");
//     }
// 
//     public DeadlineReachedException() {
//         super("Request deadline reached");
//     }
// }


// Path: src/main/java/io/openio/sds/common/DeadlineManager.java
import io.openio.sds.exceptions.DeadlineReachedException;

            synchronized (DeadlineManager.class) {
                if (instance == null) {
                    instance = new DeadlineManager();
                }
            }
        }
        return instance;
    }

    /**
     * Force the DeadlineManager to use a mocked {@link ClockSource}
     * @param clockSource The new clock source to use
     */
    public void useMockedClockSource(ClockSource clockSource) {
        this.clock = clockSource;
    }

    /**
     * Force the DeadlineManager to use the system monotonic clock source.
     */
    public void useSystemClockSource() {
        this.clock = this.new SystemClockSource();
    }

    /**
     * Raise an exception when a deadline has been reached.
     * 
     * @param deadline the deadline, in milliseconds
     * @throws DeadlineReachedException when the deadline has been reached
     */
    public void checkDeadline(int deadline) throws DeadlineReachedException {