Class CompositeIOMonitor

  • All Implemented Interfaces:
    IOMonitor

    public class CompositeIOMonitor
    extends java.lang.Object
    implements IOMonitor
    This IOMonitor instance delegates all calls to all IOMonitor instances registered.
    • Constructor Summary

      Constructors 
      Constructor Description
      CompositeIOMonitor()
      Create a new empty CompositeIOMonitor instance.
      CompositeIOMonitor​(@NotNull java.lang.Iterable<? extends IOMonitor> ioMonitors)
      Create a new CompositeIOMonitor instance delegating the passed ioMonitors
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterSegmentRead​(java.io.File file, long msb, long lsb, int length, long elapsed)
      Called after a segment is read from the file system.
      void afterSegmentWrite​(java.io.File file, long msb, long lsb, int length, long elapsed)
      Called after a segment is written to the file system.
      void beforeSegmentRead​(java.io.File file, long msb, long lsb, int length)
      Called before a segment is read from the file system.
      void beforeSegmentWrite​(java.io.File file, long msb, long lsb, int length)
      Called before a segment is written to the file system.
      @NotNull Registration registerIOMonitor​(@NotNull IOMonitor ioMonitor)
      Register a IOMonitor instance to which this CompositeIOMonitor will delegate all its calls until Registration.unregister() is called on the return Registration.
      • Methods inherited from class java.lang.Object

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

      • CompositeIOMonitor

        public CompositeIOMonitor​(@NotNull
                                  @NotNull java.lang.Iterable<? extends IOMonitor> ioMonitors)
        Create a new CompositeIOMonitor instance delegating the passed ioMonitors
        Parameters:
        ioMonitors - IOMonitor instances to delegate to
      • CompositeIOMonitor

        public CompositeIOMonitor()
        Create a new empty CompositeIOMonitor instance.
    • Method Detail

      • registerIOMonitor

        @NotNull
        public @NotNull Registration registerIOMonitor​(@NotNull
                                                       @NotNull IOMonitor ioMonitor)
        Register a IOMonitor instance to which this CompositeIOMonitor will delegate all its calls until Registration.unregister() is called on the return Registration.
        Parameters:
        ioMonitor - IOMonitor to delegate to
        Returns:
        a Registration for ioMonitor.
      • beforeSegmentRead

        public void beforeSegmentRead​(java.io.File file,
                                      long msb,
                                      long lsb,
                                      int length)
        Description copied from interface: IOMonitor
        Called before a segment is read from the file system.
        Specified by:
        beforeSegmentRead in interface IOMonitor
        Parameters:
        file - File containing the segment.
        msb - Most significant bits of the segment ID.
        lsb - Least significant bits of the segment ID.
        length - Size of the segment.
      • afterSegmentRead

        public void afterSegmentRead​(java.io.File file,
                                     long msb,
                                     long lsb,
                                     int length,
                                     long elapsed)
        Description copied from interface: IOMonitor
        Called after a segment is read from the file system. This is called only in case of successful operations.
        Specified by:
        afterSegmentRead in interface IOMonitor
        Parameters:
        file - File containing the segment.
        msb - Most significant bits of the segment ID.
        lsb - Least significant bits of the segment ID.
        length - Size of the segment.
        elapsed - Time spent by the read operation, in nanoseconds.
      • beforeSegmentWrite

        public void beforeSegmentWrite​(java.io.File file,
                                       long msb,
                                       long lsb,
                                       int length)
        Description copied from interface: IOMonitor
        Called before a segment is written to the file system.
        Specified by:
        beforeSegmentWrite in interface IOMonitor
        Parameters:
        file - File containing the segment.
        msb - Most significant bits of the segment ID.
        lsb - Least significant bits of the segment ID.
        length - Size of the segment.
      • afterSegmentWrite

        public void afterSegmentWrite​(java.io.File file,
                                      long msb,
                                      long lsb,
                                      int length,
                                      long elapsed)
        Description copied from interface: IOMonitor
        Called after a segment is written to the file system. This is called only in case of successful operations.
        Specified by:
        afterSegmentWrite in interface IOMonitor
        Parameters:
        file - File containing the segment.
        msb - Most significant bits of the segment ID.
        lsb - Least significant bits of the segment ID.
        length - Size of the segment.
        elapsed - Time spent by the write operation, in nanoseconds.