package com.fshark.overseas.advert.util;

import java.util.regex.Pattern;

/**
 * @author zhouml [zhouml@kingnet.com]
 * @date 2019-03-01
 */
public class Constants {

    private Constants() {}

    public static final String YMD = "yyyyMMdd";

    public static final String HH = "HH";

    public static final String YMDHMS_MILLIS = "yyyy-MM-dd HH:mm:ss.SSS";

    public static final Long ONE_DAY_MILLIS = 1000 * 60 * 60 * 24L;

    public static final Integer ZERO = 0;

    public static final Integer ONE = 1;

    public static final String DEFAULT_FIELD_VALUE = "-1";

    public static final Integer MINUS_ONE = -1;

    public static final String COLON = ":";

    public static final String COMMA = ",";

    public static final String YMDHMS = "yyyy-MM-dd HH:mm:ss";

    /**
     * 成功匹配或者多次匹配仍失败 产生的tuple streamid
     */
    public static final String FINISHED = "finished";

    /**
     *  topic field
     */
    public static final String TOPIC = "topic";

    /**
     *  需要微信或者电话报警 streamid
     */
    public static final String ALERT = "alert";

    public static final String FAMILY = "info";

    public static final Integer CACHE_REFRESH_INTERVAL = 60;

    public static final Pattern IP_PATTERN = Pattern.compile("\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}");


    /**
     *  重新匹配间隔  多久之内如果匹配则不再匹配 单位: ms
     */
    public static final int REMATCH_INTERVAL = 10 * 1000;

    /**
     *  重新匹配时 每次从Redis队列中拉取的数据
     */
    public static final int REMATCH_FETCH_SIZE = 1000;

    /**
     *  需要重新匹配的tuple streamid
     */
    public static final String REMATCHED = "rematched";

    public static final String TYPE_ACTIVIYION = "activation";
    public static final String TYPE_REGISTER = "register";
    public static final String TYPE_ROLELOGIN = "rolelogin";
    public static final String TYPE_PAUCHASE = "purchase";

}
