Interface ByteScanLimiter

    • Method Detail

      • isEnforcing

        boolean isEnforcing()
        Return whether or not this limiter is actully enforcing the limit (vs one that simply tracks resource consumption).
        Returns:
        true if the limiter is enforcing a limit.
      • hasBytesRemaining

        boolean hasBytesRemaining()
        Atomically check whether the number of remaining bytes is at least 0.
        Returns:
        true if the remaining count is at least 0 and false if it is less than 0
      • registerScannedBytes

        void registerScannedBytes​(long bytes)
        Atomically decrement the number of remaining bytes by the given number of bytes.
        Parameters:
        bytes - the number of bytes to register
      • getLimit

        long getLimit()
        Get the byte scan limit. In particular, this will return the target number of bytes that this limiter is being used to enforce.
        Returns:
        the byte scan limit being enforced
      • getBytesScanned

        long getBytesScanned()
        Returns the number of bytes that have been scanned thus far.
        Returns:
        the number of bytes that have been scanned