Class DefaultReshapeListener

  • All Implemented Interfaces:
    ReshapeListener

    public class DefaultReshapeListener
    extends Object
    implements ReshapeListener
    A simple ReshapeListener the logs the progress of the ReshapeWorker.

    In order not to flood the logging files the more pages a document has the less progress is logged. The progress is logged only if one the two conditions is met:

    1. The page index is relevant.
    2. The last log entry has been emitted more then n ms ago
    Since:
    jadice server 5.4.1.0
    • Field Detail

      • DEFAULT_MINIMUM_LOG_INTERVAL

        public static final long DEFAULT_MINIMUM_LOG_INTERVAL
        The default minimum interval in which the logging shall be performed. I.e. at least every n  a logging event will be emitted.
    • Constructor Detail

      • DefaultReshapeListener

        public DefaultReshapeListener()
    • Method Detail

      • isRelevantIndex

        protected static boolean isRelevantIndex​(int idx)
        Check if a page index is relevant for logging.

        This algorithm uses a logarithmic threshold, i.e.

        • for the first 10 pages every index is relevant,
        • for the pages 10 to 99 only every tenth page is relevant,
        • for the pages 100 to 999 only every 100th page is relevant,
        • and so on.
        Parameters:
        idx - the page index
        Returns:
        true iff the given index is relevant
      • getLogInterval

        public long getLogInterval()
      • setLogInterval

        public void setLogInterval​(long logInterval)
        Set the minimum time interval for which the logging events shall be generated.
        Parameters:
        logInterval - minimum time interval for which the logging events shall be generated