dataSources:
  wallet_master:
    dataSourceClassName: com.zaxxer.hikari.HikariDataSource
    driverClassName: com.p6spy.engine.spy.P6SpyDriver
    jdbcUrl: jdbc:p6spy:mysql://wallet.cluster-chffwcegvu9y.ap-southeast-1.rds.amazonaws.com:3306/aswat_wallet?characterEncoding=utf8&useUnicode=true&useSSL=false&allowMultiQueries=true&useLegacyDatetimeCode=false&serverTimezone=UTC&allowPublicKeyRetrieval=true&autoReconnect=true
    username: aswatwallet
    password: nPBosFMVV6GQ6MFR
    #hikari:
    # 连接池名称
    poolName: WalletDbPoolMaster
    #最小空闲连接数量
    minimumIdle: 5
    # 空闲连接存活最大时间，默认600000（10分钟）
    idleTimeout: 180000
    # 连接池最大连接数，默认是10 推荐的公式：((core_count * 2) + effective_spindle_count)
    maximumPoolSize: 10
    # 此属性控制从池返回的连接的默认自动提交行为,默认值：true
    autoCommit: true
    # 此属性控制池中连接的最长生命周期，值0表示无限生命周期，默认1800000即30分钟
    maxLifetime: 1800000
    # 数据库连接超时时间,默认30秒，即30000
    connectionTimeout: 30000
    connectionTestQuery: SELECT 1
  wallet_slave:
    dataSourceClassName: com.zaxxer.hikari.HikariDataSource
    driverClassName: com.p6spy.engine.spy.P6SpyDriver
    jdbcUrl: jdbc:p6spy:mysql://wallet.cluster-ro-chffwcegvu9y.ap-southeast-1.rds.amazonaws.com:3306/aswat_wallet?characterEncoding=utf8&useUnicode=true&useSSL=false&allowMultiQueries=true&useLegacyDatetimeCode=false&serverTimezone=UTC&allowPublicKeyRetrieval=true&autoReconnect=true
    username: aswatwallet
    password: nPBosFMVV6GQ6MFR
    #hikari:
    # 连接池名称
    poolName: WalletDbPoolSlave
    #最小空闲连接数量
    minimumIdle: 5
    # 空闲连接存活最大时间，默认600000（10分钟）
    idleTimeout: 180000
    # 连接池最大连接数，默认是10 推荐的公式：((core_count * 2) + effective_spindle_count)
    maximumPoolSize: 10
    # 此属性控制从池返回的连接的默认自动提交行为,默认值：true
    autoCommit: true
    # 此属性控制池中连接的最长生命周期，值0表示无限生命周期，默认1800000即30分钟
    maxLifetime: 1800000
    # 数据库连接超时时间,默认30秒，即30000
    connectionTimeout: 30000
    connectionTestQuery: SELECT 1


props:
  sql-show: true

rules:
- !READWRITE_SPLITTING
  dataSources:
    wallet_ds:
      staticStrategy:
        writeDataSourceName: wallet_master
        readDataSourceNames:
          - wallet_slave
      loadBalancerName: random
  loadBalancers:
    random:
      type: RANDOM

- !SHARDING
  tables:
    wallet_gold_asset_record:
      actualDataNodes: wallet_ds.wallet_gold_asset_record_${1..12}
      tableStrategy:
        standard:
          shardingColumn: create_time
          shardingAlgorithmName: wallet_gold_asset_record_inline
  shardingAlgorithms:
    wallet_gold_asset_record_inline:
      type: CLASS_BASED
      props:
        strategy: standard
        algorithmClassName: com.red.circle.framework.shardingsphere.sharding.TimeMonthShardingAlgorithm

