This project has retired. For details please refer to its Attic page.
Log.Reader
JavaScript is disabled on your browser.
Skip navigation links
org.apache.mesos

Class Log.Reader

  • Enclosing class:
    Log


    public static class Log.Reader
    extends java.lang.Object
    Provides read access to the Log. This class is safe for use from multiple threads and for the life of the log regardless of any exceptions thrown from its methods.
    • Constructor Summary

      Constructors
      Constructor and Description
      Reader (Log log)
      Returns an instance of a reader that will access the given instance of the Log.
    • Method Summary

      All Methods
      Modifier and Type Method and Description
      Log.Position beginning ()
      Returns the beginning position of the log (might be out of date with respect to another replica).
      Log.Position catchup (long timeout, java.util.concurrent.TimeUnit unit)
      Attempts to catch-up positions from the log for reading.
      Log.Position ending ()
      Returns the ending position of the log (might be out of date with respect to another replica).
      protected void finalize ()
      protected void initialize (Log log)
      java.util.List<Log.Entry> read (Log.Position from, Log.Position to, long timeout, java.util.concurrent.TimeUnit unit)
      Attempts to read from the log between the specified positions (inclusive).
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Reader

        public Reader(Log log)
        Returns an instance of a reader that will access the given instance of the Log.
        Parameters:
        log - The log that this reader will access.
    • Method Detail

      • read

        public java.util.List<Log.Entry> read(Log.Position from,
         Log.Position to,
         long timeout,
         java.util.concurrent.TimeUnit unit)
         throws java.util.concurrent.TimeoutException,
         Log.OperationFailedException 
        Attempts to read from the log between the specified positions (inclusive). If either of the positions are invalid, an Log.OperationFailedException will get thrown. Unfortunately, this will also get thrown in other circumstances (e.g., disk failure) and therefore it is currently impossible to tell these two cases apart.
        Parameters:
        from - Where to start reading.
        to - Where to finish reading.
        timeout - Max number of time units to wait before a TimeoutException.
        unit - Type of units used for the timeout, e.g. seconds, minutes, etc.
        Returns:
        The list of entries fetched from the Log.
        Throws:
        java.util.concurrent.TimeoutException - If the read doesn't happen before the timeout.
        Log.OperationFailedException - If the read fails due that the read no longer has the ability to perform its operations.
        See Also:
        Log.Position, TimeUnit
      • beginning

        public Log.Position beginning()
        Returns the beginning position of the log (might be out of date with respect to another replica).
        Returns:
        The beginning position of the log.
      • ending

        public Log.Position ending()
        Returns the ending position of the log (might be out of date with respect to another replica).
        Returns:
        The ending position of the log
      • catchup

        public Log.Position catchup(long timeout,
         java.util.concurrent.TimeUnit unit)
         throws java.util.concurrent.TimeoutException,
         Log.OperationFailedException 
        Attempts to catch-up positions from the log for reading.
        Parameters:
        timeout - Max number of time units to wait before a TimeoutException.
        unit - Type of time units used for the timeout, e.g. seconds, minutes, etc.
        Returns:
        The ending position of the caught-up range.
        Throws:
        java.util.concurrent.TimeoutException - If the catch-up doesn't happen before the timeout.
        Log.OperationFailedException - If the catch-up fails.
      • initialize

        protected void initialize(Log log)
      • finalize

        protected void finalize()
        Overrides:
        finalize in class java.lang.Object
Skip navigation links

AltStyle によって変換されたページ (->オリジナル) /