org.apache.ignite.internal.util

## Class GridLogThrottle

- java.lang.Object
- - org.apache.ignite.internal.util.GridLogThrottle

Direct Known Subclasses:
  LT

    public class GridLogThrottle
    extends Object

Grid log throttle.

Errors are logged only if they were not logged for the last `throttleTimeout` milliseconds. Note that not only error messages are checked for duplicates, but also exception classes.

### Field Summary

Fields
`static int` `DFLT_LOG_THROTTLE_CAPACITY`
`static int` `DFLT_THROTTLE_TIMEOUT` Default throttle timeout in milliseconds (value is `5 * 60 * 1000`).

### Constructor Summary

Constructors
`protected` `GridLogThrottle()` Ensure singleton.

### Method Summary

All Methods Static Methods Concrete Methods
`static void` `clear()` Clears all stored data.
`static void` `error(@Nullable IgniteLogger log, @Nullable Throwable e, String msg)` Logs error if needed.
`static void` `error(@Nullable IgniteLogger log, @Nullable Throwable e, String msg, boolean byMsg)` Logs error if needed.
`static void` `info(@Nullable IgniteLogger log, String msg)` Logs info if needed.
`static void` `info(@Nullable IgniteLogger log, String msg, boolean quiet)` Logs info if needed.
`static int` `throttleCapacity()` Gets system-wide log throttle capacity.
`static int` `throttleTimeout()` Gets system-wide log throttle timeout.
`static void` `throttleTimeout(int timeout)` Sets system-wide log throttle timeout.
`static void` `warn(@Nullable IgniteLogger log, String msg)` Logs warning if needed.
`static void` `warn(@Nullable IgniteLogger log, String msg, boolean quiet)` Logs warning if needed.
`static void` `warn(@Nullable IgniteLogger log, @Nullable Throwable e, String msg, boolean quite, boolean byMsg)` Logs warning if needed.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### DFLT_THROTTLE_TIMEOUT

    public static final int DFLT_THROTTLE_TIMEOUT

Default throttle timeout in milliseconds (value is `5 * 60 * 1000`).

See Also:
  Constant Field Values

#### DFLT_LOG_THROTTLE_CAPACITY

    public static final int DFLT_LOG_THROTTLE_CAPACITY

See Also:
  `IgniteSystemProperties.IGNITE_LOG_THROTTLE_CAPACITY`, Constant Field Values

### Constructor Detail

#### GridLogThrottle

    protected GridLogThrottle()

Ensure singleton.

### Method Detail

#### throttleTimeout

    public static void throttleTimeout(int timeout)

Sets system-wide log throttle timeout.

Parameters:
  `timeout` - System-wide log throttle timeout.

#### throttleTimeout

    public static int throttleTimeout()

Gets system-wide log throttle timeout.

Returns:
  System-side log throttle timeout.

#### throttleCapacity

    public static int throttleCapacity()

Gets system-wide log throttle capacity.

Returns:
  System-side log throttle capacity.

#### error

    public static void error(@Nullable
                             @Nullable IgniteLogger log,
                             @Nullable
                             @Nullable Throwable e,
                             String msg)

Logs error if needed.

Parameters:
  `log` - Logger.
  `e` - Error (optional).
  `msg` - Message.

#### error

    public static void error(@Nullable
                             @Nullable IgniteLogger log,
                             @Nullable
                             @Nullable Throwable e,
                             String msg,
                             boolean byMsg)

Logs error if needed.

Parameters:
  `log` - Logger.
  `e` - Error (optional).
  `msg` - Message.
  `byMsg` - Errors group by message, not by tuple(error, msg).

#### warn

    public static void warn(@Nullable
                            @Nullable IgniteLogger log,
                            String msg)

Logs warning if needed.

Parameters:
  `log` - Logger.
  `msg` - Message.

#### warn

    public static void warn(@Nullable
                            @Nullable IgniteLogger log,
                            @Nullable
                            @Nullable Throwable e,
                            String msg,
                            boolean quite,
                            boolean byMsg)

Logs warning if needed.

Parameters:
  `log` - Logger.
  `e` - Error (optional).
  `msg` - Message.
  `quite` - Print warning anyway.
  `byMsg` - Errors group by message, not by tuple(error, msg).

#### warn

    public static void warn(@Nullable
                            @Nullable IgniteLogger log,
                            String msg,
                            boolean quiet)

Logs warning if needed.

Parameters:
  `log` - Logger.
  `msg` - Message.
  `quiet` - Print warning anyway.

#### info

    public static void info(@Nullable
                            @Nullable IgniteLogger log,
                            String msg,
                            boolean quiet)

Logs info if needed.

Parameters:
  `log` - Logger.
  `msg` - Message.
  `quiet` - Print info anyway.

#### info

    public static void info(@Nullable
                            @Nullable IgniteLogger log,
                            String msg)

Logs info if needed.

Parameters:
  `log` - Logger.
  `msg` - Message.

#### clear

    public static void clear()

Clears all stored data. This will make throttle to behave like a new one.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.11.0
Release Date | : September 11 2021