Enum Class Policy

java.lang.Object
java.lang.Enum<Policy>
tech.riemann.nif.apm.event.audit.Policy
All Implemented Interfaces:
Serializable, Comparable<Policy>, Constable

public enum Policy extends Enum<Policy>
审计日志分表策略枚举

定义审计日志表的分表策略,用于控制表名后缀的生成规则

分表策略说明: - MONTH:按月分表,表名后缀格式为yyyyMM(如:202401) - SEASON:按季度分表,表名后缀格式为yyyyQx(如:2024Q1) - YEAR:按年分表,表名后缀格式为yyyy(如:2024) - CUSTOMER:自定义策略,由用户自行实现表名后缀生成逻辑

使用场景: - 根据数据量和查询频率选择合适的分表策略 - 数据量大且查询频繁:建议使用MONTH或SEASON - 数据量小或查询不频繁:建议使用YEAR

Author:
Kerbores(kerbores@riemann.tech)
  • Enum Constant Details

    • MONTH

      public static final Policy MONTH
      按月分表

      表名后缀格式:yyyyMM(如:202401表示2024年1月)

    • SEASON

      public static final Policy SEASON
      按季度分表

      表名后缀格式:yyyyQx(如:2024Q1表示2024年第一季度)

    • YEAR

      public static final Policy YEAR
      按年分表

      表名后缀格式:yyyy(如:2024表示2024年)

    • CUSTOMER

      public static final Policy CUSTOMER
      自定义策略

      由用户自行实现TableSuffixProvider接口定义表名后缀生成逻辑

  • Method Details

    • values

      public static Policy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Policy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null